diff --git a/webui/dist/assets/charts-Cdq_Jxe7.js b/webui/dist/assets/charts-Dhri-zxi.js similarity index 66% rename from webui/dist/assets/charts-Cdq_Jxe7.js rename to webui/dist/assets/charts-Dhri-zxi.js index 2a290019..28ac978e 100644 --- a/webui/dist/assets/charts-Cdq_Jxe7.js +++ b/webui/dist/assets/charts-Dhri-zxi.js @@ -1,49 +1,49 @@ -import{r as N,R as S,i as or}from"./router-DQNkr8RI.js";import{c as Ai,g as ce}from"./react-vendor-Dtc2IqVY.js";function wx(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t-1}return ru=t,ru}var nu,wd;function h1(){if(wd)return nu;wd=1;var e=La();function t(r,n){var i=this.__data__,a=e(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return nu=t,nu}var iu,Od;function Ba(){if(Od)return iu;Od=1;var e=c1(),t=s1(),r=l1(),n=f1(),i=h1();function a(o){var u=-1,c=o==null?0:o.length;for(this.clear();++u0?1:-1},er=function(t){return ur(t)&&t.indexOf("%")===t.length-1},q=function(t){return R1(t)&&!gi(t)},D1=function(t){return J(t)},Se=function(t){return q(t)||ur(t)},N1=0,un=function(t){var r=++N1;return"".concat(t||"").concat(r)},Le=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!q(t)&&!ur(t))return n;var a;if(er(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return gi(a)&&(a=n),i&&a>r&&(a=r),a},qt=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},q1=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function K1(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function nf(e){"@babel/helpers - typeof";return nf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nf(e)}var Yd={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Et=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},Zd=null,Mu=null,Ih=function e(t){if(t===Zd&&Array.isArray(Mu))return Mu;var r=[];return N.Children.forEach(t,function(n){J(n)||($1.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),Mu=r,Zd=t,r};function Ye(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Et(i)}):n=[Et(t)],Ih(e).forEach(function(i){var a=Xe(i,"type.displayName")||Xe(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function He(e,t){var r=Ye(e,t);return r&&r[0]}var Jd=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!q(n)||n<=0||!q(i)||i<=0)},H1=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],G1=function(t){return t&&t.type&&ur(t.type)&&H1.indexOf(t.type)>=0},V1=function(t){return t&&nf(t)==="object"&&"clipDot"in t},X1=function(t,r,n,i){var a,o=(a=ju?.[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!X(t)&&(i&&o.includes(r)||F1.includes(r))||n&&$h.includes(r)},K=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(N.isValidElement(t)&&(i=t.props),!on(i))return null;var a={};return Object.keys(i).forEach(function(o){var u;X1((u=i)===null||u===void 0?void 0:u[o],o,r,n)&&(a[o]=i[o])}),a},af=function e(t,r){if(t===r)return!0;var n=N.Children.count(t);if(n!==N.Children.count(r))return!1;if(n===0)return!0;if(n===1)return Qd(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function eA(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function uf(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,u=e.title,c=e.desc,s=Q1(e,J1),f=i||{width:r,height:n,x:0,y:0},l=te("recharts-surface",a);return S.createElement("svg",of({},K(s,!0,"svg"),{className:l,width:r,height:n,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),S.createElement("title",null,u),S.createElement("desc",null,c),t)}var tA=["children","className"];function cf(){return cf=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nA(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var ne=S.forwardRef(function(e,t){var r=e.children,n=e.className,i=rA(e,tA),a=te("recharts-layer",n);return S.createElement("g",cf({className:a},K(i,!0),{ref:t}),r)}),st=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;aa?0:a+r),n=n>a?a:n,n<0&&(n+=a),a=r>n?0:n-r>>>0,r>>>=0;for(var o=Array(a);++i=a?r:e(r,n,i)}return Iu=t,Iu}var Cu,nv;function jx(){if(nv)return Cu;nv=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,a="\\ufe0e\\ufe0f",o="\\u200d",u=RegExp("["+o+e+i+a+"]");function c(s){return u.test(s)}return Cu=c,Cu}var ku,iv;function oA(){if(iv)return ku;iv=1;function e(t){return t.split("")}return ku=e,ku}var Ru,av;function uA(){if(av)return Ru;av=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,a="\\ufe0e\\ufe0f",o="["+e+"]",u="["+i+"]",c="\\ud83c[\\udffb-\\udfff]",s="(?:"+u+"|"+c+")",f="[^"+e+"]",l="(?:\\ud83c[\\udde6-\\uddff]){2}",h="[\\ud800-\\udbff][\\udc00-\\udfff]",p="\\u200d",y=s+"?",v="["+a+"]?",d="(?:"+p+"(?:"+[f,l,h].join("|")+")"+v+y+")*",m=v+y+d,x="(?:"+[f+u+"?",u,l,h,o].join("|")+")",w=RegExp(c+"(?="+c+")|"+x+m,"g");function O(g){return g.match(w)||[]}return Ru=O,Ru}var Du,ov;function cA(){if(ov)return Du;ov=1;var e=oA(),t=jx(),r=uA();function n(i){return t(i)?r(i):e(i)}return Du=n,Du}var Nu,uv;function sA(){if(uv)return Nu;uv=1;var e=aA(),t=jx(),r=cA(),n=Sx();function i(a){return function(o){o=n(o);var u=t(o)?r(o):void 0,c=u?u[0]:o.charAt(0),s=u?e(u,1).join(""):o.slice(1);return c[a]()+s}}return Nu=i,Nu}var qu,cv;function lA(){if(cv)return qu;cv=1;var e=sA(),t=e("toUpperCase");return qu=t,qu}var fA=lA();const Wa=ce(fA);function he(e){return function(){return e}}const Mx=Math.cos,Ui=Math.sin,pt=Math.sqrt,Wi=Math.PI,za=2*Wi,sf=Math.PI,lf=2*sf,Zt=1e-6,hA=lf-Zt;function $x(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return $x;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;iZt)if(!(Math.abs(l*c-s*f)>Zt)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-o,y=i-u,v=c*c+s*s,d=p*p+y*y,m=Math.sqrt(v),x=Math.sqrt(h),w=a*Math.tan((sf-Math.acos((v+h-d)/(2*m*x)))/2),O=w/x,g=w/m;Math.abs(O-1)>Zt&&this._append`L${t+O*f},${r+O*l}`,this._append`A${a},${a},0,0,${+(l*p>f*y)},${this._x1=t+g*c},${this._y1=r+g*s}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(i),c=n*Math.sin(i),s=t+u,f=r+c,l=1^o,h=o?i-a:a-i;this._x1===null?this._append`M${s},${f}`:(Math.abs(this._x1-s)>Zt||Math.abs(this._y1-f)>Zt)&&this._append`L${s},${f}`,n&&(h<0&&(h=h%lf+lf),h>hA?this._append`A${n},${n},0,1,${l},${t-u},${r-c}A${n},${n},0,1,${l},${this._x1=s},${this._y1=f}`:h>Zt&&this._append`A${n},${n},0,${+(h>=sf)},${l},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function Ch(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new dA(t)}function kh(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ix(e){this._context=e}Ix.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Ka(e){return new Ix(e)}function Cx(e){return e[0]}function kx(e){return e[1]}function Rx(e,t){var r=he(!0),n=null,i=Ka,a=null,o=Ch(u);e=typeof e=="function"?e:e===void 0?Cx:he(e),t=typeof t=="function"?t:t===void 0?kx:he(t);function u(c){var s,f=(c=kh(c)).length,l,h=!1,p;for(n==null&&(a=i(p=o())),s=0;s<=f;++s)!(s=p;--y)u.point(w[y],O[y]);u.lineEnd(),u.areaEnd()}m&&(w[h]=+e(d,h,l),O[h]=+t(d,h,l),u.point(n?+n(d,h,l):w[h],r?+r(d,h,l):O[h]))}if(x)return u=null,x+""||null}function f(){return Rx().defined(i).curve(o).context(a)}return s.x=function(l){return arguments.length?(e=typeof l=="function"?l:he(+l),n=null,s):e},s.x0=function(l){return arguments.length?(e=typeof l=="function"?l:he(+l),s):e},s.x1=function(l){return arguments.length?(n=l==null?null:typeof l=="function"?l:he(+l),s):n},s.y=function(l){return arguments.length?(t=typeof l=="function"?l:he(+l),r=null,s):t},s.y0=function(l){return arguments.length?(t=typeof l=="function"?l:he(+l),s):t},s.y1=function(l){return arguments.length?(r=l==null?null:typeof l=="function"?l:he(+l),s):r},s.lineX0=s.lineY0=function(){return f().x(e).y(t)},s.lineY1=function(){return f().x(e).y(r)},s.lineX1=function(){return f().x(n).y(t)},s.defined=function(l){return arguments.length?(i=typeof l=="function"?l:he(!!l),s):i},s.curve=function(l){return arguments.length?(o=l,a!=null&&(u=o(a)),s):o},s.context=function(l){return arguments.length?(l==null?a=u=null:u=o(a=l),s):a},s}class Dx{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function vA(e){return new Dx(e,!0)}function yA(e){return new Dx(e,!1)}const Rh={draw(e,t){const r=pt(t/Wi);e.moveTo(r,0),e.arc(0,0,r,0,za)}},gA={draw(e,t){const r=pt(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},Nx=pt(1/3),mA=Nx*2,bA={draw(e,t){const r=pt(t/mA),n=r*Nx;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},xA={draw(e,t){const r=pt(t),n=-r/2;e.rect(n,n,r,r)}},wA=.8908130915292852,qx=Ui(Wi/10)/Ui(7*Wi/10),OA=Ui(za/10)*qx,_A=-Mx(za/10)*qx,AA={draw(e,t){const r=pt(t*wA),n=OA*r,i=_A*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=za*a/5,u=Mx(o),c=Ui(o);e.lineTo(c*r,-u*r),e.lineTo(u*n-c*i,c*n+u*i)}e.closePath()}},Lu=pt(3),SA={draw(e,t){const r=-pt(t/(Lu*3));e.moveTo(0,r*2),e.lineTo(-Lu*r,-r),e.lineTo(Lu*r,-r),e.closePath()}},Je=-.5,Qe=pt(3)/2,ff=1/pt(12),PA=(ff/2+1)*3,TA={draw(e,t){const r=pt(t/PA),n=r/2,i=r*ff,a=n,o=r*ff+r,u=-a,c=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(u,c),e.lineTo(Je*n-Qe*i,Qe*n+Je*i),e.lineTo(Je*a-Qe*o,Qe*a+Je*o),e.lineTo(Je*u-Qe*c,Qe*u+Je*c),e.lineTo(Je*n+Qe*i,Je*i-Qe*n),e.lineTo(Je*a+Qe*o,Je*o-Qe*a),e.lineTo(Je*u+Qe*c,Je*c-Qe*u),e.closePath()}};function EA(e,t){let r=null,n=Ch(i);e=typeof e=="function"?e:he(e||Rh),t=typeof t=="function"?t:he(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:he(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:he(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function zi(){}function Ki(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function Lx(e){this._context=e}Lx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ki(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ki(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function jA(e){return new Lx(e)}function Bx(e){this._context=e}Bx.prototype={areaStart:zi,areaEnd:zi,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Ki(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function MA(e){return new Bx(e)}function Fx(e){this._context=e}Fx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Ki(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function $A(e){return new Fx(e)}function Ux(e){this._context=e}Ux.prototype={areaStart:zi,areaEnd:zi,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function IA(e){return new Ux(e)}function sv(e){return e<0?-1:1}function lv(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),u=(a*i+o*n)/(n+i);return(sv(a)+sv(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(u))||0}function fv(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Bu(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,u=(a-n)/3;e._context.bezierCurveTo(n+u,i+u*t,a-u,o-u*r,a,o)}function Hi(e){this._context=e}Hi.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Bu(this,this._t0,fv(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Bu(this,fv(this,r=lv(this,e,t)),r);break;default:Bu(this,this._t0,r=lv(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Wx(e){this._context=new zx(e)}(Wx.prototype=Object.create(Hi.prototype)).point=function(e,t){Hi.prototype.point.call(this,t,e)};function zx(e){this._context=e}zx.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function CA(e){return new Hi(e)}function kA(e){return new Wx(e)}function Kx(e){this._context=e}Kx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=hv(e),i=hv(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function DA(e){return new Ha(e,.5)}function NA(e){return new Ha(e,0)}function qA(e){return new Ha(e,1)}function Ir(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,u=a.length;r=0;)r[t]=t;return r}function LA(e,t){return e[t]}function BA(e){const t=[];return t.key=e,t}function FA(){var e=he([]),t=hf,r=Ir,n=LA;function i(a){var o=Array.from(e.apply(this,arguments),BA),u,c=o.length,s=-1,f;for(const l of a)for(u=0,++s;u0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function YA(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Hx={symbolCircle:Rh,symbolCross:gA,symbolDiamond:bA,symbolSquare:xA,symbolStar:AA,symbolTriangle:SA,symbolWye:TA},ZA=Math.PI/180,JA=function(t){var r="symbol".concat(Wa(t));return Hx[r]||Rh},QA=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*ZA;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},eS=function(t,r){Hx["symbol".concat(Wa(t))]=r},Dh=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,o=t.sizeType,u=o===void 0?"area":o,c=XA(t,KA),s=dv(dv({},c),{},{type:n,size:a,sizeType:u}),f=function(){var d=JA(n),m=EA().type(d).size(QA(a,u,n));return m()},l=s.className,h=s.cx,p=s.cy,y=K(s,!0);return h===+h&&p===+p&&a===+a?S.createElement("path",pf({},y,{className:te("recharts-symbols",l),transform:"translate(".concat(h,", ").concat(p,")"),d:f()})):null};Dh.registerSymbol=eS;function Cr(e){"@babel/helpers - typeof";return Cr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cr(e)}function df(){return df=Object.assign?Object.assign.bind():function(e){for(var t=1;t-1}return ru=t,ru}var nu,wd;function f1(){if(wd)return nu;wd=1;var e=La();function t(r,n){var i=this.__data__,a=e(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return nu=t,nu}var iu,Od;function Ba(){if(Od)return iu;Od=1;var e=u1(),t=c1(),r=s1(),n=l1(),i=f1();function a(o){var u=-1,c=o==null?0:o.length;for(this.clear();++u0?1:-1},er=function(t){return ur(t)&&t.indexOf("%")===t.length-1},q=function(t){return k1(t)&&!gi(t)},R1=function(t){return J(t)},Se=function(t){return q(t)||ur(t)},D1=0,un=function(t){var r=++D1;return"".concat(t||"").concat(r)},Le=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!q(t)&&!ur(t))return n;var a;if(er(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return gi(a)&&(a=n),i&&a>r&&(a=r),a},qt=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},N1=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function z1(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function nf(e){"@babel/helpers - typeof";return nf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nf(e)}var Yd={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Et=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},Zd=null,Mu=null,Ih=function e(t){if(t===Zd&&Array.isArray(Mu))return Mu;var r=[];return N.Children.forEach(t,function(n){J(n)||(M1.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),Mu=r,Zd=t,r};function Ye(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Et(i)}):n=[Et(t)],Ih(e).forEach(function(i){var a=Xe(i,"type.displayName")||Xe(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function He(e,t){var r=Ye(e,t);return r&&r[0]}var Jd=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!q(n)||n<=0||!q(i)||i<=0)},K1=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],H1=function(t){return t&&t.type&&ur(t.type)&&K1.indexOf(t.type)>=0},G1=function(t){return t&&nf(t)==="object"&&"clipDot"in t},V1=function(t,r,n,i){var a,o=(a=ju?.[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!X(t)&&(i&&o.includes(r)||B1.includes(r))||n&&$h.includes(r)},K=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(N.isValidElement(t)&&(i=t.props),!on(i))return null;var a={};return Object.keys(i).forEach(function(o){var u;V1((u=i)===null||u===void 0?void 0:u[o],o,r,n)&&(a[o]=i[o])}),a},af=function e(t,r){if(t===r)return!0;var n=N.Children.count(t);if(n!==N.Children.count(r))return!1;if(n===0)return!0;if(n===1)return Qd(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Q1(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function uf(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,u=e.title,c=e.desc,s=J1(e,Z1),f=i||{width:r,height:n,x:0,y:0},l=te("recharts-surface",a);return S.createElement("svg",of({},K(s,!0,"svg"),{className:l,width:r,height:n,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),S.createElement("title",null,u),S.createElement("desc",null,c),t)}var eA=["children","className"];function cf(){return cf=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function rA(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var ne=S.forwardRef(function(e,t){var r=e.children,n=e.className,i=tA(e,eA),a=te("recharts-layer",n);return S.createElement("g",cf({className:a},K(i,!0),{ref:t}),r)}),st=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;aa?0:a+r),n=n>a?a:n,n<0&&(n+=a),a=r>n?0:n-r>>>0,r>>>=0;for(var o=Array(a);++i=a?r:e(r,n,i)}return Iu=t,Iu}var Cu,nv;function Ex(){if(nv)return Cu;nv=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,a="\\ufe0e\\ufe0f",o="\\u200d",u=RegExp("["+o+e+i+a+"]");function c(s){return u.test(s)}return Cu=c,Cu}var ku,iv;function aA(){if(iv)return ku;iv=1;function e(t){return t.split("")}return ku=e,ku}var Ru,av;function oA(){if(av)return Ru;av=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,a="\\ufe0e\\ufe0f",o="["+e+"]",u="["+i+"]",c="\\ud83c[\\udffb-\\udfff]",s="(?:"+u+"|"+c+")",f="[^"+e+"]",l="(?:\\ud83c[\\udde6-\\uddff]){2}",h="[\\ud800-\\udbff][\\udc00-\\udfff]",p="\\u200d",y=s+"?",v="["+a+"]?",d="(?:"+p+"(?:"+[f,l,h].join("|")+")"+v+y+")*",m=v+y+d,x="(?:"+[f+u+"?",u,l,h,o].join("|")+")",w=RegExp(c+"(?="+c+")|"+x+m,"g");function O(g){return g.match(w)||[]}return Ru=O,Ru}var Du,ov;function uA(){if(ov)return Du;ov=1;var e=aA(),t=Ex(),r=oA();function n(i){return t(i)?r(i):e(i)}return Du=n,Du}var Nu,uv;function cA(){if(uv)return Nu;uv=1;var e=iA(),t=Ex(),r=uA(),n=Ax();function i(a){return function(o){o=n(o);var u=t(o)?r(o):void 0,c=u?u[0]:o.charAt(0),s=u?e(u,1).join(""):o.slice(1);return c[a]()+s}}return Nu=i,Nu}var qu,cv;function sA(){if(cv)return qu;cv=1;var e=cA(),t=e("toUpperCase");return qu=t,qu}var lA=sA();const Wa=ce(lA);function he(e){return function(){return e}}const jx=Math.cos,Ui=Math.sin,pt=Math.sqrt,Wi=Math.PI,za=2*Wi,sf=Math.PI,lf=2*sf,Zt=1e-6,fA=lf-Zt;function Mx(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Mx;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;iZt)if(!(Math.abs(l*c-s*f)>Zt)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-o,y=i-u,v=c*c+s*s,d=p*p+y*y,m=Math.sqrt(v),x=Math.sqrt(h),w=a*Math.tan((sf-Math.acos((v+h-d)/(2*m*x)))/2),O=w/x,g=w/m;Math.abs(O-1)>Zt&&this._append`L${t+O*f},${r+O*l}`,this._append`A${a},${a},0,0,${+(l*p>f*y)},${this._x1=t+g*c},${this._y1=r+g*s}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(i),c=n*Math.sin(i),s=t+u,f=r+c,l=1^o,h=o?i-a:a-i;this._x1===null?this._append`M${s},${f}`:(Math.abs(this._x1-s)>Zt||Math.abs(this._y1-f)>Zt)&&this._append`L${s},${f}`,n&&(h<0&&(h=h%lf+lf),h>fA?this._append`A${n},${n},0,1,${l},${t-u},${r-c}A${n},${n},0,1,${l},${this._x1=s},${this._y1=f}`:h>Zt&&this._append`A${n},${n},0,${+(h>=sf)},${l},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function Ch(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new pA(t)}function kh(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function $x(e){this._context=e}$x.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Ka(e){return new $x(e)}function Ix(e){return e[0]}function Cx(e){return e[1]}function kx(e,t){var r=he(!0),n=null,i=Ka,a=null,o=Ch(u);e=typeof e=="function"?e:e===void 0?Ix:he(e),t=typeof t=="function"?t:t===void 0?Cx:he(t);function u(c){var s,f=(c=kh(c)).length,l,h=!1,p;for(n==null&&(a=i(p=o())),s=0;s<=f;++s)!(s=p;--y)u.point(w[y],O[y]);u.lineEnd(),u.areaEnd()}m&&(w[h]=+e(d,h,l),O[h]=+t(d,h,l),u.point(n?+n(d,h,l):w[h],r?+r(d,h,l):O[h]))}if(x)return u=null,x+""||null}function f(){return kx().defined(i).curve(o).context(a)}return s.x=function(l){return arguments.length?(e=typeof l=="function"?l:he(+l),n=null,s):e},s.x0=function(l){return arguments.length?(e=typeof l=="function"?l:he(+l),s):e},s.x1=function(l){return arguments.length?(n=l==null?null:typeof l=="function"?l:he(+l),s):n},s.y=function(l){return arguments.length?(t=typeof l=="function"?l:he(+l),r=null,s):t},s.y0=function(l){return arguments.length?(t=typeof l=="function"?l:he(+l),s):t},s.y1=function(l){return arguments.length?(r=l==null?null:typeof l=="function"?l:he(+l),s):r},s.lineX0=s.lineY0=function(){return f().x(e).y(t)},s.lineY1=function(){return f().x(e).y(r)},s.lineX1=function(){return f().x(n).y(t)},s.defined=function(l){return arguments.length?(i=typeof l=="function"?l:he(!!l),s):i},s.curve=function(l){return arguments.length?(o=l,a!=null&&(u=o(a)),s):o},s.context=function(l){return arguments.length?(l==null?a=u=null:u=o(a=l),s):a},s}class Rx{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function dA(e){return new Rx(e,!0)}function vA(e){return new Rx(e,!1)}const Rh={draw(e,t){const r=pt(t/Wi);e.moveTo(r,0),e.arc(0,0,r,0,za)}},yA={draw(e,t){const r=pt(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},Dx=pt(1/3),gA=Dx*2,mA={draw(e,t){const r=pt(t/gA),n=r*Dx;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},bA={draw(e,t){const r=pt(t),n=-r/2;e.rect(n,n,r,r)}},xA=.8908130915292852,Nx=Ui(Wi/10)/Ui(7*Wi/10),wA=Ui(za/10)*Nx,OA=-jx(za/10)*Nx,_A={draw(e,t){const r=pt(t*xA),n=wA*r,i=OA*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=za*a/5,u=jx(o),c=Ui(o);e.lineTo(c*r,-u*r),e.lineTo(u*n-c*i,c*n+u*i)}e.closePath()}},Lu=pt(3),AA={draw(e,t){const r=-pt(t/(Lu*3));e.moveTo(0,r*2),e.lineTo(-Lu*r,-r),e.lineTo(Lu*r,-r),e.closePath()}},Je=-.5,Qe=pt(3)/2,ff=1/pt(12),SA=(ff/2+1)*3,PA={draw(e,t){const r=pt(t/SA),n=r/2,i=r*ff,a=n,o=r*ff+r,u=-a,c=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(u,c),e.lineTo(Je*n-Qe*i,Qe*n+Je*i),e.lineTo(Je*a-Qe*o,Qe*a+Je*o),e.lineTo(Je*u-Qe*c,Qe*u+Je*c),e.lineTo(Je*n+Qe*i,Je*i-Qe*n),e.lineTo(Je*a+Qe*o,Je*o-Qe*a),e.lineTo(Je*u+Qe*c,Je*c-Qe*u),e.closePath()}};function TA(e,t){let r=null,n=Ch(i);e=typeof e=="function"?e:he(e||Rh),t=typeof t=="function"?t:he(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:he(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:he(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function zi(){}function Ki(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function qx(e){this._context=e}qx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ki(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ki(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function EA(e){return new qx(e)}function Lx(e){this._context=e}Lx.prototype={areaStart:zi,areaEnd:zi,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Ki(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function jA(e){return new Lx(e)}function Bx(e){this._context=e}Bx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Ki(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function MA(e){return new Bx(e)}function Fx(e){this._context=e}Fx.prototype={areaStart:zi,areaEnd:zi,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function $A(e){return new Fx(e)}function sv(e){return e<0?-1:1}function lv(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),u=(a*i+o*n)/(n+i);return(sv(a)+sv(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(u))||0}function fv(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Bu(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,u=(a-n)/3;e._context.bezierCurveTo(n+u,i+u*t,a-u,o-u*r,a,o)}function Hi(e){this._context=e}Hi.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Bu(this,this._t0,fv(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Bu(this,fv(this,r=lv(this,e,t)),r);break;default:Bu(this,this._t0,r=lv(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Ux(e){this._context=new Wx(e)}(Ux.prototype=Object.create(Hi.prototype)).point=function(e,t){Hi.prototype.point.call(this,t,e)};function Wx(e){this._context=e}Wx.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function IA(e){return new Hi(e)}function CA(e){return new Ux(e)}function zx(e){this._context=e}zx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=hv(e),i=hv(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function RA(e){return new Ha(e,.5)}function DA(e){return new Ha(e,0)}function NA(e){return new Ha(e,1)}function Ir(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,u=a.length;r=0;)r[t]=t;return r}function qA(e,t){return e[t]}function LA(e){const t=[];return t.key=e,t}function BA(){var e=he([]),t=hf,r=Ir,n=qA;function i(a){var o=Array.from(e.apply(this,arguments),LA),u,c=o.length,s=-1,f;for(const l of a)for(u=0,++s;u0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function XA(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Kx={symbolCircle:Rh,symbolCross:yA,symbolDiamond:mA,symbolSquare:bA,symbolStar:_A,symbolTriangle:AA,symbolWye:PA},YA=Math.PI/180,ZA=function(t){var r="symbol".concat(Wa(t));return Kx[r]||Rh},JA=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*YA;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},QA=function(t,r){Kx["symbol".concat(Wa(t))]=r},Dh=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,o=t.sizeType,u=o===void 0?"area":o,c=VA(t,zA),s=dv(dv({},c),{},{type:n,size:a,sizeType:u}),f=function(){var d=ZA(n),m=TA().type(d).size(JA(a,u,n));return m()},l=s.className,h=s.cx,p=s.cy,y=K(s,!0);return h===+h&&p===+p&&a===+a?S.createElement("path",pf({},y,{className:te("recharts-symbols",l),transform:"translate(".concat(h,", ").concat(p,")"),d:f()})):null};Dh.registerSymbol=QA;function Cr(e){"@babel/helpers - typeof";return Cr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cr(e)}function df(){return df=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var x=p.inactive?s:p.color;return S.createElement("li",df({className:d,style:l,key:"legend-item-".concat(y)},cr(n.props,p,y)),S.createElement(uf,{width:o,height:o,viewBox:f,style:h},n.renderIcon(p)),S.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},v?v(m,p,y):m))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var u={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return S.createElement("ul",{className:"recharts-default-legend",style:u},this.renderItems())}}])})(N.PureComponent);Nn(Nh,"displayName","Legend");Nn(Nh,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Fu,yv;function lS(){if(yv)return Fu;yv=1;var e=Ba();function t(){this.__data__=new e,this.size=0}return Fu=t,Fu}var Uu,gv;function fS(){if(gv)return Uu;gv=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return Uu=e,Uu}var Wu,mv;function hS(){if(mv)return Wu;mv=1;function e(t){return this.__data__.get(t)}return Wu=e,Wu}var zu,bv;function pS(){if(bv)return zu;bv=1;function e(t){return this.__data__.has(t)}return zu=e,zu}var Ku,xv;function dS(){if(xv)return Ku;xv=1;var e=Ba(),t=Th(),r=Eh(),n=200;function i(a,o){var u=this.__data__;if(u instanceof e){var c=u.__data__;if(!t||c.lengthp))return!1;var v=l.get(o),d=l.get(u);if(v&&d)return v==u&&d==o;var m=-1,x=!0,w=c&i?new e:void 0;for(l.set(o,u),l.set(u,o);++m-1&&n%1==0&&n-1&&r%1==0&&r<=e}return pc=t,pc}var dc,zv;function _S(){if(zv)return dc;zv=1;var e=kt(),t=Kh(),r=ft(),n="[object Arguments]",i="[object Array]",a="[object Boolean]",o="[object Date]",u="[object Error]",c="[object Function]",s="[object Map]",f="[object Number]",l="[object Object]",h="[object RegExp]",p="[object Set]",y="[object String]",v="[object WeakMap]",d="[object ArrayBuffer]",m="[object DataView]",x="[object Float32Array]",w="[object Float64Array]",O="[object Int8Array]",g="[object Int16Array]",b="[object Int32Array]",_="[object Uint8Array]",A="[object Uint8ClampedArray]",P="[object Uint16Array]",j="[object Uint32Array]",T={};T[x]=T[w]=T[O]=T[g]=T[b]=T[_]=T[A]=T[P]=T[j]=!0,T[n]=T[i]=T[d]=T[a]=T[m]=T[o]=T[u]=T[c]=T[s]=T[f]=T[l]=T[h]=T[p]=T[y]=T[v]=!1;function E(M){return r(M)&&t(M.length)&&!!T[e(M)]}return dc=E,dc}var vc,Kv;function Ga(){if(Kv)return vc;Kv=1;function e(t){return function(r){return t(r)}}return vc=e,vc}var Pn={exports:{}};Pn.exports;var Hv;function Hh(){return Hv||(Hv=1,(function(e,t){var r=Ox(),n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,u=(function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}})();e.exports=u})(Pn,Pn.exports)),Pn.exports}var yc,Gv;function rw(){if(Gv)return yc;Gv=1;var e=_S(),t=Ga(),r=Hh(),n=r&&r.isTypedArray,i=n?t(n):e;return yc=i,yc}var gc,Vv;function nw(){if(Vv)return gc;Vv=1;var e=xS(),t=Uh(),r=Fe(),n=Wh(),i=zh(),a=rw(),o=Object.prototype,u=o.hasOwnProperty;function c(s,f){var l=r(s),h=!l&&t(s),p=!l&&!h&&n(s),y=!l&&!h&&!p&&a(s),v=l||h||p||y,d=v?e(s.length,String):[],m=d.length;for(var x in s)(f||u.call(s,x))&&!(v&&(x=="length"||p&&(x=="offset"||x=="parent")||y&&(x=="buffer"||x=="byteLength"||x=="byteOffset")||i(x,m)))&&d.push(x);return d}return gc=c,gc}var mc,Xv;function Gh(){if(Xv)return mc;Xv=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||e;return r===i}return mc=t,mc}var bc,Yv;function iw(){if(Yv)return bc;Yv=1;function e(t,r){return function(n){return t(r(n))}}return bc=e,bc}var xc,Zv;function AS(){if(Zv)return xc;Zv=1;var e=iw(),t=e(Object.keys,Object);return xc=t,xc}var wc,Jv;function SS(){if(Jv)return wc;Jv=1;var e=Gh(),t=AS(),r=Object.prototype,n=r.hasOwnProperty;function i(a){if(!e(a))return t(a);var o=[];for(var u in Object(a))n.call(a,u)&&u!="constructor"&&o.push(u);return o}return wc=i,wc}var Oc,Qv;function cn(){if(Qv)return Oc;Qv=1;var e=Ph(),t=Kh();function r(n){return n!=null&&t(n.length)&&!e(n)}return Oc=r,Oc}var _c,ey;function sn(){if(ey)return _c;ey=1;var e=nw(),t=SS(),r=cn();function n(i){return r(i)?e(i):t(i)}return _c=n,_c}var Ac,ty;function aw(){if(ty)return Ac;ty=1;var e=ew(),t=Fh(),r=sn();function n(i){return e(i,r,t)}return Ac=n,Ac}var Sc,ry;function PS(){if(ry)return Sc;ry=1;var e=aw(),t=1,r=Object.prototype,n=r.hasOwnProperty;function i(a,o,u,c,s,f){var l=u&t,h=e(a),p=h.length,y=e(o),v=y.length;if(p!=v&&!l)return!1;for(var d=p;d--;){var m=h[d];if(!(l?m in o:n.call(o,m)))return!1}var x=f.get(a),w=f.get(o);if(x&&w)return x==o&&w==a;var O=!0;f.set(a,o),f.set(o,a);for(var g=l;++d-1}return Zc=t,Zc}var Jc,jy;function KS(){if(jy)return Jc;jy=1;function e(t,r,n){for(var i=-1,a=t==null?0:t.length;++i=o){var m=s?null:i(c);if(m)return a(m);y=!1,h=n,d=new e}else d=s?[]:v;e:for(;++l=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function oP(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function uP(e){return e.value}function cP(e,t){if(S.isValidElement(e))return S.cloneElement(e,t);if(typeof e=="function")return S.createElement(e,t);t.ref;var r=aP(t,ZS);return S.createElement(Nh,r)}var Ny=1,jr=(function(e){function t(){var r;JS(this,t);for(var n=arguments.length,i=new Array(n),a=0;aNy||Math.abs(i.height-this.lastBoundingBox.height)>Ny)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Ot({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,u=i.verticalAlign,c=i.margin,s=i.chartWidth,f=i.chartHeight,l,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var p=this.getBBoxSnapshot();l={left:((s||0)-p.width)/2}}else l=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(u==="middle"){var y=this.getBBoxSnapshot();h={top:((f||0)-y.height)/2}}else h=u==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Ot(Ot({},l),h)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,u=i.height,c=i.wrapperStyle,s=i.payloadUniqBy,f=i.payload,l=Ot(Ot({position:"absolute",width:o||"auto",height:u||"auto"},this.getDefaultPosition(c)),c);return S.createElement("div",{className:"recharts-legend-wrapper",style:l,ref:function(p){n.wrapperNode=p}},cP(a,Ot(Ot({},this.props),{},{payload:lw(f,s,uP)})))}}],[{key:"getWithHeight",value:function(n,i){var a=Ot(Ot({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&q(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])})(N.PureComponent);Xa(jr,"displayName","Legend");Xa(jr,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var ns,qy;function sP(){if(qy)return ns;qy=1;var e=nn(),t=Uh(),r=Fe(),n=e?e.isConcatSpreadable:void 0;function i(a){return r(a)||t(a)||!!(n&&a&&a[n])}return ns=i,ns}var is,Ly;function Xh(){if(Ly)return is;Ly=1;var e=Bh(),t=sP();function r(n,i,a,o,u){var c=-1,s=n.length;for(a||(a=t),u||(u=[]);++c0&&a(f)?i>1?r(f,i-1,a,o,u):e(u,f):o||(u[u.length]=f)}return u}return is=r,is}var as,By;function lP(){if(By)return as;By=1;function e(t){return function(r,n,i){for(var a=-1,o=Object(r),u=i(r),c=u.length;c--;){var s=u[t?c:++a];if(n(o[s],s,o)===!1)break}return r}}return as=e,as}var os,Fy;function fP(){if(Fy)return os;Fy=1;var e=lP(),t=e();return os=t,os}var us,Uy;function pw(){if(Uy)return us;Uy=1;var e=fP(),t=sn();function r(n,i){return n&&e(n,i,t)}return us=r,us}var cs,Wy;function hP(){if(Wy)return cs;Wy=1;var e=cn();function t(r,n){return function(i,a){if(i==null)return i;if(!e(i))return r(i,a);for(var o=i.length,u=n?o:-1,c=Object(i);(n?u--:++un||u&&c&&f&&!s&&!l||a&&c&&f||!i&&f||!o)return 1;if(!a&&!u&&!l&&r=s)return f;var l=i[a];return f*(l=="desc"?-1:1)}}return r.index-n.index}return ps=t,ps}var ds,Xy;function yP(){if(Xy)return ds;Xy=1;var e=jh(),t=Mh(),r=xt(),n=dw(),i=pP(),a=Ga(),o=vP(),u=ln(),c=Fe();function s(f,l,h){l.length?l=e(l,function(v){return c(v)?function(d){return t(d,v.length===1?v[0]:v)}:v}):l=[u];var p=-1;l=e(l,a(r));var y=n(f,function(v,d,m){var x=e(l,function(w){return w(v)});return{criteria:x,index:++p,value:v}});return i(y,function(v,d){return o(v,d,h)})}return ds=s,ds}var vs,Yy;function gP(){if(Yy)return vs;Yy=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return vs=e,vs}var ys,Zy;function vw(){if(Zy)return ys;Zy=1;var e=gP(),t=Math.max;function r(n,i,a){return i=t(i===void 0?n.length-1:i,0),function(){for(var o=arguments,u=-1,c=t(o.length-i,0),s=Array(c);++u0){if(++a>=e)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return xs=n,xs}var ws,rg;function gw(){if(rg)return ws;rg=1;var e=bP(),t=xP(),r=t(e);return ws=r,ws}var Os,ng;function wP(){if(ng)return Os;ng=1;var e=ln(),t=vw(),r=gw();function n(i,a){return r(t(i,a,e),i+"")}return Os=n,Os}var _s,ig;function Ya(){if(ig)return _s;ig=1;var e=qa(),t=cn(),r=zh(),n=ht();function i(a,o,u){if(!n(u))return!1;var c=typeof o;return(c=="number"?t(u)&&r(o,u.length):c=="string"&&o in u)?e(u[o],a):!1}return _s=i,_s}var As,ag;function OP(){if(ag)return As;ag=1;var e=Xh(),t=yP(),r=wP(),n=Ya(),i=r(function(a,o){if(a==null)return[];var u=o.length;return u>1&&n(a,o[0],o[1])?o=[]:u>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),t(a,e(o,1),[])});return As=i,As}var _P=OP();const Zh=ce(_P);function qn(e){"@babel/helpers - typeof";return qn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qn(e)}function gf(){return gf=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(yn,"-left"),q(r)&&t&&q(t.x)&&r=t.y),"".concat(yn,"-top"),q(n)&&t&&q(t.y)&&nv?Math.max(f,c[n]):Math.max(l,c[n])}function qP(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function LP(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,u=e.useTranslate3d,c=e.viewBox,s,f,l;return o.height>0&&o.width>0&&r?(f=cg({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),l=cg({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),s=qP({translateX:f,translateY:l,useTranslate3d:u})):s=DP,{cssProperties:s,cssClasses:NP({translateX:f,translateY:l,coordinate:r})}}function Rr(e){"@babel/helpers - typeof";return Rr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rr(e)}function sg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function lg(e){for(var t=1;tfg||Math.abs(n.height-this.state.lastBoundingBox.height)>fg)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,u=i.animationDuration,c=i.animationEasing,s=i.children,f=i.coordinate,l=i.hasPayload,h=i.isAnimationActive,p=i.offset,y=i.position,v=i.reverseDirection,d=i.useTranslate3d,m=i.viewBox,x=i.wrapperStyle,w=LP({allowEscapeViewBox:o,coordinate:f,offsetTopLeft:p,position:y,reverseDirection:v,tooltipBox:this.state.lastBoundingBox,useTranslate3d:d,viewBox:m}),O=w.cssClasses,g=w.cssProperties,b=lg(lg({transition:h&&a?"transform ".concat(u,"ms ").concat(c):void 0},g),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&l?"visible":"hidden",position:"absolute",top:0,left:0},x);return S.createElement("div",{tabIndex:-1,className:O,style:b,ref:function(A){n.wrapperNode=A}},s)}}])})(N.PureComponent),XP=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},pr={isSsr:XP()};function Dr(e){"@babel/helpers - typeof";return Dr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dr(e)}function hg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function pg(e){for(var t=1;t0;return S.createElement(VP,{allowEscapeViewBox:o,animationDuration:u,animationEasing:c,isAnimationActive:h,active:a,coordinate:f,hasPayload:b,offset:p,position:d,reverseDirection:m,useTranslate3d:x,viewBox:w,wrapperStyle:O},aT(s,pg(pg({},this.props),{},{payload:g})))}}])})(N.PureComponent);Jh(_t,"displayName","Tooltip");Jh(_t,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!pr.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var Ps,dg;function oT(){if(dg)return Ps;dg=1;var e=lt(),t=function(){return e.Date.now()};return Ps=t,Ps}var Ts,vg;function uT(){if(vg)return Ts;vg=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return Ts=t,Ts}var Es,yg;function cT(){if(yg)return Es;yg=1;var e=uT(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return Es=r,Es}var js,gg;function Ow(){if(gg)return js;gg=1;var e=cT(),t=ht(),r=an(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,u=parseInt;function c(s){if(typeof s=="number")return s;if(r(s))return n;if(t(s)){var f=typeof s.valueOf=="function"?s.valueOf():s;s=t(f)?f+"":f}if(typeof s!="string")return s===0?s:+s;s=e(s);var l=a.test(s);return l||o.test(s)?u(s.slice(2),l?2:8):i.test(s)?n:+s}return js=c,js}var Ms,mg;function sT(){if(mg)return Ms;mg=1;var e=ht(),t=oT(),r=Ow(),n="Expected a function",i=Math.max,a=Math.min;function o(u,c,s){var f,l,h,p,y,v,d=0,m=!1,x=!1,w=!0;if(typeof u!="function")throw new TypeError(n);c=r(c)||0,e(s)&&(m=!!s.leading,x="maxWait"in s,h=x?i(r(s.maxWait)||0,c):h,w="trailing"in s?!!s.trailing:w);function O(M){var I=f,$=l;return f=l=void 0,d=M,p=u.apply($,I),p}function g(M){return d=M,y=setTimeout(A,c),m?O(M):p}function b(M){var I=M-v,$=M-d,k=c-I;return x?a(k,h-$):k}function _(M){var I=M-v,$=M-d;return v===void 0||I>=c||I<0||x&&$>=h}function A(){var M=t();if(_(M))return P(M);y=setTimeout(A,b(M))}function P(M){return y=void 0,w&&f?O(M):(f=l=void 0,p)}function j(){y!==void 0&&clearTimeout(y),d=0,f=v=l=y=void 0}function T(){return y===void 0?p:P(t())}function E(){var M=t(),I=_(M);if(f=arguments,l=this,v=M,I){if(y===void 0)return g(v);if(x)return clearTimeout(y),y=setTimeout(A,c),O(v)}return y===void 0&&(y=setTimeout(A,c)),p}return E.cancel=j,E.flush=T,E}return Ms=o,Ms}var $s,bg;function lT(){if(bg)return $s;bg=1;var e=sT(),t=ht(),r="Expected a function";function n(i,a,o){var u=!0,c=!0;if(typeof i!="function")throw new TypeError(r);return t(o)&&(u="leading"in o?!!o.leading:u,c="trailing"in o?!!o.trailing:c),e(i,a,{leading:u,maxWait:a,trailing:c})}return $s=n,$s}var fT=lT();const _w=ce(fT);function Bn(e){"@babel/helpers - typeof";return Bn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bn(e)}function xg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ti(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(M=_w(M,v,{trailing:!0,leading:!1}));var I=new ResizeObserver(M),$=g.current.getBoundingClientRect(),k=$.width,R=$.height;return T(k,R),I.observe(g.current),function(){I.disconnect()}},[T,v]);var E=N.useMemo(function(){var M=P.containerWidth,I=P.containerHeight;if(M<0||I<0)return null;st(er(o)||er(c),`The width(%s) and height(%s) are both fixed numbers, + A`).concat(o,",").concat(o,",0,1,1,").concat(u,",").concat(a),className:"recharts-legend-icon"});if(n.type==="rect")return S.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(et/8,"h").concat(et,"v").concat(et*3/4,"h").concat(-et,"z"),className:"recharts-legend-icon"});if(S.isValidElement(n.legendIcon)){var s=eS({},n);return delete s.legendIcon,S.cloneElement(n.legendIcon,s)}return S.createElement(Dh,{fill:c,cx:a,cy:a,size:et,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,i=this.props,a=i.payload,o=i.iconSize,u=i.layout,c=i.formatter,s=i.inactiveColor,f={x:0,y:0,width:et,height:et},l={display:u==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(p,y){var v=p.formatter||c,d=te(Nn(Nn({"recharts-legend-item":!0},"legend-item-".concat(y),!0),"inactive",p.inactive));if(p.type==="none")return null;var m=X(p.value)?null:p.value;st(!X(p.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: `);var x=p.inactive?s:p.color;return S.createElement("li",df({className:d,style:l,key:"legend-item-".concat(y)},cr(n.props,p,y)),S.createElement(uf,{width:o,height:o,viewBox:f,style:h},n.renderIcon(p)),S.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},v?v(m,p,y):m))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var u={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return S.createElement("ul",{className:"recharts-default-legend",style:u},this.renderItems())}}])})(N.PureComponent);Nn(Nh,"displayName","Legend");Nn(Nh,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Fu,yv;function sS(){if(yv)return Fu;yv=1;var e=Ba();function t(){this.__data__=new e,this.size=0}return Fu=t,Fu}var Uu,gv;function lS(){if(gv)return Uu;gv=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return Uu=e,Uu}var Wu,mv;function fS(){if(mv)return Wu;mv=1;function e(t){return this.__data__.get(t)}return Wu=e,Wu}var zu,bv;function hS(){if(bv)return zu;bv=1;function e(t){return this.__data__.has(t)}return zu=e,zu}var Ku,xv;function pS(){if(xv)return Ku;xv=1;var e=Ba(),t=Th(),r=Eh(),n=200;function i(a,o){var u=this.__data__;if(u instanceof e){var c=u.__data__;if(!t||c.lengthp))return!1;var v=l.get(o),d=l.get(u);if(v&&d)return v==u&&d==o;var m=-1,x=!0,w=c&i?new e:void 0;for(l.set(o,u),l.set(u,o);++m-1&&n%1==0&&n-1&&r%1==0&&r<=e}return pc=t,pc}var dc,zv;function OS(){if(zv)return dc;zv=1;var e=kt(),t=Kh(),r=ft(),n="[object Arguments]",i="[object Array]",a="[object Boolean]",o="[object Date]",u="[object Error]",c="[object Function]",s="[object Map]",f="[object Number]",l="[object Object]",h="[object RegExp]",p="[object Set]",y="[object String]",v="[object WeakMap]",d="[object ArrayBuffer]",m="[object DataView]",x="[object Float32Array]",w="[object Float64Array]",O="[object Int8Array]",g="[object Int16Array]",b="[object Int32Array]",_="[object Uint8Array]",A="[object Uint8ClampedArray]",P="[object Uint16Array]",j="[object Uint32Array]",T={};T[x]=T[w]=T[O]=T[g]=T[b]=T[_]=T[A]=T[P]=T[j]=!0,T[n]=T[i]=T[d]=T[a]=T[m]=T[o]=T[u]=T[c]=T[s]=T[f]=T[l]=T[h]=T[p]=T[y]=T[v]=!1;function E(M){return r(M)&&t(M.length)&&!!T[e(M)]}return dc=E,dc}var vc,Kv;function Ga(){if(Kv)return vc;Kv=1;function e(t){return function(r){return t(r)}}return vc=e,vc}var Pn={exports:{}};Pn.exports;var Hv;function Hh(){return Hv||(Hv=1,(function(e,t){var r=wx(),n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,u=(function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}})();e.exports=u})(Pn,Pn.exports)),Pn.exports}var yc,Gv;function tw(){if(Gv)return yc;Gv=1;var e=OS(),t=Ga(),r=Hh(),n=r&&r.isTypedArray,i=n?t(n):e;return yc=i,yc}var gc,Vv;function rw(){if(Vv)return gc;Vv=1;var e=bS(),t=Uh(),r=Fe(),n=Wh(),i=zh(),a=tw(),o=Object.prototype,u=o.hasOwnProperty;function c(s,f){var l=r(s),h=!l&&t(s),p=!l&&!h&&n(s),y=!l&&!h&&!p&&a(s),v=l||h||p||y,d=v?e(s.length,String):[],m=d.length;for(var x in s)(f||u.call(s,x))&&!(v&&(x=="length"||p&&(x=="offset"||x=="parent")||y&&(x=="buffer"||x=="byteLength"||x=="byteOffset")||i(x,m)))&&d.push(x);return d}return gc=c,gc}var mc,Xv;function Gh(){if(Xv)return mc;Xv=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||e;return r===i}return mc=t,mc}var bc,Yv;function nw(){if(Yv)return bc;Yv=1;function e(t,r){return function(n){return t(r(n))}}return bc=e,bc}var xc,Zv;function _S(){if(Zv)return xc;Zv=1;var e=nw(),t=e(Object.keys,Object);return xc=t,xc}var wc,Jv;function AS(){if(Jv)return wc;Jv=1;var e=Gh(),t=_S(),r=Object.prototype,n=r.hasOwnProperty;function i(a){if(!e(a))return t(a);var o=[];for(var u in Object(a))n.call(a,u)&&u!="constructor"&&o.push(u);return o}return wc=i,wc}var Oc,Qv;function cn(){if(Qv)return Oc;Qv=1;var e=Ph(),t=Kh();function r(n){return n!=null&&t(n.length)&&!e(n)}return Oc=r,Oc}var _c,ey;function sn(){if(ey)return _c;ey=1;var e=rw(),t=AS(),r=cn();function n(i){return r(i)?e(i):t(i)}return _c=n,_c}var Ac,ty;function iw(){if(ty)return Ac;ty=1;var e=Qx(),t=Fh(),r=sn();function n(i){return e(i,r,t)}return Ac=n,Ac}var Sc,ry;function SS(){if(ry)return Sc;ry=1;var e=iw(),t=1,r=Object.prototype,n=r.hasOwnProperty;function i(a,o,u,c,s,f){var l=u&t,h=e(a),p=h.length,y=e(o),v=y.length;if(p!=v&&!l)return!1;for(var d=p;d--;){var m=h[d];if(!(l?m in o:n.call(o,m)))return!1}var x=f.get(a),w=f.get(o);if(x&&w)return x==o&&w==a;var O=!0;f.set(a,o),f.set(o,a);for(var g=l;++d-1}return Zc=t,Zc}var Jc,jy;function zS(){if(jy)return Jc;jy=1;function e(t,r,n){for(var i=-1,a=t==null?0:t.length;++i=o){var m=s?null:i(c);if(m)return a(m);y=!1,h=n,d=new e}else d=s?[]:v;e:for(;++l=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function aP(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function oP(e){return e.value}function uP(e,t){if(S.isValidElement(e))return S.cloneElement(e,t);if(typeof e=="function")return S.createElement(e,t);t.ref;var r=iP(t,YS);return S.createElement(Nh,r)}var Ny=1,jr=(function(e){function t(){var r;ZS(this,t);for(var n=arguments.length,i=new Array(n),a=0;aNy||Math.abs(i.height-this.lastBoundingBox.height)>Ny)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Ot({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,u=i.verticalAlign,c=i.margin,s=i.chartWidth,f=i.chartHeight,l,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var p=this.getBBoxSnapshot();l={left:((s||0)-p.width)/2}}else l=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(u==="middle"){var y=this.getBBoxSnapshot();h={top:((f||0)-y.height)/2}}else h=u==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Ot(Ot({},l),h)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,u=i.height,c=i.wrapperStyle,s=i.payloadUniqBy,f=i.payload,l=Ot(Ot({position:"absolute",width:o||"auto",height:u||"auto"},this.getDefaultPosition(c)),c);return S.createElement("div",{className:"recharts-legend-wrapper",style:l,ref:function(p){n.wrapperNode=p}},uP(a,Ot(Ot({},this.props),{},{payload:sw(f,s,oP)})))}}],[{key:"getWithHeight",value:function(n,i){var a=Ot(Ot({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&q(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])})(N.PureComponent);Xa(jr,"displayName","Legend");Xa(jr,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var ns,qy;function cP(){if(qy)return ns;qy=1;var e=nn(),t=Uh(),r=Fe(),n=e?e.isConcatSpreadable:void 0;function i(a){return r(a)||t(a)||!!(n&&a&&a[n])}return ns=i,ns}var is,Ly;function Xh(){if(Ly)return is;Ly=1;var e=Bh(),t=cP();function r(n,i,a,o,u){var c=-1,s=n.length;for(a||(a=t),u||(u=[]);++c0&&a(f)?i>1?r(f,i-1,a,o,u):e(u,f):o||(u[u.length]=f)}return u}return is=r,is}var as,By;function sP(){if(By)return as;By=1;function e(t){return function(r,n,i){for(var a=-1,o=Object(r),u=i(r),c=u.length;c--;){var s=u[t?c:++a];if(n(o[s],s,o)===!1)break}return r}}return as=e,as}var os,Fy;function lP(){if(Fy)return os;Fy=1;var e=sP(),t=e();return os=t,os}var us,Uy;function hw(){if(Uy)return us;Uy=1;var e=lP(),t=sn();function r(n,i){return n&&e(n,i,t)}return us=r,us}var cs,Wy;function fP(){if(Wy)return cs;Wy=1;var e=cn();function t(r,n){return function(i,a){if(i==null)return i;if(!e(i))return r(i,a);for(var o=i.length,u=n?o:-1,c=Object(i);(n?u--:++un||u&&c&&f&&!s&&!l||a&&c&&f||!i&&f||!o)return 1;if(!a&&!u&&!l&&r=s)return f;var l=i[a];return f*(l=="desc"?-1:1)}}return r.index-n.index}return ps=t,ps}var ds,Xy;function vP(){if(Xy)return ds;Xy=1;var e=jh(),t=Mh(),r=xt(),n=pw(),i=hP(),a=Ga(),o=dP(),u=ln(),c=Fe();function s(f,l,h){l.length?l=e(l,function(v){return c(v)?function(d){return t(d,v.length===1?v[0]:v)}:v}):l=[u];var p=-1;l=e(l,a(r));var y=n(f,function(v,d,m){var x=e(l,function(w){return w(v)});return{criteria:x,index:++p,value:v}});return i(y,function(v,d){return o(v,d,h)})}return ds=s,ds}var vs,Yy;function yP(){if(Yy)return vs;Yy=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return vs=e,vs}var ys,Zy;function dw(){if(Zy)return ys;Zy=1;var e=yP(),t=Math.max;function r(n,i,a){return i=t(i===void 0?n.length-1:i,0),function(){for(var o=arguments,u=-1,c=t(o.length-i,0),s=Array(c);++u0){if(++a>=e)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return xs=n,xs}var ws,rg;function yw(){if(rg)return ws;rg=1;var e=mP(),t=bP(),r=t(e);return ws=r,ws}var Os,ng;function xP(){if(ng)return Os;ng=1;var e=ln(),t=dw(),r=yw();function n(i,a){return r(t(i,a,e),i+"")}return Os=n,Os}var _s,ig;function Ya(){if(ig)return _s;ig=1;var e=qa(),t=cn(),r=zh(),n=ht();function i(a,o,u){if(!n(u))return!1;var c=typeof o;return(c=="number"?t(u)&&r(o,u.length):c=="string"&&o in u)?e(u[o],a):!1}return _s=i,_s}var As,ag;function wP(){if(ag)return As;ag=1;var e=Xh(),t=vP(),r=xP(),n=Ya(),i=r(function(a,o){if(a==null)return[];var u=o.length;return u>1&&n(a,o[0],o[1])?o=[]:u>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),t(a,e(o,1),[])});return As=i,As}var OP=wP();const Zh=ce(OP);function qn(e){"@babel/helpers - typeof";return qn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qn(e)}function gf(){return gf=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(yn,"-left"),q(r)&&t&&q(t.x)&&r=t.y),"".concat(yn,"-top"),q(n)&&t&&q(t.y)&&nv?Math.max(f,c[n]):Math.max(l,c[n])}function NP(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function qP(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,u=e.useTranslate3d,c=e.viewBox,s,f,l;return o.height>0&&o.width>0&&r?(f=cg({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),l=cg({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),s=NP({translateX:f,translateY:l,useTranslate3d:u})):s=RP,{cssProperties:s,cssClasses:DP({translateX:f,translateY:l,coordinate:r})}}function Rr(e){"@babel/helpers - typeof";return Rr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rr(e)}function sg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function lg(e){for(var t=1;tfg||Math.abs(n.height-this.state.lastBoundingBox.height)>fg)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,u=i.animationDuration,c=i.animationEasing,s=i.children,f=i.coordinate,l=i.hasPayload,h=i.isAnimationActive,p=i.offset,y=i.position,v=i.reverseDirection,d=i.useTranslate3d,m=i.viewBox,x=i.wrapperStyle,w=qP({allowEscapeViewBox:o,coordinate:f,offsetTopLeft:p,position:y,reverseDirection:v,tooltipBox:this.state.lastBoundingBox,useTranslate3d:d,viewBox:m}),O=w.cssClasses,g=w.cssProperties,b=lg(lg({transition:h&&a?"transform ".concat(u,"ms ").concat(c):void 0},g),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&l?"visible":"hidden",position:"absolute",top:0,left:0},x);return S.createElement("div",{tabIndex:-1,className:O,style:b,ref:function(A){n.wrapperNode=A}},s)}}])})(N.PureComponent),VP=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},pr={isSsr:VP()};function Dr(e){"@babel/helpers - typeof";return Dr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dr(e)}function hg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function pg(e){for(var t=1;t0;return S.createElement(GP,{allowEscapeViewBox:o,animationDuration:u,animationEasing:c,isAnimationActive:h,active:a,coordinate:f,hasPayload:b,offset:p,position:d,reverseDirection:m,useTranslate3d:x,viewBox:w,wrapperStyle:O},iT(s,pg(pg({},this.props),{},{payload:g})))}}])})(N.PureComponent);Jh(_t,"displayName","Tooltip");Jh(_t,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!pr.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var Ps,dg;function aT(){if(dg)return Ps;dg=1;var e=lt(),t=function(){return e.Date.now()};return Ps=t,Ps}var Ts,vg;function oT(){if(vg)return Ts;vg=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return Ts=t,Ts}var Es,yg;function uT(){if(yg)return Es;yg=1;var e=oT(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return Es=r,Es}var js,gg;function ww(){if(gg)return js;gg=1;var e=uT(),t=ht(),r=an(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,u=parseInt;function c(s){if(typeof s=="number")return s;if(r(s))return n;if(t(s)){var f=typeof s.valueOf=="function"?s.valueOf():s;s=t(f)?f+"":f}if(typeof s!="string")return s===0?s:+s;s=e(s);var l=a.test(s);return l||o.test(s)?u(s.slice(2),l?2:8):i.test(s)?n:+s}return js=c,js}var Ms,mg;function cT(){if(mg)return Ms;mg=1;var e=ht(),t=aT(),r=ww(),n="Expected a function",i=Math.max,a=Math.min;function o(u,c,s){var f,l,h,p,y,v,d=0,m=!1,x=!1,w=!0;if(typeof u!="function")throw new TypeError(n);c=r(c)||0,e(s)&&(m=!!s.leading,x="maxWait"in s,h=x?i(r(s.maxWait)||0,c):h,w="trailing"in s?!!s.trailing:w);function O(M){var I=f,$=l;return f=l=void 0,d=M,p=u.apply($,I),p}function g(M){return d=M,y=setTimeout(A,c),m?O(M):p}function b(M){var I=M-v,$=M-d,k=c-I;return x?a(k,h-$):k}function _(M){var I=M-v,$=M-d;return v===void 0||I>=c||I<0||x&&$>=h}function A(){var M=t();if(_(M))return P(M);y=setTimeout(A,b(M))}function P(M){return y=void 0,w&&f?O(M):(f=l=void 0,p)}function j(){y!==void 0&&clearTimeout(y),d=0,f=v=l=y=void 0}function T(){return y===void 0?p:P(t())}function E(){var M=t(),I=_(M);if(f=arguments,l=this,v=M,I){if(y===void 0)return g(v);if(x)return clearTimeout(y),y=setTimeout(A,c),O(v)}return y===void 0&&(y=setTimeout(A,c)),p}return E.cancel=j,E.flush=T,E}return Ms=o,Ms}var $s,bg;function sT(){if(bg)return $s;bg=1;var e=cT(),t=ht(),r="Expected a function";function n(i,a,o){var u=!0,c=!0;if(typeof i!="function")throw new TypeError(r);return t(o)&&(u="leading"in o?!!o.leading:u,c="trailing"in o?!!o.trailing:c),e(i,a,{leading:u,maxWait:a,trailing:c})}return $s=n,$s}var lT=sT();const Ow=ce(lT);function Bn(e){"@babel/helpers - typeof";return Bn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bn(e)}function xg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ti(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(M=Ow(M,v,{trailing:!0,leading:!1}));var I=new ResizeObserver(M),$=g.current.getBoundingClientRect(),k=$.width,R=$.height;return T(k,R),I.observe(g.current),function(){I.disconnect()}},[T,v]);var E=N.useMemo(function(){var M=P.containerWidth,I=P.containerHeight;if(M<0||I<0)return null;st(er(o)||er(c),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,o,c),st(!r||r>0,"The aspect(%s) must be greater than zero.",r);var $=er(o)?M:o,k=er(c)?I:c;r&&r>0&&($?k=$/r:k&&($=k*r),h&&k>h&&(k=h)),st($>0||k>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,$,k,o,c,f,l,r);var R=!Array.isArray(p)&&Et(p.type).endsWith("Chart");return S.Children.map(p,function(L){return S.isValidElement(L)?N.cloneElement(L,Ti({width:$,height:k},R?{style:Ti({height:"100%",width:"100%",maxHeight:k,maxWidth:$},L.props.style)}:{})):L})},[r,p,c,h,l,f,P,o]);return S.createElement("div",{id:d?"".concat(d):void 0,className:te("recharts-responsive-container",m),style:Ti(Ti({},O),{},{width:o,height:c,minWidth:f,minHeight:l,maxHeight:h}),ref:g},E)}),Qh=function(t){return null};Qh.displayName="Cell";function Fn(e){"@babel/helpers - typeof";return Fn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fn(e)}function Og(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function wf(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||pr.isSsr)return{width:0,height:0};var n=ST(r),i=JSON.stringify({text:t,copyStyle:n});if(br.widthCache[i])return br.widthCache[i];try{var a=document.getElementById(_g);a||(a=document.createElement("span"),a.setAttribute("id",_g),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=wf(wf({},AT),n);Object.assign(a.style,o),a.textContent="".concat(t);var u=a.getBoundingClientRect(),c={width:u.width,height:u.height};return br.widthCache[i]=c,++br.cacheCount>_T&&(br.cacheCount=0,br.widthCache={}),c}catch{return{width:0,height:0}}},PT=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Un(e){"@babel/helpers - typeof";return Un=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Un(e)}function Zi(e,t){return MT(e)||jT(e,t)||ET(e,t)||TT()}function TT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ET(e,t){if(e){if(typeof e=="string")return Ag(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ag(e,t)}}function Ag(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zT(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Mg(e,t){return VT(e)||GT(e,t)||HT(e,t)||KT()}function KT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HT(e,t){if(e){if(typeof e=="string")return $g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $g(e,t)}}function $g(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return $.reduce(function(k,R){var L=R.word,B=R.width,z=k[k.length-1];if(z&&(i==null||a||z.width+B+nR.width?k:R})};if(!f)return p;for(var v="…",d=function($){var k=l.slice(0,$),R=Tw({breakAll:s,style:c,children:k+v}).wordsWithComputedWidth,L=h(R),B=L.length>o||y(L).width>Number(i);return[B,L]},m=0,x=l.length-1,w=0,O;m<=x&&w<=l.length-1;){var g=Math.floor((m+x)/2),b=g-1,_=d(b),A=Mg(_,2),P=A[0],j=A[1],T=d(g),E=Mg(T,1),M=E[0];if(!P&&!M&&(m=g+1),P&&M&&(x=g-1),!P&&M){O=j;break}w++}return O||p},Ig=function(t){var r=J(t)?[]:t.toString().split(Pw);return[{words:r}]},YT=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,u=t.maxLines;if((r||n)&&!pr.isSsr){var c,s,f=Tw({breakAll:o,children:i,style:a});if(f){var l=f.wordsWithComputedWidth,h=f.spaceWidth;c=l,s=h}else return Ig(i);return XT({breakAll:o,children:i,maxLines:u,style:a},c,s,r,n)}return Ig(i)},Cg="#808080",sr=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.lineHeight,u=o===void 0?"1em":o,c=t.capHeight,s=c===void 0?"0.71em":c,f=t.scaleToFit,l=f===void 0?!1:f,h=t.textAnchor,p=h===void 0?"start":h,y=t.verticalAnchor,v=y===void 0?"end":y,d=t.fill,m=d===void 0?Cg:d,x=jg(t,UT),w=N.useMemo(function(){return YT({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:l,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,l,x.style,x.width]),O=x.dx,g=x.dy,b=x.angle,_=x.className,A=x.breakAll,P=jg(x,WT);if(!Se(n)||!Se(a))return null;var j=n+(q(O)?O:0),T=a+(q(g)?g:0),E;switch(v){case"start":E=Is("calc(".concat(s,")"));break;case"middle":E=Is("calc(".concat((w.length-1)/2," * -").concat(u," + (").concat(s," / 2))"));break;default:E=Is("calc(".concat(w.length-1," * -").concat(u,")"));break}var M=[];if(l){var I=w[0].width,$=x.width;M.push("scale(".concat((q($)?$/I:1)/I,")"))}return b&&M.push("rotate(".concat(b,", ").concat(j,", ").concat(T,")")),M.length&&(P.transform=M.join(" ")),S.createElement("text",Of({},K(P,!0),{x:j,y:T,className:te("recharts-text",_),textAnchor:p,fill:m.includes("url")?Cg:m}),w.map(function(k,R){var L=k.words.join(A?"":" ");return S.createElement("tspan",{x:j,dy:R===0?E:u,key:"".concat(L,"-").concat(R)},L)}))};function Bt(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function ZT(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function ep(e){let t,r,n;e.length!==2?(t=Bt,r=(u,c)=>Bt(e(u),c),n=(u,c)=>e(u)-c):(t=e===Bt||e===ZT?e:JT,r=e,n=e);function i(u,c,s=0,f=u.length){if(s>>1;r(u[l],c)<0?s=l+1:f=l}while(s>>1;r(u[l],c)<=0?s=l+1:f=l}while(ss&&n(u[l-1],c)>-n(u[l],c)?l-1:l}return{left:i,center:o,right:a}}function JT(){return 0}function Ew(e){return e===null?NaN:+e}function*QT(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const eE=ep(Bt),mi=eE.right;ep(Ew).center;class kg extends Map{constructor(t,r=nE){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(Rg(this,t))}has(t){return super.has(Rg(this,t))}set(t,r){return super.set(tE(this,t),r)}delete(t){return super.delete(rE(this,t))}}function Rg({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function tE({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function rE({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function nE(e){return e!==null&&typeof e=="object"?e.valueOf():e}function iE(e=Bt){if(e===Bt)return jw;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function jw(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const aE=Math.sqrt(50),oE=Math.sqrt(10),uE=Math.sqrt(2);function Ji(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=aE?10:a>=oE?5:a>=uE?2:1;let u,c,s;return i<0?(s=Math.pow(10,-i)/o,u=Math.round(e*s),c=Math.round(t*s),u/st&&--c,s=-s):(s=Math.pow(10,i)*o,u=Math.round(e/s),c=Math.round(t/s),u*st&&--c),c0))return[];if(e===t)return[e];const n=t=i))return[];const u=a-i+1,c=new Array(u);if(n)if(o<0)for(let s=0;s=n)&&(r=n);return r}function Ng(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function Mw(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?jw:iE(i);n>r;){if(n-r>600){const c=n-r+1,s=t-r+1,f=Math.log(c),l=.5*Math.exp(2*f/3),h=.5*Math.sqrt(f*l*(c-l)/c)*(s-c/2<0?-1:1),p=Math.max(r,Math.floor(t-s*l/c+h)),y=Math.min(n,Math.floor(t+(c-s)*l/c+h));Mw(e,t,p,y,i)}const a=e[t];let o=r,u=n;for(gn(e,r,t),i(e[n],a)>0&&gn(e,r,n);o0;)--u}i(e[r],a)===0?gn(e,r,u):(++u,gn(e,u,n)),u<=t&&(r=u+1),t<=u&&(n=u-1)}return e}function gn(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function cE(e,t,r){if(e=Float64Array.from(QT(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Ng(e);if(t>=1)return Dg(e);var n,i=(n-1)*t,a=Math.floor(i),o=Dg(Mw(e,a).subarray(0,a+1)),u=Ng(e.subarray(a+1));return o+(u-o)*(i-a)}}function sE(e,t,r=Ew){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),u=+r(e[a+1],a+1,e);return o+(u-o)*(i-a)}}function lE(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?ji(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?ji(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=hE.exec(e))?new Ue(t[1],t[2],t[3],1):(t=pE.exec(e))?new Ue(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=dE.exec(e))?ji(t[1],t[2],t[3],t[4]):(t=vE.exec(e))?ji(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=yE.exec(e))?zg(t[1],t[2]/100,t[3]/100,1):(t=gE.exec(e))?zg(t[1],t[2]/100,t[3]/100,t[4]):qg.hasOwnProperty(e)?Fg(qg[e]):e==="transparent"?new Ue(NaN,NaN,NaN,0):null}function Fg(e){return new Ue(e>>16&255,e>>8&255,e&255,1)}function ji(e,t,r,n){return n<=0&&(e=t=r=NaN),new Ue(e,t,r,n)}function xE(e){return e instanceof bi||(e=Hn(e)),e?(e=e.rgb(),new Ue(e.r,e.g,e.b,e.opacity)):new Ue}function Tf(e,t,r,n){return arguments.length===1?xE(e):new Ue(e,t,r,n??1)}function Ue(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}rp(Ue,Tf,Iw(bi,{brighter(e){return e=e==null?Qi:Math.pow(Qi,e),new Ue(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?zn:Math.pow(zn,e),new Ue(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ue(ir(this.r),ir(this.g),ir(this.b),ea(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ug,formatHex:Ug,formatHex8:wE,formatRgb:Wg,toString:Wg}));function Ug(){return`#${tr(this.r)}${tr(this.g)}${tr(this.b)}`}function wE(){return`#${tr(this.r)}${tr(this.g)}${tr(this.b)}${tr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Wg(){const e=ea(this.opacity);return`${e===1?"rgb(":"rgba("}${ir(this.r)}, ${ir(this.g)}, ${ir(this.b)}${e===1?")":`, ${e})`}`}function ea(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ir(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function tr(e){return e=ir(e),(e<16?"0":"")+e.toString(16)}function zg(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new ct(e,t,r,n)}function Cw(e){if(e instanceof ct)return new ct(e.h,e.s,e.l,e.opacity);if(e instanceof bi||(e=Hn(e)),!e)return new ct;if(e instanceof ct)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,u=a-i,c=(a+i)/2;return u?(t===a?o=(r-n)/u+(r0&&c<1?0:o,new ct(o,u,c,e.opacity)}function OE(e,t,r,n){return arguments.length===1?Cw(e):new ct(e,t,r,n??1)}function ct(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}rp(ct,OE,Iw(bi,{brighter(e){return e=e==null?Qi:Math.pow(Qi,e),new ct(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?zn:Math.pow(zn,e),new ct(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Ue(Cs(e>=240?e-240:e+120,i,n),Cs(e,i,n),Cs(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new ct(Kg(this.h),Mi(this.s),Mi(this.l),ea(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=ea(this.opacity);return`${e===1?"hsl(":"hsla("}${Kg(this.h)}, ${Mi(this.s)*100}%, ${Mi(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Kg(e){return e=(e||0)%360,e<0?e+360:e}function Mi(e){return Math.max(0,Math.min(1,e||0))}function Cs(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const np=e=>()=>e;function _E(e,t){return function(r){return e+r*t}}function AE(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function SE(e){return(e=+e)==1?kw:function(t,r){return r-t?AE(t,r,e):np(isNaN(t)?r:t)}}function kw(e,t){var r=t-e;return r?_E(e,r):np(isNaN(e)?t:e)}const Hg=(function e(t){var r=SE(t);function n(i,a){var o=r((i=Tf(i)).r,(a=Tf(a)).r),u=r(i.g,a.g),c=r(i.b,a.b),s=kw(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=u(f),i.b=c(f),i.opacity=s(f),i+""}}return n.gamma=e,n})(1);function PE(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),u[o]?u[o]+=a:u[++o]=a),(n=n[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,c.push({i:o,x:dt(n,i)})),r=ks.lastIndex;return r180?f+=360:f-s>180&&(s+=360),h.push({i:l.push(i(l)+"rotate(",null,n)-2,x:dt(s,f)})):f&&l.push(i(l)+"rotate("+f+n)}function u(s,f,l,h){s!==f?h.push({i:l.push(i(l)+"skewX(",null,n)-2,x:dt(s,f)}):f&&l.push(i(l)+"skewX("+f+n)}function c(s,f,l,h,p,y){if(s!==l||f!==h){var v=p.push(i(p)+"scale(",null,",",null,")");y.push({i:v-4,x:dt(s,l)},{i:v-2,x:dt(f,h)})}else(l!==1||h!==1)&&p.push(i(p)+"scale("+l+","+h+")")}return function(s,f){var l=[],h=[];return s=e(s),f=e(f),a(s.translateX,s.translateY,f.translateX,f.translateY,l,h),o(s.rotate,f.rotate,l,h),u(s.skewX,f.skewX,l,h),c(s.scaleX,s.scaleY,f.scaleX,f.scaleY,l,h),s=f=null,function(p){for(var y=-1,v=h.length,d;++yt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function UE(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?WE:UE,c=s=null,l}function l(h){return h==null||isNaN(h=+h)?a:(c||(c=u(e.map(n),t,r)))(n(o(h)))}return l.invert=function(h){return o(i((s||(s=u(t,e.map(n),dt)))(h)))},l.domain=function(h){return arguments.length?(e=Array.from(h,ta),f()):e.slice()},l.range=function(h){return arguments.length?(t=Array.from(h),f()):t.slice()},l.rangeRound=function(h){return t=Array.from(h),r=ip,f()},l.clamp=function(h){return arguments.length?(o=h?!0:Be,f()):o!==Be},l.interpolate=function(h){return arguments.length?(r=h,f()):r},l.unknown=function(h){return arguments.length?(a=h,l):a},function(h,p){return n=h,i=p,f()}}function ap(){return Za()(Be,Be)}function zE(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ra(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Nr(e){return e=ra(Math.abs(e)),e?e[1]:NaN}function KE(e,t){return function(r,n){for(var i=r.length,a=[],o=0,u=e[0],c=0;i>0&&u>0&&(c+u+1>n&&(u=Math.max(1,n-c)),a.push(r.substring(i-=u,i+u)),!((c+=u+1)>n));)u=e[o=(o+1)%e.length];return a.reverse().join(t)}}function HE(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var GE=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Gn(e){if(!(t=GE.exec(e)))throw new Error("invalid format: "+e);var t;return new op({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Gn.prototype=op.prototype;function op(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}op.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function VE(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var Nw;function XE(e,t){var r=ra(e,t);if(!r)return e+"";var n=r[0],i=r[1],a=i-(Nw=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+ra(e,Math.max(0,t+a-1))[0]}function Yg(e,t){var r=ra(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const Zg={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:zE,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Yg(e*100,t),r:Yg,s:XE,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Jg(e){return e}var Qg=Array.prototype.map,em=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function YE(e){var t=e.grouping===void 0||e.thousands===void 0?Jg:KE(Qg.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?Jg:HE(Qg.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function s(l){l=Gn(l);var h=l.fill,p=l.align,y=l.sign,v=l.symbol,d=l.zero,m=l.width,x=l.comma,w=l.precision,O=l.trim,g=l.type;g==="n"?(x=!0,g="g"):Zg[g]||(w===void 0&&(w=12),O=!0,g="g"),(d||h==="0"&&p==="=")&&(d=!0,h="0",p="=");var b=v==="$"?r:v==="#"&&/[boxX]/.test(g)?"0"+g.toLowerCase():"",_=v==="$"?n:/[%p]/.test(g)?o:"",A=Zg[g],P=/[defgprs%]/.test(g);w=w===void 0?6:/[gprs]/.test(g)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function j(T){var E=b,M=_,I,$,k;if(g==="c")M=A(T)+M,T="";else{T=+T;var R=T<0||1/T<0;if(T=isNaN(T)?c:A(Math.abs(T),w),O&&(T=VE(T)),R&&+T==0&&y!=="+"&&(R=!1),E=(R?y==="("?y:u:y==="-"||y==="("?"":y)+E,M=(g==="s"?em[8+Nw/3]:"")+M+(R&&y==="("?")":""),P){for(I=-1,$=T.length;++I<$;)if(k=T.charCodeAt(I),48>k||k>57){M=(k===46?i+T.slice(I+1):T.slice(I))+M,T=T.slice(0,I);break}}}x&&!d&&(T=t(T,1/0));var L=E.length+T.length+M.length,B=L>1)+E+T+M+B.slice(L);break;default:T=B+E+T+M;break}return a(T)}return j.toString=function(){return l+""},j}function f(l,h){var p=s((l=Gn(l),l.type="f",l)),y=Math.max(-8,Math.min(8,Math.floor(Nr(h)/3)))*3,v=Math.pow(10,-y),d=em[8+y/3];return function(m){return p(v*m)+d}}return{format:s,formatPrefix:f}}var Ii,up,qw;ZE({thousands:",",grouping:[3],currency:["$",""]});function ZE(e){return Ii=YE(e),up=Ii.format,qw=Ii.formatPrefix,Ii}function JE(e){return Math.max(0,-Nr(Math.abs(e)))}function QE(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Nr(t)/3)))*3-Nr(Math.abs(e)))}function ej(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Nr(t)-Nr(e))+1}function Lw(e,t,r,n){var i=Sf(e,t,r),a;switch(n=Gn(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=QE(i,o))&&(n.precision=a),qw(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=ej(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=JE(i))&&(n.precision=a-(n.type==="%")*2);break}}return up(n)}function Ft(e){var t=e.domain;return e.ticks=function(r){var n=t();return _f(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return Lw(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],u=n[a],c,s,f=10;for(u0;){if(s=Af(o,u,r),s===c)return n[i]=o,n[a]=u,t(n);if(s>0)o=Math.floor(o/s)*s,u=Math.ceil(u/s)*s;else if(s<0)o=Math.ceil(o*s)/s,u=Math.floor(u*s)/s;else break;c=s}return e},e}function na(){var e=ap();return e.copy=function(){return xi(e,na())},it.apply(e,arguments),Ft(e)}function Bw(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,ta),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return Bw(e).unknown(t)},e=arguments.length?Array.from(e,ta):[0,1],Ft(r)}function Fw(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function aj(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function nm(e){return(t,r)=>-e(-t,r)}function cp(e){const t=e(tm,rm),r=t.domain;let n=10,i,a;function o(){return i=aj(n),a=ij(n),r()[0]<0?(i=nm(i),a=nm(a),e(tj,rj)):e(tm,rm),t}return t.base=function(u){return arguments.length?(n=+u,o()):n},t.domain=function(u){return arguments.length?(r(u),o()):r()},t.ticks=u=>{const c=r();let s=c[0],f=c[c.length-1];const l=f0){for(;h<=p;++h)for(y=1;yf)break;m.push(v)}}else for(;h<=p;++h)for(y=n-1;y>=1;--y)if(v=h>0?y/a(-h):y*a(h),!(vf)break;m.push(v)}m.length*2{if(u==null&&(u=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=Gn(c)).precision==null&&(c.trim=!0),c=up(c)),u===1/0)return c;const s=Math.max(1,n*u/t.ticks().length);return f=>{let l=f/a(Math.round(i(f)));return l*nr(Fw(r(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function Uw(){const e=cp(Za()).domain([1,10]);return e.copy=()=>xi(e,Uw()).base(e.base()),it.apply(e,arguments),e}function im(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function am(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function sp(e){var t=1,r=e(im(t),am(t));return r.constant=function(n){return arguments.length?e(im(t=+n),am(t)):t},Ft(r)}function Ww(){var e=sp(Za());return e.copy=function(){return xi(e,Ww()).constant(e.constant())},it.apply(e,arguments)}function om(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function oj(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function uj(e){return e<0?-e*e:e*e}function lp(e){var t=e(Be,Be),r=1;function n(){return r===1?e(Be,Be):r===.5?e(oj,uj):e(om(r),om(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},Ft(t)}function fp(){var e=lp(Za());return e.copy=function(){return xi(e,fp()).exponent(e.exponent())},it.apply(e,arguments),e}function cj(){return fp.apply(null,arguments).exponent(.5)}function um(e){return Math.sign(e)*e*e}function sj(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function zw(){var e=ap(),t=[0,1],r=!1,n;function i(a){var o=sj(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(um(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,ta)).map(um)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return zw(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},it.apply(i,arguments),Ft(i)}function Kw(){var e=[],t=[],r=[],n;function i(){var o=0,u=Math.max(1,t.length);for(r=new Array(u-1);++o0?r[u-1]:e[0],u=r?[n[r-1],t]:[n[s-1],n[s]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return Hw().domain([e,t]).range(i).unknown(a)},it.apply(Ft(o),arguments)}function Gw(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[mi(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Gw().domain(e).range(t).unknown(r)},it.apply(i,arguments)}const Rs=new Date,Ds=new Date;function Pe(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),u=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,u)=>{const c=[];if(a=i.ceil(a),u=u==null?1:Math.floor(u),!(a0))return c;let s;do c.push(s=new Date(+a)),t(a,u),e(a);while(sPe(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,u)=>{if(o>=o)if(u<0)for(;++u<=0;)for(;t(o,-1),!a(o););else for(;--u>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(Rs.setTime(+a),Ds.setTime(+o),e(Rs),e(Ds),Math.floor(r(Rs,Ds))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const ia=Pe(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ia.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Pe(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):ia);ia.range;const St=1e3,rt=St*60,Pt=rt*60,$t=Pt*24,hp=$t*7,cm=$t*30,Ns=$t*365,rr=Pe(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*St)},(e,t)=>(t-e)/St,e=>e.getUTCSeconds());rr.range;const pp=Pe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*St)},(e,t)=>{e.setTime(+e+t*rt)},(e,t)=>(t-e)/rt,e=>e.getMinutes());pp.range;const dp=Pe(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*rt)},(e,t)=>(t-e)/rt,e=>e.getUTCMinutes());dp.range;const vp=Pe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*St-e.getMinutes()*rt)},(e,t)=>{e.setTime(+e+t*Pt)},(e,t)=>(t-e)/Pt,e=>e.getHours());vp.range;const yp=Pe(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Pt)},(e,t)=>(t-e)/Pt,e=>e.getUTCHours());yp.range;const wi=Pe(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*rt)/$t,e=>e.getDate()-1);wi.range;const Ja=Pe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$t,e=>e.getUTCDate()-1);Ja.range;const Vw=Pe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$t,e=>Math.floor(e/$t));Vw.range;function dr(e){return Pe(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*rt)/hp)}const Qa=dr(0),aa=dr(1),lj=dr(2),fj=dr(3),qr=dr(4),hj=dr(5),pj=dr(6);Qa.range;aa.range;lj.range;fj.range;qr.range;hj.range;pj.range;function vr(e){return Pe(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/hp)}const eo=vr(0),oa=vr(1),dj=vr(2),vj=vr(3),Lr=vr(4),yj=vr(5),gj=vr(6);eo.range;oa.range;dj.range;vj.range;Lr.range;yj.range;gj.range;const gp=Pe(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());gp.range;const mp=Pe(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());mp.range;const It=Pe(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());It.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Pe(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});It.range;const Ct=Pe(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ct.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Pe(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Ct.range;function Xw(e,t,r,n,i,a){const o=[[rr,1,St],[rr,5,5*St],[rr,15,15*St],[rr,30,30*St],[a,1,rt],[a,5,5*rt],[a,15,15*rt],[a,30,30*rt],[i,1,Pt],[i,3,3*Pt],[i,6,6*Pt],[i,12,12*Pt],[n,1,$t],[n,2,2*$t],[r,1,hp],[t,1,cm],[t,3,3*cm],[e,1,Ns]];function u(s,f,l){const h=fd).right(o,h);if(p===o.length)return e.every(Sf(s/Ns,f/Ns,l));if(p===0)return ia.every(Math.max(Sf(s,f,l),1));const[y,v]=o[h/o[p-1][2]53)return null;"w"in D||(D.w=1),"Z"in D?(re=Ls(mn(D.y,0,1)),Y=re.getUTCDay(),re=Y>4||Y===0?oa.ceil(re):oa(re),re=Ja.offset(re,(D.V-1)*7),D.y=re.getUTCFullYear(),D.m=re.getUTCMonth(),D.d=re.getUTCDate()+(D.w+6)%7):(re=qs(mn(D.y,0,1)),Y=re.getDay(),re=Y>4||Y===0?aa.ceil(re):aa(re),re=wi.offset(re,(D.V-1)*7),D.y=re.getFullYear(),D.m=re.getMonth(),D.d=re.getDate()+(D.w+6)%7)}else("W"in D||"U"in D)&&("w"in D||(D.w="u"in D?D.u%7:"W"in D?1:0),Y="Z"in D?Ls(mn(D.y,0,1)).getUTCDay():qs(mn(D.y,0,1)).getDay(),D.m=0,D.d="W"in D?(D.w+6)%7+D.W*7-(Y+5)%7:D.w+D.U*7-(Y+6)%7);return"Z"in D?(D.H+=D.Z/100|0,D.M+=D.Z%100,Ls(D)):qs(D)}}function A(F,Q,ee,D){for(var ve=0,re=Q.length,Y=ee.length,ye,Z;ve=Y)return-1;if(ye=Q.charCodeAt(ve++),ye===37){if(ye=Q.charAt(ve++),Z=g[ye in sm?Q.charAt(ve++):ye],!Z||(D=Z(F,ee,D))<0)return-1}else if(ye!=ee.charCodeAt(D++))return-1}return D}function P(F,Q,ee){var D=s.exec(Q.slice(ee));return D?(F.p=f.get(D[0].toLowerCase()),ee+D[0].length):-1}function j(F,Q,ee){var D=p.exec(Q.slice(ee));return D?(F.w=y.get(D[0].toLowerCase()),ee+D[0].length):-1}function T(F,Q,ee){var D=l.exec(Q.slice(ee));return D?(F.w=h.get(D[0].toLowerCase()),ee+D[0].length):-1}function E(F,Q,ee){var D=m.exec(Q.slice(ee));return D?(F.m=x.get(D[0].toLowerCase()),ee+D[0].length):-1}function M(F,Q,ee){var D=v.exec(Q.slice(ee));return D?(F.m=d.get(D[0].toLowerCase()),ee+D[0].length):-1}function I(F,Q,ee){return A(F,t,Q,ee)}function $(F,Q,ee){return A(F,r,Q,ee)}function k(F,Q,ee){return A(F,n,Q,ee)}function R(F){return o[F.getDay()]}function L(F){return a[F.getDay()]}function B(F){return c[F.getMonth()]}function z(F){return u[F.getMonth()]}function H(F){return i[+(F.getHours()>=12)]}function U(F){return 1+~~(F.getMonth()/3)}function G(F){return o[F.getUTCDay()]}function se(F){return a[F.getUTCDay()]}function me(F){return c[F.getUTCMonth()]}function De(F){return u[F.getUTCMonth()]}function wt(F){return i[+(F.getUTCHours()>=12)]}function Ie(F){return 1+~~(F.getUTCMonth()/3)}return{format:function(F){var Q=b(F+="",w);return Q.toString=function(){return F},Q},parse:function(F){var Q=_(F+="",!1);return Q.toString=function(){return F},Q},utcFormat:function(F){var Q=b(F+="",O);return Q.toString=function(){return F},Q},utcParse:function(F){var Q=_(F+="",!0);return Q.toString=function(){return F},Q}}}var sm={"-":"",_:" ",0:"0"},Me=/^\s*\d+/,_j=/^%/,Aj=/[\\^$*+?|[\]().{}]/g;function ie(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function Pj(e,t,r){var n=Me.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function Tj(e,t,r){var n=Me.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function Ej(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function jj(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function Mj(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function lm(e,t,r){var n=Me.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function fm(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function $j(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Ij(e,t,r){var n=Me.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Cj(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function hm(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function kj(e,t,r){var n=Me.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function pm(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function Rj(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Dj(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Nj(e,t,r){var n=Me.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function qj(e,t,r){var n=Me.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Lj(e,t,r){var n=_j.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function Bj(e,t,r){var n=Me.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function Fj(e,t,r){var n=Me.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function dm(e,t){return ie(e.getDate(),t,2)}function Uj(e,t){return ie(e.getHours(),t,2)}function Wj(e,t){return ie(e.getHours()%12||12,t,2)}function zj(e,t){return ie(1+wi.count(It(e),e),t,3)}function Yw(e,t){return ie(e.getMilliseconds(),t,3)}function Kj(e,t){return Yw(e,t)+"000"}function Hj(e,t){return ie(e.getMonth()+1,t,2)}function Gj(e,t){return ie(e.getMinutes(),t,2)}function Vj(e,t){return ie(e.getSeconds(),t,2)}function Xj(e){var t=e.getDay();return t===0?7:t}function Yj(e,t){return ie(Qa.count(It(e)-1,e),t,2)}function Zw(e){var t=e.getDay();return t>=4||t===0?qr(e):qr.ceil(e)}function Zj(e,t){return e=Zw(e),ie(qr.count(It(e),e)+(It(e).getDay()===4),t,2)}function Jj(e){return e.getDay()}function Qj(e,t){return ie(aa.count(It(e)-1,e),t,2)}function eM(e,t){return ie(e.getFullYear()%100,t,2)}function tM(e,t){return e=Zw(e),ie(e.getFullYear()%100,t,2)}function rM(e,t){return ie(e.getFullYear()%1e4,t,4)}function nM(e,t){var r=e.getDay();return e=r>=4||r===0?qr(e):qr.ceil(e),ie(e.getFullYear()%1e4,t,4)}function iM(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ie(t/60|0,"0",2)+ie(t%60,"0",2)}function vm(e,t){return ie(e.getUTCDate(),t,2)}function aM(e,t){return ie(e.getUTCHours(),t,2)}function oM(e,t){return ie(e.getUTCHours()%12||12,t,2)}function uM(e,t){return ie(1+Ja.count(Ct(e),e),t,3)}function Jw(e,t){return ie(e.getUTCMilliseconds(),t,3)}function cM(e,t){return Jw(e,t)+"000"}function sM(e,t){return ie(e.getUTCMonth()+1,t,2)}function lM(e,t){return ie(e.getUTCMinutes(),t,2)}function fM(e,t){return ie(e.getUTCSeconds(),t,2)}function hM(e){var t=e.getUTCDay();return t===0?7:t}function pM(e,t){return ie(eo.count(Ct(e)-1,e),t,2)}function Qw(e){var t=e.getUTCDay();return t>=4||t===0?Lr(e):Lr.ceil(e)}function dM(e,t){return e=Qw(e),ie(Lr.count(Ct(e),e)+(Ct(e).getUTCDay()===4),t,2)}function vM(e){return e.getUTCDay()}function yM(e,t){return ie(oa.count(Ct(e)-1,e),t,2)}function gM(e,t){return ie(e.getUTCFullYear()%100,t,2)}function mM(e,t){return e=Qw(e),ie(e.getUTCFullYear()%100,t,2)}function bM(e,t){return ie(e.getUTCFullYear()%1e4,t,4)}function xM(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Lr(e):Lr.ceil(e),ie(e.getUTCFullYear()%1e4,t,4)}function wM(){return"+0000"}function ym(){return"%"}function gm(e){return+e}function mm(e){return Math.floor(+e/1e3)}var xr,eO,tO;OM({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function OM(e){return xr=Oj(e),eO=xr.format,xr.parse,tO=xr.utcFormat,xr.utcParse,xr}function _M(e){return new Date(e)}function AM(e){return e instanceof Date?+e:+new Date(+e)}function bp(e,t,r,n,i,a,o,u,c,s){var f=ap(),l=f.invert,h=f.domain,p=s(".%L"),y=s(":%S"),v=s("%I:%M"),d=s("%I %p"),m=s("%a %d"),x=s("%b %d"),w=s("%B"),O=s("%Y");function g(b){return(c(b)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>cE(e,a/n))},r.copy=function(){return aO(t).domain(e)},Rt.apply(r,arguments)}function ro(){var e=0,t=.5,r=1,n=1,i,a,o,u,c,s=Be,f,l=!1,h;function p(v){return isNaN(v=+v)?h:(v=.5+((v=+f(v))-a)*(n*vr}return Fs=e,Fs}var Us,Om;function jM(){if(Om)return Us;Om=1;var e=no(),t=sO(),r=ln();function n(i){return i&&i.length?e(i,r,t):void 0}return Us=n,Us}var MM=jM();const io=ce(MM);var Ws,_m;function lO(){if(_m)return Ws;_m=1;function e(t,r){return te.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};W.decimalPlaces=W.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*de;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};W.dividedBy=W.div=function(e){return jt(this,new this.constructor(e))};W.dividedToIntegerBy=W.idiv=function(e){var t=this,r=t.constructor;return le(jt(t,new r(e),0,1),r.precision)};W.equals=W.eq=function(e){return!this.cmp(e)};W.exponent=function(){return we(this)};W.greaterThan=W.gt=function(e){return this.cmp(e)>0};W.greaterThanOrEqualTo=W.gte=function(e){return this.cmp(e)>=0};W.isInteger=W.isint=function(){return this.e>this.d.length-2};W.isNegative=W.isneg=function(){return this.s<0};W.isPositive=W.ispos=function(){return this.s>0};W.isZero=function(){return this.s===0};W.lessThan=W.lt=function(e){return this.cmp(e)<0};W.lessThanOrEqualTo=W.lte=function(e){return this.cmp(e)<1};W.logarithm=W.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Ve))throw Error(nt+"NaN");if(r.s<1)throw Error(nt+(r.s?"NaN":"-Infinity"));return r.eq(Ve)?new n(0):(ge=!1,t=jt(Vn(r,a),Vn(e,a),a),ge=!0,le(t,i))};W.minus=W.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?dO(t,e):hO(t,(e.s=-e.s,e))};W.modulo=W.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(nt+"NaN");return r.s?(ge=!1,t=jt(r,e,0,1).times(e),ge=!0,r.minus(t)):le(new n(r),i)};W.naturalExponential=W.exp=function(){return pO(this)};W.naturalLogarithm=W.ln=function(){return Vn(this)};W.negated=W.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};W.plus=W.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?hO(t,e):dO(t,(e.s=-e.s,e))};W.precision=W.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ar+e);if(t=we(i)+1,n=i.d.length-1,r=n*de+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};W.squareRoot=W.sqrt=function(){var e,t,r,n,i,a,o,u=this,c=u.constructor;if(u.s<1){if(!u.s)return new c(0);throw Error(nt+"NaN")}for(e=we(u),ge=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=vt(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=pn((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(i.toString()),r=c.precision,i=o=r+3;;)if(a=n,n=a.plus(jt(u,a,o+2)).times(.5),vt(a.d).slice(0,o)===(t=vt(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(le(a,r+1,0),a.times(a).eq(u)){n=a;break}}else if(t!="9999")break;o+=4}return ge=!0,le(n,r)};W.times=W.mul=function(e){var t,r,n,i,a,o,u,c,s,f=this,l=f.constructor,h=f.d,p=(e=new l(e)).d;if(!f.s||!e.s)return new l(0);for(e.s*=f.s,r=f.e+e.e,c=h.length,s=p.length,c=0;){for(t=0,i=c+n;i>n;)u=a[i]+p[n]*h[i-n-1]+t,a[i--]=u%Ee|0,t=u/Ee|0;a[i]=(a[i]+t)%Ee|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,ge?le(e,l.precision):e};W.toDecimalPlaces=W.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(mt(e,0,hn),t===void 0?t=n.rounding:mt(t,0,8),le(r,e+we(r)+1,t))};W.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=lr(n,!0):(mt(e,0,hn),t===void 0?t=i.rounding:mt(t,0,8),n=le(new i(n),e+1,t),r=lr(n,!0,e+1)),r};W.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?lr(i):(mt(e,0,hn),t===void 0?t=a.rounding:mt(t,0,8),n=le(new a(i),e+we(i)+1,t),r=lr(n.abs(),!1,e+we(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};W.toInteger=W.toint=function(){var e=this,t=e.constructor;return le(new t(e),we(e)+1,t.rounding)};W.toNumber=function(){return+this};W.toPower=W.pow=function(e){var t,r,n,i,a,o,u=this,c=u.constructor,s=12,f=+(e=new c(e));if(!e.s)return new c(Ve);if(u=new c(u),!u.s){if(e.s<1)throw Error(nt+"Infinity");return u}if(u.eq(Ve))return u;if(n=c.precision,e.eq(Ve))return le(u,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=u.s,o){if((r=f<0?-f:f)<=fO){for(i=new c(Ve),t=Math.ceil(n/de+4),ge=!1;r%2&&(i=i.times(u),jm(i.d,t)),r=pn(r/2),r!==0;)u=u.times(u),jm(u.d,t);return ge=!0,e.s<0?new c(Ve).div(i):le(i,n)}}else if(a<0)throw Error(nt+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,u.s=1,ge=!1,i=e.times(Vn(u,n+s)),ge=!0,i=pO(i),i.s=a,i};W.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=we(i),n=lr(i,r<=a.toExpNeg||r>=a.toExpPos)):(mt(e,1,hn),t===void 0?t=a.rounding:mt(t,0,8),i=le(new a(i),e,t),r=we(i),n=lr(i,e<=r||r<=a.toExpNeg,e)),n};W.toSignificantDigits=W.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(mt(e,1,hn),t===void 0?t=n.rounding:mt(t,0,8)),le(new n(r),e,t)};W.toString=W.valueOf=W.val=W.toJSON=W[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=we(e),r=e.constructor;return lr(e,t<=r.toExpNeg||t>=r.toExpPos)};function hO(e,t){var r,n,i,a,o,u,c,s,f=e.constructor,l=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),ge?le(t,l):t;if(c=e.d,s=t.d,o=e.e,i=t.e,c=c.slice(),a=o-i,a){for(a<0?(n=c,a=-a,u=s.length):(n=s,i=o,u=c.length),o=Math.ceil(l/de),u=o>u?o+1:u+1,a>u&&(a=u,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(u=c.length,a=s.length,u-a<0&&(a=u,n=s,s=c,c=n),r=0;a;)r=(c[--a]=c[a]+s[a]+r)/Ee|0,c[a]%=Ee;for(r&&(c.unshift(r),++i),u=c.length;c[--u]==0;)c.pop();return t.d=c,t.e=i,ge?le(t,l):t}function mt(e,t,r){if(e!==~~e||er)throw Error(ar+e)}function vt(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(u=c=0;ui[u]?1:-1;break}return c}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var u,c,s,f,l,h,p,y,v,d,m,x,w,O,g,b,_,A,P=n.constructor,j=n.s==i.s?1:-1,T=n.d,E=i.d;if(!n.s)return new P(n);if(!i.s)throw Error(nt+"Division by zero");for(c=n.e-i.e,_=E.length,g=T.length,p=new P(j),y=p.d=[],s=0;E[s]==(T[s]||0);)++s;if(E[s]>(T[s]||0)&&--c,a==null?x=a=P.precision:o?x=a+(we(n)-we(i))+1:x=a,x<0)return new P(0);if(x=x/de+2|0,s=0,_==1)for(f=0,E=E[0],x++;(s1&&(E=e(E,f),T=e(T,f),_=E.length,g=T.length),O=_,v=T.slice(0,_),d=v.length;d<_;)v[d++]=0;A=E.slice(),A.unshift(0),b=E[0],E[1]>=Ee/2&&++b;do f=0,u=t(E,v,_,d),u<0?(m=v[0],_!=d&&(m=m*Ee+(v[1]||0)),f=m/b|0,f>1?(f>=Ee&&(f=Ee-1),l=e(E,f),h=l.length,d=v.length,u=t(l,v,h,d),u==1&&(f--,r(l,_16)throw Error(Op+we(e));if(!e.s)return new f(Ve);for(ge=!1,u=l,o=new f(.03125);e.abs().gte(.1);)e=e.times(o),s+=5;for(n=Math.log(Jt(2,s))/Math.LN10*2+5|0,u+=n,r=i=a=new f(Ve),f.precision=u;;){if(i=le(i.times(e),u),r=r.times(++c),o=a.plus(jt(i,r,u)),vt(o.d).slice(0,u)===vt(a.d).slice(0,u)){for(;s--;)a=le(a.times(a),u);return f.precision=l,t==null?(ge=!0,le(a,l)):a}a=o}}function we(e){for(var t=e.e*de,r=e.d[0];r>=10;r/=10)t++;return t}function Vs(e,t,r){if(t>e.LN10.sd())throw ge=!0,r&&(e.precision=r),Error(nt+"LN10 precision limit exceeded");return le(new e(e.LN10),t)}function Nt(e){for(var t="";e--;)t+="0";return t}function Vn(e,t){var r,n,i,a,o,u,c,s,f,l=1,h=10,p=e,y=p.d,v=p.constructor,d=v.precision;if(p.s<1)throw Error(nt+(p.s?"NaN":"-Infinity"));if(p.eq(Ve))return new v(0);if(t==null?(ge=!1,s=d):s=t,p.eq(10))return t==null&&(ge=!0),Vs(v,s);if(s+=h,v.precision=s,r=vt(y),n=r.charAt(0),a=we(p),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=vt(p.d),n=r.charAt(0),l++;a=we(p),n>1?(p=new v("0."+r),a++):p=new v(n+"."+r.slice(1))}else return c=Vs(v,s+2,d).times(a+""),p=Vn(new v(n+"."+r.slice(1)),s-h).plus(c),v.precision=d,t==null?(ge=!0,le(p,d)):p;for(u=o=p=jt(p.minus(Ve),p.plus(Ve),s),f=le(p.times(p),s),i=3;;){if(o=le(o.times(f),s),c=u.plus(jt(o,new v(i),s)),vt(c.d).slice(0,s)===vt(u.d).slice(0,s))return u=u.times(2),a!==0&&(u=u.plus(Vs(v,s+2,d).times(a+""))),u=jt(u,new v(l),s),v.precision=d,t==null?(ge=!0,le(u,d)):u;u=c,i+=2}}function Em(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=pn(r/de),e.d=[],n=(r+1)%de,r<0&&(n+=de),nua||e.e<-ua))throw Error(Op+r)}else e.s=0,e.e=0,e.d=[0];return e}function le(e,t,r){var n,i,a,o,u,c,s,f,l=e.d;for(o=1,a=l[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=de,i=t,s=l[f=0];else{if(f=Math.ceil((n+1)/de),a=l.length,f>=a)return e;for(s=a=l[f],o=1;a>=10;a/=10)o++;n%=de,i=n-de+o}if(r!==void 0&&(a=Jt(10,o-i-1),u=s/a%10|0,c=t<0||l[f+1]!==void 0||s%a,c=r<4?(u||c)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||c||r==6&&(n>0?i>0?s/Jt(10,o-i):0:l[f-1])%10&1||r==(e.s<0?8:7))),t<1||!l[0])return c?(a=we(e),l.length=1,t=t-a-1,l[0]=Jt(10,(de-t%de)%de),e.e=pn(-t/de)||0):(l.length=1,l[0]=e.e=e.s=0),e;if(n==0?(l.length=f,a=1,f--):(l.length=f+1,a=Jt(10,de-n),l[f]=i>0?(s/Jt(10,o-i)%Jt(10,i)|0)*a:0),c)for(;;)if(f==0){(l[0]+=a)==Ee&&(l[0]=1,++e.e);break}else{if(l[f]+=a,l[f]!=Ee)break;l[f--]=0,a=1}for(n=l.length;l[--n]===0;)l.pop();if(ge&&(e.e>ua||e.e<-ua))throw Error(Op+we(e));return e}function dO(e,t){var r,n,i,a,o,u,c,s,f,l,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),ge?le(t,p):t;if(c=e.d,l=t.d,n=t.e,s=e.e,c=c.slice(),o=s-n,o){for(f=o<0,f?(r=c,o=-o,u=l.length):(r=l,n=s,u=c.length),i=Math.max(Math.ceil(p/de),u)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=c.length,u=l.length,f=i0;--i)c[u++]=0;for(i=l.length;i>o;){if(c[--i]0?a=a.charAt(0)+"."+a.slice(1)+Nt(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Nt(-i-1)+a,r&&(n=r-o)>0&&(a+=Nt(n))):i>=o?(a+=Nt(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Nt(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=Nt(n))),e.s<0?"-"+a:a}function jm(e,t){if(e.length>t)return e.length=t,!0}function vO(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(ar+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return Em(o,a.toString())}else if(typeof a!="string")throw Error(ar+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,BM.test(a))Em(o,a);else throw Error(ar+a)}if(i.prototype=W,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=vO,i.config=i.set=FM,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(ar+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(ar+r+": "+n);return this}var _p=vO(LM);Ve=new _p(1);const ue=_p;function UM(e){return HM(e)||KM(e)||zM(e)||WM()}function WM(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zM(e,t){if(e){if(typeof e=="string")return $f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $f(e,t)}}function KM(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function HM(e){if(Array.isArray(e))return $f(e)}function $f(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-o,Mm(function(){for(var u=arguments.length,c=new Array(u),s=0;se.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),u;!(n=(u=o.next()).done)&&(r.push(u.value),!(t&&r.length===t));n=!0);}catch(c){i=!0,a=c}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function u$(e){if(Array.isArray(e))return e}function xO(e){var t=Xn(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function wO(e,t,r){if(e.lte(0))return new ue(0);var n=uo.getDigitCount(e.toNumber()),i=new ue(10).pow(n),a=e.div(i),o=n!==1?.05:.1,u=new ue(Math.ceil(a.div(o).toNumber())).add(r).mul(o),c=u.mul(i);return t?c:new ue(Math.ceil(c))}function c$(e,t,r){var n=1,i=new ue(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new ue(10).pow(uo.getDigitCount(e)-1),i=new ue(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new ue(Math.floor(e)))}else e===0?i=new ue(Math.floor((t-1)/2)):r||(i=new ue(Math.floor(e)));var o=Math.floor((t-1)/2),u=YM(XM(function(c){return i.add(new ue(c-o).mul(n)).toNumber()}),If);return u(0,t)}function OO(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new ue(0),tickMin:new ue(0),tickMax:new ue(0)};var a=wO(new ue(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new ue(0):(o=new ue(e).add(t).div(2),o=o.sub(new ue(o).mod(a)));var u=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new ue(t).sub(o).div(a).toNumber()),s=u+c+1;return s>r?OO(e,t,r,n,i+1):(s0?c+(r-s):c,u=t>0?u:u+(r-s)),{step:a,tickMin:o.sub(new ue(u).mul(a)),tickMax:o.add(new ue(c).mul(a))})}function s$(e){var t=Xn(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),u=xO([r,n]),c=Xn(u,2),s=c[0],f=c[1];if(s===-1/0||f===1/0){var l=f===1/0?[s].concat(kf(If(0,i-1).map(function(){return 1/0}))):[].concat(kf(If(0,i-1).map(function(){return-1/0})),[f]);return r>n?Cf(l):l}if(s===f)return c$(s,i,a);var h=OO(s,f,o,a),p=h.step,y=h.tickMin,v=h.tickMax,d=uo.rangeStep(y,v.add(new ue(.1).mul(p)),p);return r>n?Cf(d):d}function l$(e,t){var r=Xn(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=xO([n,i]),u=Xn(o,2),c=u[0],s=u[1];if(c===-1/0||s===1/0)return[n,i];if(c===s)return[c];var f=Math.max(t,2),l=wO(new ue(s).sub(c).div(f-1),a,0),h=[].concat(kf(uo.rangeStep(new ue(c),new ue(s).sub(new ue(.99).mul(l)),l)),[s]);return n>i?Cf(h):h}var f$=mO(s$),h$=mO(l$),p$=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Br(e){"@babel/helpers - typeof";return Br=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Br(e)}function ca(){return ca=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function x$(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function w$(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O$(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,u=(r=n?.length)!==null&&r!==void 0?r:0;if(u<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var c=a.range,s=0;s0?i[s-1].coordinate:i[u-1].coordinate,l=i[s].coordinate,h=s>=u-1?i[0].coordinate:i[s+1].coordinate,p=void 0;if(qe(l-f)!==qe(h-l)){var y=[];if(qe(h-l)===qe(c[1]-c[0])){p=h;var v=l+c[1]-c[0];y[0]=Math.min(v,(v+f)/2),y[1]=Math.max(v,(v+f)/2)}else{p=f;var d=h+c[1]-c[0];y[0]=Math.min(l,(d+l)/2),y[1]=Math.max(l,(d+l)/2)}var m=[Math.min(l,(p+l)/2),Math.max(l,(p+l)/2)];if(t>m[0]&&t<=m[1]||t>=y[0]&&t<=y[1]){o=i[s].index;break}}else{var x=Math.min(f,h),w=Math.max(f,h);if(t>(x+l)/2&&t<=(w+l)/2){o=i[s].index;break}}}else for(var O=0;O0&&O(n[O].coordinate+n[O-1].coordinate)/2&&t<=(n[O].coordinate+n[O+1].coordinate)/2||O===u-1&&t>(n[O].coordinate+n[O-1].coordinate)/2){o=n[O].index;break}return o},Ap=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?be(be({},t.type.defaultProps),t.props):t.props,o=a.stroke,u=a.fill,c;switch(i){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:u;break;default:c=u;break}return c},L$=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},u=Object.keys(a),c=0,s=u.length;c=0});if(m&&m.length){var x=m[0].type.defaultProps,w=x!==void 0?be(be({},x),m[0].props):m[0].props,O=w.barSize,g=w[d];o[g]||(o[g]=[]);var b=J(O)?r:O;o[g].push({item:m[0],stackList:m.slice(1),barSize:J(b)?void 0:Le(b,n,0)})}}return o},B$=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,u=t.maxBarSize,c=o.length;if(c<1)return null;var s=Le(r,i,0,!0),f,l=[];if(o[0].barSize===+o[0].barSize){var h=!1,p=i/c,y=o.reduce(function(O,g){return O+g.barSize||0},0);y+=(c-1)*s,y>=i&&(y-=(c-1)*s,s=0),y>=i&&p>0&&(h=!0,p*=.9,y=c*p);var v=(i-y)/2>>0,d={offset:v-s,size:0};f=o.reduce(function(O,g){var b={item:g.item,position:{offset:d.offset+d.size+s,size:h?p:g.barSize}},_=[].concat(Cm(O),[b]);return d=_[_.length-1].position,g.stackList&&g.stackList.length&&g.stackList.forEach(function(A){_.push({item:A,position:d})}),_},l)}else{var m=Le(n,i,0,!0);i-2*m-(c-1)*s<=0&&(s=0);var x=(i-2*m-(c-1)*s)/c;x>1&&(x>>=0);var w=u===+u?Math.min(x,u):x;f=o.reduce(function(O,g,b){var _=[].concat(Cm(O),[{item:g.item,position:{offset:m+(x+s)*b+(x-w)/2,size:w}}]);return g.stackList&&g.stackList.length&&g.stackList.forEach(function(A){_.push({item:A,position:_[_.length-1].position})}),_},l)}return f},F$=function(t,r,n,i){var a=n.children,o=n.width,u=n.margin,c=o-(u.left||0)-(u.right||0),s=PO({children:a,legendWidth:c});if(s){var f=i||{},l=f.width,h=f.height,p=s.align,y=s.verticalAlign,v=s.layout;if((v==="vertical"||v==="horizontal"&&y==="middle")&&p!=="center"&&q(t[p]))return be(be({},t),{},$r({},p,t[p]+(l||0)));if((v==="horizontal"||v==="vertical"&&p==="center")&&y!=="middle"&&q(t[y]))return be(be({},t),{},$r({},y,t[y]+(h||0)))}return t},U$=function(t,r,n){return J(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},TO=function(t,r,n,i,a){var o=r.props.children,u=Ye(o,_i).filter(function(s){return U$(i,a,s.props.direction)});if(u&&u.length){var c=u.map(function(s){return s.props.dataKey});return t.reduce(function(s,f){var l=Ae(f,n);if(J(l))return s;var h=Array.isArray(l)?[ao(l),io(l)]:[l,l],p=c.reduce(function(y,v){var d=Ae(f,v,0),m=h[0]-Math.abs(Array.isArray(d)?d[0]:d),x=h[1]+Math.abs(Array.isArray(d)?d[1]:d);return[Math.min(m,y[0]),Math.max(x,y[1])]},[1/0,-1/0]);return[Math.min(p[0],s[0]),Math.max(p[1],s[1])]},[1/0,-1/0])}return null},W$=function(t,r,n,i,a){var o=r.map(function(u){return TO(t,u,n,a,i)}).filter(function(u){return!J(u)});return o&&o.length?o.reduce(function(u,c){return[Math.min(u[0],c[0]),Math.max(u[1],c[1])]},[1/0,-1/0]):null},EO=function(t,r,n,i,a){var o=r.map(function(c){var s=c.props.dataKey;return n==="number"&&s&&TO(t,c,s,i)||$n(t,s,n,a)});if(n==="number")return o.reduce(function(c,s){return[Math.min(c[0],s[0]),Math.max(c[1],s[1])]},[1/0,-1/0]);var u={};return o.reduce(function(c,s){for(var f=0,l=s.length;f=2?qe(u[0]-u[1])*2*s:s,r&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(l){var h=a?a.indexOf(l):l;return{coordinate:i(h)+s,value:l,offset:s}});return f.filter(function(l){return!gi(l.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(l,h){return{coordinate:i(l)+s,value:l,index:h,offset:s}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(l){return{coordinate:i(l)+s,value:l,offset:s}}):i.domain().map(function(l,h){return{coordinate:i(l)+s,value:a?a[l]:l,index:h,offset:s}})},Xs=new WeakMap,Ci=function(t,r){if(typeof r!="function")return t;Xs.has(t)||Xs.set(t,new WeakMap);var n=Xs.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},$O=function(t,r,n){var i=t.scale,a=t.type,o=t.layout,u=t.axisType;if(i==="auto")return o==="radial"&&u==="radiusAxis"?{scale:Wn(),realScaleType:"band"}:o==="radial"&&u==="angleAxis"?{scale:na(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Mn(),realScaleType:"point"}:a==="category"?{scale:Wn(),realScaleType:"band"}:{scale:na(),realScaleType:"linear"};if(ur(i)){var c="scale".concat(Wa(i));return{scale:(bm[c]||Mn)(),realScaleType:bm[c]?c:"point"}}return X(i)?{scale:i}:{scale:Mn(),realScaleType:"point"}},Rm=1e-4,IO=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),a=Math.min(i[0],i[1])-Rm,o=Math.max(i[0],i[1])+Rm,u=t(r[0]),c=t(r[n-1]);(uo||co)&&t.domain([r[0],r[n-1]])}},z$=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]=0?(t[u][n][0]=a,t[u][n][1]=a+c,a=t[u][n][1]):(t[u][n][0]=o,t[u][n][1]=o+c,o=t[u][n][1])}},G$=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[o][n][0]=a,t[o][n][1]=a+u,a=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},V$={sign:H$,expand:UA,none:Ir,silhouette:WA,wiggle:zA,positive:G$},X$=function(t,r,n){var i=r.map(function(u){return u.props.dataKey}),a=V$[n],o=FA().keys(i).value(function(u,c){return+Ae(u,c,0)}).order(hf).offset(a);return o(t)},Y$=function(t,r,n,i,a,o){if(!t)return null;var u=o?r.reverse():r,c={},s=u.reduce(function(l,h){var p,y=(p=h.type)!==null&&p!==void 0&&p.defaultProps?be(be({},h.type.defaultProps),h.props):h.props,v=y.stackId,d=y.hide;if(d)return l;var m=y[n],x=l[m]||{hasStack:!1,stackGroups:{}};if(Se(v)){var w=x.stackGroups[v]||{numericAxisId:n,cateAxisId:i,items:[]};w.items.push(h),x.hasStack=!0,x.stackGroups[v]=w}else x.stackGroups[un("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[h]};return be(be({},l),{},$r({},m,x))},c),f={};return Object.keys(s).reduce(function(l,h){var p=s[h];if(p.hasStack){var y={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(v,d){var m=p.stackGroups[d];return be(be({},v),{},$r({},d,{numericAxisId:n,cateAxisId:i,items:m.items,stackedData:X$(t,m.items,a)}))},y)}return be(be({},l),{},$r({},h,p))},f)},CO=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,u=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var s=t.domain();if(!s.length)return null;var f=f$(s,a,u);return t.domain([ao(f),io(f)]),{niceTicks:f}}if(a&&i==="number"){var l=t.domain(),h=h$(l,a,u);return{niceTicks:h}}return null};function Dm(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!J(i[t.dataKey])){var u=Bi(r,"value",i[t.dataKey]);if(u)return u.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var c=Ae(i,J(o)?t.dataKey:o);return J(c)?null:t.scale(c)}var Nm=function(t){var r=t.axis,n=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,u=t.index;if(r.type==="category")return n[u]?n[u].coordinate+i:null;var c=Ae(o,r.dataKey,r.domain[u]);return J(c)?null:r.scale(c)-a/2+i},Z$=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},J$=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?be(be({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(Se(a)){var o=r[a];if(o){var u=o.items.indexOf(t);return u>=0?o.stackedData[u]:null}}return null},Q$=function(t){return t.reduce(function(r,n){return[ao(n.concat([r[0]]).filter(q)),io(n.concat([r[1]]).filter(q))]},[1/0,-1/0])},kO=function(t,r,n){return Object.keys(t).reduce(function(i,a){var o=t[a],u=o.stackedData,c=u.reduce(function(s,f){var l=Q$(f.slice(r,n+1));return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]);return[Math.min(c[0],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},qm=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Lm=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,qf=function(t,r,n){if(X(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(q(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(qm.test(t[0])){var a=+qm.exec(t[0])[1];i[0]=r[0]-a}else X(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(q(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(Lm.test(t[1])){var o=+Lm.exec(t[1])[1];i[1]=r[1]+o}else X(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},la=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var a=Zh(r,function(l){return l.coordinate}),o=1/0,u=1,c=a.length;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},cI=function(t,r,n,i,a){var o=t.width,u=t.height,c=t.startAngle,s=t.endAngle,f=Le(t.cx,o,o/2),l=Le(t.cy,u,u/2),h=NO(o,u,n),p=Le(t.innerRadius,h,0),y=Le(t.outerRadius,h,h*.8),v=Object.keys(r);return v.reduce(function(d,m){var x=r[m],w=x.domain,O=x.reversed,g;if(J(x.range))i==="angleAxis"?g=[c,s]:i==="radiusAxis"&&(g=[p,y]),O&&(g=[g[1],g[0]]);else{g=x.range;var b=g,_=rI(b,2);c=_[0],s=_[1]}var A=$O(x,a),P=A.realScaleType,j=A.scale;j.domain(w).range(g),IO(j);var T=CO(j,At(At({},x),{},{realScaleType:P})),E=At(At(At({},x),T),{},{range:g,radius:y,realScaleType:P,scale:j,cx:f,cy:l,innerRadius:p,outerRadius:y,startAngle:c,endAngle:s});return At(At({},d),{},DO({},m,E))},{})},sI=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(i-o,2))},lI=function(t,r){var n=t.x,i=t.y,a=r.cx,o=r.cy,u=sI({x:n,y:i},{x:a,y:o});if(u<=0)return{radius:u};var c=(n-a)/u,s=Math.acos(c);return i>o&&(s=2*Math.PI-s),{radius:u,angle:uI(s),angleInRadian:s}},fI=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},hI=function(t,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),u=Math.min(a,o);return t+u*360},Wm=function(t,r){var n=t.x,i=t.y,a=lI({x:n,y:i},r),o=a.radius,u=a.angle,c=r.innerRadius,s=r.outerRadius;if(os)return!1;if(o===0)return!0;var f=fI(r),l=f.startAngle,h=f.endAngle,p=u,y;if(l<=h){for(;p>h;)p-=360;for(;p=l&&p<=h}else{for(;p>l;)p-=360;for(;p=h&&p<=l}return y?At(At({},r),{},{radius:o,angle:hI(p,r)}):null},qO=function(t){return!N.isValidElement(t)&&!X(t)&&typeof t!="boolean"?t.className:""};function Qn(e){"@babel/helpers - typeof";return Qn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qn(e)}var pI=["offset"];function dI(e){return mI(e)||gI(e)||yI(e)||vI()}function vI(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yI(e,t){if(e){if(typeof e=="string")return Lf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Lf(e,t)}}function gI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function mI(e){if(Array.isArray(e))return Lf(e)}function Lf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function xI(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function zm(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _e(e){for(var t=1;t=0?1:-1,w,O;i==="insideStart"?(w=p+x*o,O=v):i==="insideEnd"?(w=y-x*o,O=!v):i==="end"&&(w=y+x*o,O=v),O=m<=0?O:!O;var g=pe(s,f,d,w),b=pe(s,f,d,w+(O?1:-1)*359),_="M".concat(g.x,",").concat(g.y,` + height and width.`,$,k,o,c,f,l,r);var R=!Array.isArray(p)&&Et(p.type).endsWith("Chart");return S.Children.map(p,function(L){return S.isValidElement(L)?N.cloneElement(L,Ti({width:$,height:k},R?{style:Ti({height:"100%",width:"100%",maxHeight:k,maxWidth:$},L.props.style)}:{})):L})},[r,p,c,h,l,f,P,o]);return S.createElement("div",{id:d?"".concat(d):void 0,className:te("recharts-responsive-container",m),style:Ti(Ti({},O),{},{width:o,height:c,minWidth:f,minHeight:l,maxHeight:h}),ref:g},E)}),Qh=function(t){return null};Qh.displayName="Cell";function Fn(e){"@babel/helpers - typeof";return Fn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fn(e)}function Og(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function wf(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||pr.isSsr)return{width:0,height:0};var n=AT(r),i=JSON.stringify({text:t,copyStyle:n});if(br.widthCache[i])return br.widthCache[i];try{var a=document.getElementById(_g);a||(a=document.createElement("span"),a.setAttribute("id",_g),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=wf(wf({},_T),n);Object.assign(a.style,o),a.textContent="".concat(t);var u=a.getBoundingClientRect(),c={width:u.width,height:u.height};return br.widthCache[i]=c,++br.cacheCount>OT&&(br.cacheCount=0,br.widthCache={}),c}catch{return{width:0,height:0}}},ST=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Un(e){"@babel/helpers - typeof";return Un=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Un(e)}function Zi(e,t){return jT(e)||ET(e,t)||TT(e,t)||PT()}function PT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TT(e,t){if(e){if(typeof e=="string")return Ag(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ag(e,t)}}function Ag(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function WT(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Mg(e,t){return GT(e)||HT(e,t)||KT(e,t)||zT()}function zT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KT(e,t){if(e){if(typeof e=="string")return $g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $g(e,t)}}function $g(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return $.reduce(function(k,R){var L=R.word,B=R.width,z=k[k.length-1];if(z&&(i==null||a||z.width+B+nR.width?k:R})};if(!f)return p;for(var v="…",d=function($){var k=l.slice(0,$),R=Pw({breakAll:s,style:c,children:k+v}).wordsWithComputedWidth,L=h(R),B=L.length>o||y(L).width>Number(i);return[B,L]},m=0,x=l.length-1,w=0,O;m<=x&&w<=l.length-1;){var g=Math.floor((m+x)/2),b=g-1,_=d(b),A=Mg(_,2),P=A[0],j=A[1],T=d(g),E=Mg(T,1),M=E[0];if(!P&&!M&&(m=g+1),P&&M&&(x=g-1),!P&&M){O=j;break}w++}return O||p},Ig=function(t){var r=J(t)?[]:t.toString().split(Sw);return[{words:r}]},XT=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,u=t.maxLines;if((r||n)&&!pr.isSsr){var c,s,f=Pw({breakAll:o,children:i,style:a});if(f){var l=f.wordsWithComputedWidth,h=f.spaceWidth;c=l,s=h}else return Ig(i);return VT({breakAll:o,children:i,maxLines:u,style:a},c,s,r,n)}return Ig(i)},Cg="#808080",sr=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.lineHeight,u=o===void 0?"1em":o,c=t.capHeight,s=c===void 0?"0.71em":c,f=t.scaleToFit,l=f===void 0?!1:f,h=t.textAnchor,p=h===void 0?"start":h,y=t.verticalAnchor,v=y===void 0?"end":y,d=t.fill,m=d===void 0?Cg:d,x=jg(t,FT),w=N.useMemo(function(){return XT({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:l,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,l,x.style,x.width]),O=x.dx,g=x.dy,b=x.angle,_=x.className,A=x.breakAll,P=jg(x,UT);if(!Se(n)||!Se(a))return null;var j=n+(q(O)?O:0),T=a+(q(g)?g:0),E;switch(v){case"start":E=Is("calc(".concat(s,")"));break;case"middle":E=Is("calc(".concat((w.length-1)/2," * -").concat(u," + (").concat(s," / 2))"));break;default:E=Is("calc(".concat(w.length-1," * -").concat(u,")"));break}var M=[];if(l){var I=w[0].width,$=x.width;M.push("scale(".concat((q($)?$/I:1)/I,")"))}return b&&M.push("rotate(".concat(b,", ").concat(j,", ").concat(T,")")),M.length&&(P.transform=M.join(" ")),S.createElement("text",Of({},K(P,!0),{x:j,y:T,className:te("recharts-text",_),textAnchor:p,fill:m.includes("url")?Cg:m}),w.map(function(k,R){var L=k.words.join(A?"":" ");return S.createElement("tspan",{x:j,dy:R===0?E:u,key:"".concat(L,"-").concat(R)},L)}))};function Bt(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function YT(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function ep(e){let t,r,n;e.length!==2?(t=Bt,r=(u,c)=>Bt(e(u),c),n=(u,c)=>e(u)-c):(t=e===Bt||e===YT?e:ZT,r=e,n=e);function i(u,c,s=0,f=u.length){if(s>>1;r(u[l],c)<0?s=l+1:f=l}while(s>>1;r(u[l],c)<=0?s=l+1:f=l}while(ss&&n(u[l-1],c)>-n(u[l],c)?l-1:l}return{left:i,center:o,right:a}}function ZT(){return 0}function Tw(e){return e===null?NaN:+e}function*JT(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const QT=ep(Bt),mi=QT.right;ep(Tw).center;class kg extends Map{constructor(t,r=rE){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(Rg(this,t))}has(t){return super.has(Rg(this,t))}set(t,r){return super.set(eE(this,t),r)}delete(t){return super.delete(tE(this,t))}}function Rg({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function eE({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function tE({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function rE(e){return e!==null&&typeof e=="object"?e.valueOf():e}function nE(e=Bt){if(e===Bt)return Ew;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function Ew(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const iE=Math.sqrt(50),aE=Math.sqrt(10),oE=Math.sqrt(2);function Ji(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=iE?10:a>=aE?5:a>=oE?2:1;let u,c,s;return i<0?(s=Math.pow(10,-i)/o,u=Math.round(e*s),c=Math.round(t*s),u/st&&--c,s=-s):(s=Math.pow(10,i)*o,u=Math.round(e/s),c=Math.round(t/s),u*st&&--c),c0))return[];if(e===t)return[e];const n=t=i))return[];const u=a-i+1,c=new Array(u);if(n)if(o<0)for(let s=0;s=n)&&(r=n);return r}function Ng(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function jw(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?Ew:nE(i);n>r;){if(n-r>600){const c=n-r+1,s=t-r+1,f=Math.log(c),l=.5*Math.exp(2*f/3),h=.5*Math.sqrt(f*l*(c-l)/c)*(s-c/2<0?-1:1),p=Math.max(r,Math.floor(t-s*l/c+h)),y=Math.min(n,Math.floor(t+(c-s)*l/c+h));jw(e,t,p,y,i)}const a=e[t];let o=r,u=n;for(gn(e,r,t),i(e[n],a)>0&&gn(e,r,n);o0;)--u}i(e[r],a)===0?gn(e,r,u):(++u,gn(e,u,n)),u<=t&&(r=u+1),t<=u&&(n=u-1)}return e}function gn(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function uE(e,t,r){if(e=Float64Array.from(JT(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Ng(e);if(t>=1)return Dg(e);var n,i=(n-1)*t,a=Math.floor(i),o=Dg(jw(e,a).subarray(0,a+1)),u=Ng(e.subarray(a+1));return o+(u-o)*(i-a)}}function cE(e,t,r=Tw){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),u=+r(e[a+1],a+1,e);return o+(u-o)*(i-a)}}function sE(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?ji(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?ji(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=fE.exec(e))?new Ue(t[1],t[2],t[3],1):(t=hE.exec(e))?new Ue(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=pE.exec(e))?ji(t[1],t[2],t[3],t[4]):(t=dE.exec(e))?ji(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=vE.exec(e))?zg(t[1],t[2]/100,t[3]/100,1):(t=yE.exec(e))?zg(t[1],t[2]/100,t[3]/100,t[4]):qg.hasOwnProperty(e)?Fg(qg[e]):e==="transparent"?new Ue(NaN,NaN,NaN,0):null}function Fg(e){return new Ue(e>>16&255,e>>8&255,e&255,1)}function ji(e,t,r,n){return n<=0&&(e=t=r=NaN),new Ue(e,t,r,n)}function bE(e){return e instanceof bi||(e=Hn(e)),e?(e=e.rgb(),new Ue(e.r,e.g,e.b,e.opacity)):new Ue}function Tf(e,t,r,n){return arguments.length===1?bE(e):new Ue(e,t,r,n??1)}function Ue(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}rp(Ue,Tf,$w(bi,{brighter(e){return e=e==null?Qi:Math.pow(Qi,e),new Ue(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?zn:Math.pow(zn,e),new Ue(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ue(ir(this.r),ir(this.g),ir(this.b),ea(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ug,formatHex:Ug,formatHex8:xE,formatRgb:Wg,toString:Wg}));function Ug(){return`#${tr(this.r)}${tr(this.g)}${tr(this.b)}`}function xE(){return`#${tr(this.r)}${tr(this.g)}${tr(this.b)}${tr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Wg(){const e=ea(this.opacity);return`${e===1?"rgb(":"rgba("}${ir(this.r)}, ${ir(this.g)}, ${ir(this.b)}${e===1?")":`, ${e})`}`}function ea(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ir(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function tr(e){return e=ir(e),(e<16?"0":"")+e.toString(16)}function zg(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new ct(e,t,r,n)}function Iw(e){if(e instanceof ct)return new ct(e.h,e.s,e.l,e.opacity);if(e instanceof bi||(e=Hn(e)),!e)return new ct;if(e instanceof ct)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,u=a-i,c=(a+i)/2;return u?(t===a?o=(r-n)/u+(r0&&c<1?0:o,new ct(o,u,c,e.opacity)}function wE(e,t,r,n){return arguments.length===1?Iw(e):new ct(e,t,r,n??1)}function ct(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}rp(ct,wE,$w(bi,{brighter(e){return e=e==null?Qi:Math.pow(Qi,e),new ct(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?zn:Math.pow(zn,e),new ct(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Ue(Cs(e>=240?e-240:e+120,i,n),Cs(e,i,n),Cs(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new ct(Kg(this.h),Mi(this.s),Mi(this.l),ea(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=ea(this.opacity);return`${e===1?"hsl(":"hsla("}${Kg(this.h)}, ${Mi(this.s)*100}%, ${Mi(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Kg(e){return e=(e||0)%360,e<0?e+360:e}function Mi(e){return Math.max(0,Math.min(1,e||0))}function Cs(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const np=e=>()=>e;function OE(e,t){return function(r){return e+r*t}}function _E(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function AE(e){return(e=+e)==1?Cw:function(t,r){return r-t?_E(t,r,e):np(isNaN(t)?r:t)}}function Cw(e,t){var r=t-e;return r?OE(e,r):np(isNaN(e)?t:e)}const Hg=(function e(t){var r=AE(t);function n(i,a){var o=r((i=Tf(i)).r,(a=Tf(a)).r),u=r(i.g,a.g),c=r(i.b,a.b),s=Cw(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=u(f),i.b=c(f),i.opacity=s(f),i+""}}return n.gamma=e,n})(1);function SE(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),u[o]?u[o]+=a:u[++o]=a),(n=n[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,c.push({i:o,x:dt(n,i)})),r=ks.lastIndex;return r180?f+=360:f-s>180&&(s+=360),h.push({i:l.push(i(l)+"rotate(",null,n)-2,x:dt(s,f)})):f&&l.push(i(l)+"rotate("+f+n)}function u(s,f,l,h){s!==f?h.push({i:l.push(i(l)+"skewX(",null,n)-2,x:dt(s,f)}):f&&l.push(i(l)+"skewX("+f+n)}function c(s,f,l,h,p,y){if(s!==l||f!==h){var v=p.push(i(p)+"scale(",null,",",null,")");y.push({i:v-4,x:dt(s,l)},{i:v-2,x:dt(f,h)})}else(l!==1||h!==1)&&p.push(i(p)+"scale("+l+","+h+")")}return function(s,f){var l=[],h=[];return s=e(s),f=e(f),a(s.translateX,s.translateY,f.translateX,f.translateY,l,h),o(s.rotate,f.rotate,l,h),u(s.skewX,f.skewX,l,h),c(s.scaleX,s.scaleY,f.scaleX,f.scaleY,l,h),s=f=null,function(p){for(var y=-1,v=h.length,d;++yt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function FE(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?UE:FE,c=s=null,l}function l(h){return h==null||isNaN(h=+h)?a:(c||(c=u(e.map(n),t,r)))(n(o(h)))}return l.invert=function(h){return o(i((s||(s=u(t,e.map(n),dt)))(h)))},l.domain=function(h){return arguments.length?(e=Array.from(h,ta),f()):e.slice()},l.range=function(h){return arguments.length?(t=Array.from(h),f()):t.slice()},l.rangeRound=function(h){return t=Array.from(h),r=ip,f()},l.clamp=function(h){return arguments.length?(o=h?!0:Be,f()):o!==Be},l.interpolate=function(h){return arguments.length?(r=h,f()):r},l.unknown=function(h){return arguments.length?(a=h,l):a},function(h,p){return n=h,i=p,f()}}function ap(){return Za()(Be,Be)}function WE(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ra(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Nr(e){return e=ra(Math.abs(e)),e?e[1]:NaN}function zE(e,t){return function(r,n){for(var i=r.length,a=[],o=0,u=e[0],c=0;i>0&&u>0&&(c+u+1>n&&(u=Math.max(1,n-c)),a.push(r.substring(i-=u,i+u)),!((c+=u+1)>n));)u=e[o=(o+1)%e.length];return a.reverse().join(t)}}function KE(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var HE=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Gn(e){if(!(t=HE.exec(e)))throw new Error("invalid format: "+e);var t;return new op({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Gn.prototype=op.prototype;function op(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}op.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function GE(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var Dw;function VE(e,t){var r=ra(e,t);if(!r)return e+"";var n=r[0],i=r[1],a=i-(Dw=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+ra(e,Math.max(0,t+a-1))[0]}function Yg(e,t){var r=ra(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const Zg={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:WE,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Yg(e*100,t),r:Yg,s:VE,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Jg(e){return e}var Qg=Array.prototype.map,em=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function XE(e){var t=e.grouping===void 0||e.thousands===void 0?Jg:zE(Qg.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?Jg:KE(Qg.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function s(l){l=Gn(l);var h=l.fill,p=l.align,y=l.sign,v=l.symbol,d=l.zero,m=l.width,x=l.comma,w=l.precision,O=l.trim,g=l.type;g==="n"?(x=!0,g="g"):Zg[g]||(w===void 0&&(w=12),O=!0,g="g"),(d||h==="0"&&p==="=")&&(d=!0,h="0",p="=");var b=v==="$"?r:v==="#"&&/[boxX]/.test(g)?"0"+g.toLowerCase():"",_=v==="$"?n:/[%p]/.test(g)?o:"",A=Zg[g],P=/[defgprs%]/.test(g);w=w===void 0?6:/[gprs]/.test(g)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function j(T){var E=b,M=_,I,$,k;if(g==="c")M=A(T)+M,T="";else{T=+T;var R=T<0||1/T<0;if(T=isNaN(T)?c:A(Math.abs(T),w),O&&(T=GE(T)),R&&+T==0&&y!=="+"&&(R=!1),E=(R?y==="("?y:u:y==="-"||y==="("?"":y)+E,M=(g==="s"?em[8+Dw/3]:"")+M+(R&&y==="("?")":""),P){for(I=-1,$=T.length;++I<$;)if(k=T.charCodeAt(I),48>k||k>57){M=(k===46?i+T.slice(I+1):T.slice(I))+M,T=T.slice(0,I);break}}}x&&!d&&(T=t(T,1/0));var L=E.length+T.length+M.length,B=L>1)+E+T+M+B.slice(L);break;default:T=B+E+T+M;break}return a(T)}return j.toString=function(){return l+""},j}function f(l,h){var p=s((l=Gn(l),l.type="f",l)),y=Math.max(-8,Math.min(8,Math.floor(Nr(h)/3)))*3,v=Math.pow(10,-y),d=em[8+y/3];return function(m){return p(v*m)+d}}return{format:s,formatPrefix:f}}var Ii,up,Nw;YE({thousands:",",grouping:[3],currency:["$",""]});function YE(e){return Ii=XE(e),up=Ii.format,Nw=Ii.formatPrefix,Ii}function ZE(e){return Math.max(0,-Nr(Math.abs(e)))}function JE(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Nr(t)/3)))*3-Nr(Math.abs(e)))}function QE(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Nr(t)-Nr(e))+1}function qw(e,t,r,n){var i=Sf(e,t,r),a;switch(n=Gn(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=JE(i,o))&&(n.precision=a),Nw(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=QE(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=ZE(i))&&(n.precision=a-(n.type==="%")*2);break}}return up(n)}function Ft(e){var t=e.domain;return e.ticks=function(r){var n=t();return _f(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return qw(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],u=n[a],c,s,f=10;for(u0;){if(s=Af(o,u,r),s===c)return n[i]=o,n[a]=u,t(n);if(s>0)o=Math.floor(o/s)*s,u=Math.ceil(u/s)*s;else if(s<0)o=Math.ceil(o*s)/s,u=Math.floor(u*s)/s;else break;c=s}return e},e}function na(){var e=ap();return e.copy=function(){return xi(e,na())},it.apply(e,arguments),Ft(e)}function Lw(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,ta),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return Lw(e).unknown(t)},e=arguments.length?Array.from(e,ta):[0,1],Ft(r)}function Bw(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function ij(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function nm(e){return(t,r)=>-e(-t,r)}function cp(e){const t=e(tm,rm),r=t.domain;let n=10,i,a;function o(){return i=ij(n),a=nj(n),r()[0]<0?(i=nm(i),a=nm(a),e(ej,tj)):e(tm,rm),t}return t.base=function(u){return arguments.length?(n=+u,o()):n},t.domain=function(u){return arguments.length?(r(u),o()):r()},t.ticks=u=>{const c=r();let s=c[0],f=c[c.length-1];const l=f0){for(;h<=p;++h)for(y=1;yf)break;m.push(v)}}else for(;h<=p;++h)for(y=n-1;y>=1;--y)if(v=h>0?y/a(-h):y*a(h),!(vf)break;m.push(v)}m.length*2{if(u==null&&(u=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=Gn(c)).precision==null&&(c.trim=!0),c=up(c)),u===1/0)return c;const s=Math.max(1,n*u/t.ticks().length);return f=>{let l=f/a(Math.round(i(f)));return l*nr(Bw(r(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function Fw(){const e=cp(Za()).domain([1,10]);return e.copy=()=>xi(e,Fw()).base(e.base()),it.apply(e,arguments),e}function im(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function am(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function sp(e){var t=1,r=e(im(t),am(t));return r.constant=function(n){return arguments.length?e(im(t=+n),am(t)):t},Ft(r)}function Uw(){var e=sp(Za());return e.copy=function(){return xi(e,Uw()).constant(e.constant())},it.apply(e,arguments)}function om(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function aj(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function oj(e){return e<0?-e*e:e*e}function lp(e){var t=e(Be,Be),r=1;function n(){return r===1?e(Be,Be):r===.5?e(aj,oj):e(om(r),om(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},Ft(t)}function fp(){var e=lp(Za());return e.copy=function(){return xi(e,fp()).exponent(e.exponent())},it.apply(e,arguments),e}function uj(){return fp.apply(null,arguments).exponent(.5)}function um(e){return Math.sign(e)*e*e}function cj(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Ww(){var e=ap(),t=[0,1],r=!1,n;function i(a){var o=cj(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(um(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,ta)).map(um)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return Ww(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},it.apply(i,arguments),Ft(i)}function zw(){var e=[],t=[],r=[],n;function i(){var o=0,u=Math.max(1,t.length);for(r=new Array(u-1);++o0?r[u-1]:e[0],u=r?[n[r-1],t]:[n[s-1],n[s]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return Kw().domain([e,t]).range(i).unknown(a)},it.apply(Ft(o),arguments)}function Hw(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[mi(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Hw().domain(e).range(t).unknown(r)},it.apply(i,arguments)}const Rs=new Date,Ds=new Date;function Pe(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),u=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,u)=>{const c=[];if(a=i.ceil(a),u=u==null?1:Math.floor(u),!(a0))return c;let s;do c.push(s=new Date(+a)),t(a,u),e(a);while(sPe(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,u)=>{if(o>=o)if(u<0)for(;++u<=0;)for(;t(o,-1),!a(o););else for(;--u>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(Rs.setTime(+a),Ds.setTime(+o),e(Rs),e(Ds),Math.floor(r(Rs,Ds))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const ia=Pe(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ia.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Pe(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):ia);ia.range;const St=1e3,rt=St*60,Pt=rt*60,$t=Pt*24,hp=$t*7,cm=$t*30,Ns=$t*365,rr=Pe(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*St)},(e,t)=>(t-e)/St,e=>e.getUTCSeconds());rr.range;const pp=Pe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*St)},(e,t)=>{e.setTime(+e+t*rt)},(e,t)=>(t-e)/rt,e=>e.getMinutes());pp.range;const dp=Pe(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*rt)},(e,t)=>(t-e)/rt,e=>e.getUTCMinutes());dp.range;const vp=Pe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*St-e.getMinutes()*rt)},(e,t)=>{e.setTime(+e+t*Pt)},(e,t)=>(t-e)/Pt,e=>e.getHours());vp.range;const yp=Pe(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Pt)},(e,t)=>(t-e)/Pt,e=>e.getUTCHours());yp.range;const wi=Pe(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*rt)/$t,e=>e.getDate()-1);wi.range;const Ja=Pe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$t,e=>e.getUTCDate()-1);Ja.range;const Gw=Pe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$t,e=>Math.floor(e/$t));Gw.range;function dr(e){return Pe(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*rt)/hp)}const Qa=dr(0),aa=dr(1),sj=dr(2),lj=dr(3),qr=dr(4),fj=dr(5),hj=dr(6);Qa.range;aa.range;sj.range;lj.range;qr.range;fj.range;hj.range;function vr(e){return Pe(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/hp)}const eo=vr(0),oa=vr(1),pj=vr(2),dj=vr(3),Lr=vr(4),vj=vr(5),yj=vr(6);eo.range;oa.range;pj.range;dj.range;Lr.range;vj.range;yj.range;const gp=Pe(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());gp.range;const mp=Pe(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());mp.range;const It=Pe(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());It.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Pe(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});It.range;const Ct=Pe(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ct.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Pe(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Ct.range;function Vw(e,t,r,n,i,a){const o=[[rr,1,St],[rr,5,5*St],[rr,15,15*St],[rr,30,30*St],[a,1,rt],[a,5,5*rt],[a,15,15*rt],[a,30,30*rt],[i,1,Pt],[i,3,3*Pt],[i,6,6*Pt],[i,12,12*Pt],[n,1,$t],[n,2,2*$t],[r,1,hp],[t,1,cm],[t,3,3*cm],[e,1,Ns]];function u(s,f,l){const h=fd).right(o,h);if(p===o.length)return e.every(Sf(s/Ns,f/Ns,l));if(p===0)return ia.every(Math.max(Sf(s,f,l),1));const[y,v]=o[h/o[p-1][2]53)return null;"w"in D||(D.w=1),"Z"in D?(re=Ls(mn(D.y,0,1)),Y=re.getUTCDay(),re=Y>4||Y===0?oa.ceil(re):oa(re),re=Ja.offset(re,(D.V-1)*7),D.y=re.getUTCFullYear(),D.m=re.getUTCMonth(),D.d=re.getUTCDate()+(D.w+6)%7):(re=qs(mn(D.y,0,1)),Y=re.getDay(),re=Y>4||Y===0?aa.ceil(re):aa(re),re=wi.offset(re,(D.V-1)*7),D.y=re.getFullYear(),D.m=re.getMonth(),D.d=re.getDate()+(D.w+6)%7)}else("W"in D||"U"in D)&&("w"in D||(D.w="u"in D?D.u%7:"W"in D?1:0),Y="Z"in D?Ls(mn(D.y,0,1)).getUTCDay():qs(mn(D.y,0,1)).getDay(),D.m=0,D.d="W"in D?(D.w+6)%7+D.W*7-(Y+5)%7:D.w+D.U*7-(Y+6)%7);return"Z"in D?(D.H+=D.Z/100|0,D.M+=D.Z%100,Ls(D)):qs(D)}}function A(F,Q,ee,D){for(var ve=0,re=Q.length,Y=ee.length,ye,Z;ve=Y)return-1;if(ye=Q.charCodeAt(ve++),ye===37){if(ye=Q.charAt(ve++),Z=g[ye in sm?Q.charAt(ve++):ye],!Z||(D=Z(F,ee,D))<0)return-1}else if(ye!=ee.charCodeAt(D++))return-1}return D}function P(F,Q,ee){var D=s.exec(Q.slice(ee));return D?(F.p=f.get(D[0].toLowerCase()),ee+D[0].length):-1}function j(F,Q,ee){var D=p.exec(Q.slice(ee));return D?(F.w=y.get(D[0].toLowerCase()),ee+D[0].length):-1}function T(F,Q,ee){var D=l.exec(Q.slice(ee));return D?(F.w=h.get(D[0].toLowerCase()),ee+D[0].length):-1}function E(F,Q,ee){var D=m.exec(Q.slice(ee));return D?(F.m=x.get(D[0].toLowerCase()),ee+D[0].length):-1}function M(F,Q,ee){var D=v.exec(Q.slice(ee));return D?(F.m=d.get(D[0].toLowerCase()),ee+D[0].length):-1}function I(F,Q,ee){return A(F,t,Q,ee)}function $(F,Q,ee){return A(F,r,Q,ee)}function k(F,Q,ee){return A(F,n,Q,ee)}function R(F){return o[F.getDay()]}function L(F){return a[F.getDay()]}function B(F){return c[F.getMonth()]}function z(F){return u[F.getMonth()]}function H(F){return i[+(F.getHours()>=12)]}function U(F){return 1+~~(F.getMonth()/3)}function G(F){return o[F.getUTCDay()]}function se(F){return a[F.getUTCDay()]}function me(F){return c[F.getUTCMonth()]}function De(F){return u[F.getUTCMonth()]}function wt(F){return i[+(F.getUTCHours()>=12)]}function Ie(F){return 1+~~(F.getUTCMonth()/3)}return{format:function(F){var Q=b(F+="",w);return Q.toString=function(){return F},Q},parse:function(F){var Q=_(F+="",!1);return Q.toString=function(){return F},Q},utcFormat:function(F){var Q=b(F+="",O);return Q.toString=function(){return F},Q},utcParse:function(F){var Q=_(F+="",!0);return Q.toString=function(){return F},Q}}}var sm={"-":"",_:" ",0:"0"},Me=/^\s*\d+/,Oj=/^%/,_j=/[\\^$*+?|[\]().{}]/g;function ie(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function Sj(e,t,r){var n=Me.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function Pj(e,t,r){var n=Me.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function Tj(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function Ej(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function jj(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function lm(e,t,r){var n=Me.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function fm(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Mj(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function $j(e,t,r){var n=Me.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Ij(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function hm(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Cj(e,t,r){var n=Me.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function pm(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function kj(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Rj(e,t,r){var n=Me.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Dj(e,t,r){var n=Me.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function Nj(e,t,r){var n=Me.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function qj(e,t,r){var n=Oj.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function Lj(e,t,r){var n=Me.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function Bj(e,t,r){var n=Me.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function dm(e,t){return ie(e.getDate(),t,2)}function Fj(e,t){return ie(e.getHours(),t,2)}function Uj(e,t){return ie(e.getHours()%12||12,t,2)}function Wj(e,t){return ie(1+wi.count(It(e),e),t,3)}function Xw(e,t){return ie(e.getMilliseconds(),t,3)}function zj(e,t){return Xw(e,t)+"000"}function Kj(e,t){return ie(e.getMonth()+1,t,2)}function Hj(e,t){return ie(e.getMinutes(),t,2)}function Gj(e,t){return ie(e.getSeconds(),t,2)}function Vj(e){var t=e.getDay();return t===0?7:t}function Xj(e,t){return ie(Qa.count(It(e)-1,e),t,2)}function Yw(e){var t=e.getDay();return t>=4||t===0?qr(e):qr.ceil(e)}function Yj(e,t){return e=Yw(e),ie(qr.count(It(e),e)+(It(e).getDay()===4),t,2)}function Zj(e){return e.getDay()}function Jj(e,t){return ie(aa.count(It(e)-1,e),t,2)}function Qj(e,t){return ie(e.getFullYear()%100,t,2)}function eM(e,t){return e=Yw(e),ie(e.getFullYear()%100,t,2)}function tM(e,t){return ie(e.getFullYear()%1e4,t,4)}function rM(e,t){var r=e.getDay();return e=r>=4||r===0?qr(e):qr.ceil(e),ie(e.getFullYear()%1e4,t,4)}function nM(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ie(t/60|0,"0",2)+ie(t%60,"0",2)}function vm(e,t){return ie(e.getUTCDate(),t,2)}function iM(e,t){return ie(e.getUTCHours(),t,2)}function aM(e,t){return ie(e.getUTCHours()%12||12,t,2)}function oM(e,t){return ie(1+Ja.count(Ct(e),e),t,3)}function Zw(e,t){return ie(e.getUTCMilliseconds(),t,3)}function uM(e,t){return Zw(e,t)+"000"}function cM(e,t){return ie(e.getUTCMonth()+1,t,2)}function sM(e,t){return ie(e.getUTCMinutes(),t,2)}function lM(e,t){return ie(e.getUTCSeconds(),t,2)}function fM(e){var t=e.getUTCDay();return t===0?7:t}function hM(e,t){return ie(eo.count(Ct(e)-1,e),t,2)}function Jw(e){var t=e.getUTCDay();return t>=4||t===0?Lr(e):Lr.ceil(e)}function pM(e,t){return e=Jw(e),ie(Lr.count(Ct(e),e)+(Ct(e).getUTCDay()===4),t,2)}function dM(e){return e.getUTCDay()}function vM(e,t){return ie(oa.count(Ct(e)-1,e),t,2)}function yM(e,t){return ie(e.getUTCFullYear()%100,t,2)}function gM(e,t){return e=Jw(e),ie(e.getUTCFullYear()%100,t,2)}function mM(e,t){return ie(e.getUTCFullYear()%1e4,t,4)}function bM(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Lr(e):Lr.ceil(e),ie(e.getUTCFullYear()%1e4,t,4)}function xM(){return"+0000"}function ym(){return"%"}function gm(e){return+e}function mm(e){return Math.floor(+e/1e3)}var xr,Qw,eO;wM({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function wM(e){return xr=wj(e),Qw=xr.format,xr.parse,eO=xr.utcFormat,xr.utcParse,xr}function OM(e){return new Date(e)}function _M(e){return e instanceof Date?+e:+new Date(+e)}function bp(e,t,r,n,i,a,o,u,c,s){var f=ap(),l=f.invert,h=f.domain,p=s(".%L"),y=s(":%S"),v=s("%I:%M"),d=s("%I %p"),m=s("%a %d"),x=s("%b %d"),w=s("%B"),O=s("%Y");function g(b){return(c(b)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>uE(e,a/n))},r.copy=function(){return iO(t).domain(e)},Rt.apply(r,arguments)}function ro(){var e=0,t=.5,r=1,n=1,i,a,o,u,c,s=Be,f,l=!1,h;function p(v){return isNaN(v=+v)?h:(v=.5+((v=+f(v))-a)*(n*vr}return Fs=e,Fs}var Us,Om;function EM(){if(Om)return Us;Om=1;var e=no(),t=cO(),r=ln();function n(i){return i&&i.length?e(i,r,t):void 0}return Us=n,Us}var jM=EM();const io=ce(jM);var Ws,_m;function sO(){if(_m)return Ws;_m=1;function e(t,r){return te.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};W.decimalPlaces=W.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*de;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};W.dividedBy=W.div=function(e){return jt(this,new this.constructor(e))};W.dividedToIntegerBy=W.idiv=function(e){var t=this,r=t.constructor;return le(jt(t,new r(e),0,1),r.precision)};W.equals=W.eq=function(e){return!this.cmp(e)};W.exponent=function(){return we(this)};W.greaterThan=W.gt=function(e){return this.cmp(e)>0};W.greaterThanOrEqualTo=W.gte=function(e){return this.cmp(e)>=0};W.isInteger=W.isint=function(){return this.e>this.d.length-2};W.isNegative=W.isneg=function(){return this.s<0};W.isPositive=W.ispos=function(){return this.s>0};W.isZero=function(){return this.s===0};W.lessThan=W.lt=function(e){return this.cmp(e)<0};W.lessThanOrEqualTo=W.lte=function(e){return this.cmp(e)<1};W.logarithm=W.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Ve))throw Error(nt+"NaN");if(r.s<1)throw Error(nt+(r.s?"NaN":"-Infinity"));return r.eq(Ve)?new n(0):(ge=!1,t=jt(Vn(r,a),Vn(e,a),a),ge=!0,le(t,i))};W.minus=W.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?pO(t,e):fO(t,(e.s=-e.s,e))};W.modulo=W.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(nt+"NaN");return r.s?(ge=!1,t=jt(r,e,0,1).times(e),ge=!0,r.minus(t)):le(new n(r),i)};W.naturalExponential=W.exp=function(){return hO(this)};W.naturalLogarithm=W.ln=function(){return Vn(this)};W.negated=W.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};W.plus=W.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?fO(t,e):pO(t,(e.s=-e.s,e))};W.precision=W.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ar+e);if(t=we(i)+1,n=i.d.length-1,r=n*de+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};W.squareRoot=W.sqrt=function(){var e,t,r,n,i,a,o,u=this,c=u.constructor;if(u.s<1){if(!u.s)return new c(0);throw Error(nt+"NaN")}for(e=we(u),ge=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=vt(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=pn((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(i.toString()),r=c.precision,i=o=r+3;;)if(a=n,n=a.plus(jt(u,a,o+2)).times(.5),vt(a.d).slice(0,o)===(t=vt(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(le(a,r+1,0),a.times(a).eq(u)){n=a;break}}else if(t!="9999")break;o+=4}return ge=!0,le(n,r)};W.times=W.mul=function(e){var t,r,n,i,a,o,u,c,s,f=this,l=f.constructor,h=f.d,p=(e=new l(e)).d;if(!f.s||!e.s)return new l(0);for(e.s*=f.s,r=f.e+e.e,c=h.length,s=p.length,c=0;){for(t=0,i=c+n;i>n;)u=a[i]+p[n]*h[i-n-1]+t,a[i--]=u%Ee|0,t=u/Ee|0;a[i]=(a[i]+t)%Ee|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,ge?le(e,l.precision):e};W.toDecimalPlaces=W.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(mt(e,0,hn),t===void 0?t=n.rounding:mt(t,0,8),le(r,e+we(r)+1,t))};W.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=lr(n,!0):(mt(e,0,hn),t===void 0?t=i.rounding:mt(t,0,8),n=le(new i(n),e+1,t),r=lr(n,!0,e+1)),r};W.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?lr(i):(mt(e,0,hn),t===void 0?t=a.rounding:mt(t,0,8),n=le(new a(i),e+we(i)+1,t),r=lr(n.abs(),!1,e+we(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};W.toInteger=W.toint=function(){var e=this,t=e.constructor;return le(new t(e),we(e)+1,t.rounding)};W.toNumber=function(){return+this};W.toPower=W.pow=function(e){var t,r,n,i,a,o,u=this,c=u.constructor,s=12,f=+(e=new c(e));if(!e.s)return new c(Ve);if(u=new c(u),!u.s){if(e.s<1)throw Error(nt+"Infinity");return u}if(u.eq(Ve))return u;if(n=c.precision,e.eq(Ve))return le(u,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=u.s,o){if((r=f<0?-f:f)<=lO){for(i=new c(Ve),t=Math.ceil(n/de+4),ge=!1;r%2&&(i=i.times(u),jm(i.d,t)),r=pn(r/2),r!==0;)u=u.times(u),jm(u.d,t);return ge=!0,e.s<0?new c(Ve).div(i):le(i,n)}}else if(a<0)throw Error(nt+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,u.s=1,ge=!1,i=e.times(Vn(u,n+s)),ge=!0,i=hO(i),i.s=a,i};W.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=we(i),n=lr(i,r<=a.toExpNeg||r>=a.toExpPos)):(mt(e,1,hn),t===void 0?t=a.rounding:mt(t,0,8),i=le(new a(i),e,t),r=we(i),n=lr(i,e<=r||r<=a.toExpNeg,e)),n};W.toSignificantDigits=W.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(mt(e,1,hn),t===void 0?t=n.rounding:mt(t,0,8)),le(new n(r),e,t)};W.toString=W.valueOf=W.val=W.toJSON=W[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=we(e),r=e.constructor;return lr(e,t<=r.toExpNeg||t>=r.toExpPos)};function fO(e,t){var r,n,i,a,o,u,c,s,f=e.constructor,l=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),ge?le(t,l):t;if(c=e.d,s=t.d,o=e.e,i=t.e,c=c.slice(),a=o-i,a){for(a<0?(n=c,a=-a,u=s.length):(n=s,i=o,u=c.length),o=Math.ceil(l/de),u=o>u?o+1:u+1,a>u&&(a=u,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(u=c.length,a=s.length,u-a<0&&(a=u,n=s,s=c,c=n),r=0;a;)r=(c[--a]=c[a]+s[a]+r)/Ee|0,c[a]%=Ee;for(r&&(c.unshift(r),++i),u=c.length;c[--u]==0;)c.pop();return t.d=c,t.e=i,ge?le(t,l):t}function mt(e,t,r){if(e!==~~e||er)throw Error(ar+e)}function vt(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(u=c=0;ui[u]?1:-1;break}return c}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var u,c,s,f,l,h,p,y,v,d,m,x,w,O,g,b,_,A,P=n.constructor,j=n.s==i.s?1:-1,T=n.d,E=i.d;if(!n.s)return new P(n);if(!i.s)throw Error(nt+"Division by zero");for(c=n.e-i.e,_=E.length,g=T.length,p=new P(j),y=p.d=[],s=0;E[s]==(T[s]||0);)++s;if(E[s]>(T[s]||0)&&--c,a==null?x=a=P.precision:o?x=a+(we(n)-we(i))+1:x=a,x<0)return new P(0);if(x=x/de+2|0,s=0,_==1)for(f=0,E=E[0],x++;(s1&&(E=e(E,f),T=e(T,f),_=E.length,g=T.length),O=_,v=T.slice(0,_),d=v.length;d<_;)v[d++]=0;A=E.slice(),A.unshift(0),b=E[0],E[1]>=Ee/2&&++b;do f=0,u=t(E,v,_,d),u<0?(m=v[0],_!=d&&(m=m*Ee+(v[1]||0)),f=m/b|0,f>1?(f>=Ee&&(f=Ee-1),l=e(E,f),h=l.length,d=v.length,u=t(l,v,h,d),u==1&&(f--,r(l,_16)throw Error(Op+we(e));if(!e.s)return new f(Ve);for(ge=!1,u=l,o=new f(.03125);e.abs().gte(.1);)e=e.times(o),s+=5;for(n=Math.log(Jt(2,s))/Math.LN10*2+5|0,u+=n,r=i=a=new f(Ve),f.precision=u;;){if(i=le(i.times(e),u),r=r.times(++c),o=a.plus(jt(i,r,u)),vt(o.d).slice(0,u)===vt(a.d).slice(0,u)){for(;s--;)a=le(a.times(a),u);return f.precision=l,t==null?(ge=!0,le(a,l)):a}a=o}}function we(e){for(var t=e.e*de,r=e.d[0];r>=10;r/=10)t++;return t}function Vs(e,t,r){if(t>e.LN10.sd())throw ge=!0,r&&(e.precision=r),Error(nt+"LN10 precision limit exceeded");return le(new e(e.LN10),t)}function Nt(e){for(var t="";e--;)t+="0";return t}function Vn(e,t){var r,n,i,a,o,u,c,s,f,l=1,h=10,p=e,y=p.d,v=p.constructor,d=v.precision;if(p.s<1)throw Error(nt+(p.s?"NaN":"-Infinity"));if(p.eq(Ve))return new v(0);if(t==null?(ge=!1,s=d):s=t,p.eq(10))return t==null&&(ge=!0),Vs(v,s);if(s+=h,v.precision=s,r=vt(y),n=r.charAt(0),a=we(p),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=vt(p.d),n=r.charAt(0),l++;a=we(p),n>1?(p=new v("0."+r),a++):p=new v(n+"."+r.slice(1))}else return c=Vs(v,s+2,d).times(a+""),p=Vn(new v(n+"."+r.slice(1)),s-h).plus(c),v.precision=d,t==null?(ge=!0,le(p,d)):p;for(u=o=p=jt(p.minus(Ve),p.plus(Ve),s),f=le(p.times(p),s),i=3;;){if(o=le(o.times(f),s),c=u.plus(jt(o,new v(i),s)),vt(c.d).slice(0,s)===vt(u.d).slice(0,s))return u=u.times(2),a!==0&&(u=u.plus(Vs(v,s+2,d).times(a+""))),u=jt(u,new v(l),s),v.precision=d,t==null?(ge=!0,le(u,d)):u;u=c,i+=2}}function Em(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=pn(r/de),e.d=[],n=(r+1)%de,r<0&&(n+=de),nua||e.e<-ua))throw Error(Op+r)}else e.s=0,e.e=0,e.d=[0];return e}function le(e,t,r){var n,i,a,o,u,c,s,f,l=e.d;for(o=1,a=l[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=de,i=t,s=l[f=0];else{if(f=Math.ceil((n+1)/de),a=l.length,f>=a)return e;for(s=a=l[f],o=1;a>=10;a/=10)o++;n%=de,i=n-de+o}if(r!==void 0&&(a=Jt(10,o-i-1),u=s/a%10|0,c=t<0||l[f+1]!==void 0||s%a,c=r<4?(u||c)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||c||r==6&&(n>0?i>0?s/Jt(10,o-i):0:l[f-1])%10&1||r==(e.s<0?8:7))),t<1||!l[0])return c?(a=we(e),l.length=1,t=t-a-1,l[0]=Jt(10,(de-t%de)%de),e.e=pn(-t/de)||0):(l.length=1,l[0]=e.e=e.s=0),e;if(n==0?(l.length=f,a=1,f--):(l.length=f+1,a=Jt(10,de-n),l[f]=i>0?(s/Jt(10,o-i)%Jt(10,i)|0)*a:0),c)for(;;)if(f==0){(l[0]+=a)==Ee&&(l[0]=1,++e.e);break}else{if(l[f]+=a,l[f]!=Ee)break;l[f--]=0,a=1}for(n=l.length;l[--n]===0;)l.pop();if(ge&&(e.e>ua||e.e<-ua))throw Error(Op+we(e));return e}function pO(e,t){var r,n,i,a,o,u,c,s,f,l,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),ge?le(t,p):t;if(c=e.d,l=t.d,n=t.e,s=e.e,c=c.slice(),o=s-n,o){for(f=o<0,f?(r=c,o=-o,u=l.length):(r=l,n=s,u=c.length),i=Math.max(Math.ceil(p/de),u)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=c.length,u=l.length,f=i0;--i)c[u++]=0;for(i=l.length;i>o;){if(c[--i]0?a=a.charAt(0)+"."+a.slice(1)+Nt(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Nt(-i-1)+a,r&&(n=r-o)>0&&(a+=Nt(n))):i>=o?(a+=Nt(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Nt(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=Nt(n))),e.s<0?"-"+a:a}function jm(e,t){if(e.length>t)return e.length=t,!0}function dO(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(ar+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return Em(o,a.toString())}else if(typeof a!="string")throw Error(ar+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,LM.test(a))Em(o,a);else throw Error(ar+a)}if(i.prototype=W,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=dO,i.config=i.set=BM,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(ar+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(ar+r+": "+n);return this}var _p=dO(qM);Ve=new _p(1);const ue=_p;function FM(e){return KM(e)||zM(e)||WM(e)||UM()}function UM(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WM(e,t){if(e){if(typeof e=="string")return $f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $f(e,t)}}function zM(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function KM(e){if(Array.isArray(e))return $f(e)}function $f(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-o,Mm(function(){for(var u=arguments.length,c=new Array(u),s=0;se.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),u;!(n=(u=o.next()).done)&&(r.push(u.value),!(t&&r.length===t));n=!0);}catch(c){i=!0,a=c}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function o$(e){if(Array.isArray(e))return e}function bO(e){var t=Xn(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function xO(e,t,r){if(e.lte(0))return new ue(0);var n=uo.getDigitCount(e.toNumber()),i=new ue(10).pow(n),a=e.div(i),o=n!==1?.05:.1,u=new ue(Math.ceil(a.div(o).toNumber())).add(r).mul(o),c=u.mul(i);return t?c:new ue(Math.ceil(c))}function u$(e,t,r){var n=1,i=new ue(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new ue(10).pow(uo.getDigitCount(e)-1),i=new ue(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new ue(Math.floor(e)))}else e===0?i=new ue(Math.floor((t-1)/2)):r||(i=new ue(Math.floor(e)));var o=Math.floor((t-1)/2),u=XM(VM(function(c){return i.add(new ue(c-o).mul(n)).toNumber()}),If);return u(0,t)}function wO(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new ue(0),tickMin:new ue(0),tickMax:new ue(0)};var a=xO(new ue(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new ue(0):(o=new ue(e).add(t).div(2),o=o.sub(new ue(o).mod(a)));var u=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new ue(t).sub(o).div(a).toNumber()),s=u+c+1;return s>r?wO(e,t,r,n,i+1):(s0?c+(r-s):c,u=t>0?u:u+(r-s)),{step:a,tickMin:o.sub(new ue(u).mul(a)),tickMax:o.add(new ue(c).mul(a))})}function c$(e){var t=Xn(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),u=bO([r,n]),c=Xn(u,2),s=c[0],f=c[1];if(s===-1/0||f===1/0){var l=f===1/0?[s].concat(kf(If(0,i-1).map(function(){return 1/0}))):[].concat(kf(If(0,i-1).map(function(){return-1/0})),[f]);return r>n?Cf(l):l}if(s===f)return u$(s,i,a);var h=wO(s,f,o,a),p=h.step,y=h.tickMin,v=h.tickMax,d=uo.rangeStep(y,v.add(new ue(.1).mul(p)),p);return r>n?Cf(d):d}function s$(e,t){var r=Xn(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=bO([n,i]),u=Xn(o,2),c=u[0],s=u[1];if(c===-1/0||s===1/0)return[n,i];if(c===s)return[c];var f=Math.max(t,2),l=xO(new ue(s).sub(c).div(f-1),a,0),h=[].concat(kf(uo.rangeStep(new ue(c),new ue(s).sub(new ue(.99).mul(l)),l)),[s]);return n>i?Cf(h):h}var l$=gO(c$),f$=gO(s$),h$=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Br(e){"@babel/helpers - typeof";return Br=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Br(e)}function ca(){return ca=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function b$(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function x$(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w$(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,u=(r=n?.length)!==null&&r!==void 0?r:0;if(u<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var c=a.range,s=0;s0?i[s-1].coordinate:i[u-1].coordinate,l=i[s].coordinate,h=s>=u-1?i[0].coordinate:i[s+1].coordinate,p=void 0;if(qe(l-f)!==qe(h-l)){var y=[];if(qe(h-l)===qe(c[1]-c[0])){p=h;var v=l+c[1]-c[0];y[0]=Math.min(v,(v+f)/2),y[1]=Math.max(v,(v+f)/2)}else{p=f;var d=h+c[1]-c[0];y[0]=Math.min(l,(d+l)/2),y[1]=Math.max(l,(d+l)/2)}var m=[Math.min(l,(p+l)/2),Math.max(l,(p+l)/2)];if(t>m[0]&&t<=m[1]||t>=y[0]&&t<=y[1]){o=i[s].index;break}}else{var x=Math.min(f,h),w=Math.max(f,h);if(t>(x+l)/2&&t<=(w+l)/2){o=i[s].index;break}}}else for(var O=0;O0&&O(n[O].coordinate+n[O-1].coordinate)/2&&t<=(n[O].coordinate+n[O+1].coordinate)/2||O===u-1&&t>(n[O].coordinate+n[O-1].coordinate)/2){o=n[O].index;break}return o},Ap=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?be(be({},t.type.defaultProps),t.props):t.props,o=a.stroke,u=a.fill,c;switch(i){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:u;break;default:c=u;break}return c},q$=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},u=Object.keys(a),c=0,s=u.length;c=0});if(m&&m.length){var x=m[0].type.defaultProps,w=x!==void 0?be(be({},x),m[0].props):m[0].props,O=w.barSize,g=w[d];o[g]||(o[g]=[]);var b=J(O)?r:O;o[g].push({item:m[0],stackList:m.slice(1),barSize:J(b)?void 0:Le(b,n,0)})}}return o},L$=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,u=t.maxBarSize,c=o.length;if(c<1)return null;var s=Le(r,i,0,!0),f,l=[];if(o[0].barSize===+o[0].barSize){var h=!1,p=i/c,y=o.reduce(function(O,g){return O+g.barSize||0},0);y+=(c-1)*s,y>=i&&(y-=(c-1)*s,s=0),y>=i&&p>0&&(h=!0,p*=.9,y=c*p);var v=(i-y)/2>>0,d={offset:v-s,size:0};f=o.reduce(function(O,g){var b={item:g.item,position:{offset:d.offset+d.size+s,size:h?p:g.barSize}},_=[].concat(Cm(O),[b]);return d=_[_.length-1].position,g.stackList&&g.stackList.length&&g.stackList.forEach(function(A){_.push({item:A,position:d})}),_},l)}else{var m=Le(n,i,0,!0);i-2*m-(c-1)*s<=0&&(s=0);var x=(i-2*m-(c-1)*s)/c;x>1&&(x>>=0);var w=u===+u?Math.min(x,u):x;f=o.reduce(function(O,g,b){var _=[].concat(Cm(O),[{item:g.item,position:{offset:m+(x+s)*b+(x-w)/2,size:w}}]);return g.stackList&&g.stackList.length&&g.stackList.forEach(function(A){_.push({item:A,position:_[_.length-1].position})}),_},l)}return f},B$=function(t,r,n,i){var a=n.children,o=n.width,u=n.margin,c=o-(u.left||0)-(u.right||0),s=SO({children:a,legendWidth:c});if(s){var f=i||{},l=f.width,h=f.height,p=s.align,y=s.verticalAlign,v=s.layout;if((v==="vertical"||v==="horizontal"&&y==="middle")&&p!=="center"&&q(t[p]))return be(be({},t),{},$r({},p,t[p]+(l||0)));if((v==="horizontal"||v==="vertical"&&p==="center")&&y!=="middle"&&q(t[y]))return be(be({},t),{},$r({},y,t[y]+(h||0)))}return t},F$=function(t,r,n){return J(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},PO=function(t,r,n,i,a){var o=r.props.children,u=Ye(o,_i).filter(function(s){return F$(i,a,s.props.direction)});if(u&&u.length){var c=u.map(function(s){return s.props.dataKey});return t.reduce(function(s,f){var l=Ae(f,n);if(J(l))return s;var h=Array.isArray(l)?[ao(l),io(l)]:[l,l],p=c.reduce(function(y,v){var d=Ae(f,v,0),m=h[0]-Math.abs(Array.isArray(d)?d[0]:d),x=h[1]+Math.abs(Array.isArray(d)?d[1]:d);return[Math.min(m,y[0]),Math.max(x,y[1])]},[1/0,-1/0]);return[Math.min(p[0],s[0]),Math.max(p[1],s[1])]},[1/0,-1/0])}return null},U$=function(t,r,n,i,a){var o=r.map(function(u){return PO(t,u,n,a,i)}).filter(function(u){return!J(u)});return o&&o.length?o.reduce(function(u,c){return[Math.min(u[0],c[0]),Math.max(u[1],c[1])]},[1/0,-1/0]):null},TO=function(t,r,n,i,a){var o=r.map(function(c){var s=c.props.dataKey;return n==="number"&&s&&PO(t,c,s,i)||$n(t,s,n,a)});if(n==="number")return o.reduce(function(c,s){return[Math.min(c[0],s[0]),Math.max(c[1],s[1])]},[1/0,-1/0]);var u={};return o.reduce(function(c,s){for(var f=0,l=s.length;f=2?qe(u[0]-u[1])*2*s:s,r&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(l){var h=a?a.indexOf(l):l;return{coordinate:i(h)+s,value:l,offset:s}});return f.filter(function(l){return!gi(l.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(l,h){return{coordinate:i(l)+s,value:l,index:h,offset:s}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(l){return{coordinate:i(l)+s,value:l,offset:s}}):i.domain().map(function(l,h){return{coordinate:i(l)+s,value:a?a[l]:l,index:h,offset:s}})},Xs=new WeakMap,Ci=function(t,r){if(typeof r!="function")return t;Xs.has(t)||Xs.set(t,new WeakMap);var n=Xs.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},MO=function(t,r,n){var i=t.scale,a=t.type,o=t.layout,u=t.axisType;if(i==="auto")return o==="radial"&&u==="radiusAxis"?{scale:Wn(),realScaleType:"band"}:o==="radial"&&u==="angleAxis"?{scale:na(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Mn(),realScaleType:"point"}:a==="category"?{scale:Wn(),realScaleType:"band"}:{scale:na(),realScaleType:"linear"};if(ur(i)){var c="scale".concat(Wa(i));return{scale:(bm[c]||Mn)(),realScaleType:bm[c]?c:"point"}}return X(i)?{scale:i}:{scale:Mn(),realScaleType:"point"}},Rm=1e-4,$O=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),a=Math.min(i[0],i[1])-Rm,o=Math.max(i[0],i[1])+Rm,u=t(r[0]),c=t(r[n-1]);(uo||co)&&t.domain([r[0],r[n-1]])}},W$=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]=0?(t[u][n][0]=a,t[u][n][1]=a+c,a=t[u][n][1]):(t[u][n][0]=o,t[u][n][1]=o+c,o=t[u][n][1])}},H$=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[o][n][0]=a,t[o][n][1]=a+u,a=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},G$={sign:K$,expand:FA,none:Ir,silhouette:UA,wiggle:WA,positive:H$},V$=function(t,r,n){var i=r.map(function(u){return u.props.dataKey}),a=G$[n],o=BA().keys(i).value(function(u,c){return+Ae(u,c,0)}).order(hf).offset(a);return o(t)},X$=function(t,r,n,i,a,o){if(!t)return null;var u=o?r.reverse():r,c={},s=u.reduce(function(l,h){var p,y=(p=h.type)!==null&&p!==void 0&&p.defaultProps?be(be({},h.type.defaultProps),h.props):h.props,v=y.stackId,d=y.hide;if(d)return l;var m=y[n],x=l[m]||{hasStack:!1,stackGroups:{}};if(Se(v)){var w=x.stackGroups[v]||{numericAxisId:n,cateAxisId:i,items:[]};w.items.push(h),x.hasStack=!0,x.stackGroups[v]=w}else x.stackGroups[un("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[h]};return be(be({},l),{},$r({},m,x))},c),f={};return Object.keys(s).reduce(function(l,h){var p=s[h];if(p.hasStack){var y={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(v,d){var m=p.stackGroups[d];return be(be({},v),{},$r({},d,{numericAxisId:n,cateAxisId:i,items:m.items,stackedData:V$(t,m.items,a)}))},y)}return be(be({},l),{},$r({},h,p))},f)},IO=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,u=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var s=t.domain();if(!s.length)return null;var f=l$(s,a,u);return t.domain([ao(f),io(f)]),{niceTicks:f}}if(a&&i==="number"){var l=t.domain(),h=f$(l,a,u);return{niceTicks:h}}return null};function Dm(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!J(i[t.dataKey])){var u=Bi(r,"value",i[t.dataKey]);if(u)return u.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var c=Ae(i,J(o)?t.dataKey:o);return J(c)?null:t.scale(c)}var Nm=function(t){var r=t.axis,n=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,u=t.index;if(r.type==="category")return n[u]?n[u].coordinate+i:null;var c=Ae(o,r.dataKey,r.domain[u]);return J(c)?null:r.scale(c)-a/2+i},Y$=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},Z$=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?be(be({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(Se(a)){var o=r[a];if(o){var u=o.items.indexOf(t);return u>=0?o.stackedData[u]:null}}return null},J$=function(t){return t.reduce(function(r,n){return[ao(n.concat([r[0]]).filter(q)),io(n.concat([r[1]]).filter(q))]},[1/0,-1/0])},CO=function(t,r,n){return Object.keys(t).reduce(function(i,a){var o=t[a],u=o.stackedData,c=u.reduce(function(s,f){var l=J$(f.slice(r,n+1));return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]);return[Math.min(c[0],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},qm=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Lm=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,qf=function(t,r,n){if(X(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(q(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(qm.test(t[0])){var a=+qm.exec(t[0])[1];i[0]=r[0]-a}else X(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(q(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(Lm.test(t[1])){var o=+Lm.exec(t[1])[1];i[1]=r[1]+o}else X(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},la=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var a=Zh(r,function(l){return l.coordinate}),o=1/0,u=1,c=a.length;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},uI=function(t,r,n,i,a){var o=t.width,u=t.height,c=t.startAngle,s=t.endAngle,f=Le(t.cx,o,o/2),l=Le(t.cy,u,u/2),h=DO(o,u,n),p=Le(t.innerRadius,h,0),y=Le(t.outerRadius,h,h*.8),v=Object.keys(r);return v.reduce(function(d,m){var x=r[m],w=x.domain,O=x.reversed,g;if(J(x.range))i==="angleAxis"?g=[c,s]:i==="radiusAxis"&&(g=[p,y]),O&&(g=[g[1],g[0]]);else{g=x.range;var b=g,_=tI(b,2);c=_[0],s=_[1]}var A=MO(x,a),P=A.realScaleType,j=A.scale;j.domain(w).range(g),$O(j);var T=IO(j,At(At({},x),{},{realScaleType:P})),E=At(At(At({},x),T),{},{range:g,radius:y,realScaleType:P,scale:j,cx:f,cy:l,innerRadius:p,outerRadius:y,startAngle:c,endAngle:s});return At(At({},d),{},RO({},m,E))},{})},cI=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(i-o,2))},sI=function(t,r){var n=t.x,i=t.y,a=r.cx,o=r.cy,u=cI({x:n,y:i},{x:a,y:o});if(u<=0)return{radius:u};var c=(n-a)/u,s=Math.acos(c);return i>o&&(s=2*Math.PI-s),{radius:u,angle:oI(s),angleInRadian:s}},lI=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},fI=function(t,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),u=Math.min(a,o);return t+u*360},Wm=function(t,r){var n=t.x,i=t.y,a=sI({x:n,y:i},r),o=a.radius,u=a.angle,c=r.innerRadius,s=r.outerRadius;if(os)return!1;if(o===0)return!0;var f=lI(r),l=f.startAngle,h=f.endAngle,p=u,y;if(l<=h){for(;p>h;)p-=360;for(;p=l&&p<=h}else{for(;p>l;)p-=360;for(;p=h&&p<=l}return y?At(At({},r),{},{radius:o,angle:fI(p,r)}):null},NO=function(t){return!N.isValidElement(t)&&!X(t)&&typeof t!="boolean"?t.className:""};function Qn(e){"@babel/helpers - typeof";return Qn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qn(e)}var hI=["offset"];function pI(e){return gI(e)||yI(e)||vI(e)||dI()}function dI(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vI(e,t){if(e){if(typeof e=="string")return Lf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Lf(e,t)}}function yI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function gI(e){if(Array.isArray(e))return Lf(e)}function Lf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function bI(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function zm(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _e(e){for(var t=1;t=0?1:-1,w,O;i==="insideStart"?(w=p+x*o,O=v):i==="insideEnd"?(w=y-x*o,O=!v):i==="end"&&(w=y+x*o,O=v),O=m<=0?O:!O;var g=pe(s,f,d,w),b=pe(s,f,d,w+(O?1:-1)*359),_="M".concat(g.x,",").concat(g.y,` A`).concat(d,",").concat(d,",0,1,").concat(O?0:1,`, - `).concat(b.x,",").concat(b.y),A=J(t.id)?un("recharts-radial-line-"):t.id;return S.createElement("text",ei({},n,{dominantBaseline:"central",className:te("recharts-radial-bar-label",u)}),S.createElement("defs",null,S.createElement("path",{id:A,d:_})),S.createElement("textPath",{xlinkHref:"#".concat(A)},r))},TI=function(t){var r=t.viewBox,n=t.offset,i=t.position,a=r,o=a.cx,u=a.cy,c=a.innerRadius,s=a.outerRadius,f=a.startAngle,l=a.endAngle,h=(f+l)/2;if(i==="outside"){var p=pe(o,u,s+n,h),y=p.x,v=p.y;return{x:y,y:v,textAnchor:y>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"end"};var d=(c+s)/2,m=pe(o,u,d,h),x=m.x,w=m.y;return{x,y:w,textAnchor:"middle",verticalAnchor:"middle"}},EI=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,o=r,u=o.x,c=o.y,s=o.width,f=o.height,l=f>=0?1:-1,h=l*i,p=l>0?"end":"start",y=l>0?"start":"end",v=s>=0?1:-1,d=v*i,m=v>0?"end":"start",x=v>0?"start":"end";if(a==="top"){var w={x:u+s/2,y:c-l*i,textAnchor:"middle",verticalAnchor:p};return _e(_e({},w),n?{height:Math.max(c-n.y,0),width:s}:{})}if(a==="bottom"){var O={x:u+s/2,y:c+f+h,textAnchor:"middle",verticalAnchor:y};return _e(_e({},O),n?{height:Math.max(n.y+n.height-(c+f),0),width:s}:{})}if(a==="left"){var g={x:u-d,y:c+f/2,textAnchor:m,verticalAnchor:"middle"};return _e(_e({},g),n?{width:Math.max(g.x-n.x,0),height:f}:{})}if(a==="right"){var b={x:u+s+d,y:c+f/2,textAnchor:x,verticalAnchor:"middle"};return _e(_e({},b),n?{width:Math.max(n.x+n.width-b.x,0),height:f}:{})}var _=n?{width:s,height:f}:{};return a==="insideLeft"?_e({x:u+d,y:c+f/2,textAnchor:x,verticalAnchor:"middle"},_):a==="insideRight"?_e({x:u+s-d,y:c+f/2,textAnchor:m,verticalAnchor:"middle"},_):a==="insideTop"?_e({x:u+s/2,y:c+h,textAnchor:"middle",verticalAnchor:y},_):a==="insideBottom"?_e({x:u+s/2,y:c+f-h,textAnchor:"middle",verticalAnchor:p},_):a==="insideTopLeft"?_e({x:u+d,y:c+h,textAnchor:x,verticalAnchor:y},_):a==="insideTopRight"?_e({x:u+s-d,y:c+h,textAnchor:m,verticalAnchor:y},_):a==="insideBottomLeft"?_e({x:u+d,y:c+f-h,textAnchor:x,verticalAnchor:p},_):a==="insideBottomRight"?_e({x:u+s-d,y:c+f-h,textAnchor:m,verticalAnchor:p},_):on(a)&&(q(a.x)||er(a.x))&&(q(a.y)||er(a.y))?_e({x:u+Le(a.x,s),y:c+Le(a.y,f),textAnchor:"end",verticalAnchor:"end"},_):_e({x:u+s/2,y:c+f/2,textAnchor:"middle",verticalAnchor:"middle"},_)},jI=function(t){return"cx"in t&&q(t.cx)};function je(e){var t=e.offset,r=t===void 0?5:t,n=bI(e,pI),i=_e({offset:r},n),a=i.viewBox,o=i.position,u=i.value,c=i.children,s=i.content,f=i.className,l=f===void 0?"":f,h=i.textBreakAll;if(!a||J(u)&&J(c)&&!N.isValidElement(s)&&!X(s))return null;if(N.isValidElement(s))return N.cloneElement(s,i);var p;if(X(s)){if(p=N.createElement(s,i),N.isValidElement(p))return p}else p=AI(i);var y=jI(a),v=K(i,!0);if(y&&(o==="insideStart"||o==="insideEnd"||o==="end"))return PI(i,p,v);var d=y?TI(i):EI(i);return S.createElement(sr,ei({className:te("recharts-label",l)},v,d,{breakAll:h}),p)}je.displayName="Label";var LO=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,u=t.r,c=t.radius,s=t.innerRadius,f=t.outerRadius,l=t.x,h=t.y,p=t.top,y=t.left,v=t.width,d=t.height,m=t.clockWise,x=t.labelViewBox;if(x)return x;if(q(v)&&q(d)){if(q(l)&&q(h))return{x:l,y:h,width:v,height:d};if(q(p)&&q(y))return{x:p,y,width:v,height:d}}return q(l)&&q(h)?{x:l,y:h,width:0,height:0}:q(r)&&q(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:s||0,outerRadius:f||c||u||0,clockWise:m}:t.viewBox?t.viewBox:{}},MI=function(t,r){return t?t===!0?S.createElement(je,{key:"label-implicit",viewBox:r}):Se(t)?S.createElement(je,{key:"label-implicit",viewBox:r,value:t}):N.isValidElement(t)?t.type===je?N.cloneElement(t,{key:"label-implicit",viewBox:r}):S.createElement(je,{key:"label-implicit",content:t,viewBox:r}):X(t)?S.createElement(je,{key:"label-implicit",content:t,viewBox:r}):on(t)?S.createElement(je,ei({viewBox:r},t,{key:"label-implicit"})):null:null},$I=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,a=LO(t),o=Ye(i,je).map(function(c,s){return N.cloneElement(c,{viewBox:r||a,key:"label-".concat(s)})});if(!n)return o;var u=MI(t.label,r||a);return[u].concat(dI(o))};je.parseViewBox=LO;je.renderCallByParent=$I;var Ys,Km;function II(){if(Km)return Ys;Km=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return Ys=e,Ys}var CI=II();const kI=ce(CI);function ti(e){"@babel/helpers - typeof";return ti=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ti(e)}var RI=["valueAccessor"],DI=["data","dataKey","clockWise","id","textBreakAll"];function NI(e){return FI(e)||BI(e)||LI(e)||qI()}function qI(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LI(e,t){if(e){if(typeof e=="string")return Bf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bf(e,t)}}function BI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function FI(e){if(Array.isArray(e))return Bf(e)}function Bf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function KI(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var HI=function(t){return Array.isArray(t.value)?kI(t.value):t.value};function Mt(e){var t=e.valueAccessor,r=t===void 0?HI:t,n=Vm(e,RI),i=n.data,a=n.dataKey,o=n.clockWise,u=n.id,c=n.textBreakAll,s=Vm(n,DI);return!i||!i.length?null:S.createElement(ne,{className:"recharts-label-list"},i.map(function(f,l){var h=J(a)?r(f,l):Ae(f&&f.payload,a),p=J(u)?{}:{id:"".concat(u,"-").concat(l)};return S.createElement(je,ha({},K(f,!0),s,p,{parentViewBox:f.parentViewBox,value:h,textBreakAll:c,viewBox:je.parseViewBox(J(o)?f:Gm(Gm({},f),{},{clockWise:o})),key:"label-".concat(l),index:l}))}))}Mt.displayName="LabelList";function GI(e,t){return e?e===!0?S.createElement(Mt,{key:"labelList-implicit",data:t}):S.isValidElement(e)||X(e)?S.createElement(Mt,{key:"labelList-implicit",data:t,content:e}):on(e)?S.createElement(Mt,ha({data:t},e,{key:"labelList-implicit"})):null:null}function VI(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Ye(n,Mt).map(function(o,u){return N.cloneElement(o,{data:t,key:"labelList-".concat(u)})});if(!r)return i;var a=GI(e.label,t);return[a].concat(NI(i))}Mt.renderCallByParent=VI;function ri(e){"@babel/helpers - typeof";return ri=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ri(e)}function Ff(){return Ff=Object.assign?Object.assign.bind():function(e){for(var t=1;t=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"end"};var d=(c+s)/2,m=pe(o,u,d,h),x=m.x,w=m.y;return{x,y:w,textAnchor:"middle",verticalAnchor:"middle"}},TI=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,o=r,u=o.x,c=o.y,s=o.width,f=o.height,l=f>=0?1:-1,h=l*i,p=l>0?"end":"start",y=l>0?"start":"end",v=s>=0?1:-1,d=v*i,m=v>0?"end":"start",x=v>0?"start":"end";if(a==="top"){var w={x:u+s/2,y:c-l*i,textAnchor:"middle",verticalAnchor:p};return _e(_e({},w),n?{height:Math.max(c-n.y,0),width:s}:{})}if(a==="bottom"){var O={x:u+s/2,y:c+f+h,textAnchor:"middle",verticalAnchor:y};return _e(_e({},O),n?{height:Math.max(n.y+n.height-(c+f),0),width:s}:{})}if(a==="left"){var g={x:u-d,y:c+f/2,textAnchor:m,verticalAnchor:"middle"};return _e(_e({},g),n?{width:Math.max(g.x-n.x,0),height:f}:{})}if(a==="right"){var b={x:u+s+d,y:c+f/2,textAnchor:x,verticalAnchor:"middle"};return _e(_e({},b),n?{width:Math.max(n.x+n.width-b.x,0),height:f}:{})}var _=n?{width:s,height:f}:{};return a==="insideLeft"?_e({x:u+d,y:c+f/2,textAnchor:x,verticalAnchor:"middle"},_):a==="insideRight"?_e({x:u+s-d,y:c+f/2,textAnchor:m,verticalAnchor:"middle"},_):a==="insideTop"?_e({x:u+s/2,y:c+h,textAnchor:"middle",verticalAnchor:y},_):a==="insideBottom"?_e({x:u+s/2,y:c+f-h,textAnchor:"middle",verticalAnchor:p},_):a==="insideTopLeft"?_e({x:u+d,y:c+h,textAnchor:x,verticalAnchor:y},_):a==="insideTopRight"?_e({x:u+s-d,y:c+h,textAnchor:m,verticalAnchor:y},_):a==="insideBottomLeft"?_e({x:u+d,y:c+f-h,textAnchor:x,verticalAnchor:p},_):a==="insideBottomRight"?_e({x:u+s-d,y:c+f-h,textAnchor:m,verticalAnchor:p},_):on(a)&&(q(a.x)||er(a.x))&&(q(a.y)||er(a.y))?_e({x:u+Le(a.x,s),y:c+Le(a.y,f),textAnchor:"end",verticalAnchor:"end"},_):_e({x:u+s/2,y:c+f/2,textAnchor:"middle",verticalAnchor:"middle"},_)},EI=function(t){return"cx"in t&&q(t.cx)};function je(e){var t=e.offset,r=t===void 0?5:t,n=mI(e,hI),i=_e({offset:r},n),a=i.viewBox,o=i.position,u=i.value,c=i.children,s=i.content,f=i.className,l=f===void 0?"":f,h=i.textBreakAll;if(!a||J(u)&&J(c)&&!N.isValidElement(s)&&!X(s))return null;if(N.isValidElement(s))return N.cloneElement(s,i);var p;if(X(s)){if(p=N.createElement(s,i),N.isValidElement(p))return p}else p=_I(i);var y=EI(a),v=K(i,!0);if(y&&(o==="insideStart"||o==="insideEnd"||o==="end"))return SI(i,p,v);var d=y?PI(i):TI(i);return S.createElement(sr,ei({className:te("recharts-label",l)},v,d,{breakAll:h}),p)}je.displayName="Label";var qO=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,u=t.r,c=t.radius,s=t.innerRadius,f=t.outerRadius,l=t.x,h=t.y,p=t.top,y=t.left,v=t.width,d=t.height,m=t.clockWise,x=t.labelViewBox;if(x)return x;if(q(v)&&q(d)){if(q(l)&&q(h))return{x:l,y:h,width:v,height:d};if(q(p)&&q(y))return{x:p,y,width:v,height:d}}return q(l)&&q(h)?{x:l,y:h,width:0,height:0}:q(r)&&q(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:s||0,outerRadius:f||c||u||0,clockWise:m}:t.viewBox?t.viewBox:{}},jI=function(t,r){return t?t===!0?S.createElement(je,{key:"label-implicit",viewBox:r}):Se(t)?S.createElement(je,{key:"label-implicit",viewBox:r,value:t}):N.isValidElement(t)?t.type===je?N.cloneElement(t,{key:"label-implicit",viewBox:r}):S.createElement(je,{key:"label-implicit",content:t,viewBox:r}):X(t)?S.createElement(je,{key:"label-implicit",content:t,viewBox:r}):on(t)?S.createElement(je,ei({viewBox:r},t,{key:"label-implicit"})):null:null},MI=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,a=qO(t),o=Ye(i,je).map(function(c,s){return N.cloneElement(c,{viewBox:r||a,key:"label-".concat(s)})});if(!n)return o;var u=jI(t.label,r||a);return[u].concat(pI(o))};je.parseViewBox=qO;je.renderCallByParent=MI;var Ys,Km;function $I(){if(Km)return Ys;Km=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return Ys=e,Ys}var II=$I();const CI=ce(II);function ti(e){"@babel/helpers - typeof";return ti=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ti(e)}var kI=["valueAccessor"],RI=["data","dataKey","clockWise","id","textBreakAll"];function DI(e){return BI(e)||LI(e)||qI(e)||NI()}function NI(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qI(e,t){if(e){if(typeof e=="string")return Bf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bf(e,t)}}function LI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function BI(e){if(Array.isArray(e))return Bf(e)}function Bf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zI(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var KI=function(t){return Array.isArray(t.value)?CI(t.value):t.value};function Mt(e){var t=e.valueAccessor,r=t===void 0?KI:t,n=Vm(e,kI),i=n.data,a=n.dataKey,o=n.clockWise,u=n.id,c=n.textBreakAll,s=Vm(n,RI);return!i||!i.length?null:S.createElement(ne,{className:"recharts-label-list"},i.map(function(f,l){var h=J(a)?r(f,l):Ae(f&&f.payload,a),p=J(u)?{}:{id:"".concat(u,"-").concat(l)};return S.createElement(je,ha({},K(f,!0),s,p,{parentViewBox:f.parentViewBox,value:h,textBreakAll:c,viewBox:je.parseViewBox(J(o)?f:Gm(Gm({},f),{},{clockWise:o})),key:"label-".concat(l),index:l}))}))}Mt.displayName="LabelList";function HI(e,t){return e?e===!0?S.createElement(Mt,{key:"labelList-implicit",data:t}):S.isValidElement(e)||X(e)?S.createElement(Mt,{key:"labelList-implicit",data:t,content:e}):on(e)?S.createElement(Mt,ha({data:t},e,{key:"labelList-implicit"})):null:null}function GI(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Ye(n,Mt).map(function(o,u){return N.cloneElement(o,{data:t,key:"labelList-".concat(u)})});if(!r)return i;var a=HI(e.label,t);return[a].concat(DI(i))}Mt.renderCallByParent=GI;function ri(e){"@babel/helpers - typeof";return ri=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ri(e)}function Ff(){return Ff=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>s),`, `).concat(l.x,",").concat(l.y,` `);if(i>0){var p=pe(r,n,i,o),y=pe(r,n,i,s);h+="L ".concat(y.x,",").concat(y.y,` A `).concat(i,",").concat(i,`,0, `).concat(+(Math.abs(c)>180),",").concat(+(o<=s),`, - `).concat(p.x,",").concat(p.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},QI=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,u=t.forceCornerRadius,c=t.cornerIsExternal,s=t.startAngle,f=t.endAngle,l=qe(f-s),h=ki({cx:r,cy:n,radius:a,angle:s,sign:l,cornerRadius:o,cornerIsExternal:c}),p=h.circleTangency,y=h.lineTangency,v=h.theta,d=ki({cx:r,cy:n,radius:a,angle:f,sign:-l,cornerRadius:o,cornerIsExternal:c}),m=d.circleTangency,x=d.lineTangency,w=d.theta,O=c?Math.abs(s-f):Math.abs(s-f)-v-w;if(O<0)return u?"M ".concat(y.x,",").concat(y.y,` + `).concat(p.x,",").concat(p.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},JI=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,u=t.forceCornerRadius,c=t.cornerIsExternal,s=t.startAngle,f=t.endAngle,l=qe(f-s),h=ki({cx:r,cy:n,radius:a,angle:s,sign:l,cornerRadius:o,cornerIsExternal:c}),p=h.circleTangency,y=h.lineTangency,v=h.theta,d=ki({cx:r,cy:n,radius:a,angle:f,sign:-l,cornerRadius:o,cornerIsExternal:c}),m=d.circleTangency,x=d.lineTangency,w=d.theta,O=c?Math.abs(s-f):Math.abs(s-f)-v-w;if(O<0)return u?"M ".concat(y.x,",").concat(y.y,` a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 - `):BO({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:s,endAngle:f});var g="M ".concat(y.x,",").concat(y.y,` + `):LO({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:s,endAngle:f});var g="M ".concat(y.x,",").concat(y.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat(p.x,",").concat(p.y,` A`).concat(a,",").concat(a,",0,").concat(+(O>180),",").concat(+(l<0),",").concat(m.x,",").concat(m.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat(x.x,",").concat(x.y,` `);if(i>0){var b=ki({cx:r,cy:n,radius:i,angle:s,sign:l,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),_=b.circleTangency,A=b.lineTangency,P=b.theta,j=ki({cx:r,cy:n,radius:i,angle:f,sign:-l,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),T=j.circleTangency,E=j.lineTangency,M=j.theta,I=c?Math.abs(s-f):Math.abs(s-f)-P-M;if(I<0&&o===0)return"".concat(g,"L").concat(r,",").concat(n,"Z");g+="L".concat(E.x,",").concat(E.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat(T.x,",").concat(T.y,` A`).concat(i,",").concat(i,",0,").concat(+(I>180),",").concat(+(l>0),",").concat(_.x,",").concat(_.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat(A.x,",").concat(A.y,"Z")}else g+="L".concat(r,",").concat(n,"Z");return g},eC={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},FO=function(t){var r=Ym(Ym({},eC),t),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,u=r.cornerRadius,c=r.forceCornerRadius,s=r.cornerIsExternal,f=r.startAngle,l=r.endAngle,h=r.className;if(o0&&Math.abs(f-l)<360?d=QI({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(v,y/2),forceCornerRadius:c,cornerIsExternal:s,startAngle:f,endAngle:l}):d=BO({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:f,endAngle:l}),S.createElement("path",Ff({},K(r,!0),{className:p,d,role:"img"}))};function ni(e){"@babel/helpers - typeof";return ni=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ni(e)}function Uf(){return Uf=Object.assign?Object.assign.bind():function(e){for(var t=1;t0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function bC(e,t){return yr(e.getTime(),t.getTime())}function xC(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function wC(e,t){return e===t}function ub(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),a=e.entries(),o,u,c=0;(o=a.next())&&!o.done;){for(var s=t.entries(),f=!1,l=0;(u=s.next())&&!u.done;){if(i[l]){l++;continue}var h=o.value,p=u.value;if(r.equals(h[0],p[0],c,l,e,t,r)&&r.equals(h[1],p[1],h[0],p[0],e,t,r)){f=i[l]=!0;break}l++}if(!f)return!1;c++}return!0}var OC=yr;function _C(e,t,r){var n=ob(e),i=n.length;if(ob(t).length!==i)return!1;for(;i-- >0;)if(!UO(e,t,r,n[i]))return!1;return!0}function _n(e,t,r){var n=ib(e),i=n.length;if(ib(t).length!==i)return!1;for(var a,o,u;i-- >0;)if(a=n[i],!UO(e,t,r,a)||(o=ab(e,a),u=ab(t,a),(o||u)&&(!o||!u||o.configurable!==u.configurable||o.enumerable!==u.enumerable||o.writable!==u.writable)))return!1;return!0}function AC(e,t){return yr(e.valueOf(),t.valueOf())}function SC(e,t){return e.source===t.source&&e.flags===t.flags}function cb(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),a=e.values(),o,u;(o=a.next())&&!o.done;){for(var c=t.values(),s=!1,f=0;(u=c.next())&&!u.done;){if(!i[f]&&r.equals(o.value,u.value,o.value,u.value,e,t,r)){s=i[f]=!0;break}f++}if(!s)return!1}return!0}function PC(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function TC(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function UO(e,t,r,n){return(n===gC||n===yC||n===vC)&&(e.$$typeof||t.$$typeof)?!0:dC(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var EC="[object Arguments]",jC="[object Boolean]",MC="[object Date]",$C="[object Error]",IC="[object Map]",CC="[object Number]",kC="[object Object]",RC="[object RegExp]",DC="[object Set]",NC="[object String]",qC="[object URL]",LC=Array.isArray,sb=typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView:null,lb=Object.assign,BC=Object.prototype.toString.call.bind(Object.prototype.toString);function FC(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,i=e.areFunctionsEqual,a=e.areMapsEqual,o=e.areNumbersEqual,u=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,s=e.areRegExpsEqual,f=e.areSetsEqual,l=e.areTypedArraysEqual,h=e.areUrlsEqual,p=e.unknownTagComparators;return function(v,d,m){if(v===d)return!0;if(v==null||d==null)return!1;var x=typeof v;if(x!==typeof d)return!1;if(x!=="object")return x==="number"?o(v,d,m):x==="function"?i(v,d,m):!1;var w=v.constructor;if(w!==d.constructor)return!1;if(w===Object)return u(v,d,m);if(LC(v))return t(v,d,m);if(sb!=null&&sb(v))return l(v,d,m);if(w===Date)return r(v,d,m);if(w===RegExp)return s(v,d,m);if(w===Map)return a(v,d,m);if(w===Set)return f(v,d,m);var O=BC(v);if(O===MC)return r(v,d,m);if(O===RC)return s(v,d,m);if(O===IC)return a(v,d,m);if(O===DC)return f(v,d,m);if(O===kC)return typeof v.then!="function"&&typeof d.then!="function"&&u(v,d,m);if(O===qC)return h(v,d,m);if(O===$C)return n(v,d,m);if(O===EC)return u(v,d,m);if(O===jC||O===CC||O===NC)return c(v,d,m);if(p){var g=p[O];if(!g){var b=pC(v);b&&(g=p[b])}if(g)return g(v,d,m)}return!1}}function UC(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?_n:mC,areDatesEqual:bC,areErrorsEqual:xC,areFunctionsEqual:wC,areMapsEqual:n?nb(ub,_n):ub,areNumbersEqual:OC,areObjectsEqual:n?_n:_C,arePrimitiveWrappersEqual:AC,areRegExpsEqual:SC,areSetsEqual:n?nb(cb,_n):cb,areTypedArraysEqual:n?_n:PC,areUrlsEqual:TC,unknownTagComparators:void 0};if(r&&(i=lb({},i,r(i))),t){var a=Di(i.areArraysEqual),o=Di(i.areMapsEqual),u=Di(i.areObjectsEqual),c=Di(i.areSetsEqual);i=lb({},i,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:u,areSetsEqual:c})}return i}function WC(e){return function(t,r,n,i,a,o,u){return e(t,r,u)}}function zC(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,a=e.strict;if(n)return function(c,s){var f=n(),l=f.cache,h=l===void 0?t?new WeakMap:void 0:l,p=f.meta;return r(c,s,{cache:h,equals:i,meta:p,strict:a})};if(t)return function(c,s){return r(c,s,{cache:new WeakMap,equals:i,meta:void 0,strict:a})};var o={cache:void 0,equals:i,meta:void 0,strict:a};return function(c,s){return r(c,s,o)}}var KC=Wt();Wt({strict:!0});Wt({circular:!0});Wt({circular:!0,strict:!0});Wt({createInternalComparator:function(){return yr}});Wt({strict:!0,createInternalComparator:function(){return yr}});Wt({circular:!0,createInternalComparator:function(){return yr}});Wt({circular:!0,createInternalComparator:function(){return yr},strict:!0});function Wt(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,i=e.createState,a=e.strict,o=a===void 0?!1:a,u=UC(e),c=FC(u),s=n?n(c):WC(c);return zC({circular:r,comparator:c,createState:i,equals:s,strict:o})}function HC(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function fb(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>t?(e(a),r=-1):HC(i)};requestAnimationFrame(n)}function Wf(e){"@babel/helpers - typeof";return Wf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wf(e)}function GC(e){return ZC(e)||YC(e)||XC(e)||VC()}function VC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XC(e,t){if(e){if(typeof e=="string")return hb(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hb(e,t)}}function hb(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:m<0?0:m},v=function(m){for(var x=m>1?1:m,w=x,O=0;O<8;++O){var g=l(w)-x,b=p(w);if(Math.abs(g-x)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,u=o===void 0?17:o,c=function(f,l,h){var p=-(f-l)*n,y=h*a,v=h+(p-y)*u/1e3,d=h*u/1e3+f;return Math.abs(d-l)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ek(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function el(e){return Ik(e)||$k(e)||Mk(e)||jk()}function jk(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mk(e,t){if(e){if(typeof e=="string")return Vf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vf(e,t)}}function $k(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ik(e){if(Array.isArray(e))return Vf(e)}function Vf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ya(e){return ya=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ya(e)}var bt=(function(e){Nk(r,e);var t=qk(r);function r(n,i){var a;Ck(this,r),a=t.call(this,n,i);var o=a.props,u=o.isActive,c=o.attributeName,s=o.from,f=o.to,l=o.steps,h=o.children,p=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(Zf(a)),a.changeStyle=a.changeStyle.bind(Zf(a)),!u||p<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:f}),Yf(a);if(l&&l.length)a.state={style:l[0].style};else if(s){if(typeof h=="function")return a.state={style:s},Yf(a);a.state={style:c?Tn({},c,s):s}}else a.state={style:{}};return a}return Rk(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,u=a.canBegin,c=a.attributeName,s=a.shouldReAnimate,f=a.to,l=a.from,h=this.state.style;if(u){if(!o){var p={style:c?Tn({},c,f):f};this.state&&h&&(c&&h[c]!==f||!c&&h!==f)&&this.setState(p);return}if(!(KC(i.to,f)&&i.canBegin&&i.isActive)){var y=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var v=y||s?l:i.to;if(this.state&&h){var d={style:c?Tn({},c,v):v};(c&&h[c]!==v||!c&&h!==v)&&this.setState(d)}this.runAnimation(at(at({},this.props),{},{from:v,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,u=i.to,c=i.duration,s=i.easing,f=i.begin,l=i.onAnimationEnd,h=i.onAnimationStart,p=Sk(o,u,dk(s),c,this.changeStyle),y=function(){a.stopJSAnimation=p()};this.manager.start([h,f,y,c,l])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,u=i.begin,c=i.onAnimationStart,s=o[0],f=s.style,l=s.duration,h=l===void 0?0:l,p=function(v,d,m){if(m===0)return v;var x=d.duration,w=d.easing,O=w===void 0?"ease":w,g=d.style,b=d.properties,_=d.onAnimationEnd,A=m>0?o[m-1]:d,P=b||Object.keys(g);if(typeof O=="function"||O==="spring")return[].concat(el(v),[a.runJSAnimation.bind(a,{from:A.style,to:g,duration:x,easing:O}),x]);var j=vb(P,x,O),T=at(at(at({},A.style),g),{},{transition:j});return[].concat(el(v),[T,x,_]).filter(rk)};return this.manager.start([c].concat(el(o.reduce(p,[f,Math.max(h,u)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=JC());var a=i.begin,o=i.duration,u=i.attributeName,c=i.to,s=i.easing,f=i.onAnimationStart,l=i.onAnimationEnd,h=i.steps,p=i.children,y=this.manager;if(this.unSubscribe=y.subscribe(this.handleStyleChange),typeof s=="function"||typeof p=="function"||s==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var v=u?Tn({},u,c):c,d=vb(Object.keys(v),o,s);y.start([f,a,at(at({},v),{},{transition:d}),o,l])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var u=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=Tk(i,Pk),s=N.Children.count(a),f=this.state.style;if(typeof a=="function")return a(f);if(!u||s===0||o<=0)return a;var l=function(p){var y=p.props,v=y.style,d=v===void 0?{}:v,m=y.className,x=N.cloneElement(p,at(at({},c),{},{style:at(at({},d),f),className:m}));return x};return s===1?l(N.Children.only(a)):S.createElement("div",null,N.Children.map(a,function(h){return l(h)}))}}]),r})(N.PureComponent);bt.displayName="Animate";bt.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};bt.propTypes={from:oe.oneOfType([oe.object,oe.string]),to:oe.oneOfType([oe.object,oe.string]),attributeName:oe.string,duration:oe.number,begin:oe.number,easing:oe.oneOfType([oe.string,oe.func]),steps:oe.arrayOf(oe.shape({duration:oe.number.isRequired,style:oe.object.isRequired,easing:oe.oneOfType([oe.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),oe.func]),properties:oe.arrayOf("string"),onAnimationEnd:oe.func})),children:oe.oneOfType([oe.node,oe.func]),isActive:oe.bool,canBegin:oe.bool,onAnimationEnd:oe.func,shouldReAnimate:oe.bool,onAnimationStart:oe.func,onAnimationReStart:oe.func};function wb(){return wb=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,c=n>=0?1:-1,s=i>=0&&n>=0||i<0&&n<0?1:0,f;if(o>0&&a instanceof Array){for(var l=[0,0,0,0],h=0,p=4;ho?o:a[h];f="M".concat(t,",").concat(r+u*l[0]),l[0]>0&&(f+="A ".concat(l[0],",").concat(l[0],",0,0,").concat(s,",").concat(t+c*l[0],",").concat(r)),f+="L ".concat(t+n-c*l[1],",").concat(r),l[1]>0&&(f+="A ".concat(l[1],",").concat(l[1],",0,0,").concat(s,`, + A`).concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat(A.x,",").concat(A.y,"Z")}else g+="L".concat(r,",").concat(n,"Z");return g},QI={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},BO=function(t){var r=Ym(Ym({},QI),t),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,u=r.cornerRadius,c=r.forceCornerRadius,s=r.cornerIsExternal,f=r.startAngle,l=r.endAngle,h=r.className;if(o0&&Math.abs(f-l)<360?d=JI({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(v,y/2),forceCornerRadius:c,cornerIsExternal:s,startAngle:f,endAngle:l}):d=LO({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:f,endAngle:l}),S.createElement("path",Ff({},K(r,!0),{className:p,d,role:"img"}))};function ni(e){"@babel/helpers - typeof";return ni=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ni(e)}function Uf(){return Uf=Object.assign?Object.assign.bind():function(e){for(var t=1;t0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function mC(e,t){return yr(e.getTime(),t.getTime())}function bC(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function xC(e,t){return e===t}function ub(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),a=e.entries(),o,u,c=0;(o=a.next())&&!o.done;){for(var s=t.entries(),f=!1,l=0;(u=s.next())&&!u.done;){if(i[l]){l++;continue}var h=o.value,p=u.value;if(r.equals(h[0],p[0],c,l,e,t,r)&&r.equals(h[1],p[1],h[0],p[0],e,t,r)){f=i[l]=!0;break}l++}if(!f)return!1;c++}return!0}var wC=yr;function OC(e,t,r){var n=ob(e),i=n.length;if(ob(t).length!==i)return!1;for(;i-- >0;)if(!FO(e,t,r,n[i]))return!1;return!0}function _n(e,t,r){var n=ib(e),i=n.length;if(ib(t).length!==i)return!1;for(var a,o,u;i-- >0;)if(a=n[i],!FO(e,t,r,a)||(o=ab(e,a),u=ab(t,a),(o||u)&&(!o||!u||o.configurable!==u.configurable||o.enumerable!==u.enumerable||o.writable!==u.writable)))return!1;return!0}function _C(e,t){return yr(e.valueOf(),t.valueOf())}function AC(e,t){return e.source===t.source&&e.flags===t.flags}function cb(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),a=e.values(),o,u;(o=a.next())&&!o.done;){for(var c=t.values(),s=!1,f=0;(u=c.next())&&!u.done;){if(!i[f]&&r.equals(o.value,u.value,o.value,u.value,e,t,r)){s=i[f]=!0;break}f++}if(!s)return!1}return!0}function SC(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function PC(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function FO(e,t,r,n){return(n===yC||n===vC||n===dC)&&(e.$$typeof||t.$$typeof)?!0:pC(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var TC="[object Arguments]",EC="[object Boolean]",jC="[object Date]",MC="[object Error]",$C="[object Map]",IC="[object Number]",CC="[object Object]",kC="[object RegExp]",RC="[object Set]",DC="[object String]",NC="[object URL]",qC=Array.isArray,sb=typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView:null,lb=Object.assign,LC=Object.prototype.toString.call.bind(Object.prototype.toString);function BC(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,i=e.areFunctionsEqual,a=e.areMapsEqual,o=e.areNumbersEqual,u=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,s=e.areRegExpsEqual,f=e.areSetsEqual,l=e.areTypedArraysEqual,h=e.areUrlsEqual,p=e.unknownTagComparators;return function(v,d,m){if(v===d)return!0;if(v==null||d==null)return!1;var x=typeof v;if(x!==typeof d)return!1;if(x!=="object")return x==="number"?o(v,d,m):x==="function"?i(v,d,m):!1;var w=v.constructor;if(w!==d.constructor)return!1;if(w===Object)return u(v,d,m);if(qC(v))return t(v,d,m);if(sb!=null&&sb(v))return l(v,d,m);if(w===Date)return r(v,d,m);if(w===RegExp)return s(v,d,m);if(w===Map)return a(v,d,m);if(w===Set)return f(v,d,m);var O=LC(v);if(O===jC)return r(v,d,m);if(O===kC)return s(v,d,m);if(O===$C)return a(v,d,m);if(O===RC)return f(v,d,m);if(O===CC)return typeof v.then!="function"&&typeof d.then!="function"&&u(v,d,m);if(O===NC)return h(v,d,m);if(O===MC)return n(v,d,m);if(O===TC)return u(v,d,m);if(O===EC||O===IC||O===DC)return c(v,d,m);if(p){var g=p[O];if(!g){var b=hC(v);b&&(g=p[b])}if(g)return g(v,d,m)}return!1}}function FC(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?_n:gC,areDatesEqual:mC,areErrorsEqual:bC,areFunctionsEqual:xC,areMapsEqual:n?nb(ub,_n):ub,areNumbersEqual:wC,areObjectsEqual:n?_n:OC,arePrimitiveWrappersEqual:_C,areRegExpsEqual:AC,areSetsEqual:n?nb(cb,_n):cb,areTypedArraysEqual:n?_n:SC,areUrlsEqual:PC,unknownTagComparators:void 0};if(r&&(i=lb({},i,r(i))),t){var a=Di(i.areArraysEqual),o=Di(i.areMapsEqual),u=Di(i.areObjectsEqual),c=Di(i.areSetsEqual);i=lb({},i,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:u,areSetsEqual:c})}return i}function UC(e){return function(t,r,n,i,a,o,u){return e(t,r,u)}}function WC(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,a=e.strict;if(n)return function(c,s){var f=n(),l=f.cache,h=l===void 0?t?new WeakMap:void 0:l,p=f.meta;return r(c,s,{cache:h,equals:i,meta:p,strict:a})};if(t)return function(c,s){return r(c,s,{cache:new WeakMap,equals:i,meta:void 0,strict:a})};var o={cache:void 0,equals:i,meta:void 0,strict:a};return function(c,s){return r(c,s,o)}}var zC=Wt();Wt({strict:!0});Wt({circular:!0});Wt({circular:!0,strict:!0});Wt({createInternalComparator:function(){return yr}});Wt({strict:!0,createInternalComparator:function(){return yr}});Wt({circular:!0,createInternalComparator:function(){return yr}});Wt({circular:!0,createInternalComparator:function(){return yr},strict:!0});function Wt(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,i=e.createState,a=e.strict,o=a===void 0?!1:a,u=FC(e),c=BC(u),s=n?n(c):UC(c);return WC({circular:r,comparator:c,createState:i,equals:s,strict:o})}function KC(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function fb(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>t?(e(a),r=-1):KC(i)};requestAnimationFrame(n)}function Wf(e){"@babel/helpers - typeof";return Wf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wf(e)}function HC(e){return YC(e)||XC(e)||VC(e)||GC()}function GC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VC(e,t){if(e){if(typeof e=="string")return hb(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hb(e,t)}}function hb(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:m<0?0:m},v=function(m){for(var x=m>1?1:m,w=x,O=0;O<8;++O){var g=l(w)-x,b=p(w);if(Math.abs(g-x)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,u=o===void 0?17:o,c=function(f,l,h){var p=-(f-l)*n,y=h*a,v=h+(p-y)*u/1e3,d=h*u/1e3+f;return Math.abs(d-l)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Tk(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function el(e){return $k(e)||Mk(e)||jk(e)||Ek()}function Ek(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jk(e,t){if(e){if(typeof e=="string")return Vf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vf(e,t)}}function Mk(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function $k(e){if(Array.isArray(e))return Vf(e)}function Vf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ya(e){return ya=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ya(e)}var bt=(function(e){Dk(r,e);var t=Nk(r);function r(n,i){var a;Ik(this,r),a=t.call(this,n,i);var o=a.props,u=o.isActive,c=o.attributeName,s=o.from,f=o.to,l=o.steps,h=o.children,p=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(Zf(a)),a.changeStyle=a.changeStyle.bind(Zf(a)),!u||p<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:f}),Yf(a);if(l&&l.length)a.state={style:l[0].style};else if(s){if(typeof h=="function")return a.state={style:s},Yf(a);a.state={style:c?Tn({},c,s):s}}else a.state={style:{}};return a}return kk(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,u=a.canBegin,c=a.attributeName,s=a.shouldReAnimate,f=a.to,l=a.from,h=this.state.style;if(u){if(!o){var p={style:c?Tn({},c,f):f};this.state&&h&&(c&&h[c]!==f||!c&&h!==f)&&this.setState(p);return}if(!(zC(i.to,f)&&i.canBegin&&i.isActive)){var y=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var v=y||s?l:i.to;if(this.state&&h){var d={style:c?Tn({},c,v):v};(c&&h[c]!==v||!c&&h!==v)&&this.setState(d)}this.runAnimation(at(at({},this.props),{},{from:v,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,u=i.to,c=i.duration,s=i.easing,f=i.begin,l=i.onAnimationEnd,h=i.onAnimationStart,p=Ak(o,u,pk(s),c,this.changeStyle),y=function(){a.stopJSAnimation=p()};this.manager.start([h,f,y,c,l])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,u=i.begin,c=i.onAnimationStart,s=o[0],f=s.style,l=s.duration,h=l===void 0?0:l,p=function(v,d,m){if(m===0)return v;var x=d.duration,w=d.easing,O=w===void 0?"ease":w,g=d.style,b=d.properties,_=d.onAnimationEnd,A=m>0?o[m-1]:d,P=b||Object.keys(g);if(typeof O=="function"||O==="spring")return[].concat(el(v),[a.runJSAnimation.bind(a,{from:A.style,to:g,duration:x,easing:O}),x]);var j=vb(P,x,O),T=at(at(at({},A.style),g),{},{transition:j});return[].concat(el(v),[T,x,_]).filter(tk)};return this.manager.start([c].concat(el(o.reduce(p,[f,Math.max(h,u)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=ZC());var a=i.begin,o=i.duration,u=i.attributeName,c=i.to,s=i.easing,f=i.onAnimationStart,l=i.onAnimationEnd,h=i.steps,p=i.children,y=this.manager;if(this.unSubscribe=y.subscribe(this.handleStyleChange),typeof s=="function"||typeof p=="function"||s==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var v=u?Tn({},u,c):c,d=vb(Object.keys(v),o,s);y.start([f,a,at(at({},v),{},{transition:d}),o,l])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var u=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=Pk(i,Sk),s=N.Children.count(a),f=this.state.style;if(typeof a=="function")return a(f);if(!u||s===0||o<=0)return a;var l=function(p){var y=p.props,v=y.style,d=v===void 0?{}:v,m=y.className,x=N.cloneElement(p,at(at({},c),{},{style:at(at({},d),f),className:m}));return x};return s===1?l(N.Children.only(a)):S.createElement("div",null,N.Children.map(a,function(h){return l(h)}))}}]),r})(N.PureComponent);bt.displayName="Animate";bt.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};bt.propTypes={from:oe.oneOfType([oe.object,oe.string]),to:oe.oneOfType([oe.object,oe.string]),attributeName:oe.string,duration:oe.number,begin:oe.number,easing:oe.oneOfType([oe.string,oe.func]),steps:oe.arrayOf(oe.shape({duration:oe.number.isRequired,style:oe.object.isRequired,easing:oe.oneOfType([oe.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),oe.func]),properties:oe.arrayOf("string"),onAnimationEnd:oe.func})),children:oe.oneOfType([oe.node,oe.func]),isActive:oe.bool,canBegin:oe.bool,onAnimationEnd:oe.func,shouldReAnimate:oe.bool,onAnimationStart:oe.func,onAnimationReStart:oe.func};function wb(){return wb=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,c=n>=0?1:-1,s=i>=0&&n>=0||i<0&&n<0?1:0,f;if(o>0&&a instanceof Array){for(var l=[0,0,0,0],h=0,p=4;ho?o:a[h];f="M".concat(t,",").concat(r+u*l[0]),l[0]>0&&(f+="A ".concat(l[0],",").concat(l[0],",0,0,").concat(s,",").concat(t+c*l[0],",").concat(r)),f+="L ".concat(t+n-c*l[1],",").concat(r),l[1]>0&&(f+="A ".concat(l[1],",").concat(l[1],",0,0,").concat(s,`, `).concat(t+n,",").concat(r+u*l[1])),f+="L ".concat(t+n,",").concat(r+i-u*l[2]),l[2]>0&&(f+="A ".concat(l[2],",").concat(l[2],",0,0,").concat(s,`, `).concat(t+n-c*l[2],",").concat(r+i)),f+="L ".concat(t+c*l[3],",").concat(r+i),l[3]>0&&(f+="A ".concat(l[3],",").concat(l[3],",0,0,").concat(s,`, `).concat(t,",").concat(r+i-u*l[3])),f+="Z"}else if(o>0&&a===+a&&a>0){var y=Math.min(o,a);f="M ".concat(t,",").concat(r+u*y,` @@ -53,13 +53,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho L `).concat(t+n,",").concat(r+i-u*y,` A `).concat(y,",").concat(y,",0,0,").concat(s,",").concat(t+n-c*y,",").concat(r+i,` L `).concat(t+c*y,",").concat(r+i,` - A `).concat(y,",").concat(y,",0,0,").concat(s,",").concat(t,",").concat(r+i-u*y," Z")}else f="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return f},Vk=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,a=r.x,o=r.y,u=r.width,c=r.height;if(Math.abs(u)>0&&Math.abs(c)>0){var s=Math.min(a,a+u),f=Math.max(a,a+u),l=Math.min(o,o+c),h=Math.max(o,o+c);return n>=s&&n<=f&&i>=l&&i<=h}return!1},Xk={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Sp=function(t){var r=Ab(Ab({},Xk),t),n=N.useRef(),i=N.useState(-1),a=Bk(i,2),o=a[0],u=a[1];N.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var O=n.current.getTotalLength();O&&u(O)}catch{}},[]);var c=r.x,s=r.y,f=r.width,l=r.height,h=r.radius,p=r.className,y=r.animationEasing,v=r.animationDuration,d=r.animationBegin,m=r.isAnimationActive,x=r.isUpdateAnimationActive;if(c!==+c||s!==+s||f!==+f||l!==+l||f===0||l===0)return null;var w=te("recharts-rectangle",p);return x?S.createElement(bt,{canBegin:o>0,from:{width:f,height:l,x:c,y:s},to:{width:f,height:l,x:c,y:s},duration:v,animationEasing:y,isActive:x},function(O){var g=O.width,b=O.height,_=O.x,A=O.y;return S.createElement(bt,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:d,duration:v,isActive:m,easing:y},S.createElement("path",ga({},K(r,!0),{className:w,d:Sb(_,A,g,b,h),ref:n})))}):S.createElement("path",ga({},K(r,!0),{className:w,d:Sb(c,s,f,l,h)}))},Yk=["points","className","baseLinePoints","connectNulls"];function Ar(){return Ar=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Jk(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Pb(e){return rR(e)||tR(e)||eR(e)||Qk()}function Qk(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eR(e,t){if(e){if(typeof e=="string")return Jf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Jf(e,t)}}function tR(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function rR(e){if(Array.isArray(e))return Jf(e)}function Jf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){Tb(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),Tb(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},Cn=function(t,r){var n=nR(t);r&&(n=[n.reduce(function(a,o){return[].concat(Pb(a),Pb(o))},[])]);var i=n.map(function(a){return a.reduce(function(o,u,c){return"".concat(o).concat(c===0?"M":"L").concat(u.x,",").concat(u.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},iR=function(t,r,n){var i=Cn(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(Cn(r.reverse(),n).slice(1))},aR=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,a=t.connectNulls,o=Zk(t,Yk);if(!r||!r.length)return null;var u=te("recharts-polygon",n);if(i&&i.length){var c=o.stroke&&o.stroke!=="none",s=iR(r,i,a);return S.createElement("g",{className:u},S.createElement("path",Ar({},K(o,!0),{fill:s.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:s})),c?S.createElement("path",Ar({},K(o,!0),{fill:"none",d:Cn(r,a)})):null,c?S.createElement("path",Ar({},K(o,!0),{fill:"none",d:Cn(i,a)})):null)}var f=Cn(r,a);return S.createElement("path",Ar({},K(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",className:u,d:f}))};function Qf(){return Qf=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function hR(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var pR=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},dR=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.top,u=o===void 0?0:o,c=t.left,s=c===void 0?0:c,f=t.width,l=f===void 0?0:f,h=t.height,p=h===void 0?0:h,y=t.className,v=fR(t,oR),d=uR({x:n,y:a,top:u,left:s,width:l,height:p},v);return!q(n)||!q(a)||!q(l)||!q(p)||!q(u)||!q(s)?null:S.createElement("path",eh({},K(d,!0),{className:te("recharts-cross",y),d:pR(n,a,l,p,u,s)}))},tl,jb;function vR(){if(jb)return tl;jb=1;var e=no(),t=sO(),r=xt();function n(i,a){return i&&i.length?e(i,r(a,2),t):void 0}return tl=n,tl}var yR=vR();const gR=ce(yR);var rl,Mb;function mR(){if(Mb)return rl;Mb=1;var e=no(),t=xt(),r=lO();function n(i,a){return i&&i.length?e(i,t(a,2),r):void 0}return rl=n,rl}var bR=mR();const xR=ce(bR);var wR=["cx","cy","angle","ticks","axisLine"],OR=["ticks","tick","angle","tickFormatter","stroke"];function Ur(e){"@babel/helpers - typeof";return Ur=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ur(e)}function kn(){return kn=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _R(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function AR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cb(e,t){for(var r=0;rDb?o=i==="outer"?"start":"end":a<-Db?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.radius,u=n.axisLine,c=n.axisLineType,s=Yt(Yt({},K(this.props,!1)),{},{fill:"none"},K(u,!1));if(c==="circle")return S.createElement(co,Qt({className:"recharts-polar-angle-axis-line"},s,{cx:i,cy:a,r:o}));var f=this.props.ticks,l=f.map(function(h){return pe(i,a,o,h.coordinate)});return S.createElement(aR,Qt({className:"recharts-polar-angle-axis-line"},s,{points:l}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,o=i.tick,u=i.tickLine,c=i.tickFormatter,s=i.stroke,f=K(this.props,!1),l=K(o,!1),h=Yt(Yt({},f),{},{fill:"none"},K(u,!1)),p=a.map(function(y,v){var d=n.getTickLineCoord(y),m=n.getTickTextAnchor(y),x=Yt(Yt(Yt({textAnchor:m},f),{},{stroke:"none",fill:s},l),{},{index:v,payload:y,x:d.x2,y:d.y2});return S.createElement(ne,Qt({className:te("recharts-polar-angle-axis-tick",qO(o)),key:"tick-".concat(y.coordinate)},cr(n.props,y,v)),u&&S.createElement("line",Qt({className:"recharts-polar-angle-axis-tick-line"},h,d)),o&&t.renderTickItem(o,x,c?c(y.value,v):y.value))});return S.createElement(ne,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.radius,o=n.axisLine;return a<=0||!i||!i.length?null:S.createElement(ne,{className:te("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,a){var o;return S.isValidElement(n)?o=S.cloneElement(n,i):X(n)?o=n(i):o=S.createElement(sr,Qt({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])})(N.PureComponent);fo(ho,"displayName","PolarAngleAxis");fo(ho,"axisType","angleAxis");fo(ho,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var nl,Nb;function Pp(){if(Nb)return nl;Nb=1;var e=iw(),t=e(Object.getPrototypeOf,Object);return nl=t,nl}var il,qb;function LR(){if(qb)return il;qb=1;var e=kt(),t=Pp(),r=ft(),n="[object Object]",i=Function.prototype,a=Object.prototype,o=i.toString,u=a.hasOwnProperty,c=o.call(Object);function s(f){if(!r(f)||e(f)!=n)return!1;var l=t(f);if(l===null)return!0;var h=u.call(l,"constructor")&&l.constructor;return typeof h=="function"&&h instanceof h&&o.call(h)==c}return il=s,il}var BR=LR();const FR=ce(BR);var al,Lb;function UR(){if(Lb)return al;Lb=1;var e=kt(),t=ft(),r="[object Boolean]";function n(i){return i===!0||i===!1||t(i)&&e(i)==r}return al=n,al}var WR=UR();const zR=ce(WR);function ci(e){"@babel/helpers - typeof";return ci=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ci(e)}function xa(){return xa=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:h,x:c,y:s},to:{upperWidth:f,lowerWidth:l,height:h,x:c,y:s},duration:v,animationEasing:y,isActive:m},function(w){var O=w.upperWidth,g=w.lowerWidth,b=w.height,_=w.x,A=w.y;return S.createElement(bt,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:d,duration:v,easing:y},S.createElement("path",xa({},K(r,!0),{className:x,d:Wb(_,A,O,g,b),ref:n})))}):S.createElement("g",null,S.createElement("path",xa({},K(r,!0),{className:x,d:Wb(c,s,f,l,h)})))},tD=["option","shapeType","propTransformer","activeClassName","isActive"];function si(e){"@babel/helpers - typeof";return si=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},si(e)}function rD(e,t){if(e==null)return{};var r=nD(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nD(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function zb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function wa(e){for(var t=1;t0?Xe(w,"paddingAngle",0):0;if(g){var _=Ge(g.endAngle-g.startAngle,w.endAngle-w.startAngle),A=fe(fe({},w),{},{startAngle:x+b,endAngle:x+_(v)+b});d.push(A),x=A.endAngle}else{var P=w.endAngle,j=w.startAngle,T=Ge(0,P-j),E=T(v),M=fe(fe({},w),{},{startAngle:x+b,endAngle:x+E+b});d.push(M),x=M.endAngle}}),S.createElement(ne,null,n.renderSectorsStatically(d))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var u=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[u].focus(),i.setState({sectorToFocus:u});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,a=n.isAnimationActive,o=this.state.prevSectors;return a&&i&&i.length&&(!o||!Oi(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,a=i.hide,o=i.sectors,u=i.className,c=i.label,s=i.cx,f=i.cy,l=i.innerRadius,h=i.outerRadius,p=i.isAnimationActive,y=this.state.isAnimationFinished;if(a||!o||!o.length||!q(s)||!q(f)||!q(l)||!q(h))return null;var v=te("recharts-pie",u);return S.createElement(ne,{tabIndex:this.props.rootTabIndex,className:v,ref:function(m){n.pieRef=m}},this.renderSectors(),c&&this.renderLabels(o),je.renderCallByParent(this.props,null,!1),(!p||y)&&Mt.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n0&&Math.abs(c)>0){var s=Math.min(a,a+u),f=Math.max(a,a+u),l=Math.min(o,o+c),h=Math.max(o,o+c);return n>=s&&n<=f&&i>=l&&i<=h}return!1},Vk={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Sp=function(t){var r=Ab(Ab({},Vk),t),n=N.useRef(),i=N.useState(-1),a=Lk(i,2),o=a[0],u=a[1];N.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var O=n.current.getTotalLength();O&&u(O)}catch{}},[]);var c=r.x,s=r.y,f=r.width,l=r.height,h=r.radius,p=r.className,y=r.animationEasing,v=r.animationDuration,d=r.animationBegin,m=r.isAnimationActive,x=r.isUpdateAnimationActive;if(c!==+c||s!==+s||f!==+f||l!==+l||f===0||l===0)return null;var w=te("recharts-rectangle",p);return x?S.createElement(bt,{canBegin:o>0,from:{width:f,height:l,x:c,y:s},to:{width:f,height:l,x:c,y:s},duration:v,animationEasing:y,isActive:x},function(O){var g=O.width,b=O.height,_=O.x,A=O.y;return S.createElement(bt,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:d,duration:v,isActive:m,easing:y},S.createElement("path",ga({},K(r,!0),{className:w,d:Sb(_,A,g,b,h),ref:n})))}):S.createElement("path",ga({},K(r,!0),{className:w,d:Sb(c,s,f,l,h)}))},Xk=["points","className","baseLinePoints","connectNulls"];function Ar(){return Ar=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Zk(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Pb(e){return tR(e)||eR(e)||Qk(e)||Jk()}function Jk(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qk(e,t){if(e){if(typeof e=="string")return Jf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Jf(e,t)}}function eR(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function tR(e){if(Array.isArray(e))return Jf(e)}function Jf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){Tb(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),Tb(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},Cn=function(t,r){var n=rR(t);r&&(n=[n.reduce(function(a,o){return[].concat(Pb(a),Pb(o))},[])]);var i=n.map(function(a){return a.reduce(function(o,u,c){return"".concat(o).concat(c===0?"M":"L").concat(u.x,",").concat(u.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},nR=function(t,r,n){var i=Cn(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(Cn(r.reverse(),n).slice(1))},iR=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,a=t.connectNulls,o=Yk(t,Xk);if(!r||!r.length)return null;var u=te("recharts-polygon",n);if(i&&i.length){var c=o.stroke&&o.stroke!=="none",s=nR(r,i,a);return S.createElement("g",{className:u},S.createElement("path",Ar({},K(o,!0),{fill:s.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:s})),c?S.createElement("path",Ar({},K(o,!0),{fill:"none",d:Cn(r,a)})):null,c?S.createElement("path",Ar({},K(o,!0),{fill:"none",d:Cn(i,a)})):null)}var f=Cn(r,a);return S.createElement("path",Ar({},K(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",className:u,d:f}))};function Qf(){return Qf=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function fR(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var hR=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},pR=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.top,u=o===void 0?0:o,c=t.left,s=c===void 0?0:c,f=t.width,l=f===void 0?0:f,h=t.height,p=h===void 0?0:h,y=t.className,v=lR(t,aR),d=oR({x:n,y:a,top:u,left:s,width:l,height:p},v);return!q(n)||!q(a)||!q(l)||!q(p)||!q(u)||!q(s)?null:S.createElement("path",eh({},K(d,!0),{className:te("recharts-cross",y),d:hR(n,a,l,p,u,s)}))},tl,jb;function dR(){if(jb)return tl;jb=1;var e=no(),t=cO(),r=xt();function n(i,a){return i&&i.length?e(i,r(a,2),t):void 0}return tl=n,tl}var vR=dR();const yR=ce(vR);var rl,Mb;function gR(){if(Mb)return rl;Mb=1;var e=no(),t=xt(),r=sO();function n(i,a){return i&&i.length?e(i,t(a,2),r):void 0}return rl=n,rl}var mR=gR();const bR=ce(mR);var xR=["cx","cy","angle","ticks","axisLine"],wR=["ticks","tick","angle","tickFormatter","stroke"];function Ur(e){"@babel/helpers - typeof";return Ur=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ur(e)}function kn(){return kn=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function OR(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _R(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cb(e,t){for(var r=0;rDb?o=i==="outer"?"start":"end":a<-Db?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.radius,u=n.axisLine,c=n.axisLineType,s=Yt(Yt({},K(this.props,!1)),{},{fill:"none"},K(u,!1));if(c==="circle")return S.createElement(co,Qt({className:"recharts-polar-angle-axis-line"},s,{cx:i,cy:a,r:o}));var f=this.props.ticks,l=f.map(function(h){return pe(i,a,o,h.coordinate)});return S.createElement(iR,Qt({className:"recharts-polar-angle-axis-line"},s,{points:l}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,o=i.tick,u=i.tickLine,c=i.tickFormatter,s=i.stroke,f=K(this.props,!1),l=K(o,!1),h=Yt(Yt({},f),{},{fill:"none"},K(u,!1)),p=a.map(function(y,v){var d=n.getTickLineCoord(y),m=n.getTickTextAnchor(y),x=Yt(Yt(Yt({textAnchor:m},f),{},{stroke:"none",fill:s},l),{},{index:v,payload:y,x:d.x2,y:d.y2});return S.createElement(ne,Qt({className:te("recharts-polar-angle-axis-tick",NO(o)),key:"tick-".concat(y.coordinate)},cr(n.props,y,v)),u&&S.createElement("line",Qt({className:"recharts-polar-angle-axis-tick-line"},h,d)),o&&t.renderTickItem(o,x,c?c(y.value,v):y.value))});return S.createElement(ne,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.radius,o=n.axisLine;return a<=0||!i||!i.length?null:S.createElement(ne,{className:te("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,a){var o;return S.isValidElement(n)?o=S.cloneElement(n,i):X(n)?o=n(i):o=S.createElement(sr,Qt({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])})(N.PureComponent);fo(ho,"displayName","PolarAngleAxis");fo(ho,"axisType","angleAxis");fo(ho,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var nl,Nb;function Pp(){if(Nb)return nl;Nb=1;var e=nw(),t=e(Object.getPrototypeOf,Object);return nl=t,nl}var il,qb;function qR(){if(qb)return il;qb=1;var e=kt(),t=Pp(),r=ft(),n="[object Object]",i=Function.prototype,a=Object.prototype,o=i.toString,u=a.hasOwnProperty,c=o.call(Object);function s(f){if(!r(f)||e(f)!=n)return!1;var l=t(f);if(l===null)return!0;var h=u.call(l,"constructor")&&l.constructor;return typeof h=="function"&&h instanceof h&&o.call(h)==c}return il=s,il}var LR=qR();const BR=ce(LR);var al,Lb;function FR(){if(Lb)return al;Lb=1;var e=kt(),t=ft(),r="[object Boolean]";function n(i){return i===!0||i===!1||t(i)&&e(i)==r}return al=n,al}var UR=FR();const WR=ce(UR);function ci(e){"@babel/helpers - typeof";return ci=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ci(e)}function xa(){return xa=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:h,x:c,y:s},to:{upperWidth:f,lowerWidth:l,height:h,x:c,y:s},duration:v,animationEasing:y,isActive:m},function(w){var O=w.upperWidth,g=w.lowerWidth,b=w.height,_=w.x,A=w.y;return S.createElement(bt,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:d,duration:v,easing:y},S.createElement("path",xa({},K(r,!0),{className:x,d:Wb(_,A,O,g,b),ref:n})))}):S.createElement("g",null,S.createElement("path",xa({},K(r,!0),{className:x,d:Wb(c,s,f,l,h)})))},eD=["option","shapeType","propTransformer","activeClassName","isActive"];function si(e){"@babel/helpers - typeof";return si=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},si(e)}function tD(e,t){if(e==null)return{};var r=rD(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function rD(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function zb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function wa(e){for(var t=1;t0?Xe(w,"paddingAngle",0):0;if(g){var _=Ge(g.endAngle-g.startAngle,w.endAngle-w.startAngle),A=fe(fe({},w),{},{startAngle:x+b,endAngle:x+_(v)+b});d.push(A),x=A.endAngle}else{var P=w.endAngle,j=w.startAngle,T=Ge(0,P-j),E=T(v),M=fe(fe({},w),{},{startAngle:x+b,endAngle:x+E+b});d.push(M),x=M.endAngle}}),S.createElement(ne,null,n.renderSectorsStatically(d))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var u=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[u].focus(),i.setState({sectorToFocus:u});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,a=n.isAnimationActive,o=this.state.prevSectors;return a&&i&&i.length&&(!o||!Oi(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,a=i.hide,o=i.sectors,u=i.className,c=i.label,s=i.cx,f=i.cy,l=i.innerRadius,h=i.outerRadius,p=i.isAnimationActive,y=this.state.isAnimationFinished;if(a||!o||!o.length||!q(s)||!q(f)||!q(l)||!q(h))return null;var v=te("recharts-pie",u);return S.createElement(ne,{tabIndex:this.props.rootTabIndex,className:v,ref:function(m){n.pieRef=m}},this.renderSectors(),c&&this.renderLabels(o),je.renderCallByParent(this.props,null,!1),(!p||y)&&Mt.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n=360?x:x-1)*c,O=d-x*p-w,g=i.reduce(function(A,P){var j=Ae(P,m,0);return A+(q(j)?j:0)},0),b;if(g>0){var _;b=i.map(function(A,P){var j=Ae(A,m,0),T=Ae(A,f,P),E=(q(j)?j:0)/g,M;P?M=_.endAngle+qe(v)*c*(j!==0?1:0):M=o;var I=M+qe(v)*((j!==0?p:0)+E*O),$=(M+I)/2,k=(y.innerRadius+y.outerRadius)/2,R=[{name:T,value:j,payload:A,dataKey:m,type:h}],L=pe(y.cx,y.cy,k,$);return _=fe(fe(fe({percent:E,cornerRadius:a,name:T,tooltipPayload:R,midAngle:$,middleRadius:k,tooltipPosition:L},A),y),{},{value:Ae(A,m),startAngle:M,endAngle:I,payload:A,paddingAngle:qe(v)*c}),_})}return fe(fe({},y),{},{sectors:b,data:i})});var ol,Vb;function AD(){if(Vb)return ol;Vb=1;var e=Math.ceil,t=Math.max;function r(n,i,a,o){for(var u=-1,c=t(e((i-n)/(a||1)),0),s=Array(c);c--;)s[o?c:++u]=n,n+=a;return s}return ol=r,ol}var ul,Xb;function r_(){if(Xb)return ul;Xb=1;var e=Ow(),t=1/0,r=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=e(i),i===t||i===-t){var a=i<0?-1:1;return a*r}return i===i?i:0}return ul=n,ul}var cl,Yb;function SD(){if(Yb)return cl;Yb=1;var e=AD(),t=Ya(),r=r_();function n(i){return function(a,o,u){return u&&typeof u!="number"&&t(a,o,u)&&(o=u=void 0),a=r(a),o===void 0?(o=a,a=0):o=r(o),u=u===void 0?a0&&n.handleDrag(i.changedTouches[0])}),Ke(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,u=i.startIndex;o?.({endIndex:a,startIndex:u})}),n.detachDragEndListener()}),Ke(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Ke(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Ke(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Ke(n,"handleSlideDragStart",function(i){var a=r0(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return ND(t,e),CD(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,u=this.props,c=u.gap,s=u.data,f=s.length-1,l=Math.min(i,a),h=Math.max(i,a),p=t.getIndexInRange(o,l),y=t.getIndexInRange(o,h);return{startIndex:p-p%c,endIndex:y===f?f:y-y%c}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,u=i.dataKey,c=Ae(a[n],u,n);return X(o)?o(c,n):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,u=i.endX,c=this.props,s=c.x,f=c.width,l=c.travellerWidth,h=c.startIndex,p=c.endIndex,y=c.onChange,v=n.pageX-a;v>0?v=Math.min(v,s+f-l-u,s+f-l-o):v<0&&(v=Math.max(v,s-o,s-u));var d=this.getIndex({startX:o+v,endX:u+v});(d.startIndex!==h||d.endIndex!==p)&&y&&y(d),this.setState({startX:o+v,endX:u+v,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=r0(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,u=i.endX,c=i.startX,s=this.state[o],f=this.props,l=f.x,h=f.width,p=f.travellerWidth,y=f.onChange,v=f.gap,d=f.data,m={startX:this.state.startX,endX:this.state.endX},x=n.pageX-a;x>0?x=Math.min(x,l+h-p-s):x<0&&(x=Math.max(x,l-s)),m[o]=s+x;var w=this.getIndex(m),O=w.startIndex,g=w.endIndex,b=function(){var A=d.length-1;return o==="startX"&&(u>c?O%v===0:g%v===0)||uc?g%v===0:O%v===0)||u>c&&g===A};this.setState(Ke(Ke({},o,s+x),"brushMoveStartX",n.pageX),function(){y&&b()&&y(w)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,u=o.scaleValues,c=o.startX,s=o.endX,f=this.state[i],l=u.indexOf(f);if(l!==-1){var h=l+n;if(!(h===-1||h>=u.length)){var p=u[h];i==="startX"&&p>=s||i==="endX"&&p<=c||this.setState(Ke({},i,p),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,u=n.height,c=n.fill,s=n.stroke;return S.createElement("rect",{stroke:s,fill:c,x:i,y:a,width:o,height:u})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,u=n.height,c=n.data,s=n.children,f=n.padding,l=N.Children.only(s);return l?S.cloneElement(l,{x:i,y:a,width:o,height:u,margin:f,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,u=this,c=this.props,s=c.y,f=c.travellerWidth,l=c.height,h=c.traveller,p=c.ariaLabel,y=c.data,v=c.startIndex,d=c.endIndex,m=Math.max(n,this.props.x),x=ll(ll({},K(this.props,!1)),{},{x:m,y:s,width:f,height:l}),w=p||"Min value: ".concat((a=y[v])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=y[d])===null||o===void 0?void 0:o.name);return S.createElement(ne,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(g){["ArrowLeft","ArrowRight"].includes(g.key)&&(g.preventDefault(),g.stopPropagation(),u.handleTravellerMoveKeyboard(g.key==="ArrowRight"?1:-1,i))},onFocus:function(){u.setState({isTravellerFocused:!0})},onBlur:function(){u.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,x))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,u=a.height,c=a.stroke,s=a.travellerWidth,f=Math.min(n,i)+s,l=Math.max(Math.abs(i-n)-s,0);return S.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:f,y:o,width:l,height:u})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,u=n.height,c=n.travellerWidth,s=n.stroke,f=this.state,l=f.startX,h=f.endX,p=5,y={pointerEvents:"none",fill:s};return S.createElement(ne,{className:"recharts-brush-texts"},S.createElement(sr,Aa({textAnchor:"end",verticalAnchor:"middle",x:Math.min(l,h)-p,y:o+u/2},y),this.getTextOfTick(i)),S.createElement(sr,Aa({textAnchor:"start",verticalAnchor:"middle",x:Math.max(l,h)+c+p,y:o+u/2},y),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,u=n.x,c=n.y,s=n.width,f=n.height,l=n.alwaysShowText,h=this.state,p=h.startX,y=h.endX,v=h.isTextActive,d=h.isSlideMoving,m=h.isTravellerMoving,x=h.isTravellerFocused;if(!i||!i.length||!q(u)||!q(c)||!q(s)||!q(f)||s<=0||f<=0)return null;var w=te("recharts-brush",a),O=S.Children.count(o)===1,g=$D("userSelect","none");return S.createElement(ne,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:g},this.renderBackground(),O&&this.renderPanorama(),this.renderSlide(p,y),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(y,"endX"),(v||d||m||x||l)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,u=n.height,c=n.stroke,s=Math.floor(a+u/2)-1;return S.createElement(S.Fragment,null,S.createElement("rect",{x:i,y:a,width:o,height:u,fill:c,stroke:"none"}),S.createElement("line",{x1:i+1,y1:s,x2:i+o-1,y2:s,fill:"none",stroke:"#fff"}),S.createElement("line",{x1:i+1,y1:s+2,x2:i+o-1,y2:s+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return S.isValidElement(n)?a=S.cloneElement(n,i):X(n)?a=n(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,u=n.x,c=n.travellerWidth,s=n.updateId,f=n.startIndex,l=n.endIndex;if(a!==i.prevData||s!==i.prevUpdateId)return ll({prevData:a,prevTravellerWidth:c,prevUpdateId:s,prevX:u,prevWidth:o},a&&a.length?LD({data:a,width:o,x:u,travellerWidth:c,startIndex:f,endIndex:l}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||u!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([u,u+o-c]);var h=i.scale.domain().map(function(p){return i.scale(p)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:s,prevX:u,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,u=a-1;u-o>1;){var c=Math.floor((o+u)/2);n[c]>i?u=c:o=c}return i>=n[u]?u:o}}])})(N.PureComponent);Ke(Hr,"displayName","Brush");Ke(Hr,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var fl,n0;function BD(){if(n0)return fl;n0=1;var e=Yh();function t(r,n){var i;return e(r,function(a,o,u){return i=n(a,o,u),!i}),!!i}return fl=t,fl}var hl,i0;function FD(){if(i0)return hl;i0=1;var e=Yx(),t=xt(),r=BD(),n=Fe(),i=Ya();function a(o,u,c){var s=n(o)?e:r;return c&&i(o,u,c)&&(u=void 0),s(o,t(u,3))}return hl=a,hl}var UD=FD();const WD=ce(UD);var gt=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},pl,a0;function Tp(){if(a0)return pl;a0=1;var e=yw();function t(r,n,i){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return pl=t,pl}var dl,o0;function zD(){if(o0)return dl;o0=1;var e=Tp(),t=pw(),r=xt();function n(i,a){var o={};return a=r(a,3),t(i,function(u,c,s){e(o,c,a(u,c,s))}),o}return dl=n,dl}var KD=zD();const HD=ce(KD);var vl,u0;function GD(){if(u0)return vl;u0=1;function e(t,r){for(var n=-1,i=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function rN(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function nN(e,t){var r=e.x,n=e.y,i=tN(e,ZD),a="".concat(r),o=parseInt(a,10),u="".concat(n),c=parseInt(u,10),s="".concat(t.height||i.height),f=parseInt(s,10),l="".concat(t.width||i.width),h=parseInt(l,10);return An(An(An(An(An({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:f,width:h,name:t.name,radius:t.radius})}function f0(e){return S.createElement(QO,ah({shapeType:"rectangle",propTransformer:nN,activeClassName:"recharts-active-bar"},e))}var iN=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var a=q(n)||D1(n);return a?t(n,i):(a||or(!1),r)}},aN=["value","background"],u_;function Gr(e){"@babel/helpers - typeof";return Gr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gr(e)}function oN(e,t){if(e==null)return{};var r=uN(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function uN(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Pa(){return Pa=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs($)0&&Math.abs(I)0&&(M=Math.min((se||0)-(I[me-1]||0),M))}),Number.isFinite(M)){var $=M/E,k=v.layout==="vertical"?n.height:n.width;if(v.padding==="gap"&&(_=$*k/2),v.padding==="no-gap"){var R=Le(t.barCategoryGap,$*k),L=$*k/2;_=L-R-(L-R)/k*R}}}i==="xAxis"?A=[n.left+(w.left||0)+(_||0),n.left+n.width-(w.right||0)-(_||0)]:i==="yAxis"?A=c==="horizontal"?[n.top+n.height-(w.bottom||0),n.top+(w.top||0)]:[n.top+(w.top||0)+(_||0),n.top+n.height-(w.bottom||0)-(_||0)]:A=v.range,g&&(A=[A[1],A[0]]);var B=$O(v,a,h),z=B.scale,H=B.realScaleType;z.domain(m).range(A),IO(z);var U=CO(z,ot(ot({},v),{},{realScaleType:H}));i==="xAxis"?(T=d==="top"&&!O||d==="bottom"&&O,P=n.left,j=l[b]-T*v.height):i==="yAxis"&&(T=d==="left"&&!O||d==="right"&&O,P=l[b]-T*v.width,j=n.top);var G=ot(ot(ot({},v),U),{},{realScaleType:H,x:P,y:j,scale:z,width:i==="xAxis"?n.width:v.width,height:i==="yAxis"?n.height:v.height});return G.bandSize=la(G,U),!v.hide&&i==="xAxis"?l[b]+=(T?-1:1)*G.height:v.hide||(l[b]+=(T?-1:1)*G.width),ot(ot({},p),{},yo({},y,G))},{})},h_=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},mN=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return h_({x:r,y:n},{x:i,y:a})},p_=(function(){function e(t){vN(this,e),this.scale=t}return yN(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var u=this.bandwidth?this.bandwidth():0;return this.scale(r)+u}default:return this.scale(r)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])})();yo(p_,"EPS",1e-4);var Ep=function(t){var r=Object.keys(t).reduce(function(n,i){return ot(ot({},n),{},yo({},i,p_.create(t[i])))},{});return ot(ot({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,u=a.position;return HD(i,function(c,s){return r[s].apply(c,{bandAware:o,position:u})})},isInRange:function(i){return o_(i,function(a,o){return r[o].isInRange(a)})}})};function bN(e){return(e%180+180)%180}var xN=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=bN(i),o=a*Math.PI/180,u=Math.atan(n/r),c=o>u&&o-1?c[s?a[f]:f]:void 0}}return ml=n,ml}var bl,g0;function ON(){if(g0)return bl;g0=1;var e=r_();function t(r){var n=e(r),i=n%1;return n===n?i?n-i:n:0}return bl=t,bl}var xl,m0;function _N(){if(m0)return xl;m0=1;var e=sw(),t=xt(),r=ON(),n=Math.max;function i(a,o,u){var c=a==null?0:a.length;if(!c)return-1;var s=u==null?0:r(u);return s<0&&(s=n(c+s,0)),e(a,t(o,3),s)}return xl=i,xl}var wl,b0;function AN(){if(b0)return wl;b0=1;var e=wN(),t=_N(),r=e(t);return wl=r,wl}var SN=AN();const PN=ce(SN);var TN=Ax();const EN=ce(TN);var jN=EN(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),jp=N.createContext(void 0),Mp=N.createContext(void 0),d_=N.createContext(void 0),v_=N.createContext({}),y_=N.createContext(void 0),g_=N.createContext(0),m_=N.createContext(0),x0=function(t){var r=t.state,n=r.xAxisMap,i=r.yAxisMap,a=r.offset,o=t.clipPathId,u=t.children,c=t.width,s=t.height,f=jN(a);return S.createElement(jp.Provider,{value:n},S.createElement(Mp.Provider,{value:i},S.createElement(v_.Provider,{value:a},S.createElement(d_.Provider,{value:f},S.createElement(y_.Provider,{value:o},S.createElement(g_.Provider,{value:s},S.createElement(m_.Provider,{value:c},u)))))))},MN=function(){return N.useContext(y_)},b_=function(t){var r=N.useContext(jp);r==null&&or(!1);var n=r[t];return n==null&&or(!1),n},$N=function(){var t=N.useContext(jp);return qt(t)},IN=function(){var t=N.useContext(Mp),r=PN(t,function(n){return o_(n.domain,Number.isFinite)});return r||qt(t)},x_=function(t){var r=N.useContext(Mp);r==null&&or(!1);var n=r[t];return n==null&&or(!1),n},CN=function(){var t=N.useContext(d_);return t},kN=function(){return N.useContext(v_)},$p=function(){return N.useContext(m_)},Ip=function(){return N.useContext(g_)};function Vr(e){"@babel/helpers - typeof";return Vr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vr(e)}function RN(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function DN(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function gq(e,t){return T_(e,t+1)}function mq(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,u=t.end,c=0,s=1,f=o,l=function(){var y=n?.[c];if(y===void 0)return{v:T_(n,s)};var v=c,d,m=function(){return d===void 0&&(d=r(y,v)),d},x=y.coordinate,w=c===0||$a(e,x,m,f,u);w||(c=0,f=o,s+=1),w&&(f=x+e*(m()/2+i),c+=s)},h;s<=a.length;)if(h=l(),h)return h.v;return[]}function di(e){"@babel/helpers - typeof";return di=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},di(e)}function E0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ke(e){for(var t=1;t0?p.coordinate-d*e:p.coordinate})}else a[h]=p=ke(ke({},p),{},{tickCoord:p.coordinate});var m=$a(e,p.tickCoord,v,u,c);m&&(c=p.tickCoord-e*(v()/2+i),a[h]=ke(ke({},p),{},{isShow:!0}))},f=o-1;f>=0;f--)s(f);return a}function _q(e,t,r,n,i,a){var o=(n||[]).slice(),u=o.length,c=t.start,s=t.end;if(a){var f=n[u-1],l=r(f,u-1),h=e*(f.coordinate+e*l/2-s);o[u-1]=f=ke(ke({},f),{},{tickCoord:h>0?f.coordinate-h*e:f.coordinate});var p=$a(e,f.tickCoord,function(){return l},c,s);p&&(s=f.tickCoord-e*(l/2+i),o[u-1]=ke(ke({},f),{},{isShow:!0}))}for(var y=a?u-1:u,v=function(x){var w=o[x],O,g=function(){return O===void 0&&(O=r(w,x)),O};if(x===0){var b=e*(w.coordinate-e*g()/2-c);o[x]=w=ke(ke({},w),{},{tickCoord:b<0?w.coordinate-b*e:w.coordinate})}else o[x]=w=ke(ke({},w),{},{tickCoord:w.coordinate});var _=$a(e,w.tickCoord,g,c,s);_&&(c=w.tickCoord+e*(g()/2+i),o[x]=ke(ke({},w),{},{isShow:!0}))},d=0;d=2?qe(i[1].coordinate-i[0].coordinate):1,m=yq(a,d,p);return c==="equidistantPreserveStart"?mq(d,m,v,i,o):(c==="preserveStart"||c==="preserveStartEnd"?h=_q(d,m,v,i,o,c==="preserveStartEnd"):h=Oq(d,m,v,i,o),h.filter(function(x){return x.isShow}))}var Aq=["viewBox"],Sq=["viewBox"],Pq=["ticks"];function Zr(e){"@babel/helpers - typeof";return Zr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zr(e)}function Pr(){return Pr=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Tq(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Eq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function M0(e,t){for(var r=0;r0?c(this.props):c(p)),o<=0||u<=0||!y||!y.length?null:S.createElement(ne,{className:te("recharts-cartesian-axis",s),ref:function(d){n.layerReference=d}},a&&this.renderAxisLine(),this.renderTicks(y,this.state.fontSize,this.state.letterSpacing),je.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,u=te(i.className,"recharts-cartesian-axis-tick-value");return S.isValidElement(n)?o=S.cloneElement(n,Oe(Oe({},i),{},{className:u})):X(n)?o=n(Oe(Oe({},i),{},{className:u})):o=S.createElement(sr,Pr({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])})(N.Component);Dp(vn,"displayName","CartesianAxis");Dp(vn,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Rq=["x1","y1","x2","y2","key"],Dq=["offset"];function fr(e){"@babel/helpers - typeof";return fr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fr(e)}function $0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Re(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Bq(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Fq=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,i=t.x,a=t.y,o=t.width,u=t.height,c=t.ry;return S.createElement("rect",{x:i,y:a,ry:c,width:o,height:u,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function M_(e,t){var r;if(S.isValidElement(e))r=S.cloneElement(e,t);else if(X(e))r=e(t);else{var n=t.x1,i=t.y1,a=t.x2,o=t.y2,u=t.key,c=I0(t,Rq),s=K(c,!1);s.offset;var f=I0(s,Dq);r=S.createElement("line",nr({},f,{x1:n,y1:i,x2:a,y2:o,fill:"none",key:u}))}return r}function Uq(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,a=e.horizontalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(u,c){var s=Re(Re({},e),{},{x1:t,y1:u,x2:t+r,y2:u,key:"line-".concat(c),index:c});return M_(i,s)});return S.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function Wq(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,a=e.verticalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(u,c){var s=Re(Re({},e),{},{x1:u,y1:t,x2:u,y2:t+r,key:"line-".concat(c),index:c});return M_(i,s)});return S.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function zq(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,a=e.width,o=e.height,u=e.horizontalPoints,c=e.horizontal,s=c===void 0?!0:c;if(!s||!t||!t.length)return null;var f=u.map(function(h){return Math.round(h+i-i)}).sort(function(h,p){return h-p});i!==f[0]&&f.unshift(0);var l=f.map(function(h,p){var y=!f[p+1],v=y?i+o-h:f[p+1]-h;if(v<=0)return null;var d=p%t.length;return S.createElement("rect",{key:"react-".concat(p),y:h,x:n,height:v,width:a,stroke:"none",fill:t[d],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},l)}function Kq(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,a=e.x,o=e.y,u=e.width,c=e.height,s=e.verticalPoints;if(!r||!n||!n.length)return null;var f=s.map(function(h){return Math.round(h+a-a)}).sort(function(h,p){return h-p});a!==f[0]&&f.unshift(0);var l=f.map(function(h,p){var y=!f[p+1],v=y?a+u-h:f[p+1]-h;if(v<=0)return null;var d=p%n.length;return S.createElement("rect",{key:"react-".concat(p),x:h,y:o,width:v,height:c,stroke:"none",fill:n[d],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},l)}var Hq=function(t,r){var n=t.xAxis,i=t.width,a=t.height,o=t.offset;return MO(Rp(Re(Re(Re({},vn.defaultProps),n),{},{ticks:Tt(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,r)},Gq=function(t,r){var n=t.yAxis,i=t.width,a=t.height,o=t.offset;return MO(Rp(Re(Re(Re({},vn.defaultProps),n),{},{ticks:Tt(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,r)},wr={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Vq(e){var t,r,n,i,a,o,u=$p(),c=Ip(),s=kN(),f=Re(Re({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:wr.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:wr.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:wr.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:wr.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:wr.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:wr.verticalFill,x:q(e.x)?e.x:s.left,y:q(e.y)?e.y:s.top,width:q(e.width)?e.width:s.width,height:q(e.height)?e.height:s.height}),l=f.x,h=f.y,p=f.width,y=f.height,v=f.syncWithTicks,d=f.horizontalValues,m=f.verticalValues,x=$N(),w=IN();if(!q(p)||p<=0||!q(y)||y<=0||!q(l)||l!==+l||!q(h)||h!==+h)return null;var O=f.verticalCoordinatesGenerator||Hq,g=f.horizontalCoordinatesGenerator||Gq,b=f.horizontalPoints,_=f.verticalPoints;if((!b||!b.length)&&X(g)){var A=d&&d.length,P=g({yAxis:w?Re(Re({},w),{},{ticks:A?d:w.ticks}):void 0,width:u,height:c,offset:s},A?!0:v);st(Array.isArray(P),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(fr(P),"]")),Array.isArray(P)&&(b=P)}if((!_||!_.length)&&X(O)){var j=m&&m.length,T=O({xAxis:x?Re(Re({},x),{},{ticks:j?m:x.ticks}):void 0,width:u,height:c,offset:s},j?!0:v);st(Array.isArray(T),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(fr(T),"]")),Array.isArray(T)&&(_=T)}return S.createElement("g",{className:"recharts-cartesian-grid"},S.createElement(Fq,{fill:f.fill,fillOpacity:f.fillOpacity,x:f.x,y:f.y,width:f.width,height:f.height,ry:f.ry}),S.createElement(Uq,nr({},f,{offset:s,horizontalPoints:b,xAxis:x,yAxis:w})),S.createElement(Wq,nr({},f,{offset:s,verticalPoints:_,xAxis:x,yAxis:w})),S.createElement(zq,nr({},f,{horizontalPoints:b})),S.createElement(Kq,nr({},f,{verticalPoints:_})))}Vq.displayName="CartesianGrid";var Xq=["type","layout","connectNulls","ref"],Yq=["key"];function Jr(e){"@babel/helpers - typeof";return Jr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jr(e)}function C0(e,t){if(e==null)return{};var r=Zq(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Zq(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Rn(){return Rn=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rl){p=[].concat(Or(c.slice(0,y)),[l-v]);break}var d=p.length%2===0?[0,h]:[h];return[].concat(Or(t.repeat(c,f)),Or(p),d).map(function(m){return"".concat(m,"px")}).join(", ")}),ut(r,"id",un("recharts-line-")),ut(r,"pathRef",function(o){r.mainCurve=o}),ut(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),ut(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return u2(t,e),n2(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,u=a.xAxis,c=a.yAxis,s=a.layout,f=a.children,l=Ye(f,_i);if(!l)return null;var h=function(v,d){return{x:v.x,y:v.y,value:v.value,errorVal:Ae(v.payload,d)}},p={clipPath:n?"url(#clipPath-".concat(i,")"):null};return S.createElement(ne,p,l.map(function(y){return S.cloneElement(y,{key:"bar-".concat(y.props.dataKey),data:o,xAxis:u,yAxis:c,layout:s,dataPointFormatter:h})}))}},{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var u=this.props,c=u.dot,s=u.points,f=u.dataKey,l=K(this.props,!1),h=K(c,!0),p=s.map(function(v,d){var m=ze(ze(ze({key:"dot-".concat(d),r:3},l),h),{},{index:d,cx:v.x,cy:v.y,value:v.value,dataKey:f,payload:v.payload,points:s});return t.renderDotItem(c,m)}),y={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return S.createElement(ne,Rn({className:"recharts-line-dots",key:"dots"},y),p)}},{key:"renderCurveStatically",value:function(n,i,a,o){var u=this.props,c=u.type,s=u.layout,f=u.connectNulls;u.ref;var l=C0(u,Xq),h=ze(ze(ze({},K(l,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},o),{},{type:c,layout:s,connectNulls:f});return S.createElement(pa,Rn({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var a=this,o=this.props,u=o.points,c=o.strokeDasharray,s=o.isAnimationActive,f=o.animationBegin,l=o.animationDuration,h=o.animationEasing,p=o.animationId,y=o.animateNewValues,v=o.width,d=o.height,m=this.state,x=m.prevPoints,w=m.totalLength;return S.createElement(bt,{begin:f,duration:l,isActive:s,easing:h,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(O){var g=O.t;if(x){var b=x.length/u.length,_=u.map(function(E,M){var I=Math.floor(M*b);if(x[I]){var $=x[I],k=Ge($.x,E.x),R=Ge($.y,E.y);return ze(ze({},E),{},{x:k(g),y:R(g)})}if(y){var L=Ge(v*2,E.x),B=Ge(d/2,E.y);return ze(ze({},E),{},{x:L(g),y:B(g)})}return ze(ze({},E),{},{x:E.x,y:E.y})});return a.renderCurveStatically(_,n,i)}var A=Ge(0,w),P=A(g),j;if(c){var T="".concat(c).split(/[,\s]+/gim).map(function(E){return parseFloat(E)});j=a.getStrokeDasharray(P,w,T)}else j=a.generateSimpleStrokeDasharray(w,P);return a.renderCurveStatically(u,n,i,{strokeDasharray:j})})}},{key:"renderCurve",value:function(n,i){var a=this.props,o=a.points,u=a.isAnimationActive,c=this.state,s=c.prevPoints,f=c.totalLength;return u&&o&&o.length&&(!s&&f>0||!Oi(s,o))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(o,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,u=i.points,c=i.className,s=i.xAxis,f=i.yAxis,l=i.top,h=i.left,p=i.width,y=i.height,v=i.isAnimationActive,d=i.id;if(a||!u||!u.length)return null;var m=this.state.isAnimationFinished,x=u.length===1,w=te("recharts-line",c),O=s&&s.allowDataOverflow,g=f&&f.allowDataOverflow,b=O||g,_=J(d)?this.id:d,A=(n=K(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},P=A.r,j=P===void 0?3:P,T=A.strokeWidth,E=T===void 0?2:T,M=V1(o)?o:{},I=M.clipDot,$=I===void 0?!0:I,k=j*2+E;return S.createElement(ne,{className:w},O||g?S.createElement("defs",null,S.createElement("clipPath",{id:"clipPath-".concat(_)},S.createElement("rect",{x:O?h:h-p/2,y:g?l:l-y/2,width:O?p:p*2,height:g?y:y*2})),!$&&S.createElement("clipPath",{id:"clipPath-dots-".concat(_)},S.createElement("rect",{x:h-k/2,y:l-k/2,width:p+k,height:y+k}))):null,!x&&this.renderCurve(b,_),this.renderErrorBar(b,_),(x||o)&&this.renderDots(b,$,_),(!v||m)&&Mt.renderCallByParent(this.props,u))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var a=n.length%2!==0?[].concat(Or(n),[0]):n,o=[],u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Z2(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function J2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Q2(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&q(i)&&q(a)?t.slice(i,a+1):[]};function K_(e){return e==="number"?[0,"auto"]:void 0}var Ah=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,u=Ao(r,t);return n<0||!a||!a.length||n>=u.length?null:a.reduce(function(c,s){var f,l=(f=s.props.data)!==null&&f!==void 0?f:r;l&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(l=l.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var p=l===void 0?u:l;h=Bi(p,o.dataKey,i)}else h=l&&l[n]||u[n];return h?[].concat(rn(c),[RO(s,h)]):c},[])},U0=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=fL(a,n),u=t.orderedTooltipTicks,c=t.tooltipAxis,s=t.tooltipTicks,f=q$(o,u,s,c);if(f>=0&&s){var l=s[f]&&s[f].value,h=Ah(t,r,f,l),p=hL(n,u,f,a);return{activeTooltipIndex:f,activeLabel:l,activePayload:h,activeCoordinate:p}}return null},pL=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,u=r.stackGroups,c=r.dataStartIndex,s=r.dataEndIndex,f=t.layout,l=t.children,h=t.stackOffset,p=jO(f,a);return n.reduce(function(y,v){var d,m=v.type.defaultProps!==void 0?C(C({},v.type.defaultProps),v.props):v.props,x=m.type,w=m.dataKey,O=m.allowDataOverflow,g=m.allowDuplicatedCategory,b=m.scale,_=m.ticks,A=m.includeHidden,P=m[o];if(y[P])return y;var j=Ao(t.data,{graphicalItems:i.filter(function(U){var G,se=o in U.props?U.props[o]:(G=U.type.defaultProps)===null||G===void 0?void 0:G[o];return se===P}),dataStartIndex:c,dataEndIndex:s}),T=j.length,E,M,I;L2(m.domain,O,x)&&(E=qf(m.domain,null,O),p&&(x==="number"||b!=="auto")&&(I=$n(j,w,"category")));var $=K_(x);if(!E||E.length===0){var k,R=(k=m.domain)!==null&&k!==void 0?k:$;if(w){if(E=$n(j,w,x),x==="category"&&p){var L=q1(E);g&&L?(M=E,E=_a(0,T)):g||(E=Bm(R,E,v).reduce(function(U,G){return U.indexOf(G)>=0?U:[].concat(rn(U),[G])},[]))}else if(x==="category")g?E=E.filter(function(U){return U!==""&&!J(U)}):E=Bm(R,E,v).reduce(function(U,G){return U.indexOf(G)>=0||G===""||J(G)?U:[].concat(rn(U),[G])},[]);else if(x==="number"){var B=W$(j,i.filter(function(U){var G,se,me=o in U.props?U.props[o]:(G=U.type.defaultProps)===null||G===void 0?void 0:G[o],De="hide"in U.props?U.props.hide:(se=U.type.defaultProps)===null||se===void 0?void 0:se.hide;return me===P&&(A||!De)}),w,a,f);B&&(E=B)}p&&(x==="number"||b!=="auto")&&(I=$n(j,w,"category"))}else p?E=_a(0,T):u&&u[P]&&u[P].hasStack&&x==="number"?E=h==="expand"?[0,1]:kO(u[P].stackGroups,c,s):E=EO(j,i.filter(function(U){var G=o in U.props?U.props[o]:U.type.defaultProps[o],se="hide"in U.props?U.props.hide:U.type.defaultProps.hide;return G===P&&(A||!se)}),x,f,!0);if(x==="number")E=wh(l,E,P,a,_),R&&(E=qf(R,E,O));else if(x==="category"&&R){var z=R,H=E.every(function(U){return z.indexOf(U)>=0});H&&(E=z)}}return C(C({},y),{},V({},P,C(C({},m),{},{axisType:a,domain:E,categoricalDomain:I,duplicateDomain:M,originalDomain:(d=m.domain)!==null&&d!==void 0?d:$,isCategorical:p,layout:f})))},{})},dL=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,u=r.stackGroups,c=r.dataStartIndex,s=r.dataEndIndex,f=t.layout,l=t.children,h=Ao(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:s}),p=h.length,y=jO(f,a),v=-1;return n.reduce(function(d,m){var x=m.type.defaultProps!==void 0?C(C({},m.type.defaultProps),m.props):m.props,w=x[o],O=K_("number");if(!d[w]){v++;var g;return y?g=_a(0,p):u&&u[w]&&u[w].hasStack?(g=kO(u[w].stackGroups,c,s),g=wh(l,g,w,a)):(g=qf(O,EO(h,n.filter(function(b){var _,A,P=o in b.props?b.props[o]:(_=b.type.defaultProps)===null||_===void 0?void 0:_[o],j="hide"in b.props?b.props.hide:(A=b.type.defaultProps)===null||A===void 0?void 0:A.hide;return P===w&&!j}),"number",f),i.defaultProps.allowDataOverflow),g=wh(l,g,w,a)),C(C({},d),{},V({},w,C(C({axisType:a},i.defaultProps),{},{hide:!0,orientation:Xe(sL,"".concat(a,".").concat(v%2),null),domain:g,originalDomain:O,isCategorical:y,layout:f})))}return d},{})},vL=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,u=r.stackGroups,c=r.dataStartIndex,s=r.dataEndIndex,f=t.children,l="".concat(i,"Id"),h=Ye(f,a),p={};return h&&h.length?p=pL(t,{axes:h,graphicalItems:o,axisType:i,axisIdKey:l,stackGroups:u,dataStartIndex:c,dataEndIndex:s}):o&&o.length&&(p=dL(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:l,stackGroups:u,dataStartIndex:c,dataEndIndex:s})),p},yL=function(t){var r=qt(t),n=Tt(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Zh(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:la(r,n)}},W0=function(t){var r=t.children,n=t.defaultShowTooltip,i=He(r,Hr),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},gL=function(t){return!t||!t.length?!1:t.some(function(r){var n=Et(r&&r.type);return n&&n.indexOf("Bar")>=0})},z0=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},mL=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,u=t.yAxisMap,c=u===void 0?{}:u,s=n.width,f=n.height,l=n.children,h=n.margin||{},p=He(l,Hr),y=He(l,jr),v=Object.keys(c).reduce(function(g,b){var _=c[b],A=_.orientation;return!_.mirror&&!_.hide?C(C({},g),{},V({},A,g[A]+_.width)):g},{left:h.left||0,right:h.right||0}),d=Object.keys(o).reduce(function(g,b){var _=o[b],A=_.orientation;return!_.mirror&&!_.hide?C(C({},g),{},V({},A,Xe(g,"".concat(A))+_.height)):g},{top:h.top||0,bottom:h.bottom||0}),m=C(C({},d),v),x=m.bottom;p&&(m.bottom+=p.props.height||Hr.defaultProps.height),y&&r&&(m=F$(m,i,n,r));var w=s-m.left-m.right,O=f-m.top-m.bottom;return C(C({brushBottom:x},m),{},{width:Math.max(w,0),height:Math.max(O,0)})},bL=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},Np=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,u=o===void 0?["axis"]:o,c=t.axisComponents,s=t.legendContent,f=t.formatAxisMap,l=t.defaultProps,h=function(m,x){var w=x.graphicalItems,O=x.stackGroups,g=x.offset,b=x.updateId,_=x.dataStartIndex,A=x.dataEndIndex,P=m.barSize,j=m.layout,T=m.barGap,E=m.barCategoryGap,M=m.maxBarSize,I=z0(j),$=I.numericAxisName,k=I.cateAxisName,R=gL(w),L=[];return w.forEach(function(B,z){var H=Ao(m.data,{graphicalItems:[B],dataStartIndex:_,dataEndIndex:A}),U=B.type.defaultProps!==void 0?C(C({},B.type.defaultProps),B.props):B.props,G=U.dataKey,se=U.maxBarSize,me=U["".concat($,"Id")],De=U["".concat(k,"Id")],wt={},Ie=c.reduce(function(Ze,Ce){var Te=x["".concat(Ce.axisType,"Map")],Kt=U["".concat(Ce.axisType,"Id")];Te&&Te[Kt]||Ce.axisType==="zAxis"||or(!1);var Ht=Te[Kt];return C(C({},Ze),{},V(V({},Ce.axisType,Ht),"".concat(Ce.axisType,"Ticks"),Tt(Ht)))},wt),F=Ie[k],Q=Ie["".concat(k,"Ticks")],ee=O&&O[me]&&O[me].hasStack&&J$(B,O[me].stackGroups),D=Et(B.type).indexOf("Bar")>=0,ve=la(F,Q),re=[],Y=R&&L$({barSize:P,stackGroups:O,totalSize:bL(Ie,k)});if(D){var ye,Z,Ne=J(se)?M:se,We=(ye=(Z=la(F,Q,!0))!==null&&Z!==void 0?Z:Ne)!==null&&ye!==void 0?ye:0;re=B$({barGap:T,barCategoryGap:E,bandSize:We!==ve?We:ve,sizeList:Y[De],maxBarSize:Ne}),We!==ve&&(re=re.map(function(Ze){return C(C({},Ze),{},{position:C(C({},Ze.position),{},{offset:Ze.position.offset-We/2})})}))}var gr=B&&B.type&&B.type.getComposedData;gr&&L.push({props:C(C({},gr(C(C({},Ie),{},{displayedData:H,props:m,dataKey:G,item:B,bandSize:ve,barPosition:re,offset:g,stackedData:ee,layout:j,dataStartIndex:_,dataEndIndex:A}))),{},V(V(V({key:B.key||"item-".concat(z)},$,Ie[$]),k,Ie[k]),"animationId",b)),childIndex:Z1(B,m.children),item:B})}),L},p=function(m,x){var w=m.props,O=m.dataStartIndex,g=m.dataEndIndex,b=m.updateId;if(!Jd({props:w}))return null;var _=w.children,A=w.layout,P=w.stackOffset,j=w.data,T=w.reverseStackOrder,E=z0(A),M=E.numericAxisName,I=E.cateAxisName,$=Ye(_,n),k=Y$(j,$,"".concat(M,"Id"),"".concat(I,"Id"),P,T),R=c.reduce(function(U,G){var se="".concat(G.axisType,"Map");return C(C({},U),{},V({},se,vL(w,C(C({},G),{},{graphicalItems:$,stackGroups:G.axisType===M&&k,dataStartIndex:O,dataEndIndex:g}))))},{}),L=mL(C(C({},R),{},{props:w,graphicalItems:$}),x?.legendBBox);Object.keys(R).forEach(function(U){R[U]=f(w,R[U],L,U.replace("Map",""),r)});var B=R["".concat(I,"Map")],z=yL(B),H=h(w,C(C({},R),{},{dataStartIndex:O,dataEndIndex:g,updateId:b,graphicalItems:$,stackGroups:k,offset:L}));return C(C({formattedGraphicalItems:H,graphicalItems:$,offset:L,stackGroups:k},z),R)},y=(function(d){function m(x){var w,O,g;return J2(this,m),g=tL(this,m,[x]),V(g,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),V(g,"accessibilityManager",new q2),V(g,"handleLegendBBoxUpdate",function(b){if(b){var _=g.state,A=_.dataStartIndex,P=_.dataEndIndex,j=_.updateId;g.setState(C({legendBBox:b},p({props:g.props,dataStartIndex:A,dataEndIndex:P,updateId:j},C(C({},g.state),{},{legendBBox:b}))))}}),V(g,"handleReceiveSyncEvent",function(b,_,A){if(g.props.syncId===b){if(A===g.eventEmitterSymbol&&typeof g.props.syncMethod!="function")return;g.applySyncEvent(_)}}),V(g,"handleBrushChange",function(b){var _=b.startIndex,A=b.endIndex;if(_!==g.state.dataStartIndex||A!==g.state.dataEndIndex){var P=g.state.updateId;g.setState(function(){return C({dataStartIndex:_,dataEndIndex:A},p({props:g.props,dataStartIndex:_,dataEndIndex:A,updateId:P},g.state))}),g.triggerSyncEvent({dataStartIndex:_,dataEndIndex:A})}}),V(g,"handleMouseEnter",function(b){var _=g.getMouseInfo(b);if(_){var A=C(C({},_),{},{isTooltipActive:!0});g.setState(A),g.triggerSyncEvent(A);var P=g.props.onMouseEnter;X(P)&&P(A,b)}}),V(g,"triggeredAfterMouseMove",function(b){var _=g.getMouseInfo(b),A=_?C(C({},_),{},{isTooltipActive:!0}):{isTooltipActive:!1};g.setState(A),g.triggerSyncEvent(A);var P=g.props.onMouseMove;X(P)&&P(A,b)}),V(g,"handleItemMouseEnter",function(b){g.setState(function(){return{isTooltipActive:!0,activeItem:b,activePayload:b.tooltipPayload,activeCoordinate:b.tooltipPosition||{x:b.cx,y:b.cy}}})}),V(g,"handleItemMouseLeave",function(){g.setState(function(){return{isTooltipActive:!1}})}),V(g,"handleMouseMove",function(b){b.persist(),g.throttleTriggeredAfterMouseMove(b)}),V(g,"handleMouseLeave",function(b){g.throttleTriggeredAfterMouseMove.cancel();var _={isTooltipActive:!1};g.setState(_),g.triggerSyncEvent(_);var A=g.props.onMouseLeave;X(A)&&A(_,b)}),V(g,"handleOuterEvent",function(b){var _=Y1(b),A=Xe(g.props,"".concat(_));if(_&&X(A)){var P,j;/.*touch.*/i.test(_)?j=g.getMouseInfo(b.changedTouches[0]):j=g.getMouseInfo(b),A((P=j)!==null&&P!==void 0?P:{},b)}}),V(g,"handleClick",function(b){var _=g.getMouseInfo(b);if(_){var A=C(C({},_),{},{isTooltipActive:!0});g.setState(A),g.triggerSyncEvent(A);var P=g.props.onClick;X(P)&&P(A,b)}}),V(g,"handleMouseDown",function(b){var _=g.props.onMouseDown;if(X(_)){var A=g.getMouseInfo(b);_(A,b)}}),V(g,"handleMouseUp",function(b){var _=g.props.onMouseUp;if(X(_)){var A=g.getMouseInfo(b);_(A,b)}}),V(g,"handleTouchMove",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&g.throttleTriggeredAfterMouseMove(b.changedTouches[0])}),V(g,"handleTouchStart",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&g.handleMouseDown(b.changedTouches[0])}),V(g,"handleTouchEnd",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&g.handleMouseUp(b.changedTouches[0])}),V(g,"handleDoubleClick",function(b){var _=g.props.onDoubleClick;if(X(_)){var A=g.getMouseInfo(b);_(A,b)}}),V(g,"handleContextMenu",function(b){var _=g.props.onContextMenu;if(X(_)){var A=g.getMouseInfo(b);_(A,b)}}),V(g,"triggerSyncEvent",function(b){g.props.syncId!==void 0&&Al.emit(Sl,g.props.syncId,b,g.eventEmitterSymbol)}),V(g,"applySyncEvent",function(b){var _=g.props,A=_.layout,P=_.syncMethod,j=g.state.updateId,T=b.dataStartIndex,E=b.dataEndIndex;if(b.dataStartIndex!==void 0||b.dataEndIndex!==void 0)g.setState(C({dataStartIndex:T,dataEndIndex:E},p({props:g.props,dataStartIndex:T,dataEndIndex:E,updateId:j},g.state)));else if(b.activeTooltipIndex!==void 0){var M=b.chartX,I=b.chartY,$=b.activeTooltipIndex,k=g.state,R=k.offset,L=k.tooltipTicks;if(!R)return;if(typeof P=="function")$=P(L,b);else if(P==="value"){$=-1;for(var B=0;B=0){var ee,D;if(M.dataKey&&!M.allowDuplicatedCategory){var ve=typeof M.dataKey=="function"?Q:"payload.".concat(M.dataKey.toString());ee=Bi(B,ve,$),D=z&&H&&Bi(H,ve,$)}else ee=B?.[I],D=z&&H&&H[I];if(De||me){var re=b.props.activeIndex!==void 0?b.props.activeIndex:I;return[N.cloneElement(b,C(C(C({},P.props),Ie),{},{activeIndex:re})),null,null]}if(!J(ee))return[F].concat(rn(g.renderActivePoints({item:P,activePoint:ee,basePoint:D,childIndex:I,isRange:z})))}else{var Y,ye=(Y=g.getItemByXY(g.state.activeCoordinate))!==null&&Y!==void 0?Y:{graphicalItem:F},Z=ye.graphicalItem,Ne=Z.item,We=Ne===void 0?b:Ne,gr=Z.childIndex,Ze=C(C(C({},P.props),Ie),{},{activeIndex:gr});return[N.cloneElement(We,Ze),null,null]}return z?[F,null,null]:[F,null]}),V(g,"renderCustomized",function(b,_,A){return N.cloneElement(b,C(C({key:"recharts-customized-".concat(A)},g.props),g.state))}),V(g,"renderMap",{CartesianGrid:{handler:qi,once:!0},ReferenceArea:{handler:g.renderReferenceElement},ReferenceLine:{handler:qi},ReferenceDot:{handler:g.renderReferenceElement},XAxis:{handler:qi},YAxis:{handler:qi},Brush:{handler:g.renderBrush,once:!0},Bar:{handler:g.renderGraphicChild},Line:{handler:g.renderGraphicChild},Area:{handler:g.renderGraphicChild},Radar:{handler:g.renderGraphicChild},RadialBar:{handler:g.renderGraphicChild},Scatter:{handler:g.renderGraphicChild},Pie:{handler:g.renderGraphicChild},Funnel:{handler:g.renderGraphicChild},Tooltip:{handler:g.renderCursor,once:!0},PolarGrid:{handler:g.renderPolarGrid,once:!0},PolarAngleAxis:{handler:g.renderPolarAxis},PolarRadiusAxis:{handler:g.renderPolarAxis},Customized:{handler:g.renderCustomized}}),g.clipPathId="".concat((w=x.id)!==null&&w!==void 0?w:un("recharts"),"-clip"),g.throttleTriggeredAfterMouseMove=_w(g.triggeredAfterMouseMove,(O=x.throttleDelay)!==null&&O!==void 0?O:1e3/60),g.state={},g}return iL(m,d),eL(m,[{key:"componentDidMount",value:function(){var w,O;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(O=this.props.margin.top)!==null&&O!==void 0?O:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,O=w.children,g=w.data,b=w.height,_=w.layout,A=He(O,_t);if(A){var P=A.props.defaultIndex;if(!(typeof P!="number"||P<0||P>this.state.tooltipTicks.length-1)){var j=this.state.tooltipTicks[P]&&this.state.tooltipTicks[P].value,T=Ah(this.state,g,P,j),E=this.state.tooltipTicks[P].coordinate,M=(this.state.offset.top+b)/2,I=_==="horizontal",$=I?{x:E,y:M}:{y:E,x:M},k=this.state.formattedGraphicalItems.find(function(L){var B=L.item;return B.type.name==="Scatter"});k&&($=C(C({},$),k.props.points[P].tooltipPosition),T=k.props.points[P].tooltipPayload);var R={activeTooltipIndex:P,isTooltipActive:!0,activeLabel:j,activePayload:T,activeCoordinate:$};this.setState(R),this.renderCursor(A),this.accessibilityManager.setIndex(P)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,O){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==O.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var g,b;this.accessibilityManager.setDetails({offset:{left:(g=this.props.margin.left)!==null&&g!==void 0?g:0,top:(b=this.props.margin.top)!==null&&b!==void 0?b:0}})}return null}},{key:"componentDidUpdate",value:function(w){af([He(w.children,_t)],[He(this.props.children,_t)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=He(this.props.children,_t);if(w&&typeof w.props.shared=="boolean"){var O=w.props.shared?"axis":"item";return u.indexOf(O)>=0?O:a}return a}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var O=this.container,g=O.getBoundingClientRect(),b=PT(g),_={chartX:Math.round(w.pageX-b.left),chartY:Math.round(w.pageY-b.top)},A=g.width/O.offsetWidth||1,P=this.inRange(_.chartX,_.chartY,A);if(!P)return null;var j=this.state,T=j.xAxisMap,E=j.yAxisMap,M=this.getTooltipEventType(),I=U0(this.state,this.props.data,this.props.layout,P);if(M!=="axis"&&T&&E){var $=qt(T).scale,k=qt(E).scale,R=$&&$.invert?$.invert(_.chartX):null,L=k&&k.invert?k.invert(_.chartY):null;return C(C({},_),{},{xValue:R,yValue:L},I)}return I?C(C({},_),I):null}},{key:"inRange",value:function(w,O){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,b=this.props.layout,_=w/g,A=O/g;if(b==="horizontal"||b==="vertical"){var P=this.state.offset,j=_>=P.left&&_<=P.left+P.width&&A>=P.top&&A<=P.top+P.height;return j?{x:_,y:A}:null}var T=this.state,E=T.angleAxisMap,M=T.radiusAxisMap;if(E&&M){var I=qt(E);return Wm({x:_,y:A},I)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,O=this.getTooltipEventType(),g=He(w,_t),b={};g&&O==="axis"&&(g.props.trigger==="click"?b={onClick:this.handleClick}:b={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var _=Fi(this.props,this.handleOuterEvent);return C(C({},_),b)}},{key:"addListener",value:function(){Al.on(Sl,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Al.removeListener(Sl,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,O,g){for(var b=this.state.formattedGraphicalItems,_=0,A=b.length;_=360?x:x-1)*c,O=d-x*p-w,g=i.reduce(function(A,P){var j=Ae(P,m,0);return A+(q(j)?j:0)},0),b;if(g>0){var _;b=i.map(function(A,P){var j=Ae(A,m,0),T=Ae(A,f,P),E=(q(j)?j:0)/g,M;P?M=_.endAngle+qe(v)*c*(j!==0?1:0):M=o;var I=M+qe(v)*((j!==0?p:0)+E*O),$=(M+I)/2,k=(y.innerRadius+y.outerRadius)/2,R=[{name:T,value:j,payload:A,dataKey:m,type:h}],L=pe(y.cx,y.cy,k,$);return _=fe(fe(fe({percent:E,cornerRadius:a,name:T,tooltipPayload:R,midAngle:$,middleRadius:k,tooltipPosition:L},A),y),{},{value:Ae(A,m),startAngle:M,endAngle:I,payload:A,paddingAngle:qe(v)*c}),_})}return fe(fe({},y),{},{sectors:b,data:i})});var ol,Vb;function _D(){if(Vb)return ol;Vb=1;var e=Math.ceil,t=Math.max;function r(n,i,a,o){for(var u=-1,c=t(e((i-n)/(a||1)),0),s=Array(c);c--;)s[o?c:++u]=n,n+=a;return s}return ol=r,ol}var ul,Xb;function t_(){if(Xb)return ul;Xb=1;var e=ww(),t=1/0,r=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=e(i),i===t||i===-t){var a=i<0?-1:1;return a*r}return i===i?i:0}return ul=n,ul}var cl,Yb;function AD(){if(Yb)return cl;Yb=1;var e=_D(),t=Ya(),r=t_();function n(i){return function(a,o,u){return u&&typeof u!="number"&&t(a,o,u)&&(o=u=void 0),a=r(a),o===void 0?(o=a,a=0):o=r(o),u=u===void 0?a0&&n.handleDrag(i.changedTouches[0])}),Ke(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,u=i.startIndex;o?.({endIndex:a,startIndex:u})}),n.detachDragEndListener()}),Ke(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Ke(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Ke(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Ke(n,"handleSlideDragStart",function(i){var a=r0(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return DD(t,e),ID(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,u=this.props,c=u.gap,s=u.data,f=s.length-1,l=Math.min(i,a),h=Math.max(i,a),p=t.getIndexInRange(o,l),y=t.getIndexInRange(o,h);return{startIndex:p-p%c,endIndex:y===f?f:y-y%c}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,u=i.dataKey,c=Ae(a[n],u,n);return X(o)?o(c,n):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,u=i.endX,c=this.props,s=c.x,f=c.width,l=c.travellerWidth,h=c.startIndex,p=c.endIndex,y=c.onChange,v=n.pageX-a;v>0?v=Math.min(v,s+f-l-u,s+f-l-o):v<0&&(v=Math.max(v,s-o,s-u));var d=this.getIndex({startX:o+v,endX:u+v});(d.startIndex!==h||d.endIndex!==p)&&y&&y(d),this.setState({startX:o+v,endX:u+v,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=r0(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,u=i.endX,c=i.startX,s=this.state[o],f=this.props,l=f.x,h=f.width,p=f.travellerWidth,y=f.onChange,v=f.gap,d=f.data,m={startX:this.state.startX,endX:this.state.endX},x=n.pageX-a;x>0?x=Math.min(x,l+h-p-s):x<0&&(x=Math.max(x,l-s)),m[o]=s+x;var w=this.getIndex(m),O=w.startIndex,g=w.endIndex,b=function(){var A=d.length-1;return o==="startX"&&(u>c?O%v===0:g%v===0)||uc?g%v===0:O%v===0)||u>c&&g===A};this.setState(Ke(Ke({},o,s+x),"brushMoveStartX",n.pageX),function(){y&&b()&&y(w)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,u=o.scaleValues,c=o.startX,s=o.endX,f=this.state[i],l=u.indexOf(f);if(l!==-1){var h=l+n;if(!(h===-1||h>=u.length)){var p=u[h];i==="startX"&&p>=s||i==="endX"&&p<=c||this.setState(Ke({},i,p),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,u=n.height,c=n.fill,s=n.stroke;return S.createElement("rect",{stroke:s,fill:c,x:i,y:a,width:o,height:u})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,u=n.height,c=n.data,s=n.children,f=n.padding,l=N.Children.only(s);return l?S.cloneElement(l,{x:i,y:a,width:o,height:u,margin:f,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,u=this,c=this.props,s=c.y,f=c.travellerWidth,l=c.height,h=c.traveller,p=c.ariaLabel,y=c.data,v=c.startIndex,d=c.endIndex,m=Math.max(n,this.props.x),x=ll(ll({},K(this.props,!1)),{},{x:m,y:s,width:f,height:l}),w=p||"Min value: ".concat((a=y[v])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=y[d])===null||o===void 0?void 0:o.name);return S.createElement(ne,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(g){["ArrowLeft","ArrowRight"].includes(g.key)&&(g.preventDefault(),g.stopPropagation(),u.handleTravellerMoveKeyboard(g.key==="ArrowRight"?1:-1,i))},onFocus:function(){u.setState({isTravellerFocused:!0})},onBlur:function(){u.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,x))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,u=a.height,c=a.stroke,s=a.travellerWidth,f=Math.min(n,i)+s,l=Math.max(Math.abs(i-n)-s,0);return S.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:f,y:o,width:l,height:u})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,u=n.height,c=n.travellerWidth,s=n.stroke,f=this.state,l=f.startX,h=f.endX,p=5,y={pointerEvents:"none",fill:s};return S.createElement(ne,{className:"recharts-brush-texts"},S.createElement(sr,Aa({textAnchor:"end",verticalAnchor:"middle",x:Math.min(l,h)-p,y:o+u/2},y),this.getTextOfTick(i)),S.createElement(sr,Aa({textAnchor:"start",verticalAnchor:"middle",x:Math.max(l,h)+c+p,y:o+u/2},y),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,u=n.x,c=n.y,s=n.width,f=n.height,l=n.alwaysShowText,h=this.state,p=h.startX,y=h.endX,v=h.isTextActive,d=h.isSlideMoving,m=h.isTravellerMoving,x=h.isTravellerFocused;if(!i||!i.length||!q(u)||!q(c)||!q(s)||!q(f)||s<=0||f<=0)return null;var w=te("recharts-brush",a),O=S.Children.count(o)===1,g=MD("userSelect","none");return S.createElement(ne,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:g},this.renderBackground(),O&&this.renderPanorama(),this.renderSlide(p,y),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(y,"endX"),(v||d||m||x||l)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,u=n.height,c=n.stroke,s=Math.floor(a+u/2)-1;return S.createElement(S.Fragment,null,S.createElement("rect",{x:i,y:a,width:o,height:u,fill:c,stroke:"none"}),S.createElement("line",{x1:i+1,y1:s,x2:i+o-1,y2:s,fill:"none",stroke:"#fff"}),S.createElement("line",{x1:i+1,y1:s+2,x2:i+o-1,y2:s+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return S.isValidElement(n)?a=S.cloneElement(n,i):X(n)?a=n(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,u=n.x,c=n.travellerWidth,s=n.updateId,f=n.startIndex,l=n.endIndex;if(a!==i.prevData||s!==i.prevUpdateId)return ll({prevData:a,prevTravellerWidth:c,prevUpdateId:s,prevX:u,prevWidth:o},a&&a.length?qD({data:a,width:o,x:u,travellerWidth:c,startIndex:f,endIndex:l}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||u!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([u,u+o-c]);var h=i.scale.domain().map(function(p){return i.scale(p)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:s,prevX:u,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,u=a-1;u-o>1;){var c=Math.floor((o+u)/2);n[c]>i?u=c:o=c}return i>=n[u]?u:o}}])})(N.PureComponent);Ke(Hr,"displayName","Brush");Ke(Hr,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var fl,n0;function LD(){if(n0)return fl;n0=1;var e=Yh();function t(r,n){var i;return e(r,function(a,o,u){return i=n(a,o,u),!i}),!!i}return fl=t,fl}var hl,i0;function BD(){if(i0)return hl;i0=1;var e=Xx(),t=xt(),r=LD(),n=Fe(),i=Ya();function a(o,u,c){var s=n(o)?e:r;return c&&i(o,u,c)&&(u=void 0),s(o,t(u,3))}return hl=a,hl}var FD=BD();const UD=ce(FD);var gt=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},pl,a0;function Tp(){if(a0)return pl;a0=1;var e=vw();function t(r,n,i){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return pl=t,pl}var dl,o0;function WD(){if(o0)return dl;o0=1;var e=Tp(),t=hw(),r=xt();function n(i,a){var o={};return a=r(a,3),t(i,function(u,c,s){e(o,c,a(u,c,s))}),o}return dl=n,dl}var zD=WD();const KD=ce(zD);var vl,u0;function HD(){if(u0)return vl;u0=1;function e(t,r){for(var n=-1,i=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function tN(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function rN(e,t){var r=e.x,n=e.y,i=eN(e,YD),a="".concat(r),o=parseInt(a,10),u="".concat(n),c=parseInt(u,10),s="".concat(t.height||i.height),f=parseInt(s,10),l="".concat(t.width||i.width),h=parseInt(l,10);return An(An(An(An(An({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:f,width:h,name:t.name,radius:t.radius})}function f0(e){return S.createElement(JO,ah({shapeType:"rectangle",propTransformer:rN,activeClassName:"recharts-active-bar"},e))}var nN=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var a=q(n)||R1(n);return a?t(n,i):(a||or(!1),r)}},iN=["value","background"],o_;function Gr(e){"@babel/helpers - typeof";return Gr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gr(e)}function aN(e,t){if(e==null)return{};var r=oN(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function oN(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Pa(){return Pa=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs($)0&&Math.abs(I)0&&(M=Math.min((se||0)-(I[me-1]||0),M))}),Number.isFinite(M)){var $=M/E,k=v.layout==="vertical"?n.height:n.width;if(v.padding==="gap"&&(_=$*k/2),v.padding==="no-gap"){var R=Le(t.barCategoryGap,$*k),L=$*k/2;_=L-R-(L-R)/k*R}}}i==="xAxis"?A=[n.left+(w.left||0)+(_||0),n.left+n.width-(w.right||0)-(_||0)]:i==="yAxis"?A=c==="horizontal"?[n.top+n.height-(w.bottom||0),n.top+(w.top||0)]:[n.top+(w.top||0)+(_||0),n.top+n.height-(w.bottom||0)-(_||0)]:A=v.range,g&&(A=[A[1],A[0]]);var B=MO(v,a,h),z=B.scale,H=B.realScaleType;z.domain(m).range(A),$O(z);var U=IO(z,ot(ot({},v),{},{realScaleType:H}));i==="xAxis"?(T=d==="top"&&!O||d==="bottom"&&O,P=n.left,j=l[b]-T*v.height):i==="yAxis"&&(T=d==="left"&&!O||d==="right"&&O,P=l[b]-T*v.width,j=n.top);var G=ot(ot(ot({},v),U),{},{realScaleType:H,x:P,y:j,scale:z,width:i==="xAxis"?n.width:v.width,height:i==="yAxis"?n.height:v.height});return G.bandSize=la(G,U),!v.hide&&i==="xAxis"?l[b]+=(T?-1:1)*G.height:v.hide||(l[b]+=(T?-1:1)*G.width),ot(ot({},p),{},yo({},y,G))},{})},f_=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},gN=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return f_({x:r,y:n},{x:i,y:a})},h_=(function(){function e(t){dN(this,e),this.scale=t}return vN(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var u=this.bandwidth?this.bandwidth():0;return this.scale(r)+u}default:return this.scale(r)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])})();yo(h_,"EPS",1e-4);var Ep=function(t){var r=Object.keys(t).reduce(function(n,i){return ot(ot({},n),{},yo({},i,h_.create(t[i])))},{});return ot(ot({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,u=a.position;return KD(i,function(c,s){return r[s].apply(c,{bandAware:o,position:u})})},isInRange:function(i){return a_(i,function(a,o){return r[o].isInRange(a)})}})};function mN(e){return(e%180+180)%180}var bN=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=mN(i),o=a*Math.PI/180,u=Math.atan(n/r),c=o>u&&o-1?c[s?a[f]:f]:void 0}}return ml=n,ml}var bl,g0;function wN(){if(g0)return bl;g0=1;var e=t_();function t(r){var n=e(r),i=n%1;return n===n?i?n-i:n:0}return bl=t,bl}var xl,m0;function ON(){if(m0)return xl;m0=1;var e=cw(),t=xt(),r=wN(),n=Math.max;function i(a,o,u){var c=a==null?0:a.length;if(!c)return-1;var s=u==null?0:r(u);return s<0&&(s=n(c+s,0)),e(a,t(o,3),s)}return xl=i,xl}var wl,b0;function _N(){if(b0)return wl;b0=1;var e=xN(),t=ON(),r=e(t);return wl=r,wl}var AN=_N();const SN=ce(AN);var PN=_x();const TN=ce(PN);var EN=TN(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),jp=N.createContext(void 0),Mp=N.createContext(void 0),p_=N.createContext(void 0),d_=N.createContext({}),v_=N.createContext(void 0),y_=N.createContext(0),g_=N.createContext(0),x0=function(t){var r=t.state,n=r.xAxisMap,i=r.yAxisMap,a=r.offset,o=t.clipPathId,u=t.children,c=t.width,s=t.height,f=EN(a);return S.createElement(jp.Provider,{value:n},S.createElement(Mp.Provider,{value:i},S.createElement(d_.Provider,{value:a},S.createElement(p_.Provider,{value:f},S.createElement(v_.Provider,{value:o},S.createElement(y_.Provider,{value:s},S.createElement(g_.Provider,{value:c},u)))))))},jN=function(){return N.useContext(v_)},m_=function(t){var r=N.useContext(jp);r==null&&or(!1);var n=r[t];return n==null&&or(!1),n},MN=function(){var t=N.useContext(jp);return qt(t)},$N=function(){var t=N.useContext(Mp),r=SN(t,function(n){return a_(n.domain,Number.isFinite)});return r||qt(t)},b_=function(t){var r=N.useContext(Mp);r==null&&or(!1);var n=r[t];return n==null&&or(!1),n},IN=function(){var t=N.useContext(p_);return t},CN=function(){return N.useContext(d_)},$p=function(){return N.useContext(g_)},Ip=function(){return N.useContext(y_)};function Vr(e){"@babel/helpers - typeof";return Vr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vr(e)}function kN(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function RN(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function yq(e,t){return P_(e,t+1)}function gq(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,u=t.end,c=0,s=1,f=o,l=function(){var y=n?.[c];if(y===void 0)return{v:P_(n,s)};var v=c,d,m=function(){return d===void 0&&(d=r(y,v)),d},x=y.coordinate,w=c===0||$a(e,x,m,f,u);w||(c=0,f=o,s+=1),w&&(f=x+e*(m()/2+i),c+=s)},h;s<=a.length;)if(h=l(),h)return h.v;return[]}function di(e){"@babel/helpers - typeof";return di=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},di(e)}function E0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ke(e){for(var t=1;t0?p.coordinate-d*e:p.coordinate})}else a[h]=p=ke(ke({},p),{},{tickCoord:p.coordinate});var m=$a(e,p.tickCoord,v,u,c);m&&(c=p.tickCoord-e*(v()/2+i),a[h]=ke(ke({},p),{},{isShow:!0}))},f=o-1;f>=0;f--)s(f);return a}function Oq(e,t,r,n,i,a){var o=(n||[]).slice(),u=o.length,c=t.start,s=t.end;if(a){var f=n[u-1],l=r(f,u-1),h=e*(f.coordinate+e*l/2-s);o[u-1]=f=ke(ke({},f),{},{tickCoord:h>0?f.coordinate-h*e:f.coordinate});var p=$a(e,f.tickCoord,function(){return l},c,s);p&&(s=f.tickCoord-e*(l/2+i),o[u-1]=ke(ke({},f),{},{isShow:!0}))}for(var y=a?u-1:u,v=function(x){var w=o[x],O,g=function(){return O===void 0&&(O=r(w,x)),O};if(x===0){var b=e*(w.coordinate-e*g()/2-c);o[x]=w=ke(ke({},w),{},{tickCoord:b<0?w.coordinate-b*e:w.coordinate})}else o[x]=w=ke(ke({},w),{},{tickCoord:w.coordinate});var _=$a(e,w.tickCoord,g,c,s);_&&(c=w.tickCoord+e*(g()/2+i),o[x]=ke(ke({},w),{},{isShow:!0}))},d=0;d=2?qe(i[1].coordinate-i[0].coordinate):1,m=vq(a,d,p);return c==="equidistantPreserveStart"?gq(d,m,v,i,o):(c==="preserveStart"||c==="preserveStartEnd"?h=Oq(d,m,v,i,o,c==="preserveStartEnd"):h=wq(d,m,v,i,o),h.filter(function(x){return x.isShow}))}var _q=["viewBox"],Aq=["viewBox"],Sq=["ticks"];function Zr(e){"@babel/helpers - typeof";return Zr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zr(e)}function Pr(){return Pr=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Pq(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Tq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function M0(e,t){for(var r=0;r0?c(this.props):c(p)),o<=0||u<=0||!y||!y.length?null:S.createElement(ne,{className:te("recharts-cartesian-axis",s),ref:function(d){n.layerReference=d}},a&&this.renderAxisLine(),this.renderTicks(y,this.state.fontSize,this.state.letterSpacing),je.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,u=te(i.className,"recharts-cartesian-axis-tick-value");return S.isValidElement(n)?o=S.cloneElement(n,Oe(Oe({},i),{},{className:u})):X(n)?o=n(Oe(Oe({},i),{},{className:u})):o=S.createElement(sr,Pr({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])})(N.Component);Dp(vn,"displayName","CartesianAxis");Dp(vn,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var kq=["x1","y1","x2","y2","key"],Rq=["offset"];function fr(e){"@babel/helpers - typeof";return fr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fr(e)}function $0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Re(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Lq(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Bq=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,i=t.x,a=t.y,o=t.width,u=t.height,c=t.ry;return S.createElement("rect",{x:i,y:a,ry:c,width:o,height:u,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function j_(e,t){var r;if(S.isValidElement(e))r=S.cloneElement(e,t);else if(X(e))r=e(t);else{var n=t.x1,i=t.y1,a=t.x2,o=t.y2,u=t.key,c=I0(t,kq),s=K(c,!1);s.offset;var f=I0(s,Rq);r=S.createElement("line",nr({},f,{x1:n,y1:i,x2:a,y2:o,fill:"none",key:u}))}return r}function Fq(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,a=e.horizontalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(u,c){var s=Re(Re({},e),{},{x1:t,y1:u,x2:t+r,y2:u,key:"line-".concat(c),index:c});return j_(i,s)});return S.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function Uq(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,a=e.verticalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(u,c){var s=Re(Re({},e),{},{x1:u,y1:t,x2:u,y2:t+r,key:"line-".concat(c),index:c});return j_(i,s)});return S.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function Wq(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,a=e.width,o=e.height,u=e.horizontalPoints,c=e.horizontal,s=c===void 0?!0:c;if(!s||!t||!t.length)return null;var f=u.map(function(h){return Math.round(h+i-i)}).sort(function(h,p){return h-p});i!==f[0]&&f.unshift(0);var l=f.map(function(h,p){var y=!f[p+1],v=y?i+o-h:f[p+1]-h;if(v<=0)return null;var d=p%t.length;return S.createElement("rect",{key:"react-".concat(p),y:h,x:n,height:v,width:a,stroke:"none",fill:t[d],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},l)}function zq(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,a=e.x,o=e.y,u=e.width,c=e.height,s=e.verticalPoints;if(!r||!n||!n.length)return null;var f=s.map(function(h){return Math.round(h+a-a)}).sort(function(h,p){return h-p});a!==f[0]&&f.unshift(0);var l=f.map(function(h,p){var y=!f[p+1],v=y?a+u-h:f[p+1]-h;if(v<=0)return null;var d=p%n.length;return S.createElement("rect",{key:"react-".concat(p),x:h,y:o,width:v,height:c,stroke:"none",fill:n[d],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},l)}var Kq=function(t,r){var n=t.xAxis,i=t.width,a=t.height,o=t.offset;return jO(Rp(Re(Re(Re({},vn.defaultProps),n),{},{ticks:Tt(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,r)},Hq=function(t,r){var n=t.yAxis,i=t.width,a=t.height,o=t.offset;return jO(Rp(Re(Re(Re({},vn.defaultProps),n),{},{ticks:Tt(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,r)},wr={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Gq(e){var t,r,n,i,a,o,u=$p(),c=Ip(),s=CN(),f=Re(Re({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:wr.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:wr.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:wr.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:wr.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:wr.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:wr.verticalFill,x:q(e.x)?e.x:s.left,y:q(e.y)?e.y:s.top,width:q(e.width)?e.width:s.width,height:q(e.height)?e.height:s.height}),l=f.x,h=f.y,p=f.width,y=f.height,v=f.syncWithTicks,d=f.horizontalValues,m=f.verticalValues,x=MN(),w=$N();if(!q(p)||p<=0||!q(y)||y<=0||!q(l)||l!==+l||!q(h)||h!==+h)return null;var O=f.verticalCoordinatesGenerator||Kq,g=f.horizontalCoordinatesGenerator||Hq,b=f.horizontalPoints,_=f.verticalPoints;if((!b||!b.length)&&X(g)){var A=d&&d.length,P=g({yAxis:w?Re(Re({},w),{},{ticks:A?d:w.ticks}):void 0,width:u,height:c,offset:s},A?!0:v);st(Array.isArray(P),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(fr(P),"]")),Array.isArray(P)&&(b=P)}if((!_||!_.length)&&X(O)){var j=m&&m.length,T=O({xAxis:x?Re(Re({},x),{},{ticks:j?m:x.ticks}):void 0,width:u,height:c,offset:s},j?!0:v);st(Array.isArray(T),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(fr(T),"]")),Array.isArray(T)&&(_=T)}return S.createElement("g",{className:"recharts-cartesian-grid"},S.createElement(Bq,{fill:f.fill,fillOpacity:f.fillOpacity,x:f.x,y:f.y,width:f.width,height:f.height,ry:f.ry}),S.createElement(Fq,nr({},f,{offset:s,horizontalPoints:b,xAxis:x,yAxis:w})),S.createElement(Uq,nr({},f,{offset:s,verticalPoints:_,xAxis:x,yAxis:w})),S.createElement(Wq,nr({},f,{horizontalPoints:b})),S.createElement(zq,nr({},f,{verticalPoints:_})))}Gq.displayName="CartesianGrid";var Vq=["type","layout","connectNulls","ref"],Xq=["key"];function Jr(e){"@babel/helpers - typeof";return Jr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jr(e)}function C0(e,t){if(e==null)return{};var r=Yq(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Yq(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Rn(){return Rn=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rl){p=[].concat(Or(c.slice(0,y)),[l-v]);break}var d=p.length%2===0?[0,h]:[h];return[].concat(Or(t.repeat(c,f)),Or(p),d).map(function(m){return"".concat(m,"px")}).join(", ")}),ut(r,"id",un("recharts-line-")),ut(r,"pathRef",function(o){r.mainCurve=o}),ut(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),ut(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return o2(t,e),r2(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,u=a.xAxis,c=a.yAxis,s=a.layout,f=a.children,l=Ye(f,_i);if(!l)return null;var h=function(v,d){return{x:v.x,y:v.y,value:v.value,errorVal:Ae(v.payload,d)}},p={clipPath:n?"url(#clipPath-".concat(i,")"):null};return S.createElement(ne,p,l.map(function(y){return S.cloneElement(y,{key:"bar-".concat(y.props.dataKey),data:o,xAxis:u,yAxis:c,layout:s,dataPointFormatter:h})}))}},{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var u=this.props,c=u.dot,s=u.points,f=u.dataKey,l=K(this.props,!1),h=K(c,!0),p=s.map(function(v,d){var m=ze(ze(ze({key:"dot-".concat(d),r:3},l),h),{},{index:d,cx:v.x,cy:v.y,value:v.value,dataKey:f,payload:v.payload,points:s});return t.renderDotItem(c,m)}),y={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return S.createElement(ne,Rn({className:"recharts-line-dots",key:"dots"},y),p)}},{key:"renderCurveStatically",value:function(n,i,a,o){var u=this.props,c=u.type,s=u.layout,f=u.connectNulls;u.ref;var l=C0(u,Vq),h=ze(ze(ze({},K(l,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},o),{},{type:c,layout:s,connectNulls:f});return S.createElement(pa,Rn({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var a=this,o=this.props,u=o.points,c=o.strokeDasharray,s=o.isAnimationActive,f=o.animationBegin,l=o.animationDuration,h=o.animationEasing,p=o.animationId,y=o.animateNewValues,v=o.width,d=o.height,m=this.state,x=m.prevPoints,w=m.totalLength;return S.createElement(bt,{begin:f,duration:l,isActive:s,easing:h,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(O){var g=O.t;if(x){var b=x.length/u.length,_=u.map(function(E,M){var I=Math.floor(M*b);if(x[I]){var $=x[I],k=Ge($.x,E.x),R=Ge($.y,E.y);return ze(ze({},E),{},{x:k(g),y:R(g)})}if(y){var L=Ge(v*2,E.x),B=Ge(d/2,E.y);return ze(ze({},E),{},{x:L(g),y:B(g)})}return ze(ze({},E),{},{x:E.x,y:E.y})});return a.renderCurveStatically(_,n,i)}var A=Ge(0,w),P=A(g),j;if(c){var T="".concat(c).split(/[,\s]+/gim).map(function(E){return parseFloat(E)});j=a.getStrokeDasharray(P,w,T)}else j=a.generateSimpleStrokeDasharray(w,P);return a.renderCurveStatically(u,n,i,{strokeDasharray:j})})}},{key:"renderCurve",value:function(n,i){var a=this.props,o=a.points,u=a.isAnimationActive,c=this.state,s=c.prevPoints,f=c.totalLength;return u&&o&&o.length&&(!s&&f>0||!Oi(s,o))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(o,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,u=i.points,c=i.className,s=i.xAxis,f=i.yAxis,l=i.top,h=i.left,p=i.width,y=i.height,v=i.isAnimationActive,d=i.id;if(a||!u||!u.length)return null;var m=this.state.isAnimationFinished,x=u.length===1,w=te("recharts-line",c),O=s&&s.allowDataOverflow,g=f&&f.allowDataOverflow,b=O||g,_=J(d)?this.id:d,A=(n=K(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},P=A.r,j=P===void 0?3:P,T=A.strokeWidth,E=T===void 0?2:T,M=G1(o)?o:{},I=M.clipDot,$=I===void 0?!0:I,k=j*2+E;return S.createElement(ne,{className:w},O||g?S.createElement("defs",null,S.createElement("clipPath",{id:"clipPath-".concat(_)},S.createElement("rect",{x:O?h:h-p/2,y:g?l:l-y/2,width:O?p:p*2,height:g?y:y*2})),!$&&S.createElement("clipPath",{id:"clipPath-dots-".concat(_)},S.createElement("rect",{x:h-k/2,y:l-k/2,width:p+k,height:y+k}))):null,!x&&this.renderCurve(b,_),this.renderErrorBar(b,_),(x||o)&&this.renderDots(b,$,_),(!v||m)&&Mt.renderCallByParent(this.props,u))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var a=n.length%2!==0?[].concat(Or(n),[0]):n,o=[],u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Y2(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Z2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J2(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&q(i)&&q(a)?t.slice(i,a+1):[]};function z_(e){return e==="number"?[0,"auto"]:void 0}var Ah=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,u=Ao(r,t);return n<0||!a||!a.length||n>=u.length?null:a.reduce(function(c,s){var f,l=(f=s.props.data)!==null&&f!==void 0?f:r;l&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(l=l.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var p=l===void 0?u:l;h=Bi(p,o.dataKey,i)}else h=l&&l[n]||u[n];return h?[].concat(rn(c),[kO(s,h)]):c},[])},U0=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=lL(a,n),u=t.orderedTooltipTicks,c=t.tooltipAxis,s=t.tooltipTicks,f=N$(o,u,s,c);if(f>=0&&s){var l=s[f]&&s[f].value,h=Ah(t,r,f,l),p=fL(n,u,f,a);return{activeTooltipIndex:f,activeLabel:l,activePayload:h,activeCoordinate:p}}return null},hL=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,u=r.stackGroups,c=r.dataStartIndex,s=r.dataEndIndex,f=t.layout,l=t.children,h=t.stackOffset,p=EO(f,a);return n.reduce(function(y,v){var d,m=v.type.defaultProps!==void 0?C(C({},v.type.defaultProps),v.props):v.props,x=m.type,w=m.dataKey,O=m.allowDataOverflow,g=m.allowDuplicatedCategory,b=m.scale,_=m.ticks,A=m.includeHidden,P=m[o];if(y[P])return y;var j=Ao(t.data,{graphicalItems:i.filter(function(U){var G,se=o in U.props?U.props[o]:(G=U.type.defaultProps)===null||G===void 0?void 0:G[o];return se===P}),dataStartIndex:c,dataEndIndex:s}),T=j.length,E,M,I;q2(m.domain,O,x)&&(E=qf(m.domain,null,O),p&&(x==="number"||b!=="auto")&&(I=$n(j,w,"category")));var $=z_(x);if(!E||E.length===0){var k,R=(k=m.domain)!==null&&k!==void 0?k:$;if(w){if(E=$n(j,w,x),x==="category"&&p){var L=N1(E);g&&L?(M=E,E=_a(0,T)):g||(E=Bm(R,E,v).reduce(function(U,G){return U.indexOf(G)>=0?U:[].concat(rn(U),[G])},[]))}else if(x==="category")g?E=E.filter(function(U){return U!==""&&!J(U)}):E=Bm(R,E,v).reduce(function(U,G){return U.indexOf(G)>=0||G===""||J(G)?U:[].concat(rn(U),[G])},[]);else if(x==="number"){var B=U$(j,i.filter(function(U){var G,se,me=o in U.props?U.props[o]:(G=U.type.defaultProps)===null||G===void 0?void 0:G[o],De="hide"in U.props?U.props.hide:(se=U.type.defaultProps)===null||se===void 0?void 0:se.hide;return me===P&&(A||!De)}),w,a,f);B&&(E=B)}p&&(x==="number"||b!=="auto")&&(I=$n(j,w,"category"))}else p?E=_a(0,T):u&&u[P]&&u[P].hasStack&&x==="number"?E=h==="expand"?[0,1]:CO(u[P].stackGroups,c,s):E=TO(j,i.filter(function(U){var G=o in U.props?U.props[o]:U.type.defaultProps[o],se="hide"in U.props?U.props.hide:U.type.defaultProps.hide;return G===P&&(A||!se)}),x,f,!0);if(x==="number")E=wh(l,E,P,a,_),R&&(E=qf(R,E,O));else if(x==="category"&&R){var z=R,H=E.every(function(U){return z.indexOf(U)>=0});H&&(E=z)}}return C(C({},y),{},V({},P,C(C({},m),{},{axisType:a,domain:E,categoricalDomain:I,duplicateDomain:M,originalDomain:(d=m.domain)!==null&&d!==void 0?d:$,isCategorical:p,layout:f})))},{})},pL=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,u=r.stackGroups,c=r.dataStartIndex,s=r.dataEndIndex,f=t.layout,l=t.children,h=Ao(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:s}),p=h.length,y=EO(f,a),v=-1;return n.reduce(function(d,m){var x=m.type.defaultProps!==void 0?C(C({},m.type.defaultProps),m.props):m.props,w=x[o],O=z_("number");if(!d[w]){v++;var g;return y?g=_a(0,p):u&&u[w]&&u[w].hasStack?(g=CO(u[w].stackGroups,c,s),g=wh(l,g,w,a)):(g=qf(O,TO(h,n.filter(function(b){var _,A,P=o in b.props?b.props[o]:(_=b.type.defaultProps)===null||_===void 0?void 0:_[o],j="hide"in b.props?b.props.hide:(A=b.type.defaultProps)===null||A===void 0?void 0:A.hide;return P===w&&!j}),"number",f),i.defaultProps.allowDataOverflow),g=wh(l,g,w,a)),C(C({},d),{},V({},w,C(C({axisType:a},i.defaultProps),{},{hide:!0,orientation:Xe(cL,"".concat(a,".").concat(v%2),null),domain:g,originalDomain:O,isCategorical:y,layout:f})))}return d},{})},dL=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,u=r.stackGroups,c=r.dataStartIndex,s=r.dataEndIndex,f=t.children,l="".concat(i,"Id"),h=Ye(f,a),p={};return h&&h.length?p=hL(t,{axes:h,graphicalItems:o,axisType:i,axisIdKey:l,stackGroups:u,dataStartIndex:c,dataEndIndex:s}):o&&o.length&&(p=pL(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:l,stackGroups:u,dataStartIndex:c,dataEndIndex:s})),p},vL=function(t){var r=qt(t),n=Tt(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Zh(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:la(r,n)}},W0=function(t){var r=t.children,n=t.defaultShowTooltip,i=He(r,Hr),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},yL=function(t){return!t||!t.length?!1:t.some(function(r){var n=Et(r&&r.type);return n&&n.indexOf("Bar")>=0})},z0=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},gL=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,u=t.yAxisMap,c=u===void 0?{}:u,s=n.width,f=n.height,l=n.children,h=n.margin||{},p=He(l,Hr),y=He(l,jr),v=Object.keys(c).reduce(function(g,b){var _=c[b],A=_.orientation;return!_.mirror&&!_.hide?C(C({},g),{},V({},A,g[A]+_.width)):g},{left:h.left||0,right:h.right||0}),d=Object.keys(o).reduce(function(g,b){var _=o[b],A=_.orientation;return!_.mirror&&!_.hide?C(C({},g),{},V({},A,Xe(g,"".concat(A))+_.height)):g},{top:h.top||0,bottom:h.bottom||0}),m=C(C({},d),v),x=m.bottom;p&&(m.bottom+=p.props.height||Hr.defaultProps.height),y&&r&&(m=B$(m,i,n,r));var w=s-m.left-m.right,O=f-m.top-m.bottom;return C(C({brushBottom:x},m),{},{width:Math.max(w,0),height:Math.max(O,0)})},mL=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},Np=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,u=o===void 0?["axis"]:o,c=t.axisComponents,s=t.legendContent,f=t.formatAxisMap,l=t.defaultProps,h=function(m,x){var w=x.graphicalItems,O=x.stackGroups,g=x.offset,b=x.updateId,_=x.dataStartIndex,A=x.dataEndIndex,P=m.barSize,j=m.layout,T=m.barGap,E=m.barCategoryGap,M=m.maxBarSize,I=z0(j),$=I.numericAxisName,k=I.cateAxisName,R=yL(w),L=[];return w.forEach(function(B,z){var H=Ao(m.data,{graphicalItems:[B],dataStartIndex:_,dataEndIndex:A}),U=B.type.defaultProps!==void 0?C(C({},B.type.defaultProps),B.props):B.props,G=U.dataKey,se=U.maxBarSize,me=U["".concat($,"Id")],De=U["".concat(k,"Id")],wt={},Ie=c.reduce(function(Ze,Ce){var Te=x["".concat(Ce.axisType,"Map")],Kt=U["".concat(Ce.axisType,"Id")];Te&&Te[Kt]||Ce.axisType==="zAxis"||or(!1);var Ht=Te[Kt];return C(C({},Ze),{},V(V({},Ce.axisType,Ht),"".concat(Ce.axisType,"Ticks"),Tt(Ht)))},wt),F=Ie[k],Q=Ie["".concat(k,"Ticks")],ee=O&&O[me]&&O[me].hasStack&&Z$(B,O[me].stackGroups),D=Et(B.type).indexOf("Bar")>=0,ve=la(F,Q),re=[],Y=R&&q$({barSize:P,stackGroups:O,totalSize:mL(Ie,k)});if(D){var ye,Z,Ne=J(se)?M:se,We=(ye=(Z=la(F,Q,!0))!==null&&Z!==void 0?Z:Ne)!==null&&ye!==void 0?ye:0;re=L$({barGap:T,barCategoryGap:E,bandSize:We!==ve?We:ve,sizeList:Y[De],maxBarSize:Ne}),We!==ve&&(re=re.map(function(Ze){return C(C({},Ze),{},{position:C(C({},Ze.position),{},{offset:Ze.position.offset-We/2})})}))}var gr=B&&B.type&&B.type.getComposedData;gr&&L.push({props:C(C({},gr(C(C({},Ie),{},{displayedData:H,props:m,dataKey:G,item:B,bandSize:ve,barPosition:re,offset:g,stackedData:ee,layout:j,dataStartIndex:_,dataEndIndex:A}))),{},V(V(V({key:B.key||"item-".concat(z)},$,Ie[$]),k,Ie[k]),"animationId",b)),childIndex:Y1(B,m.children),item:B})}),L},p=function(m,x){var w=m.props,O=m.dataStartIndex,g=m.dataEndIndex,b=m.updateId;if(!Jd({props:w}))return null;var _=w.children,A=w.layout,P=w.stackOffset,j=w.data,T=w.reverseStackOrder,E=z0(A),M=E.numericAxisName,I=E.cateAxisName,$=Ye(_,n),k=X$(j,$,"".concat(M,"Id"),"".concat(I,"Id"),P,T),R=c.reduce(function(U,G){var se="".concat(G.axisType,"Map");return C(C({},U),{},V({},se,dL(w,C(C({},G),{},{graphicalItems:$,stackGroups:G.axisType===M&&k,dataStartIndex:O,dataEndIndex:g}))))},{}),L=gL(C(C({},R),{},{props:w,graphicalItems:$}),x?.legendBBox);Object.keys(R).forEach(function(U){R[U]=f(w,R[U],L,U.replace("Map",""),r)});var B=R["".concat(I,"Map")],z=vL(B),H=h(w,C(C({},R),{},{dataStartIndex:O,dataEndIndex:g,updateId:b,graphicalItems:$,stackGroups:k,offset:L}));return C(C({formattedGraphicalItems:H,graphicalItems:$,offset:L,stackGroups:k},z),R)},y=(function(d){function m(x){var w,O,g;return Z2(this,m),g=eL(this,m,[x]),V(g,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),V(g,"accessibilityManager",new N2),V(g,"handleLegendBBoxUpdate",function(b){if(b){var _=g.state,A=_.dataStartIndex,P=_.dataEndIndex,j=_.updateId;g.setState(C({legendBBox:b},p({props:g.props,dataStartIndex:A,dataEndIndex:P,updateId:j},C(C({},g.state),{},{legendBBox:b}))))}}),V(g,"handleReceiveSyncEvent",function(b,_,A){if(g.props.syncId===b){if(A===g.eventEmitterSymbol&&typeof g.props.syncMethod!="function")return;g.applySyncEvent(_)}}),V(g,"handleBrushChange",function(b){var _=b.startIndex,A=b.endIndex;if(_!==g.state.dataStartIndex||A!==g.state.dataEndIndex){var P=g.state.updateId;g.setState(function(){return C({dataStartIndex:_,dataEndIndex:A},p({props:g.props,dataStartIndex:_,dataEndIndex:A,updateId:P},g.state))}),g.triggerSyncEvent({dataStartIndex:_,dataEndIndex:A})}}),V(g,"handleMouseEnter",function(b){var _=g.getMouseInfo(b);if(_){var A=C(C({},_),{},{isTooltipActive:!0});g.setState(A),g.triggerSyncEvent(A);var P=g.props.onMouseEnter;X(P)&&P(A,b)}}),V(g,"triggeredAfterMouseMove",function(b){var _=g.getMouseInfo(b),A=_?C(C({},_),{},{isTooltipActive:!0}):{isTooltipActive:!1};g.setState(A),g.triggerSyncEvent(A);var P=g.props.onMouseMove;X(P)&&P(A,b)}),V(g,"handleItemMouseEnter",function(b){g.setState(function(){return{isTooltipActive:!0,activeItem:b,activePayload:b.tooltipPayload,activeCoordinate:b.tooltipPosition||{x:b.cx,y:b.cy}}})}),V(g,"handleItemMouseLeave",function(){g.setState(function(){return{isTooltipActive:!1}})}),V(g,"handleMouseMove",function(b){b.persist(),g.throttleTriggeredAfterMouseMove(b)}),V(g,"handleMouseLeave",function(b){g.throttleTriggeredAfterMouseMove.cancel();var _={isTooltipActive:!1};g.setState(_),g.triggerSyncEvent(_);var A=g.props.onMouseLeave;X(A)&&A(_,b)}),V(g,"handleOuterEvent",function(b){var _=X1(b),A=Xe(g.props,"".concat(_));if(_&&X(A)){var P,j;/.*touch.*/i.test(_)?j=g.getMouseInfo(b.changedTouches[0]):j=g.getMouseInfo(b),A((P=j)!==null&&P!==void 0?P:{},b)}}),V(g,"handleClick",function(b){var _=g.getMouseInfo(b);if(_){var A=C(C({},_),{},{isTooltipActive:!0});g.setState(A),g.triggerSyncEvent(A);var P=g.props.onClick;X(P)&&P(A,b)}}),V(g,"handleMouseDown",function(b){var _=g.props.onMouseDown;if(X(_)){var A=g.getMouseInfo(b);_(A,b)}}),V(g,"handleMouseUp",function(b){var _=g.props.onMouseUp;if(X(_)){var A=g.getMouseInfo(b);_(A,b)}}),V(g,"handleTouchMove",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&g.throttleTriggeredAfterMouseMove(b.changedTouches[0])}),V(g,"handleTouchStart",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&g.handleMouseDown(b.changedTouches[0])}),V(g,"handleTouchEnd",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&g.handleMouseUp(b.changedTouches[0])}),V(g,"handleDoubleClick",function(b){var _=g.props.onDoubleClick;if(X(_)){var A=g.getMouseInfo(b);_(A,b)}}),V(g,"handleContextMenu",function(b){var _=g.props.onContextMenu;if(X(_)){var A=g.getMouseInfo(b);_(A,b)}}),V(g,"triggerSyncEvent",function(b){g.props.syncId!==void 0&&Al.emit(Sl,g.props.syncId,b,g.eventEmitterSymbol)}),V(g,"applySyncEvent",function(b){var _=g.props,A=_.layout,P=_.syncMethod,j=g.state.updateId,T=b.dataStartIndex,E=b.dataEndIndex;if(b.dataStartIndex!==void 0||b.dataEndIndex!==void 0)g.setState(C({dataStartIndex:T,dataEndIndex:E},p({props:g.props,dataStartIndex:T,dataEndIndex:E,updateId:j},g.state)));else if(b.activeTooltipIndex!==void 0){var M=b.chartX,I=b.chartY,$=b.activeTooltipIndex,k=g.state,R=k.offset,L=k.tooltipTicks;if(!R)return;if(typeof P=="function")$=P(L,b);else if(P==="value"){$=-1;for(var B=0;B=0){var ee,D;if(M.dataKey&&!M.allowDuplicatedCategory){var ve=typeof M.dataKey=="function"?Q:"payload.".concat(M.dataKey.toString());ee=Bi(B,ve,$),D=z&&H&&Bi(H,ve,$)}else ee=B?.[I],D=z&&H&&H[I];if(De||me){var re=b.props.activeIndex!==void 0?b.props.activeIndex:I;return[N.cloneElement(b,C(C(C({},P.props),Ie),{},{activeIndex:re})),null,null]}if(!J(ee))return[F].concat(rn(g.renderActivePoints({item:P,activePoint:ee,basePoint:D,childIndex:I,isRange:z})))}else{var Y,ye=(Y=g.getItemByXY(g.state.activeCoordinate))!==null&&Y!==void 0?Y:{graphicalItem:F},Z=ye.graphicalItem,Ne=Z.item,We=Ne===void 0?b:Ne,gr=Z.childIndex,Ze=C(C(C({},P.props),Ie),{},{activeIndex:gr});return[N.cloneElement(We,Ze),null,null]}return z?[F,null,null]:[F,null]}),V(g,"renderCustomized",function(b,_,A){return N.cloneElement(b,C(C({key:"recharts-customized-".concat(A)},g.props),g.state))}),V(g,"renderMap",{CartesianGrid:{handler:qi,once:!0},ReferenceArea:{handler:g.renderReferenceElement},ReferenceLine:{handler:qi},ReferenceDot:{handler:g.renderReferenceElement},XAxis:{handler:qi},YAxis:{handler:qi},Brush:{handler:g.renderBrush,once:!0},Bar:{handler:g.renderGraphicChild},Line:{handler:g.renderGraphicChild},Area:{handler:g.renderGraphicChild},Radar:{handler:g.renderGraphicChild},RadialBar:{handler:g.renderGraphicChild},Scatter:{handler:g.renderGraphicChild},Pie:{handler:g.renderGraphicChild},Funnel:{handler:g.renderGraphicChild},Tooltip:{handler:g.renderCursor,once:!0},PolarGrid:{handler:g.renderPolarGrid,once:!0},PolarAngleAxis:{handler:g.renderPolarAxis},PolarRadiusAxis:{handler:g.renderPolarAxis},Customized:{handler:g.renderCustomized}}),g.clipPathId="".concat((w=x.id)!==null&&w!==void 0?w:un("recharts"),"-clip"),g.throttleTriggeredAfterMouseMove=Ow(g.triggeredAfterMouseMove,(O=x.throttleDelay)!==null&&O!==void 0?O:1e3/60),g.state={},g}return nL(m,d),Q2(m,[{key:"componentDidMount",value:function(){var w,O;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(O=this.props.margin.top)!==null&&O!==void 0?O:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,O=w.children,g=w.data,b=w.height,_=w.layout,A=He(O,_t);if(A){var P=A.props.defaultIndex;if(!(typeof P!="number"||P<0||P>this.state.tooltipTicks.length-1)){var j=this.state.tooltipTicks[P]&&this.state.tooltipTicks[P].value,T=Ah(this.state,g,P,j),E=this.state.tooltipTicks[P].coordinate,M=(this.state.offset.top+b)/2,I=_==="horizontal",$=I?{x:E,y:M}:{y:E,x:M},k=this.state.formattedGraphicalItems.find(function(L){var B=L.item;return B.type.name==="Scatter"});k&&($=C(C({},$),k.props.points[P].tooltipPosition),T=k.props.points[P].tooltipPayload);var R={activeTooltipIndex:P,isTooltipActive:!0,activeLabel:j,activePayload:T,activeCoordinate:$};this.setState(R),this.renderCursor(A),this.accessibilityManager.setIndex(P)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,O){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==O.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var g,b;this.accessibilityManager.setDetails({offset:{left:(g=this.props.margin.left)!==null&&g!==void 0?g:0,top:(b=this.props.margin.top)!==null&&b!==void 0?b:0}})}return null}},{key:"componentDidUpdate",value:function(w){af([He(w.children,_t)],[He(this.props.children,_t)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=He(this.props.children,_t);if(w&&typeof w.props.shared=="boolean"){var O=w.props.shared?"axis":"item";return u.indexOf(O)>=0?O:a}return a}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var O=this.container,g=O.getBoundingClientRect(),b=ST(g),_={chartX:Math.round(w.pageX-b.left),chartY:Math.round(w.pageY-b.top)},A=g.width/O.offsetWidth||1,P=this.inRange(_.chartX,_.chartY,A);if(!P)return null;var j=this.state,T=j.xAxisMap,E=j.yAxisMap,M=this.getTooltipEventType(),I=U0(this.state,this.props.data,this.props.layout,P);if(M!=="axis"&&T&&E){var $=qt(T).scale,k=qt(E).scale,R=$&&$.invert?$.invert(_.chartX):null,L=k&&k.invert?k.invert(_.chartY):null;return C(C({},_),{},{xValue:R,yValue:L},I)}return I?C(C({},_),I):null}},{key:"inRange",value:function(w,O){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,b=this.props.layout,_=w/g,A=O/g;if(b==="horizontal"||b==="vertical"){var P=this.state.offset,j=_>=P.left&&_<=P.left+P.width&&A>=P.top&&A<=P.top+P.height;return j?{x:_,y:A}:null}var T=this.state,E=T.angleAxisMap,M=T.radiusAxisMap;if(E&&M){var I=qt(E);return Wm({x:_,y:A},I)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,O=this.getTooltipEventType(),g=He(w,_t),b={};g&&O==="axis"&&(g.props.trigger==="click"?b={onClick:this.handleClick}:b={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var _=Fi(this.props,this.handleOuterEvent);return C(C({},_),b)}},{key:"addListener",value:function(){Al.on(Sl,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Al.removeListener(Sl,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,O,g){for(var b=this.state.formattedGraphicalItems,_=0,A=b.length;_{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e>1;if(n=yh[i])e=i+1;else return!0;if(e==t)return!1}}function al(n){return n>=127462&&n<=127487}const hl=8205;function Nu(n,e,t=!0,i=!0){return(t?bh:Xu)(n,e,i)}function bh(n,e,t){if(e==n.length)return e;e&&Sh(n.charCodeAt(e))&&xh(n.charCodeAt(e-1))&&e--;let i=zs(n,e);for(e+=cl(i);e=0&&al(zs(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Xu(n,e,t){for(;e>0;){let i=bh(n,e-2,t);if(i=56320&&n<57344}function xh(n){return n>=55296&&n<56320}function cl(n){return n<65536?1:2}class V{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=li(this,e,t);let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),Ze.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=li(this,e,t);let i=[];return this.decompose(e,t,i,0),Ze.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new Ai(this),r=new Ai(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new Ai(this,e)}iterRange(e,t=this.length){return new kh(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new wh(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?V.empty:e.length<=32?new K(e):Ze.from(K.split(e,[]))}}class K extends V{constructor(e,t=Fu(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new _u(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new K(fl(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=Xn(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new K(l,o.length+r.length));else{let a=l.length>>1;i.push(new K(l.slice(0,a)),new K(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof K))return super.replace(e,t,i);[e,t]=li(this,e,t);let s=Xn(this.text,Xn(i.text,fl(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new K(s,r):Ze.from(K.split(s,[]),r)}sliceString(e,t=this.length,i=` +`){[e,t]=li(this,e,t);let s="";for(let r=0,o=0;r<=t&&oe&&o&&(s+=i),er&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new K(i,s)),i=[],s=-1);return s>-1&&t.push(new K(i,s)),t}}class Ze extends V{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=a+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r=o){let h=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if([e,t]=li(this,e,t),i.lines=r&&t<=l){let a=o.replace(e-r,t-r,i),h=this.lines-o.lines+a.lines;if(a.lines>4&&a.lines>h>>6){let c=this.children.slice();return c[s]=a,new Ze(c,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=` +`){[e,t]=li(this,e,t);let s="";for(let r=0,o=0;re&&r&&(s+=i),eo&&(s+=l.sliceString(e-o,t-o,i)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Ze))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let a=this.children[s],h=e.children[r];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new K(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof Ze)for(let m of d.children)f(m);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof K&&a&&(p=c[c.length-1])instanceof K&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new K(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:Ze.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new Ze(l,t)}}V.empty=new K([""],0);function Fu(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Xn(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r=t&&(a>i&&(l=l.slice(0,i-s)),s0?1:(e instanceof K?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof K?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=` +`,this;e--}else if(s instanceof K){let a=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof K?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class kh{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new Ai(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class wh{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(V.prototype[Symbol.iterator]=function(){return this.iter()},Ai.prototype[Symbol.iterator]=kh.prototype[Symbol.iterator]=wh.prototype[Symbol.iterator]=function(){return this});class _u{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}function li(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function pe(n,e,t=!0,i=!0){return Nu(n,e,t,i)}function Uu(n){return n>=56320&&n<57344}function Hu(n){return n>=55296&&n<56320}function Te(n,e){let t=n.charCodeAt(e);if(!Hu(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return Uu(i)?(t-55296<<10)+(i-56320)+65536:t}function bo(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Ye(n){return n<65536?1:2}const kr=/\r\n?|\n/;var de=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(de||(de={}));class it{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-s);r+=l}else{if(i!=de.Simple&&h>=e&&(i==de.TrackDel&&se||i==de.TrackBefore&&se))return null;if(h>e||h==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i=0&&s<=t&&l>=e)return st?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new it(e)}static create(e){return new it(e)}}class se extends it{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return wr(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return vr(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;i.length0&&kt(i,t,r.text),r.forward(c),l+=c}let h=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,i){let s=[],r=[],o=0,l=null;function a(c=!1){if(!c&&!s.length)return;ou||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d=="string"?V.of(d.split(i||kr)):d:V.empty,m=p.length;if(f==u&&m==0)return;fo&&Oe(s,f-o,-1),Oe(s,u-f,m),kt(r,s,p),o=u}}return h(e),a(!l),l}static empty(e){return new se(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let s=0;sl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length=0&&t<=0&&t==n[s+1]?n[s]+=e:s>=0&&e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function kt(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(s,h,r,c,f),s=h,r=c}}}function vr(n,e,t,i=!1){let s=[],r=i?[]:null,o=new Bi(n),l=new Bi(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);Oe(s,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||i.length>h),r.forward2(a),o.forward(a)}}}}class Bi{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?V.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?V.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Wt{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new Wt(i,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return b.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return b.range(this.anchor,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return b.range(e.anchor,e.head)}static create(e,t,i){return new Wt(e,t,i)}}class b{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:b.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;ie.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new b(e.ranges.map(t=>Wt.fromJSON(t)),e.main)}static single(e,t=e){return new b([b.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;se?8:0)|r)}static normalized(e,t=0){let i=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(i);for(let s=1;sr.head?b.range(a,l):b.range(l,a))}}return new b(e,t)}}function Th(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let So=0;class A{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=So++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(e={}){return new A(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:xo),!!e.static,e.enables)}of(e){return new Fn([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Fn(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Fn(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function xo(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class Fn{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=So++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:(((t=e[f.id])!==null&&t!==void 0?t:1)&1)==0&&c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||Tr(f,c)){let d=i(f);if(l?!ul(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let m=ns(u,p);if(this.dependencies.every(g=>g instanceof A?u.facet(g)===f.facet(g):g instanceof he?u.field(g,!1)==f.field(g,!1):!0)||(l?ul(d=i(f),m,s):s(d=i(f),m)))return f.values[o]=m,0}else d=i(f);return f.values[o]=d,1}}}}function ul(n,e,t){if(n.length!=e.length)return!1;for(let i=0;in[a.id]),s=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let h=[];for(let c=0;ci===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(On).find(i=>i.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,s)=>{let r=i.facet(On),o=s.facet(On),l;return(l=r.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(i.values[t]=l.create(i),1):s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}}init(e){return[this,On.of({field:this,create:e})]}get extension(){return this}}const $t={lowest:4,low:3,default:2,high:1,highest:0};function Si(n){return e=>new Ch(e,n)}const Mt={highest:Si($t.highest),high:Si($t.high),default:Si($t.default),low:Si($t.low),lowest:Si($t.lowest)};class Ch{constructor(e,t){this.inner=e,this.prec=t}}class vs{of(e){return new Cr(this,e)}reconfigure(e){return vs.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Cr{constructor(e,t){this.compartment=e,this.inner=t}}class is{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let s=[],r=Object.create(null),o=new Map;for(let u of Gu(e,t,o))u instanceof he?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of s)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i?.config.facets;for(let u in r){let d=r[u],p=d[0].facet,m=c&&c[u]||[];if(d.every(g=>g.type==0))if(l[p.id]=a.length<<1|1,xo(m,d))a.push(i.facet(p));else{let g=p.combine(d.map(y=>y.value));a.push(i&&p.compare(g,i.facet(p))?i.facet(p):g)}else{for(let g of d)g.type==0?(l[g.id]=a.length<<1|1,a.push(g.value)):(l[g.id]=h.length<<1,h.push(y=>g.dynamicSlot(y)));l[p.id]=h.length<<1,h.push(g=>ju(g,p,d))}}let f=h.map(u=>u(l));return new is(e,o,f,l,a,r)}}function Gu(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof Cr&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof Cr){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),r(h,l)}else if(o instanceof Ch)r(o.inner,o.prec);else if(o instanceof he)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof Fn)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,$t.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,l)}}return r(n,$t.default),i.reduce((o,l)=>o.concat(l))}function Mi(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function ns(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const Ph=A.define(),Pr=A.define({combine:n=>n.some(e=>e),static:!0}),Qh=A.define({combine:n=>n.length?n[0]:void 0,static:!0}),Ah=A.define(),Mh=A.define(),Rh=A.define(),Dh=A.define({combine:n=>n.length?n[0]:!1});class st{constructor(e,t){this.type=e,this.value=t}static define(){return new Zu}}class Zu{of(e){return new st(this,e)}}class Yu{constructor(e){this.map=e}of(e){return new q(this,e)}}class q{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new q(this.type,t)}is(e){return this.type==e}static define(e={}){return new Yu(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}}q.reconfigure=q.define();q.appendConfig=q.define();class ie{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&Th(i,t.newLength),r.some(l=>l.type==ie.time)||(this.annotations=r.concat(ie.time.of(Date.now())))}static create(e,t,i,s,r,o){return new ie(e,t,i,s,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(ie.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}ie.time=st.define();ie.userEvent=st.define();ie.addToHistory=st.define();ie.remote=st.define();function Ku(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i=n[i]))r=n[i++],o=n[i++];else if(s=0;s--){let r=i[s](n);r instanceof ie?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof ie?n=r[0]:n=qh(e,ti(r),!1)}return n}function ed(n){let e=n.startState,t=e.facet(Rh),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=Eh(i,Qr(e,r,n.changes.newLength),!0))}return i==n?n:ie.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const td=[];function ti(n){return n==null?td:Array.isArray(n)?n:[n]}var Y=(function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n})(Y||(Y={}));const id=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Ar;try{Ar=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function nd(n){if(Ar)return Ar.test(n);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||id.test(t)))return!0}return!1}function sd(n){return e=>{if(!/\S/.test(e))return Y.Space;if(nd(e))return Y.Word;for(let t=0;t-1)return Y.Word;return Y.Other}}class I{constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ls.set(h,a)),t=null),s.set(l.value.compartment,l.value.extension)):l.is(q.reconfigure)?(t=null,i=l.value):l.is(q.appendConfig)&&(t=null,i=ti(i).concat(l.value));let r;t?r=e.startState.values.slice():(t=is.resolve(i,s,this),r=new I(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,h)=>h.reconfigure(a,this),null).values);let o=e.startState.facet(Pr)?e.newSelection:e.newSelection.asSingle();new I(t,e.newDoc,o,r,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:b.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=ti(i.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return I.create({doc:e.doc,selection:b.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=is.resolve(e.extensions||[],new Map),i=e.doc instanceof V?e.doc:V.of((e.doc||"").split(t.staticFacet(I.lineSeparator)||kr)),s=e.selection?e.selection instanceof b?e.selection:b.single(e.selection.anchor,e.selection.head):b.single(0);return Th(s,i.length),t.staticFacet(Pr)||(s=s.asSingle()),new I(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(I.tabSize)}get lineBreak(){return this.facet(I.lineSeparator)||` +`}get readOnly(){return this.facet(Dh)}phrase(e,...t){for(let i of this.facet(I.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let s=[];for(let r of this.facet(Ph))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return sd(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=pe(t,o,!1);if(r(t.slice(a,o))!=Y.Word)break;o=a}for(;ln.length?n[0]:4});I.lineSeparator=Qh;I.readOnly=Dh;I.phrases=A.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(s=>n[s]==e[s])}});I.languageData=Ph;I.changeFilter=Ah;I.transactionFilter=Mh;I.transactionExtender=Rh;vs.reconfigure=q.define();function rt(n,e,t={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))i[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class Nt{eq(e){return this==e}range(e,t=e){return Mr.create(e,t,this)}}Nt.prototype.startSide=Nt.prototype.endSide=0;Nt.prototype.point=!1;Nt.prototype.mapMode=de.TrackDel;let Mr=class $h{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new $h(e,t,i)}};function Rr(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class ko{constructor(e,t,i,s){this.from=e,this.to=t,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let a=o+l>>1,h=r[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return h>=0?o:l;h>=0?l=a:o=a+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);rd||u==d&&h.startSide>0&&h.endSide<=0)continue;(d-u||h.endSide-h.startSide)<0||(o<0&&(o=u),h.point&&(l=Math.max(l,d-u)),i.push(h),s.push(u-o),r.push(d-o))}return{mapped:i.length?new ko(s,r,i,l):null,pos:o}}}class N{constructor(e,t,i,s){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=s}static create(e,t,i,s){return new N(e,t,i,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(Rr)),this.isEmpty)return t.length?N.of(t):this;let l=new Bh(this,null,-1).goto(0),a=0,h=[],c=new gt;for(;l.value||a=0){let f=t[a++];c.addInner(f.from,f.to,f.value)||h.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&e<=r+o.length&&o.between(r,e-r,t-r,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return Wi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Wi.from(e).goto(t)}static compare(e,t,i,s,r=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=dl(o,l,i),h=new xi(o,a,r),c=new xi(l,a,r);i.iterGaps((f,u,d)=>pl(h,f,c,u,d,s)),i.empty&&i.length==0&&pl(h,0,c,0,0,s)}static eq(e,t,i=0,s){s==null&&(s=999999999);let r=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),o=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=dl(r,o),a=new xi(r,l,0).goto(i),h=new xi(o,l,0).goto(i);for(;;){if(a.to!=h.to||!Dr(a.active,h.active)||a.point&&(!h.point||!a.point.eq(h.point)))return!1;if(a.to>s)return!0;a.next(),h.next()}}static spans(e,t,i,s,r=-1){let o=new xi(e,null,r).goto(t),l=t,a=o.openStart;for(;;){let h=Math.min(o.to,i);if(o.point){let c=o.activeForPoint(o.to),f=o.pointFroml&&(s.span(l,h,o.active,a),a=o.openEnd(h));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(e,t=!1){let i=new gt;for(let s of e instanceof Mr?[e]:t?rd(e):e)i.add(s.from,s.to,s.value);return i.finish()}static join(e){if(!e.length)return N.empty;let t=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let s=e[i];s!=N.empty;s=s.nextLayer)t=new N(s.chunkPos,s.chunk,t,Math.max(s.maxPoint,t.maxPoint));return t}}N.empty=new N([],[],null,-1);function rd(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(Rr);e=i}return n}N.empty.nextLayer=N.empty;class gt{finishChunk(e){this.chunks.push(new ko(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new gt)).add(e,t,i)}addInner(e,t,i){let s=e-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(N.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=N.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function dl(n,e,t){let i=new Map;for(let r of n)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&s.push(new Bh(o,t,i,r));return s.length==1?s[0]:new Wi(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)Is(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)Is(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Is(this.heap,0)}}}function Is(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let s=n[i];if(i+1=0&&(s=n[i+1],i++),t.compare(s)<0)break;n[i]=t,n[e]=s,e=i}}class xi{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Wi.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){yn(this.active,e),yn(this.activeTo,e),yn(this.activeRank,e),this.minActive=ml(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:s,rank:r}=this.cursor;for(;t0;)t++;bn(this.active,t,i),bn(this.activeTo,t,s),bn(this.activeRank,t,r),e&&bn(e,t,this.cursor.from),this.minActive=ml(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let s=this.minActive;if(s>-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),i&&yn(i,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&i[s]=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function pl(n,e,t,i,s,r){n.goto(e),t.goto(i);let o=i+s,l=i,a=i-e;for(;;){let h=n.to+a-t.to,c=h||n.endSide-t.endSide,f=c<0?n.to+a:t.to,u=Math.min(f,o);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&Dr(n.activeForPoint(n.to),t.activeForPoint(t.to))||r.comparePoint(l,u,n.point,t.point):u>l&&!Dr(n.active,t.active)&&r.compareRange(l,u,n.active,t.active),f>o)break;(h||n.openEnd!=t.openEnd)&&r.boundChange&&r.boundChange(f),l=f,c<=0&&n.next(),c>=0&&t.next()}}function Dr(n,e){if(n.length!=e.length)return!1;for(let t=0;t=e;i--)n[i+1]=n[i];n[e]=t}function ml(n,e){let t=-1,i=1e9;for(let s=0;s=e)return s;if(s==n.length)break;r+=n.charCodeAt(s)==9?t-r%t:1,s=pe(n,s)}return i===!0?-1:n.length}const qr="ͼ",gl=typeof Symbol>"u"?"__"+qr:Symbol.for(qr),$r=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Ol=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Tt{constructor(e,t){this.rules=[];let{finish:i}=t||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,h){let c=[],f=/^@(\w+)\b/.exec(o[0]),u=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))r(d.split(/,\s*/).map(m=>o.map(g=>m.replace(/&/,g))).reduce((m,g)=>m.concat(g)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(s(d),p,c,u)}else p!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(c.length||u)&&a.push((i&&!f&&!h?o.map(i):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in e)r(s(o),e[o],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=Ol[gl]||1;return Ol[gl]=e+1,qr+e.toString(36)}static mount(e,t,i){let s=e[$r],r=i&&i.nonce;s?r&&s.setNonce(r):s=new od(e,r),s.mount(Array.isArray(t)?t:[t],e)}}let yl=new Map;class od{constructor(e,t){let i=e.ownerDocument||e,s=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let r=yl.get(i);if(r)return e[$r]=r;this.sheet=new s.CSSStyleSheet,yl.set(i,this)}else this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[$r]=this}mount(e,t){let i=this.sheet,s=0,r=0;for(let o=0;o-1&&(this.modules.splice(a,1),r--,a=-1),a==-1){if(this.modules.splice(r++,0,l),i)for(let h=0;h",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},ld=typeof navigator<"u"&&/Mac/.test(navigator.platform),ad=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ue=0;ue<10;ue++)Ct[48+ue]=Ct[96+ue]=String(ue);for(var ue=1;ue<=24;ue++)Ct[ue+111]="F"+ue;for(var ue=65;ue<=90;ue++)Ct[ue]=String.fromCharCode(ue+32),Li[ue]=String.fromCharCode(ue);for(var Vs in Ct)Li.hasOwnProperty(Vs)||(Li[Vs]=Ct[Vs]);function hd(n){var e=ld&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||ad&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Li:Ct)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function U(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=t[i];typeof s=="string"?n.setAttribute(i,s):s!=null&&(n[i]=s)}e++}for(;e2);var Q={mac:Sl||/Mac/.test(xe.platform),windows:/Win/.test(xe.platform),linux:/Linux|X11/.test(xe.platform),ie:Ts,ie_version:Lh?Br.documentMode||6:Lr?+Lr[1]:Wr?+Wr[1]:0,gecko:bl,gecko_version:bl?+(/Firefox\/(\d+)/.exec(xe.userAgent)||[0,0])[1]:0,chrome:!!Ns,chrome_version:Ns?+Ns[1]:0,ios:Sl,android:/Android\b/.test(xe.userAgent),webkit_version:cd?+(/\bAppleWebKit\/(\d+)/.exec(xe.userAgent)||[0,0])[1]:0,safari:zr,safari_version:zr?+(/\bVersion\/(\d+(\.\d+)?)/.exec(xe.userAgent)||[0,0])[1]:0,tabSize:Br.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function zi(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Ir(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function _n(n,e){if(!e.anchorNode)return!1;try{return Ir(n,e.anchorNode)}catch{return!1}}function ai(n){return n.nodeType==3?Ft(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Ri(n,e,t,i){return t?xl(n,e,t,i,-1)||xl(n,e,t,i,1):!1}function Xt(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function ss(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function xl(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:nt(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=Xt(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=s<0?nt(n):0}else return!1}}function nt(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function sn(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function fd(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function zh(n,e){let t=e.width/n.offsetWidth,i=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-n.offsetHeight)<1)&&(i=1),{scaleX:t,scaleY:i}}function ud(n,e,t,i,s,r,o,l){let a=n.ownerDocument,h=a.defaultView||window;for(let c=n,f=!1;c&&!f;)if(c.nodeType==1){let u,d=c==a.body,p=1,m=1;if(d)u=fd(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let S=c.getBoundingClientRect();({scaleX:p,scaleY:m}=zh(c,S)),u={left:S.left,right:S.left+c.clientWidth*p,top:S.top,bottom:S.top+c.clientHeight*m}}let g=0,y=0;if(s=="nearest")e.top0&&e.bottom>u.bottom+y&&(y=e.bottom-u.bottom+o)):e.bottom>u.bottom&&(y=e.bottom-u.bottom+o,t<0&&e.top-y0&&e.right>u.right+g&&(g=e.right-u.right+r)):e.right>u.right&&(g=e.right-u.right+r,t<0&&e.leftu.bottom||e.leftu.right)&&(e={left:Math.max(e.left,u.left),right:Math.min(e.right,u.right),top:Math.max(e.top,u.top),bottom:Math.min(e.bottom,u.bottom)}),c=c.assignedSlot||c.parentNode}else if(c.nodeType==11)c=c.host;else break}function dd(n){let e=n.ownerDocument,t,i;for(let s=n.parentNode;s&&!(s==e.body||t&&i);)if(s.nodeType==1)!i&&s.scrollHeight>s.clientHeight&&(i=s),!t&&s.scrollWidth>s.clientWidth&&(t=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:t,y:i}}class pd{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?nt(t):0),i,Math.min(e.focusOffset,i?nt(i):0))}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}}let qt=null;Q.safari&&Q.safari_version>=26&&(qt=!1);function Ih(n){if(n.setActive)return n.setActive();if(qt)return n.focus(qt);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(qt==null?{get preventScroll(){return qt={preventScroll:!0},!0}}:void 0),!qt){qt=!1;for(let t=0;tMath.max(1,n.scrollHeight-n.clientHeight-4)}function Xh(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i>0)return{node:t,offset:i};if(t.nodeType==1&&i>0){if(t.contentEditable=="false")return null;t=t.childNodes[i-1],i=nt(t)}else if(t.parentNode&&!ss(t))i=Xt(t),t=t.parentNode;else return null}}function Fh(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&it)return f.domBoundsAround(e,t,h);if(u>=e&&s==-1&&(s=a,r=h),h>t&&f.dom.parentNode==this.dom){o=a,l=c;break}c=u,h=u+f.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=wo){this.markDirty();for(let s=e;sthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function Uh(n,e,t,i,s,r,o,l,a){let{children:h}=n,c=h.length?h[e]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:o;if(!(e==i&&c&&!o&&!u&&r.length<2&&c.merge(t,s,r.length?f:null,t==0,l,a))){if(i0&&(!o&&r.length&&c.merge(t,c.length,r[0],!1,l,0)?c.breakAfter=r.shift().breakAfter:(tOd||i.flags&8)?!1:(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new Ve(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new ye(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return yd(this.dom,e,t)}}class Ot extends _{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let s of t)s.setParent(this)}setAttrs(e){if(Vh(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,i,s,r,o){return i&&(!(i instanceof Ot&&i.mark.eq(this.mark))||e&&r<=0||te&&t.push(i=e&&(s=r),i=a,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new Ot(this.mark,t,o)}domAtPos(e){return jh(this,e)}coordsAt(e,t){return Zh(this,e,t)}}function yd(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let s=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?Q.chrome||Q.gecko||(e?(s--,o=1):r=0)?0:l.length-1];return Q.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,h=>h.width)||a),o?sn(a,o<0):a||null}class pt extends _{static create(e,t,i){return new pt(e,t,i)}constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}split(e){let t=pt.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,i,s,r,o){return i&&(!(i instanceof pt)||!this.widget.compare(i.widget)||e>0&&r<=0||t0)?ye.before(this.dom):ye.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;let s=this.dom.getClientRects(),r=null;if(!s.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?s.length-1:0;r=s[l],!(e>0?l==0:l==s.length-1||r.top0?ye.before(this.dom):ye.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return V.empty}get isHidden(){return!0}}Ve.prototype.children=pt.prototype.children=hi.prototype.children=wo;function jh(n,e){let t=n.dom,{children:i}=n,s=0;for(let r=0;sr&&e0;r--){let o=i[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=s;r0&&e instanceof Ot&&s.length&&(i=s[s.length-1])instanceof Ot&&i.mark.eq(e.mark)?Gh(i,e.children[0],t-1):(s.push(e),e.setParent(n)),n.length+=e.length}function Zh(n,e,t){let i=null,s=-1,r=null,o=-1;function l(h,c){for(let f=0,u=0;f=c&&(d.children.length?l(d,c-u):(!r||r.isHidden&&(t>0||Sd(r,d)))&&(p>c||u==p&&d.getSide()>0)?(r=d,o=c-u):(u-1?1:0)!=s.length-(t&&s.indexOf(t)>-1?1:0))return!1;for(let r of i)if(r!=t&&(s.indexOf(r)==-1||n[r]!==e[r]))return!1;return!0}function Nr(n,e,t){let i=!1;if(e)for(let s in e)t&&s in t||(i=!0,s=="style"?n.style.cssText="":n.removeAttribute(s));if(t)for(let s in t)e&&e[s]==t[s]||(i=!0,s=="style"?n.style.cssText=t[s]:n.setAttribute(s,t[s]));return i}function xd(n){let e=Object.create(null);for(let t=0;t0?3e8:-4e8:t>0?1e8:-1e8,new Pt(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,s;if(e.isBlockGap)i=-5e8,s=4e8;else{let{start:r,end:o}=Yh(e,t);i=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new Pt(e,i,s,t,e.widget||null,!0)}static line(e){return new on(e)}static set(e,t=!1){return N.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}R.none=N.empty;class rn extends R{constructor(e){let{start:t,end:i}=Yh(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,i;return this==e||e instanceof rn&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((i=e.attrs)===null||i===void 0?void 0:i.class))&&rs(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}rn.prototype.point=!1;class on extends R{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof on&&this.spec.class==e.spec.class&&rs(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}on.prototype.mapMode=de.TrackBefore;on.prototype.point=!0;class Pt extends R{constructor(e,t,i,s,r,o){super(t,i,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?de.TrackBefore:de.TrackAfter:de.TrackDel}get type(){return this.startSide!=this.endSide?ke.WidgetRange:this.startSide<=0?ke.WidgetBefore:ke.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Pt&&kd(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}Pt.prototype.point=!0;function Yh(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function kd(n,e){return n==e||!!(n&&e&&n.compare(e))}function Un(n,e,t,i=0){let s=t.length-1;s>=0&&t[s]+i>=n?t[s]=Math.max(t[s],e):t.push(n,e)}class te extends _{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,s,r,o){if(i){if(!(i instanceof te))return!1;this.dom||i.transferDOM(this)}return s&&this.setDeco(i?i.attrs:null),Hh(this,e,t,i?i.children.slice():[],r,o),!0}split(e){let t=new te;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i,off:s}=this.childPos(e);s&&(t.append(this.children[i].split(s),0),this.children[i].merge(s,this.children[i].length,null,!1,0,0),i++);for(let r=i;r0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){rs(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Gh(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=Vr(t,this.attrs||{})),i&&(this.attrs=Vr({class:i},this.attrs||{}))}domAtPos(e){return jh(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?this.flags&4&&(Vh(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(Nr(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let s=this.dom.lastChild;for(;s&&_.get(s)instanceof Ot;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((i=_.get(s))===null||i===void 0?void 0:i.isEditable)==!1&&(!Q.ios||!this.children.some(r=>r instanceof Ve))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let i of this.children){if(!(i instanceof Ve)||/[^ -~]/.test(i.text))return null;let s=ai(i.dom);if(s.length!=1)return null;e+=s[0].width,t=s[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let i=Zh(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight=t){if(r instanceof te)return r;if(o>t)break}s=o+r.breakAfter}return null}}class mt extends _{constructor(e,t,i){super(),this.widget=e,this.length=t,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,s,r,o){return i&&(!(i instanceof mt)||!this.widget.compare(i.widget)||e>0&&r<=0||t0}}class Xr extends ot{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class Di{constructor(e,t,i,s){this.doc=e,this.pos=t,this.end=i,this.disallowBlockEffectsFor=s,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof mt&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new te),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Sn(new hi(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof mt)&&this.getLine()}buildText(e,t,i){for(;e>0;){if(this.textOff==this.text.length){let{value:o,lineBreak:l,done:a}=this.cursor.next(this.skip);if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(l){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=o,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e),r=Math.min(s,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(Sn(new Ve(this.text.slice(this.textOff,this.textOff+r)),t),i),this.atCursorPos=!0,this.textOff+=r,e-=r,i=s<=r?0:t.length}}span(e,t,i,s){this.buildText(t-e,i,s),this.pos=t,this.openStart<0&&(this.openStart=s)}point(e,t,i,s,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof Pt){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(i instanceof Pt)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new mt(i.widget||ci.block,l,i));else{let a=pt.create(i.widget||ci.inline,l,l?0:i.startSide),h=this.atCursorPos&&!a.isEditable&&r<=s.length&&(e0),c=!a.isEditable&&(es.length||i.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!h&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),h&&(f.append(Sn(new hi(1),s),r),r=s.length+Math.max(0,r-s.length)),f.append(Sn(a,s),r),this.atCursorPos=c,this.pendingBuffer=c?es.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,i,s,r){let o=new Di(e,t,i,r);return o.openEnd=N.spans(s,t,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function Sn(n,e){for(let t of e)n=new Ot(t,[n],n.length);return n}class ci extends ot{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}ci.inline=new ci("span");ci.block=new ci("div");var Z=(function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n})(Z||(Z={}));const _t=Z.LTR,vo=Z.RTL;function Kh(n){let e=[];for(let t=0;t=t){if(l.level==i)return o;(r<0||(s!=0?s<0?l.fromt:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function ec(n,e){if(n.length!=e.length)return!1;for(let t=0;t=0;m-=3)if(Ue[m+1]==-d){let g=Ue[m+2],y=g&2?s:g&4?g&1?r:s:0;y&&(H[f]=H[Ue[m]]=y),l=m;break}}else{if(Ue.length==189)break;Ue[l++]=f,Ue[l++]=u,Ue[l++]=a}else if((p=H[f])==2||p==1){let m=p==s;a=m?0:1;for(let g=l-3;g>=0;g-=3){let y=Ue[g+2];if(y&2)break;if(m)Ue[g+2]|=2;else{if(y&4)break;Ue[g+2]|=4}}}}}function Qd(n,e,t,i){for(let s=0,r=i;s<=t.length;s++){let o=s?t[s-1].to:n,l=sa;)p==g&&(p=t[--m].from,g=m?t[m-1].to:n),H[--p]=d;a=c}else r=h,a++}}}function _r(n,e,t,i,s,r,o){let l=i%2?2:1;if(i%2==s%2)for(let a=e,h=0;aa&&o.push(new wt(a,m.from,d));let g=m.direction==_t!=!(d%2);Ur(n,g?i+1:i,s,m.inner,m.from,m.to,o),a=m.to}p=m.to}else{if(p==t||(c?H[p]!=l:H[p]==l))break;p++}u?_r(n,a,p,i+1,s,u,o):ae;){let c=!0,f=!1;if(!h||a>r[h-1].to){let m=H[a-1];m!=l&&(c=!1,f=m==16)}let u=!c&&l==1?[]:null,d=c?i:i+1,p=a;e:for(;;)if(h&&p==r[h-1].to){if(f)break e;let m=r[--h];if(!c)for(let g=m.from,y=h;;){if(g==e)break e;if(y&&r[y-1].to==g)g=r[--y].from;else{if(H[g-1]==l)break e;break}}if(u)u.push(m);else{m.toH.length;)H[H.length]=256;let i=[],s=e==_t?0:1;return Ur(n,s,s,t,0,n.length,i),i}function tc(n){return[new wt(0,n,0)]}let ic="";function Md(n,e,t,i,s){var r;let o=i.head-n.from,l=wt.find(e,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc),a=e[l],h=a.side(s,t);if(o==h){let u=l+=s?1:-1;if(u<0||u>=e.length)return null;a=e[l=u],o=a.side(!s,t),h=a.side(s,t)}let c=pe(n.text,o,a.forward(s,t));(ca.to)&&(c=h),ic=n.text.slice(Math.min(o,c),Math.max(o,c));let f=l==(s?e.length-1:0)?null:e[l+(s?1:-1)];return f&&c==h&&f.level+(s?0:1)n.some(e=>e)}),cc=A.define({combine:n=>n.some(e=>e)}),fc=A.define();class ni{constructor(e,t="nearest",i="nearest",s=5,r=5,o=!1){this.range=e,this.y=t,this.x=i,this.yMargin=s,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new ni(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new ni(b.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const xn=q.define({map:(n,e)=>n.map(e)}),uc=q.define();function Pe(n,e,t){let i=n.facet(oc);i.length?i[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}const dt=A.define({combine:n=>n.length?n[0]:!0});let Dd=0;const Kt=A.define({combine(n){return n.filter((e,t)=>{for(let i=0;i{let a=[];return o&&a.push(Ii.of(h=>{let c=h.plugin(l);return c?o(c):R.none})),r&&a.push(r(l)),a})}static fromClass(e,t){return J.define((i,s)=>new e(i,s),t)}}class Xs{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(Pe(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){Pe(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){Pe(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const dc=A.define(),Po=A.define(),Ii=A.define(),pc=A.define(),ln=A.define(),mc=A.define();function Tl(n,e){let t=n.state.facet(mc);if(!t.length)return t;let i=t.map(r=>r instanceof Function?r(n):r),s=[];return N.spans(i,e.from,e.to,{point(){},span(r,o,l,a){let h=r-e.from,c=o-e.from,f=s;for(let u=l.length-1;u>=0;u--,a--){let d=l[u].spec.bidiIsolate,p;if(d==null&&(d=Rd(e.text,h,c)),a>0&&f.length&&(p=f[f.length-1]).to==h&&p.direction==d)p.to=c,f=p.inner;else{let m={from:h,to:c,direction:d,inner:[]};f.push(m),f=m.inner}}}}),s}const gc=A.define();function Qo(n){let e=0,t=0,i=0,s=0;for(let r of n.state.facet(gc)){let o=r(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:e,right:t,top:i,bottom:s}}const Ti=A.define();class Le{constructor(e,t,i,s){this.fromA=e,this.toA=t,this.fromB=i,this.toB=s}join(e){return new Le(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let s=e[t-1];if(!(s.fromA>i.toA)){if(s.toAc)break;r+=2}if(!a)return i;new Le(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}}class os{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=se.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,a)=>s.push(new Le(r,o,l,a))),this.changedRanges=s}static create(e,t,i){return new os(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class Cl extends _{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=R.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new te],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Le(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:h,toA:c})=>cthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?s=this.domChanged.newSel.head:!zd(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let r=s>-1?qd(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:h,to:c}=this.hasComposition;i=new Le(h,c,e.changes.mapPos(h,-1),e.changes.mapPos(c,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(Q.ie||Q.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=Wd(o,l,e.changes);return i=Le.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,e.startState.doc.length,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,i);let{observer:s}=this.view;s.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=Q.chrome||Q.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||s.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to=0?s[o]:null;if(!l)break;let{fromA:a,toA:h,fromB:c,toB:f}=l,u,d,p,m;if(i&&i.range.fromBc){let w=Di.build(this.view.state.doc,c,i.range.fromB,this.decorations,this.dynamicDecorationMap),k=Di.build(this.view.state.doc,i.range.toB,f,this.decorations,this.dynamicDecorationMap);d=w.breakAtStart,p=w.openStart,m=k.openEnd;let v=this.compositionView(i);k.breakAtStart?v.breakAfter=1:k.content.length&&v.merge(v.length,v.length,k.content[0],!1,k.openStart,0)&&(v.breakAfter=k.content[0].breakAfter,k.content.shift()),w.content.length&&v.merge(0,0,w.content[w.content.length-1],!0,0,w.openEnd)&&w.content.pop(),u=w.content.concat(v).concat(k.content)}else({content:u,breakAtStart:d,openStart:p,openEnd:m}=Di.build(this.view.state.doc,c,f,this.decorations,this.dynamicDecorationMap));let{i:g,off:y}=r.findPos(h,1),{i:S,off:x}=r.findPos(a,-1);Uh(this,S,x,g,y,u,d,p,m)}i&&this.fixCompositionDOM(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let i of t.effects)i.is(uc)&&(this.editContextFormatting=i.value)}compositionView(e){let t=new Ve(e.text.nodeValue);t.flags|=8;for(let{deco:s}of e.marks)t=new Ot(s,[t],t.length);let i=new te;return i.append(t,0),i}fixCompositionDOM(e){let t=(r,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=_.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},i=this.childPos(e.range.fromB,1),s=this.children[i.i];t(e.line,s);for(let r=e.marks.length-1;r>=-1;r--)i=s.childPos(i.off,1),s=s.children[i.i],t(r>=0?e.marks[r].node:e.text,s)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,s=i==this.dom,r=!s&&!(this.view.state.facet(dt)||this.dom.tabIndex>-1)&&_n(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(s||t||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),h=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(Q.gecko&&l.empty&&!this.hasComposition&&Ed(a)){let f=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(f,a.node.childNodes[a.offset]||null)),a=h=new ye(f,0),o=!0}let c=this.view.observer.selectionRange;(o||!c.focusNode||(!Ri(a.node,a.offset,c.anchorNode,c.anchorOffset)||!Ri(h.node,h.offset,c.focusNode,c.focusOffset))&&!this.suppressWidgetCursorChange(c,l))&&(this.view.observer.ignore(()=>{Q.android&&Q.chrome&&this.dom.contains(c.focusNode)&&Ld(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=zi(this.view.root);if(f)if(l.empty){if(Q.gecko){let u=$d(a.node,a.offset);if(u&&u!=3){let d=(u==1?Xh:Fh)(a.node,a.offset);d&&(a=new ye(d.node,d.offset))}}f.collapse(a.node,a.offset),l.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(a.node,a.offset);try{f.extend(h.node,h.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,h]=[h,a]),u.setEnd(h.node,h.offset),u.setStart(a.node,a.offset),f.removeAllRanges(),f.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,h)),this.impreciseAnchor=a.precise?null:new ye(c.anchorNode,c.anchorOffset),this.impreciseHead=h.precise?null:new ye(c.focusNode,c.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Ri(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=zi(e.root),{anchorNode:s,anchorOffset:r}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=te.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!a||!h||a.bottom>h.top)return;let c=this.domAtPos(t.head+t.assoc);i.collapse(c.node,c.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&i.collapse(s,r)}moveToLine(e){let t=this.dom,i;if(e.node!=t)return e;for(let s=e.offset;!i&&s=0;s--){let r=_.get(t.childNodes[s]);r instanceof te&&(i=r.domAtPos(r.length))}return i?new ye(i.node,i.offset,!0):e}nearest(e){for(let t=e;t;){let i=_.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;t=0;o--){let l=this.children[o],a=r-l.breakAfter,h=a-l.length;if(ae||l.covers(1))&&(!i||l instanceof te&&!(i instanceof te&&t>=0)))i=l,s=h;else if(i&&h==e&&a==e&&l instanceof mt&&Math.abs(t)<2){if(l.deco.startSide<0)break;o&&(i=null)}r=h}return i?i.coordsAt(e-s,t):null}coordsForChar(e){let{i:t,off:i}=this.childPos(e,1),s=this.children[t];if(!(s instanceof te))return null;for(;s.children.length;){let{i:l,off:a}=s.childPos(i,1);for(;;l++){if(l==s.children.length)return null;if((s=s.children[l]).length)break}i=a}if(!(s instanceof Ve))return null;let r=pe(s.text,i);if(r==i)return null;let o=Ft(s.dom,i,r).getClientRects();for(let l=0;lMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==Z.LTR;for(let h=0,c=0;cs)break;if(h>=i){let d=f.dom.getBoundingClientRect();if(t.push(d.height),o){let p=f.dom.lastChild,m=p?ai(p):[];if(m.length){let g=m[m.length-1],y=a?g.right-d.left:d.right-g.left;y>l&&(l=y,this.minWidth=r,this.minWidthFrom=h,this.minWidthTo=u)}}}h=u+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?Z.RTL:Z.LTR}measureTextSize(){for(let r of this.children)if(r instanceof te){let o=r.measureTextSize();if(o)return o}let e=document.createElement("div"),t,i,s;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let r=ai(e.firstChild)[0];t=e.getBoundingClientRect().height,i=r?r.width/27:7,s=r?r.height:t,e.remove()}),{lineHeight:t,charWidth:i,textHeight:s}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new _h(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.length;if(o>i){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(R.replace({widget:new Xr(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return R.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Ii).map(r=>(this.dynamicDecorationMap[e++]=typeof r=="function")?r(this.view):r),i=!1,s=this.view.state.facet(pc).map((r,o)=>{let l=typeof r=="function";return l&&(i=!0),l?r(this.view):r});for(s.length&&(this.dynamicDecorationMap[e++]=i,t.push(N.join(s))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];et.anchor?-1:1),s;if(!i)return;!t.empty&&(s=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let r=Qo(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;ud(this.view.scrollDOM,o,t.heads instanceof pt||s.children.some(i);return i(this.children[t])}}function Ed(n){return n.node.nodeType==1&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable=="false")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable=="false")}function Oc(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let i=Xh(t.focusNode,t.focusOffset),s=Fh(t.focusNode,t.focusOffset),r=i||s;if(s&&i&&s.node!=i.node){let l=_.get(s.node);if(!l||l instanceof Ve&&l.text!=s.node.nodeValue)r=s;else if(n.docView.lastCompositionAfterCursor){let a=_.get(i.node);!a||a instanceof Ve&&a.text!=i.node.nodeValue||(r=s)}}if(n.docView.lastCompositionAfterCursor=r!=i,!r)return null;let o=e-r.offset;return{from:o,to:o+r.node.nodeValue.length,node:r.node}}function qd(n,e,t){let i=Oc(n,t);if(!i)return null;let{node:s,from:r,to:o}=i,l=s.nodeValue;if(/[\n\r]/.test(l)||n.state.doc.sliceString(i.from,i.to)!=l)return null;let a=e.invertedDesc,h=new Le(a.mapPos(r),a.mapPos(o),r,o),c=[];for(let f=s.parentNode;;f=f.parentNode){let u=_.get(f);if(u instanceof Ot)c.push({node:f,deco:u.mark});else{if(u instanceof te||f.nodeName=="DIV"&&f.parentNode==n.contentDOM)return{range:h,text:s,marks:c,line:f};if(f!=n.contentDOM)c.push({node:f,deco:new rn({inclusive:!0,attributes:xd(f),tagName:f.tagName.toLowerCase()})});else return null}}}function $d(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e{ie.from&&(t=!0)}),t}function Id(n,e,t=1){let i=n.charCategorizer(e),s=n.doc.lineAt(e),r=e-s.from;if(s.length==0)return b.cursor(e);r==0?t=1:r==s.length&&(t=-1);let o=r,l=r;t<0?o=pe(s.text,r,!1):l=pe(s.text,r);let a=i(s.text.slice(o,l));for(;o>0;){let h=pe(s.text,o,!1);if(i(s.text.slice(h,o))!=a)break;o=h}for(;ln?e.left-n:Math.max(0,n-e.right)}function Nd(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function Fs(n,e){return n.tope.top+1}function Pl(n,e){return en.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function jr(n,e,t){let i,s,r,o,l=!1,a,h,c,f;for(let p=n.firstChild;p;p=p.nextSibling){let m=ai(p);for(let g=0;gx||o==x&&r>S)&&(i=p,s=y,r=S,o=x,l=S?e0:gy.bottom&&(!c||c.bottomy.top)&&(h=p,f=y):c&&Fs(c,y)?c=Ql(c,y.bottom):f&&Fs(f,y)&&(f=Pl(f,y.top))}}if(c&&c.bottom>=t?(i=a,s=c):f&&f.top<=t&&(i=h,s=f),!i)return{node:n,offset:0};let u=Math.max(s.left,Math.min(s.right,e));if(i.nodeType==3)return Al(i,u,t);if(l&&i.contentEditable!="false")return jr(i,u,t);let d=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(s.left+s.right)/2?1:0);return{node:n,offset:d}}function Al(n,e,t){let i=n.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;lt?c.top-t:t-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&f=(c.left+c.right)/2,d=u;if(Q.chrome||Q.gecko){let p=Ft(n,l).getBoundingClientRect();Math.abs(p.left-c.right)<.1&&(d=!u)}if(f<=0)return{node:n,offset:l+(d?1:0)};s=l+(d?1:0),r=f}}}return{node:n,offset:s>-1?s:o>0?n.nodeValue.length:0}}function yc(n,e,t,i=-1){var s,r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,a,{docHeight:h}=n.viewState,{x:c,y:f}=e,u=f-l;if(u<0)return 0;if(u>h)return n.state.doc.length;for(let w=n.viewState.heightOracle.textHeight/2,k=!1;a=n.elementAtHeight(u),a.type!=ke.Text;)for(;u=i>0?a.bottom+w:a.top-w,!(u>=0&&u<=h);){if(k)return t?null:0;k=!0,i=-i}f=l+u;let d=a.from;if(dn.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:Ml(n,o,a,c,f);let p=n.dom.ownerDocument,m=n.root.elementFromPoint?n.root:p,g=m.elementFromPoint(c,f);g&&!n.contentDOM.contains(g)&&(g=null),g||(c=Math.max(o.left+1,Math.min(o.right-1,c)),g=m.elementFromPoint(c,f),g&&!n.contentDOM.contains(g)&&(g=null));let y,S=-1;if(g&&((s=n.docView.nearest(g))===null||s===void 0?void 0:s.isEditable)!=!1){if(p.caretPositionFromPoint){let w=p.caretPositionFromPoint(c,f);w&&({offsetNode:y,offset:S}=w)}else if(p.caretRangeFromPoint){let w=p.caretRangeFromPoint(c,f);w&&({startContainer:y,startOffset:S}=w)}y&&(!n.contentDOM.contains(y)||Q.safari&&Xd(y,S,c)||Q.chrome&&Fd(y,S,c))&&(y=void 0),y&&(S=Math.min(nt(y),S))}if(!y||!n.docView.dom.contains(y)){let w=te.find(n.docView,d);if(!w)return u>a.top+a.height/2?a.to:a.from;({node:y,offset:S}=jr(w.dom,c,f))}let x=n.docView.nearest(y);if(!x)return null;if(x.isWidget&&((r=x.dom)===null||r===void 0?void 0:r.nodeType)==1){let w=x.dom.getBoundingClientRect();return e.yn.defaultLineHeight*1.5){let l=n.viewState.heightOracle.textHeight,a=Math.floor((s-t.top-(n.defaultLineHeight-l)*.5)/l);r+=a*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+Er(o,r,n.state.tabSize)}function bc(n,e,t){let i,s=n;if(n.nodeType!=3||e!=(i=n.nodeValue.length))return!1;for(;;){let r=s.nextSibling;if(r){if(r.nodeName=="BR")break;return!1}else{let o=s.parentNode;if(!o||o.nodeName=="DIV")break;s=o}}return Ft(n,i-1,i).getBoundingClientRect().right>t}function Xd(n,e,t){return bc(n,e,t)}function Fd(n,e,t){if(e!=0)return bc(n,e,t);for(let s=n;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let i=n.nodeType==1?n.getBoundingClientRect():Ft(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function Gr(n,e,t){let i=n.lineBlockAt(e);if(Array.isArray(i.type)){let s;for(let r of i.type){if(r.from>e)break;if(!(r.toe)return r;(!s||r.type==ke.Text&&(s.type!=r.type||(t<0?r.frome)))&&(s=r)}}return s||i}return i}function _d(n,e,t,i){let s=Gr(n,e.head,e.assoc||-1),r=!i||s.type!=ke.Text||!(n.lineWrapping||s.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let o=n.dom.getBoundingClientRect(),l=n.textDirectionAt(s.from),a=n.posAtCoords({x:t==(l==Z.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return b.cursor(a,t?-1:1)}return b.cursor(t?s.to:s.from,t?-1:1)}function Rl(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let l=e,a=null;;){let h=Md(s,r,o,l,t),c=ic;if(!h){if(s.number==(t?n.state.doc.lines:1))return l;c=` +`,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),h=n.visualLineSide(s,!t)}if(a){if(!a(c))return l}else{if(!i)return h;a=i(c)}l=h}}function Ud(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==Y.Space&&(s=o),s==o}}function Hd(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return b.cursor(s,e.assoc);let o=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),h=n.coordsAtPos(s,e.assoc||-1),c=n.documentTop;if(h)o==null&&(o=h.left-a.left),l=r<0?h.top:h.bottom;else{let d=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-d.from))),l=(r<0?d.top:d.bottom)+c}let f=a.left+o,u=i??n.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,m=yc(n,{x:f,y:p},!1,r);if(pa.bottom||(r<0?ms)){let g=n.docView.coordsForChar(m),y=!g||p{if(e>r&&es(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:b.cursor(i,ir)&&!Zd(o,t)&&this.lineBreak(),s=o}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=s.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(i,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(e){if(e.cmIgnore)return;let t=_.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(Gd(e,i.node,i.offset)?t:0))}}function Gd(n,e,t){for(;;){if(!e||t-1;let{impreciseHead:r,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let l=r||o?[]:Jd(e),a=new jd(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=ep(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!Ir(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),h=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!Ir(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),c=e.viewport;if((Q.ios||Q.chrome)&&e.state.selection.main.empty&&a!=h&&(c.from>0||c.to-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(b.range(h,a)):this.newSel=b.single(h,a)}}}function xc(n,e){let t,{newSel:i}=e,s=n.state.selection.main,r=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=s.from,h=null;(r===8||Q.android&&e.text.length=s.from&&t.to<=s.to&&(t.from!=s.from||t.to!=s.to)&&s.to-s.from-(t.to-t.from)<=4?t={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,s.to))}:n.state.doc.lineAt(s.from).toDate.now()-50?t={from:s.from,to:s.to,insert:n.state.toText(n.inputState.insertingText)}:Q.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==` + `&&n.lineWrapping&&(i&&(i=b.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:V.of([" "])}),t)return Ao(n,t,i,r);if(i&&!i.main.eq(s)){let o=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),l=n.inputState.lastSelectionOrigin,l=="select.pointer"&&(i=Sc(n.state.facet(ln).map(a=>a(n)),i))),n.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function Ao(n,e,t,i=-1){if(Q.ios&&n.inputState.flushIOSKey(e))return!0;let s=n.state.selection.main;if(Q.android&&(e.to==s.to&&(e.from==s.from||e.from==s.from-1&&n.state.sliceDoc(e.from,s.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&ii(n.contentDOM,"Enter",13)||(e.from==s.from-1&&e.to==s.to&&e.insert.length==0||i==8&&e.insert.lengths.head)&&ii(n.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&ii(n.contentDOM,"Delete",46)))return!0;let r=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,l=()=>o||(o=Kd(n,e,t));return n.state.facet(lc).some(a=>a(n,e.from,e.to,r,l))||n.dispatch(l()),!0}function Kd(n,e,t){let i,s=n.state,r=s.selection.main,o=-1;if(e.from==e.to&&e.fromr.to){let a=e.fromf(n)),h,a);e.from==c&&(o=c)}if(o>-1)i={changes:e,selection:b.cursor(e.from+e.insert.length,-1)};else if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let a=r.frome.to?s.sliceDoc(e.to,r.to):"";i=s.replaceSelection(n.state.toText(a+e.insert.sliceString(0,void 0,n.state.lineBreak)+h))}else{let a=s.changes(e),h=t&&t.main.to<=a.newLength?t.main:void 0;if(s.selection.ranges.length>1&&(n.inputState.composing>=0||n.inputState.compositionPendingChange)&&e.to<=r.to+10&&e.to>=r.to-10){let c=n.state.sliceDoc(e.from,e.to),f,u=t&&Oc(n,t.main.head);if(u){let p=e.insert.length-(e.to-e.from);f={from:u.from,to:u.to-p}}else f=n.state.doc.lineAt(r.head);let d=r.to-e.to;i=s.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:a,range:h||p.map(a)};let m=p.to-d,g=m-c.length;if(n.state.sliceDoc(g,m)!=c||m>=f.from&&g<=f.to)return{range:p};let y=s.changes({from:g,to:m,insert:e.insert}),S=p.to-r.to;return{changes:y,range:h?b.range(Math.max(0,h.anchor+S),Math.max(0,h.head+S)):p.map(y)}})}else i={changes:a,selection:h&&s.selection.replaceRange(h)}}let l="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,l+=".compose",n.inputState.compositionFirstChange&&(l+=".start",n.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:l,scrollIntoView:!0})}function kc(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}if(o=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function Jd(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new Dl(t,i)),(s!=t||r!=i)&&e.push(new Dl(s,r))),e}function ep(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?b.single(t+e,i+e):null}class tp{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Q.safari&&e.contentDOM.addEventListener("input",()=>null),Q.gecko&&Op(e.contentDOM.ownerDocument)}handleEvent(e){!hp(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let i=this.handlers[e];if(i){for(let s of i.observers)s(this.view,t);for(let s of i.handlers){if(t.defaultPrevented)break;if(s(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=ip(e),i=this.handlers,s=this.view.contentDOM;for(let r in t)if(r!="scroll"){let o=!t[r].handlers.length,l=i[r];l&&o!=!l.handlers.length&&(s.removeEventListener(r,this.handleEvent),l=null),l||s.addEventListener(r,this.handleEvent,{passive:o})}for(let r in i)r!="scroll"&&!t[r]&&s.removeEventListener(r,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&vc.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Q.android&&Q.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return Q.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=wc.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||np.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from0?!0:Q.safari&&!Q.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function El(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(s){Pe(t.state,s)}}}function ip(n){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of n){let s=i.spec,r=s&&s.plugin.domEventHandlers,o=s&&s.plugin.domEventObservers;if(r)for(let l in r){let a=r[l];a&&t(l).handlers.push(El(i.value,a))}if(o)for(let l in o){let a=o[l];a&&t(l).observers.push(El(i.value,a))}}for(let i in Ne)t(i).handlers.push(Ne[i]);for(let i in ze)t(i).observers.push(ze[i]);return e}const wc=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],np="dthko",vc=[16,17,18,20,91,92,224,225],kn=6;function wn(n){return Math.max(0,n)*.7+8}function sp(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class rp{constructor(e,t,i,s){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=dd(e.contentDOM),this.atoms=e.state.facet(ln).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(I.allowMultipleSelections)&&op(e,t),this.dragging=ap(e,t)&&Pc(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&sp(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,i=0,s=0,r=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=Qo(this.view);e.clientX-a.left<=s+kn?t=-wn(s-e.clientX):e.clientX+a.right>=o-kn&&(t=wn(e.clientX-o)),e.clientY-a.top<=r+kn?i=-wn(r-e.clientY):e.clientY+a.bottom>=l-kn&&(i=wn(e.clientY-l)),this.setScrollSpeed(t,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,i=Sc(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function op(n,e){let t=n.state.facet(nc);return t.length?t[0](e):Q.mac?e.metaKey:e.ctrlKey}function lp(n,e){let t=n.state.facet(sc);return t.length?t[0](e):Q.mac?!e.altKey:!e.ctrlKey}function ap(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=zi(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function hp(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=_.get(t))&&i.ignoreEvent(e))return!1;return!0}const Ne=Object.create(null),ze=Object.create(null),Tc=Q.ie&&Q.ie_version<15||Q.ios&&Q.webkit_version<604;function cp(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),Cc(n,t.value)},50)}function Cs(n,e,t){for(let i of n.facet(e))t=i(t,n);return t}function Cc(n,e){e=Cs(n.state,To,e);let{state:t}=n,i,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(Zr!=null&&t.selection.ranges.every(a=>a.empty)&&Zr==r.toString()){let a=-1;i=t.changeByRange(h=>{let c=t.doc.lineAt(h.from);if(c.from==a)return{range:h};a=c.from;let f=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:b.cursor(h.from+f.length)}})}else o?i=t.changeByRange(a=>{let h=r.line(s++);return{changes:{from:a.from,to:a.to,insert:h.text},range:b.cursor(a.from+h.length)}}):i=t.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}ze.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};Ne.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);ze.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};ze.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Ne.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of n.state.facet(rc))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=dp(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new rp(n,e,t,i)),i&&n.observer.ignore(()=>{Ih(n.contentDOM);let r=n.root.activeElement;r&&!r.contains(n.contentDOM)&&r.blur()});let s=n.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}else n.inputState.setSelectionOrigin("select.pointer");return!1};function ql(n,e,t,i){if(i==1)return b.cursor(e,t);if(i==2)return Id(n.state,e,t);{let s=te.find(n.docView,e),r=n.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return le>=t.top&&e<=t.bottom&&n>=t.left&&n<=t.right;function fp(n,e,t,i){let s=te.find(n.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&$l(t,i,o))return-1;let l=s.coordsAt(r,1);return l&&$l(t,i,l)?1:o&&o.bottom>=i?-1:1}function Bl(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:fp(n,t,e.clientX,e.clientY)}}const up=Q.ie&&Q.ie_version<=11;let Wl=null,Ll=0,zl=0;function Pc(n){if(!up)return n.detail;let e=Wl,t=zl;return Wl=n,zl=Date.now(),Ll=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(Ll+1)%3:1}function dp(n,e){let t=Bl(n,e),i=Pc(e),s=n.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),s=s.map(r.changes))},get(r,o,l){let a=Bl(n,r),h,c=ql(n,a.pos,a.bias,i);if(t.pos!=a.pos&&!o){let f=ql(n,t.pos,t.bias,i),u=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=u1&&(h=pp(s,a.pos))?h:l?s.addRange(c):b.create([c])}}}function pp(n,e){for(let t=0;t=e)return b.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}Ne.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let s=n.docView.nearest(e.target);if(s&&s.isWidget){let r=s.posAtStart,o=r+s.length;(r>=t.to||o<=t.from)&&(t=b.range(r,o))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",Cs(n.state,Co,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Ne.dragend=n=>(n.inputState.draggedContent=null,!1);function Il(n,e,t,i){if(t=Cs(n.state,To,t),!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=n.inputState,o=i&&r&&lp(n,e)?{from:r.from,to:r.to}:null,l={from:s,insert:t},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"}),n.inputState.draggedContent=null}Ne.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),s=0,r=()=>{++s==t.length&&Il(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return Il(n,e,i,!0),!0}return!1};Ne.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=Tc?null:e.clipboardData;return t?(Cc(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(cp(n),!1)};function mp(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function gp(n){let e=[],t=[],i=!1;for(let s of n.selection.ranges)s.empty||(e.push(n.sliceDoc(s.from,s.to)),t.push(s));if(!e.length){let s=-1;for(let{from:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:Cs(n,Co,e.join(n.lineBreak)),ranges:t,linewise:i}}let Zr=null;Ne.copy=Ne.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=gp(n.state);if(!t&&!s)return!1;Zr=s?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=Tc?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",t),!0):(mp(n,t),!1)};const Qc=st.define();function Ac(n,e){let t=[];for(let i of n.facet(ac)){let s=i(n,e);s&&t.push(s)}return t.length?n.update({effects:t,annotations:Qc.of(!0)}):null}function Mc(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=Ac(n.state,e);t?n.dispatch(t):n.update([])}},10)}ze.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),Mc(n)};ze.blur=n=>{n.observer.clearSelectionRange(),Mc(n)};ze.compositionstart=ze.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};ze.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,Q.chrome&&Q.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};ze.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};Ne.beforeinput=(n,e)=>{var t,i;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(n.inputState.insertingText=e.data,n.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&n.observer.editContext){let r=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),o=e.getTargetRanges();if(r&&o.length){let l=o[0],a=n.posAtDOM(l.startContainer,l.startOffset),h=n.posAtDOM(l.endContainer,l.endOffset);return Ao(n,{from:a,to:h,insert:n.state.toText(r)},null),!0}}let s;if(Q.chrome&&Q.android&&(s=wc.find(r=>r.inputType==e.inputType))&&(n.observer.delayAndroidKey(s.key,s.keyCode),s.key=="Backspace"||s.key=="Delete")){let r=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>r+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return Q.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),Q.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>ze.compositionend(n,e),20),!1};const Vl=new Set;function Op(n){Vl.has(n)||(Vl.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const Nl=["pre-wrap","normal","pre-line","break-spaces"];let fi=!1;function Xl(){fi=!1}class yp{constructor(e){this.lineWrapping=e,this.doc=V.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Nl.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=i,this.textHeight=s,this.lineLength=r,a){this.heightSamples={};for(let h=0;h0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Hn&&(fi=!0),this.height=e)}replace(e,t,i){return we.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,s){let r=this,o=i.doc;for(let l=s.length-1;l>=0;l--){let{fromA:a,toA:h,fromB:c,toB:f}=s[l],u=r.lineAt(a,G.ByPosNoHeight,i.setDoc(t),0,0),d=u.to>=h?u:r.lineAt(h,G.ByPosNoHeight,i,0,0);for(f+=d.to-h,h=d.to;l>0&&u.from<=s[l-1].toA;)a=s[l-1].fromA,c=s[l-1].fromB,l--,ar*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(r>s*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(s=r&&o(this.blockAt(0,i,s,r))}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class De extends Rc{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,s){return new Ke(s,this.length,i,this.height,this.breaks)}replace(e,t,i){let s=i[0];return i.length==1&&(s instanceof De||s instanceof fe&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof fe?s=new De(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):we.of(i)}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more?this.setHeight(s.heights[s.index++]):(i||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class fe extends we{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,r=s-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:s,perLine:o,perChar:l}}blockAt(e,t,i,s){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,s);if(t.lineWrapping){let h=s+(e0){let r=i[i.length-1];r instanceof fe?i[i.length-1]=new fe(r.length+s):i.push(null,new fe(s-1))}if(e>0){let r=i[0];r instanceof fe?i[0]=new fe(e+r.length):i.unshift(new fe(e-1),null)}return we.of(i)}decomposeLeft(e,t){t.push(new fe(e-1),null)}decomposeRight(e,t){t.push(null,new fe(this.length-e-1))}updateHeight(e,t=0,i=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],l=Math.max(t,s.from),a=-1;for(s.from>t&&o.push(new fe(s.from-t-1).updateHeight(e,t));l<=r&&s.more;){let c=e.doc.lineAt(l).length;o.length&&o.push(null);let f=s.heights[s.index++];a==-1?a=f:Math.abs(f-a)>=Hn&&(a=-2);let u=new De(c,f);u.outdated=!1,o.push(u),l+=c+1}l<=r&&o.push(null,new fe(r-l).updateHeight(e,l));let h=we.of(o);return(a<0||Math.abs(h.height-this.height)>=Hn||Math.abs(a-this.heightMetrics(e,t).perLine)>=Hn)&&(fi=!0),ls(this,h)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Sp extends we{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,s){let r=i+this.left.height;return el))return h;let c=t==G.ByPosNoHeight?G.ByPosNoHeight:G.ByPos;return a?h.join(this.right.lineAt(l,c,i,o,l)):this.left.lineAt(l,c,i,s,r).join(h)}forEachLine(e,t,i,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,i,l,a,o);else{let h=this.lineAt(a,G.ByPos,i,s,r);e=e&&h.from<=t&&o(h),t>h.to&&this.right.forEachLine(h.to+1,t,i,l,a,o)}}replace(e,t,i){let s=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-s,t-s,i));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of i)r.push(l);if(e>0&&Fl(r,o-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,s=i+this.break;if(e>=s)return this.right.decomposeRight(e-s,t);e2*t.size||t.size>2*e.size?we.of(this.break?[e,null,t]:[e,t]):(this.left=ls(this.left,e),this.right=ls(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,s){let{left:r,right:o}=this,l=t+r.length+this.break,a=null;return s&&s.from<=t+r.length&&s.more?a=r=r.updateHeight(e,t,i,s):r.updateHeight(e,t,i),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(e,l,i,s):o.updateHeight(e,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Fl(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof fe&&(i=n[e+1])instanceof fe&&n.splice(e-1,3,new fe(t.length+1+i.length))}const xp=5;class Mo{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof De?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new De(i-this.pos,-1)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e=xp)&&this.addLineDeco(s,r,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new De(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new fe(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof De)return e;let t=new De(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,i){let s=this.ensureLine();s.length+=i,s.collapsed+=i,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof De)&&!this.isCovered?this.nodes.push(new De(0,-1)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let u=c.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=Math.min(h==n.parentNode?s.innerHeight:a,u.bottom)}h=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function Tp(n){let e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView||window;return e.left0&&e.top0}function Cp(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Us{constructor(e,t,i,s){this.from=e,this.to=t,this.size=i,this.displaySize=s}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;itypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new yp(t),this.stateDeco=e.facet(Ii).filter(i=>typeof i!="function"),this.heightMap=we.empty().applyChanges(this.stateDeco,V.empty,this.heightOracle.setDoc(e.doc),[new Le(0,0,0,e.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=R.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let s=i?t.head:t.anchor;if(!e.some(({from:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new vn(r,o))}}return this.viewports=e.sort((i,s)=>i.from-s.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Ul:new Ro(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Pi(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(Ii).filter(c=>typeof c!="function");let s=e.changedRanges,r=Le.extendWithRanges(s,kp(i,this.stateDeco,e?e.changes:se.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);Xl(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),(this.heightMap.height!=o||fi)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let h=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(h||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(cc)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?Z.RTL:Z.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let h=0,c=0;if(l.width&&l.height){let{scaleX:w,scaleY:k}=zh(t,l);(w>.005&&Math.abs(this.scaleX-w)>.005||k>.005&&Math.abs(this.scaleY-k)>.005)&&(this.scaleX=w,this.scaleY=k,h|=16,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,h|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=16);let d=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=Nh(e.scrollDOM);let p=(this.printing?Cp:vp)(t,this.paddingTop),m=p.top-this.pixelViewport.top,g=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget&&!Tp(e.dom))return 0;let S=l.width;if((this.contentDOMWidth!=S||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),a){let w=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(w)&&(o=!0),o||s.lineWrapping&&Math.abs(S-this.contentDOMWidth)>s.charWidth){let{lineHeight:k,charWidth:v,textHeight:T}=e.docView.measureTextSize();o=k>0&&s.refresh(r,k,v,T,Math.max(5,S/v),w),o&&(e.docView.minWidth=0,h|=16)}m>0&&g>0?c=Math.max(m,g):m<0&&g<0&&(c=Math.min(m,g)),Xl();for(let k of this.viewports){let v=k.from==this.viewport.from?w:e.docView.measureVisibleLineHeights(k);this.heightMap=(o?we.empty().applyChanges(this.stateDeco,V.empty,this.heightOracle,[new Le(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new bp(k.from,v))}fi&&(h|=2)}let x=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return x&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),h|=this.updateForViewport()),(h&2||x)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new vn(s.lineAt(o-i*1e3,G.ByHeight,r,0,0).from,s.lineAt(l+(1-i)*1e3,G.ByHeight,r,0,0).to);if(t){let{head:h}=t.range;if(ha.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=s.lineAt(h,G.ByPos,r,0,0),u;t.y=="center"?u=(f.top+f.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&h=l+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&r>1,o=s<<1;if(this.defaultTextDirection!=Z.LTR&&!i)return[];let l=[],a=(c,f,u,d)=>{if(f-cc&&yy.from>=u.from&&y.to<=u.to&&Math.abs(y.from-c)y.fromS));if(!g){if(fx.from<=f&&x.to>=f)){let x=t.moveToLineBoundary(b.cursor(f),!1,!0).head;x>c&&(f=x)}let y=this.gapSize(u,c,f,d),S=i||y<2e6?y:2e6;g=new Us(c,f,y,S)}l.push(g)},h=c=>{if(c.length2e6)for(let v of e)v.from>=c.from&&v.fromc.from&&a(c.from,d,c,f),pt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let i=[];N.spans(t,this.viewport.from,this.viewport.to,{span(r,o){i.push({from:r,to:o})},point(){}},20);let s=0;if(i.length!=this.visibleRanges.length)s=12;else for(let r=0;r=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Pi(this.heightMap.lineAt(e,G.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Pi(this.heightMap.lineAt(this.scaler.fromDOM(e),G.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Pi(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class vn{constructor(e,t){this.from=e,this.to=t}}function Qp(n,e,t){let i=[],s=n,r=0;return N.spans(t,n,e,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),r+=o-s),s=l}},20),s=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let s=0;;s++){let{from:r,to:o}=e[s],l=o-r;if(i<=l)return r+i;i-=l}}function Cn(n,e){let t=0;for(let{from:i,to:s}of n.ranges){if(e<=s){t+=e-i;break}t+=s-i}return t/n.total}function Ap(n,e){for(let t of n)if(e(t))return t}const Ul={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};class Ro{constructor(e,t,i){let s=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let h=t.lineAt(l,G.ByPos,e,0,0).top,c=t.lineAt(a,G.ByPos,e,0,0).bottom;return s+=c-h,{from:l,to:a,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,i=0,s=0;;t++){let r=tt.from==e.viewports[i].from&&t.to==e.viewports[i].to):!1}}function Pi(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),i=e.toDOM(n.bottom);return new Ke(n.from,n.length,t,i-t,Array.isArray(n._content)?n._content.map(s=>Pi(s,e)):n._content)}const Pn=A.define({combine:n=>n.join(" ")}),Yr=A.define({combine:n=>n.indexOf(!0)>-1}),Kr=Tt.newName(),Dc=Tt.newName(),Ec=Tt.newName(),qc={"&light":"."+Dc,"&dark":"."+Ec};function Jr(n,e,t){return new Tt(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,s=>{if(s=="&")return n;if(!t||!t[s])throw new RangeError(`Unsupported selector: ${s}`);return t[s]}):n+" "+i}})}const Mp=Jr("."+Kr,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},qc),Rp={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Hs=Q.ie&&Q.ie_version<=11;class Dp{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new pd,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(Q.ie&&Q.ie_version<=11||Q.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Q.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Q.chrome&&Q.chrome_version<126)&&(this.editContext=new qp(e),e.state.facet(dt)&&(e.contentDOM.editContext=this.editContext.editContext)),Hs&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(dt)?i.root.activeElement!=this.dom:!_n(this.dom,s))return;let r=s.anchorNode&&i.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Q.ie&&Q.ie_version<=11||Q.android&&Q.chrome)&&!i.state.selection.main.empty&&s.focusNode&&Ri(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=zi(e.root);if(!t)return!1;let i=Q.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Ep(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let s=_n(this.dom,i);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&ii(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,s=!1;for(let r of e){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:s}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),s=this.selectionChanged&&_n(this.dom,this.selectionRange);if(e<0&&!s)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new Yd(this.view,e,t,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let i=this.view.state,s=xc(this.view,t);return this.view.state==i&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),s}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let i=Hl(t,e.previousSibling||e.target.previousSibling,-1),s=Hl(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:s?t.posBefore(s):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(dt)!=e.state.facet(dt)&&(e.view.contentDOM.editContext=e.state.facet(dt)?this.editContext.editContext:null))}destroy(){var e,t,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Hl(n,e,t){for(;e;){let i=_.get(e);if(i&&i.parent==n)return i;let s=e.parentNode;e=s!=n.dom?s:t>0?e.nextSibling:e.previousSibling}return null}function jl(n,e){let t=e.startContainer,i=e.startOffset,s=e.endContainer,r=e.endOffset,o=n.docView.domAtPos(n.state.selection.main.anchor);return Ri(o.node,o.offset,s,r)&&([t,i,s,r]=[s,r,t,i]),{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}}function Ep(n,e){if(e.getComposedRanges){let s=e.getComposedRanges(n.root)[0];if(s)return jl(n,s)}let t=null;function i(s){s.preventDefault(),s.stopImmediatePropagation(),t=s.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",i,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",i,!0),t?jl(n,t):null}class qp{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let s=e.state.selection.main,{anchor:r,head:o}=s,l=this.toEditorPos(i.updateRangeStart),a=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let h=a-l>i.text.length;l==this.from&&rthis.to&&(a=r);let c=kc(e.state.sliceDoc(l,a),i.text,(h?s.from:s.to)-l,h?"end":null);if(!c){let u=b.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));u.main.eq(s)||e.dispatch({selection:u,userEvent:"select"});return}let f={from:c.from+l,to:c.toA+l,insert:V.of(i.text.slice(c.from,c.toB).split(` +`))};if((Q.mac||Q.android)&&f.from==o-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:a,insert:V.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!e.state.readOnly){let u=this.to-this.from+(f.to-f.from+f.insert.length);Ao(e,f,b.single(this.toEditorPos(i.selectionStart,u),this.toEditorPos(i.selectionEnd,u)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),f.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(t.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let s=[],r=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o{let s=[];for(let r of i.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let a=this.toEditorPos(r.rangeStart),h=this.toEditorPos(r.rangeEnd);if(a{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let s=zi(i.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,s=this.pendingContextChange;return e.changes.iterChanges((r,o,l,a,h)=>{if(i)return;let c=h.length-(o-r);if(s&&o>=s.to)if(s.from==r&&s.to==o&&s.insert.eq(h)){s=this.pendingContextChange=null,t+=c,this.to+=c;return}else s=null,this.revertPending(e.state);if(r+=t,o+=t,o<=this.from)this.from+=c,this.to+=c;else if(rthis.to||this.to-this.from+h.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),h.toString()),this.to+=c}t+=c}),s&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(s=>!s.isUserEvent("input.type")&&s.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),s=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(i,s)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class P{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(s=>s.forEach(r=>i(r,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=e.root||md(e.parent)||document,this.viewState=new _l(e.state||I.create(e)),e.scrollTo&&e.scrollTo.is(xn)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Kt).map(s=>new Xs(s));for(let s of this.plugins)s.update(this);this.observer=new Dp(this),this.inputState=new tp(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Cl(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof ie?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,s,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(Qc))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=Ac(r,o),a||(l=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(I.phrases)!=this.state.facet(I.phrases))return this.setState(r);s=os.create(this,r,e),s.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new ni(d.empty?d:b.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is(xn)&&(f=d.value.clip(this.state))}this.viewState.update(s,f),this.bidiCache=as.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(Ti)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(Pn)!=s.state.facet(Pn)&&(this.viewState.mustMeasureContent=!0),(t||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!s.empty)for(let u of this.state.facet(Hr))try{u(s)}catch(d){Pe(this.state,d,"update listener")}(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!xc(this,c)&&h.force&&ii(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new _l(e),this.plugins=e.facet(Kt).map(i=>new Xs(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new Cl(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Kt),i=e.state.facet(Kt);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new Xs(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.scrollDOM,s=i.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(Nh(i))r=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(s);r=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];a&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(d=>{try{return d.read(this)}catch(p){return Pe(this.state,p),Gl}}),f=os.create(this,this.state,[]),u=!1;f.flags|=a,t?t.flags|=a:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f),u&&this.docViewUpdate());for(let d=0;d1||p<-1){s=s+p,i.scrollTop=s/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(Hr))l(t)}get themeClasses(){return Kr+" "+(this.state.facet(Yr)?Ec:Dc)+" "+this.state.facet(Pn)}updateAttrs(){let e=Zl(this,dc,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(dt)?"true":"false",class:"cm-content",style:`${Q.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Zl(this,Po,t);let i=this.observer.ignore(()=>{let s=Nr(this.contentDOM,this.contentAttrs,t),r=Nr(this.dom,this.editorAttrs,e);return s||r});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let s of i.effects)if(s.is(P.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(Ti);let e=this.state.facet(P.cspNonce);Tt.mount(this.root,this.styleModules.concat(Mp).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;ti.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return _s(this,e,Rl(this,e,t,i))}moveByGroup(e,t){return _s(this,e,Rl(this,e,t,i=>Ud(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),s=this.textDirectionAt(e.from),r=i[t?i.length-1:0];return b.cursor(r.side(t,s)+e.from,r.forward(!t,s)?1:-1)}moveToLineBoundary(e,t,i=!0){return _d(this,e,t,i)}moveVertically(e,t,i){return _s(this,e,Hd(this,e,t,i))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),yc(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(e),r=this.bidiSpans(s),o=r[wt.find(r,e-s.from,-1,t)];return sn(i,o.dir==Z.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(hc)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>$p)return tc(e.length);let t=this.textDirectionAt(e.from),i;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||ec(r.isolates,i=Tl(this,e))))return r.order;i||(i=Tl(this,e));let s=Ad(e.text,t,i);return this.bidiCache.push(new as(e.from,e.to,t,i,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Q.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Ih(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return xn.of(new ni(typeof e=="number"?b.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return xn.of(new ni(b.cursor(i.from),"start","start",i.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return J.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return J.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=Tt.newName(),s=[Pn.of(i),Ti.of(Jr(`.${i}`,e))];return t&&t.dark&&s.push(Yr.of(!0)),s}static baseTheme(e){return Mt.lowest(Ti.of(Jr("."+Kr,e,qc)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),s=i&&_.get(i)||_.get(e);return((t=s?.rootView)===null||t===void 0?void 0:t.view)||null}}P.styleModule=Ti;P.inputHandler=lc;P.clipboardInputFilter=To;P.clipboardOutputFilter=Co;P.scrollHandler=fc;P.focusChangeEffect=ac;P.perLineTextDirection=hc;P.exceptionSink=oc;P.updateListener=Hr;P.editable=dt;P.mouseSelectionStyle=rc;P.dragMovesSelection=sc;P.clickAddsSelectionRange=nc;P.decorations=Ii;P.outerDecorations=pc;P.atomicRanges=ln;P.bidiIsolatedRanges=mc;P.scrollMargins=gc;P.darkTheme=Yr;P.cspNonce=A.define({combine:n=>n.length?n[0]:""});P.contentAttributes=Po;P.editorAttributes=dc;P.lineWrapping=P.contentAttributes.of({class:"cm-lineWrapping"});P.announce=q.define();const $p=4096,Gl={};class as{constructor(e,t,i,s,r,o){this.from=e,this.to=t,this.dir=i,this.isolates=s,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let i=[],s=e.length?e[e.length-1].dir:Z.LTR;for(let r=Math.max(0,e.length-10);r=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&Vr(o,t)}return t}const Bp=Q.mac?"mac":Q.windows?"win":Q.linux?"linux":"key";function Wp(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let s,r,o,l;for(let a=0;ai.concat(s),[]))),t}function zp(n,e,t){return Bc($c(n.state),e,n,t)}let xt=null;const Ip=4e3;function Vp(n,e=Bp){let t=Object.create(null),i=Object.create(null),s=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,h,c)=>{var f,u;let d=t[o]||(t[o]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>Wp(y,e));for(let y=1;y{let w=xt={view:x,prefix:S,scope:o};return setTimeout(()=>{xt==w&&(xt=null)},Ip),!0}]})}let m=p.join(" ");s(m,!1);let g=d[m]||(d[m]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&g.run.push(a),h&&(g.preventDefault=!0),c&&(g.stopPropagation=!0)};for(let o of n){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let h of l){let c=t[h]||(t[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let u in c)c[u].run.push(d=>f(d,eo))}let a=o[e]||o.key;if(a)for(let h of l)r(h,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(h,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}let eo=null;function Bc(n,e,t,i){eo=e;let s=hd(e),r=Te(s,0),o=Ye(r)==s.length&&s!=" ",l="",a=!1,h=!1,c=!1;xt&&xt.view==t&&xt.scope==i&&(l=xt.prefix+" ",vc.indexOf(e.keyCode)<0&&(h=!0,xt=null));let f=new Set,u=g=>{if(g){for(let y of g.run)if(!f.has(y)&&(f.add(y),y(t)))return g.stopPropagation&&(c=!0),!0;g.preventDefault&&(g.stopPropagation&&(c=!0),h=!0)}return!1},d=n[i],p,m;return d&&(u(d[l+Qn(s,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Q.windows&&e.ctrlKey&&e.altKey)&&!(Q.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(p=Ct[e.keyCode])&&p!=s?(u(d[l+Qn(p,e,!0)])||e.shiftKey&&(m=Li[e.keyCode])!=s&&m!=p&&u(d[l+Qn(m,e,!1)]))&&(a=!0):o&&e.shiftKey&&u(d[l+Qn(s,e,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),h&&(a=!0),a&&c&&e.stopPropagation(),eo=null,a}class hn{constructor(e,t,i,s,r){this.className=e,this.left=t,this.top=i,this.width=s,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let s=e.coordsAtPos(i.head,i.assoc||1);if(!s)return[];let r=Wc(e);return[new hn(t,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return Np(e,t,i)}}function Wc(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==Z.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function Kl(n,e,t,i){let s=n.coordsAtPos(e,t*2);if(!s)return i;let r=n.dom.getBoundingClientRect(),o=(s.top+s.bottom)/2,l=n.posAtCoords({x:r.left+1,y:o}),a=n.posAtCoords({x:r.right-1,y:o});return l==null||a==null?i:{from:Math.max(i.from,Math.min(l,a)),to:Math.min(i.to,Math.max(l,a))}}function Np(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),s=Math.min(t.to,n.viewport.to),r=n.textDirection==Z.LTR,o=n.contentDOM,l=o.getBoundingClientRect(),a=Wc(n),h=o.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),f=l.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),u=l.right-(c?parseInt(c.paddingRight):0),d=Gr(n,i,1),p=Gr(n,s,-1),m=d.type==ke.Text?d:null,g=p.type==ke.Text?p:null;if(m&&(n.lineWrapping||d.widgetLineBreaks)&&(m=Kl(n,i,1,m)),g&&(n.lineWrapping||p.widgetLineBreaks)&&(g=Kl(n,s,-1,g)),m&&g&&m.from==g.from&&m.to==g.to)return S(x(t.from,t.to,m));{let k=m?x(t.from,null,m):w(d,!1),v=g?x(null,t.to,g):w(p,!0),T=[];return(m||d).to<(g||p).from-(m&&g?1:0)||d.widgetLineBreaks>1&&k.bottom+n.defaultLineHeight/2D&&W.from=ne)break;ee>X&&$(Math.max(F,X),k==null&&F<=D,Math.min(ee,ne),v==null&&ee>=B,me.dir)}if(X=oe.to+1,X>=ne)break}return z.length==0&&$(D,k==null,B,v==null,n.textDirection),{top:E,bottom:M,horizontal:z}}function w(k,v){let T=l.top+(v?k.top:k.bottom);return{top:T,bottom:T,horizontal:[]}}}function Xp(n,e){return n.constructor==e.constructor&&n.eq(e)}class Fp{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(jn)!=e.state.facet(jn)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,i=e.facet(jn);for(;t!Xp(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let s of e)s.update&&t&&s.constructor&&this.drawn[i].constructor&&s.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(s.draw(),t);for(;t;){let s=t.nextSibling;t.remove(),t=s}this.drawn=e,Q.safari&&Q.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const jn=A.define();function Lc(n){return[J.define(e=>new Fp(e,n)),jn.of(n)]}const Vi=A.define({combine(n){return rt(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function _p(n={}){return[Vi.of(n),Up,Hp,jp,cc.of(!0)]}function zc(n){return n.startState.facet(Vi)!=n.state.facet(Vi)}const Up=Lc({above:!0,markers(n){let{state:e}=n,t=e.facet(Vi),i=[];for(let s of e.selection.ranges){let r=s==e.selection.main;if(s.empty||t.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:b.cursor(s.head,s.head>s.anchor?-1:1);for(let a of hn.forRange(n,o,l))i.push(a)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=zc(n);return t&&Jl(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){Jl(e.state,n)},class:"cm-cursorLayer"});function Jl(n,e){e.style.animationDuration=n.facet(Vi).cursorBlinkRate+"ms"}const Hp=Lc({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:hn.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||zc(n)},class:"cm-selectionLayer"}),jp=Mt.highest(P.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),Ic=q.define({map(n,e){return n==null?null:e.mapPos(n)}}),Qi=he.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(Ic)?i.value:t,n)}}),Gp=J.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(Qi);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(Qi)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(Qi),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let i=n.scrollDOM.getBoundingClientRect();return{left:t.left-i.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-i.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(Qi)!=n&&this.view.dispatch({effects:Ic.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Zp(){return[Qi,Gp]}function ea(n,e,t,i,s){e.lastIndex=0;for(let r=n.iterRange(t,i),o=t,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=e.exec(r.value);)s(o+l.index,l)}function Yp(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:s,to:r}of t)s=Math.max(n.state.doc.lineAt(s).from,s-e),r=Math.min(n.state.doc.lineAt(r).to,r+e),i.length&&i[i.length-1].to>=s?i[i.length-1].to=r:i.push({from:s,to:r});return i}class Kp{constructor(e){const{regexp:t,decoration:i,decorate:s,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,s)this.addMatch=(l,a,h,c)=>s(c,h,h+l[0].length,l,a);else if(typeof i=="function")this.addMatch=(l,a,h,c)=>{let f=i(l,a,h);f&&c(h,h+l[0].length,f)};else if(i)this.addMatch=(l,a,h,c)=>c(h,h+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new gt,i=t.add.bind(t);for(let{from:s,to:r}of Yp(e,this.maxLength))ea(e.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,e,o,i));return t.finish()}updateDeco(e,t){let i=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((r,o,l,a)=>{a>=e.view.viewport.from&&l<=e.view.viewport.to&&(i=Math.min(l,i),s=Math.max(a,s))}),e.viewportMoved||s-i>1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,t.map(e.changes),i,s):t}updateRange(e,t,i,s){for(let r of e.visibleRanges){let o=Math.max(r.from,i),l=Math.min(r.to,s);if(l>=o){let a=e.state.doc.lineAt(o),h=a.toa.from;o--)if(this.boundary.test(a.text[o-1-a.from])){c=o;break}for(;lu.push(y.range(m,g));if(a==h)for(this.regexp.lastIndex=c-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(g,e,m,p));t=t.update({filterFrom:c,filterTo:f,filter:(m,g)=>mf,add:u})}}return t}}const to=/x/.unicode!=null?"gu":"g",Jp=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,to),em={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let js=null;function tm(){var n;if(js==null&&typeof document<"u"&&document.body){let e=document.body.style;js=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return js||!1}const Gn=A.define({combine(n){let e=rt(n,{render:null,specialChars:Jp,addSpecialChars:null});return(e.replaceTabs=!tm())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,to)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,to)),e}});function im(n={}){return[Gn.of(n),nm()]}let ta=null;function nm(){return ta||(ta=J.fromClass(class{constructor(n){this.view=n,this.decorations=R.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(Gn)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new Kp({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=Te(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,a=gi(o.text,l,i-o.from);return R.replace({widget:new lm((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=R.replace({widget:new om(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Gn);n.startState.facet(Gn)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const sm="•";function rm(n){return n>=32?sm:n==10?"␤":String.fromCharCode(9216+n)}class om extends ot{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=rm(this.code),i=e.state.phrase("Control character")+" "+(em[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class lm extends ot{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function am(){return cm}const hm=R.line({class:"cm-activeLine"}),cm=J.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let i of n.state.selection.ranges){let s=n.lineBlockAt(i.head);s.from>e&&(t.push(hm.range(s.from)),e=s.from)}return R.set(t)}},{decorations:n=>n.decorations});class fm extends ot{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?ai(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),s=sn(t[0],i.direction!="rtl"),r=parseInt(i.lineHeight);return s.bottom-s.top>r*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+r}:s}ignoreEvent(){return!1}}function um(n){let e=J.fromClass(class{constructor(t){this.view=t,this.placeholder=n?R.set([R.widget({widget:new fm(n),side:1}).range(0)]):R.none}get decorations(){return this.view.state.doc.length?R.none:this.placeholder}},{decorations:t=>t.decorations});return typeof n=="string"?[e,P.contentAttributes.of({"aria-placeholder":n})]:e}const io=2e3;function dm(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>io||t.off>io||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=i;a<=s;a++){let h=n.doc.line(a);h.length<=l&&r.push(b.range(h.from+o,h.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=i;a<=s;a++){let h=n.doc.line(a),c=Er(h.text,o,n.tabSize,!0);if(c<0)r.push(b.cursor(h.to));else{let f=Er(h.text,l,n.tabSize);r.push(b.range(h.from+c,h.from+f))}}}return r}function pm(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function ia(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,r=s>io?-1:s==i.length?pm(n,e.clientX):gi(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function mm(n,e){let t=ia(n,e),i=n.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=ia(n,s);if(!l)return i;let a=dm(n.state,t,l);return a.length?o?b.create(a.concat(i.ranges)):b.create(a):i}}:null}function gm(n){let e=(t=>t.altKey&&t.button==0);return P.mouseSelectionStyle.of((t,i)=>e(i)?mm(t,i):null)}const Om={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},ym={style:"cursor: crosshair"};function bm(n={}){let[e,t]=Om[n.key||"Alt"],i=J.fromClass(class{constructor(s){this.view=s,this.isDown=!1}set(s){this.isDown!=s&&(this.isDown=s,this.view.update([]))}},{eventObservers:{keydown(s){this.set(s.keyCode==e||t(s))},keyup(s){(s.keyCode==e||!t(s))&&this.set(!1)},mousemove(s){this.set(t(s))}}});return[i,P.contentAttributes.of(s=>{var r;return!((r=s.plugin(i))===null||r===void 0)&&r.isDown?ym:null})]}const An="-10000px";class Vc{constructor(e,t,i,s){this.facet=t,this.createTooltipView=i,this.removeTooltipView=s,this.input=e.state.facet(t),this.tooltips=this.input.filter(o=>o);let r=null;this.tooltipViews=this.tooltips.map(o=>r=i(o,r))}update(e,t){var i;let s=e.state.facet(this.facet),r=s.filter(a=>a);if(s===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=t?[]:null;for(let a=0;at[h]=a),t.length=l.length),this.input=s,this.tooltips=r,this.tooltipViews=o,!0}}function Sm(n){let e=n.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const Gs=A.define({combine:n=>{var e,t,i;return{position:Q.ios?"absolute":((e=n.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(s=>s.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||Sm}}}),na=new WeakMap,Do=J.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(Gs);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Vc(n,Eo,(t,i)=>this.createTooltip(t,i),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(Gs);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),i=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let s=document.createElement("div");s.className="cm-tooltip-arrow",t.dom.appendChild(s)}return t.dom.style.position=this.position,t.dom.style.top=An,t.dom.style.left="0px",this.container.insertBefore(t.dom,i),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(n=i.destroy)===null||n===void 0||n.call(i);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,e=1,t=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:r}=this.manager.tooltipViews[0];if(Q.safari){let o=r.getBoundingClientRect();t=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else t=!!r.offsetParent&&r.offsetParent!=this.container.ownerDocument.body}if(t||this.position=="absolute")if(this.parent){let r=this.parent.getBoundingClientRect();r.width&&r.height&&(n=r.width/this.parent.offsetWidth,e=r.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:e}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),s=Qo(this.view);return{visible:{left:i.left+s.left,top:i.top+s.top,right:i.right-s.right,bottom:i.bottom-s.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((r,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(r.pos):this.view.coordsAtPos(r.pos)}),size:this.manager.tooltipViews.map(({dom:r})=>r.getBoundingClientRect()),space:this.view.state.facet(Gs).tooltipSpace(this.view),scaleX:n,scaleY:e,makeAbsolute:t}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:t,space:i,scaleX:s,scaleY:r}=n,o=[];for(let l=0;l=Math.min(t.bottom,i.bottom)||f.rightMath.min(t.right,i.right)+.1)){c.style.top=An;continue}let d=a.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,m=u.right-u.left,g=(e=na.get(h))!==null&&e!==void 0?e:u.bottom-u.top,y=h.offset||km,S=this.view.textDirection==Z.LTR,x=u.width>i.right-i.left?S?i.left:i.right-u.width:S?Math.max(i.left,Math.min(f.left-(d?14:0)+y.x,i.right-m)):Math.min(Math.max(i.left,f.left-m+(d?14:0)-y.x),i.right-m),w=this.above[l];!a.strictSide&&(w?f.top-g-p-y.yi.bottom)&&w==i.bottom-f.bottom>f.top-i.top&&(w=this.above[l]=!w);let k=(w?f.top-i.top:i.bottom-f.bottom)-p;if(kx&&E.topv&&(v=w?E.top-g-2-p:E.bottom+p+2);if(this.position=="absolute"?(c.style.top=(v-n.parent.top)/r+"px",sa(c,(x-n.parent.left)/s)):(c.style.top=v/r+"px",sa(c,x/s)),d){let E=f.left+(S?y.x:-y.x)-(x+14-7);d.style.left=E/s+"px"}h.overlap!==!0&&o.push({left:x,top:v,right:T,bottom:v+g}),c.classList.toggle("cm-tooltip-above",w),c.classList.toggle("cm-tooltip-below",!w),h.positioned&&h.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=An}},{eventObservers:{scroll(){this.maybeMeasure()}}});function sa(n,e){let t=parseInt(n.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(n.style.left=e+"px")}const xm=P.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),km={x:0,y:0},Eo=A.define({enables:[Do,xm]}),hs=A.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class Ps{static create(e){return new Ps(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Vc(e,hs,(t,i)=>this.createHostedView(t,i),t=>t.dom.remove())}createHostedView(e,t){let i=e.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let i of this.manager.tooltipViews){let s=i[e];if(s!==void 0){if(t===void 0)t=s;else if(t!==s)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const wm=Eo.compute([hs],n=>{let e=n.facet(hs);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var i;return(i=t.end)!==null&&i!==void 0?i:t.pos})),create:Ps.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class vm{constructor(e,t,i,s,r){this.view=e,this.source=t,this.field=i,this.setHover=s,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;el.bottom||t.xl.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(s)).find(c=>c.from<=s&&c.to>=s),h=a&&a.dir==Z.RTL?-1:1;r=t.x{this.pending==l&&(this.pending=null,a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])}))},a=>Pe(e.state,a,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(Do),t=e?e.manager.tooltips.findIndex(i=>i.create==Ps.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,i;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:s,tooltip:r}=this;if(s.length&&r&&!Tm(r.dom,e)||this.pending){let{pos:o}=s[0]||this.pending,l=(i=(t=s[0])===null||t===void 0?void 0:t.end)!==null&&i!==void 0?i:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!Cm(this.view,o,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:i}=this;i&&i.dom.contains(e.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=i=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Mn=4;function Tm(n,e){let{left:t,right:i,top:s,bottom:r}=n.getBoundingClientRect(),o;if(o=n.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();s=Math.min(l.top,s),r=Math.max(l.bottom,r)}return e.clientX>=t-Mn&&e.clientX<=i+Mn&&e.clientY>=s-Mn&&e.clientY<=r+Mn}function Cm(n,e,t,i,s,r){let o=n.scrollDOM.getBoundingClientRect(),l=n.documentTop+n.documentPadding.top+n.contentHeight;if(o.left>i||o.rights||Math.min(o.bottom,l)=e&&a<=t}function Pm(n,e={}){let t=q.define(),i=he.define({create(){return[]},update(s,r){if(s.length&&(e.hideOnChange&&(r.docChanged||r.selection)?s=[]:e.hideOn&&(s=s.filter(o=>!e.hideOn(r,o))),r.docChanged)){let o=[];for(let l of s){let a=r.changes.mapPos(l.pos,-1,de.TrackDel);if(a!=null){let h=Object.assign(Object.create(null),l);h.pos=a,h.end!=null&&(h.end=r.changes.mapPos(h.end)),o.push(h)}}s=o}for(let o of r.effects)o.is(t)&&(s=o.value),o.is(Qm)&&(s=[]);return s},provide:s=>hs.from(s)});return{active:i,extension:[i,J.define(s=>new vm(s,n,i,t,e.hoverTime||300)),wm]}}function Nc(n,e){let t=n.plugin(Do);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const Qm=q.define(),ra=A.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Ni(n,e){let t=n.plugin(Xc),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const Xc=J.fromClass(class{constructor(n){this.input=n.state.facet(Xi),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(ra);this.top=new Rn(n,!0,e.topContainer),this.bottom=new Rn(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(ra);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Rn(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Rn(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(Xi);if(t!=this.input){let i=t.filter(a=>a),s=[],r=[],o=[],l=[];for(let a of i){let h=this.specs.indexOf(a),c;h<0?(c=a(n.view),l.push(c)):(c=this.panels[h],c.update&&c.update(n)),s.push(c),(c.top?r:o).push(c)}this.specs=i,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>P.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Rn{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=oa(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=oa(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function oa(n){let e=n.nextSibling;return n.remove(),e}const Xi=A.define({enables:Xc});class yt extends Nt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}yt.prototype.elementClass="";yt.prototype.toDOM=void 0;yt.prototype.mapMode=de.TrackBefore;yt.prototype.startSide=yt.prototype.endSide=-1;yt.prototype.point=!0;const Zn=A.define(),Am=A.define(),Mm={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>N.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},qi=A.define();function Rm(n){return[Fc(),qi.of({...Mm,...n})]}const la=A.define({combine:n=>n.some(e=>e)});function Fc(n){return[Dm]}const Dm=J.fromClass(class{constructor(n){this.view=n,this.domAfter=null,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(qi).map(e=>new ha(n,e)),this.fixed=!n.state.facet(la);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}if(n.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(la)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=N.iter(this.view.state.facet(Zn),this.view.viewport.from),i=[],s=this.gutters.map(r=>new Em(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(r.type)){let o=!0;for(let l of r.type)if(l.type==ke.Text&&o){no(t,i,l.from);for(let a of s)a.line(this.view,l,i);o=!1}else if(l.widget)for(let a of s)a.widget(this.view,l)}else if(r.type==ke.Text){no(t,i,r.from);for(let o of s)o.line(this.view,r,i)}else if(r.widget)for(let o of s)o.widget(this.view,r);for(let r of s)r.finish();n&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(n){let e=n.startState.facet(qi),t=n.state.facet(qi),i=n.docChanged||n.heightChanged||n.viewportChanged||!N.eq(n.startState.facet(Zn),n.state.facet(Zn),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let s of this.gutters)s.update(n)&&(i=!0);else{i=!0;let s=[];for(let r of t){let o=e.indexOf(r);o<0?s.push(new ha(this.view,r)):(this.gutters[o].update(n),s.push(this.gutters[o]))}for(let r of this.gutters)r.dom.remove(),s.indexOf(r)<0&&r.destroy();for(let r of s)r.config.side=="after"?this.getDOMAfter().appendChild(r.dom):this.dom.appendChild(r.dom);this.gutters=s}return i}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:n=>P.scrollMargins.of(e=>{let t=e.plugin(n);if(!t||t.gutters.length==0||!t.fixed)return null;let i=t.dom.offsetWidth*e.scaleX,s=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Z.LTR?{left:i,right:s}:{right:i,left:s}})});function aa(n){return Array.isArray(n)?n:[n]}function no(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class Em{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=N.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:s}=this,r=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==s.elements.length){let l=new _c(e,o,r,i);s.elements.push(l),s.dom.appendChild(l.dom)}else s.elements[this.i].update(e,o,r,i);this.height=t.bottom,this.i++}line(e,t,i){let s=[];no(this.cursor,s,t.from),i.length&&(s=s.concat(i));let r=this.gutter.config.lineMarker(e,t,s);r&&s.unshift(r);let o=this.gutter;s.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,s)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t),s=i?[i]:null;for(let r of e.state.facet(Am)){let o=r(e,t.widget,t);o&&(s||(s=[])).push(o)}s&&this.addElement(e,t,s)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class ha{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,s=>{let r=s.target,o;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let a=r.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=s.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[i](e,l,s)&&s.preventDefault()});this.markers=aa(t.markers(e)),t.initialSpacer&&(this.spacer=new _c(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=aa(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let i=e.view.viewport;return!N.eq(this.markers,t,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class _c{constructor(e,t,i,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,s)}update(e,t,i,s){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),qm(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,t){let i="cm-gutterElement",s=this.dom.firstChild;for(let r=0,o=0;;){let l=o,a=rr(l,a,h)||o(l,a,h):o}return i}})}});class Zs extends yt{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Ys(n,e){return n.state.facet(Jt).formatNumber(e,n.state)}const Wm=qi.compute([Jt],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet($m)},lineMarker(e,t,i){return i.some(s=>s.toDOM)?null:new Zs(Ys(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,i)=>{for(let s of e.state.facet(Bm)){let r=s(e,t,i);if(r)return r}return null},lineMarkerChange:e=>e.startState.facet(Jt)!=e.state.facet(Jt),initialSpacer(e){return new Zs(Ys(e,ca(e.state.doc.lines)))},updateSpacer(e,t){let i=Ys(t.view,ca(t.view.state.doc.lines));return i==e.number?e:new Zs(i)},domEventHandlers:n.facet(Jt).domEventHandlers,side:"before"}));function Lm(n={}){return[Jt.of(n),Fc(),Wm]}function ca(n){let e=9;for(;e{let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.head).from;s>t&&(t=s,e.push(zm.range(s)))}return N.of(e)});function Vm(){return Im}const Uc=1024;let Nm=0;class Ks{constructor(e,t){this.from=e,this.to=t}}class L{constructor(e={}){this.id=Nm++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=ve.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}L.closedBy=new L({deserialize:n=>n.split(" ")});L.openedBy=new L({deserialize:n=>n.split(" ")});L.group=new L({deserialize:n=>n.split(" ")});L.isolate=new L({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});L.contextHash=new L({perNode:!0});L.lookAhead=new L({perNode:!0});L.mounted=new L({perNode:!0});class cs{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}static get(e){return e&&e.props&&e.props[L.mounted.id]}}const Xm=Object.create(null);class ve{constructor(e,t,i,s=0){this.name=e,this.props=t,this.id=i,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):Xm,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new ve(e.name||"",t,e.id,i);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(L.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let s of i.split(" "))t[s]=e[i];return i=>{for(let s=i.prop(L.group),r=-1;r<(s?s.length:0);r++){let o=t[r<0?i.name:s[r]];if(o)return o}}}}ve.none=new ve("",Object.create(null),0,8);class Qs{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|re.IncludeAnonymous);;){let h=!1;if(a.from<=r&&a.to>=s&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Bo(ve.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,s)=>new j(this.type,t,i,s,this.propValues),e.makeTree||((t,i,s)=>new j(ve.none,t,i,s)))}static build(e){return Hm(e)}}j.empty=new j(ve.none,[],[],0);class qo{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new qo(this.buffer,this.index)}}class Qt{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return ve.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,i){let s=this.buffer,r=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function Fi(n,e,t,i){for(var s;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?l.length:-1;e!=h;e+=t){let c=l[e],f=a[e]+o.from;if(Hc(s,i,f,f+c.length)){if(c instanceof Qt){if(r&re.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,i-f,s);if(u>-1)return new Je(new Fm(o,c,e,f),null,u)}else if(r&re.IncludeAnonymous||!c.type.isAnonymous||$o(c)){let u;if(!(r&re.IgnoreMounts)&&(u=cs.get(c))&&!u.overlay)return new Ae(u.tree,f,e,o);let d=new Ae(c,f,e,o);return r&re.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,i,s)}}}if(r&re.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,i=0){let s;if(!(i&re.IgnoreOverlays)&&(s=cs.get(this._tree))&&s.overlay){let r=e-this.from;for(let{from:o,to:l}of s.overlay)if((t>0?o<=r:o=r:l>r))return new Ae(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function ua(n,e,t,i){let s=n.cursor(),r=[];if(!s.firstChild())return r;if(t!=null){for(let o=!1;!o;)if(o=s.type.is(t),!s.nextSibling())return r}for(;;){if(i!=null&&s.type.is(i))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return i==null?r:[]}}function so(n,e,t=e.length-1){for(let i=n;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class Fm{constructor(e,t,i,s){this.parent=e,this.buffer=t,this.index=i,this.start=s}}class Je extends jc{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new Je(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,i=0){if(i&re.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new Je(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Je(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Je(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,s=this.index+4,r=i.buffer[this.index+3];if(r>s){let o=i.buffer[this.index+1];e.push(i.slice(s,r,o)),t.push(0)}return new j(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Gc(n){if(!n.length)return null;let e=0,t=n[0];for(let r=1;rt.from||o.to=e){let l=new Ae(o.tree,o.overlay[0].from+r.from,-1,r);(s||(s=[i])).push(Fi(l,e,t,!1))}}return s?Gc(s):i}class ro{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Ae)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=i+s.buffer[e+1],this.to=i+s.buffer[e+2],!0}yield(e){return e?e instanceof Ae?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&re.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&re.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&re.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:s}=this;if(s){if(e>0){if(this.index-1)for(let r=t+e,o=e<0?-1:i._tree.children.length;r!=o;r+=e){let l=i._tree.children[r];if(this.mode&re.IncludeAnonymous||l instanceof Qt||!l.type.isAnonymous||$o(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;t=o,i=r+1;break e}s=this.stack[--r]}for(let s=i;s=0;r--){if(r<0)return so(this._tree,e,s);let o=i[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}}function $o(n){return n.children.some(e=>e instanceof Qt||!e.type.isAnonymous||$o(e))}function Hm(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:s=Uc,reused:r=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(t)?new qo(t,t.length):t,a=i.types,h=0,c=0;function f(k,v,T,E,M,z){let{id:$,start:D,end:B,size:W}=l,X=c,ne=h;if(W<0)if(l.next(),W==-1){let ce=r[$];T.push(ce),E.push(D-k);return}else if(W==-3){h=$;return}else if(W==-4){c=$;return}else throw new RangeError(`Unrecognized record size: ${W}`);let oe=a[$],me,F,ee=D-k;if(B-D<=s&&(F=g(l.pos-v,M))){let ce=new Uint16Array(F.size-F.skip),ge=l.pos-F.size,_e=ce.length;for(;l.pos>ge;)_e=y(F.start,ce,_e);me=new Qt(ce,B-F.start,i),ee=F.start-k}else{let ce=l.pos-W;l.next();let ge=[],_e=[],Dt=$>=o?$:-1,Gt=0,gn=B;for(;l.pos>ce;)Dt>=0&&l.id==Dt&&l.size>=0?(l.end<=gn-s&&(p(ge,_e,D,Gt,l.end,gn,Dt,X,ne),Gt=ge.length,gn=l.end),l.next()):z>2500?u(D,ce,ge,_e):f(D,ce,ge,_e,Dt,z+1);if(Dt>=0&&Gt>0&&Gt-1&&Gt>0){let ll=d(oe,ne);me=Bo(oe,ge,_e,0,ge.length,0,B-D,ll,ll)}else me=m(oe,ge,_e,B-D,X-B,ne)}T.push(me),E.push(ee)}function u(k,v,T,E){let M=[],z=0,$=-1;for(;l.pos>v;){let{id:D,start:B,end:W,size:X}=l;if(X>4)l.next();else{if($>-1&&B<$)break;$<0&&($=W-s),M.push(D,B,W),z++,l.next()}}if(z){let D=new Uint16Array(z*4),B=M[M.length-2];for(let W=M.length-3,X=0;W>=0;W-=3)D[X++]=M[W],D[X++]=M[W+1]-B,D[X++]=M[W+2]-B,D[X++]=X;T.push(new Qt(D,M[2]-B,i)),E.push(B-k)}}function d(k,v){return(T,E,M)=>{let z=0,$=T.length-1,D,B;if($>=0&&(D=T[$])instanceof j){if(!$&&D.type==k&&D.length==M)return D;(B=D.prop(L.lookAhead))&&(z=E[$]+D.length+B)}return m(k,T,E,M,z,v)}}function p(k,v,T,E,M,z,$,D,B){let W=[],X=[];for(;k.length>E;)W.push(k.pop()),X.push(v.pop()+T-M);k.push(m(i.types[$],W,X,z-M,D-z,B)),v.push(M-T)}function m(k,v,T,E,M,z,$){if(z){let D=[L.contextHash,z];$=$?[D].concat($):[D]}if(M>25){let D=[L.lookAhead,M];$=$?[D].concat($):[D]}return new j(k,v,T,E,$)}function g(k,v){let T=l.fork(),E=0,M=0,z=0,$=T.end-s,D={size:0,start:0,skip:0};e:for(let B=T.pos-k;T.pos>B;){let W=T.size;if(T.id==v&&W>=0){D.size=E,D.start=M,D.skip=z,z+=4,E+=4,T.next();continue}let X=T.pos-W;if(W<0||X=o?4:0,oe=T.start;for(T.next();T.pos>X;){if(T.size<0)if(T.size==-3)ne+=4;else break e;else T.id>=o&&(ne+=4);T.next()}M=oe,E+=W,z+=ne}return(v<0||E==k)&&(D.size=E,D.start=M,D.skip=z),D.size>4?D:void 0}function y(k,v,T){let{id:E,start:M,end:z,size:$}=l;if(l.next(),$>=0&&E4){let B=l.pos-($-4);for(;l.pos>B;)T=y(k,v,T)}v[--T]=D,v[--T]=z-k,v[--T]=M-k,v[--T]=E}else $==-3?h=E:$==-4&&(c=E);return T}let S=[],x=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,S,x,-1,0);let w=(e=n.length)!==null&&e!==void 0?e:S.length?x[0]+S[0].length:0;return new j(a[n.topID],S.reverse(),x.reverse(),w)}const da=new WeakMap;function Yn(n,e){if(!n.isAnonymous||e instanceof Qt||e.type!=n)return 1;let t=da.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof j)){t=1;break}t+=Yn(n,i)}da.set(e,t)}return t}function Bo(n,e,t,i,s,r,o,l,a){let h=0;for(let p=i;p=c)break;v+=T}if(x==w+1){if(v>c){let T=p[w];d(T.children,T.positions,0,T.children.length,m[w]+S);continue}f.push(p[w])}else{let T=m[x-1]+p[x-1].length-k;f.push(Bo(n,p,m,w,x,k,T,null,a))}u.push(k+S-r)}}return d(e,t,i,s,0),(l||a)(f,u,o)}class jm{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof Je?this.setBuffer(e.context.buffer,e.index,t):e instanceof Ae&&this.map.set(e.tree,t)}get(e){return e instanceof Je?this.getBuffer(e.context.buffer,e.index):e instanceof Ae?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class It{constructor(e,t,i,s,r=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let s=[new It(0,e.length,e,0,!1,i)];for(let r of t)r.to>e.length&&s.push(r);return s}static applyChanges(e,t,i=128){if(!t.length)return e;let s=[],r=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l=i)for(;o&&o.from=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new It(d,p,u.tree,u.offset+h,l>0,!!c)}if(u&&s.push(u),o.to>f)break;o=rnew Ks(s.from,s.to)):[new Ks(0,0)]:[new Ks(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let s=this.startParse(e,t,i);for(;;){let r=s.advance();if(r)return r}}}class Gm{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new L({perNode:!0});let Zm=0;class qe{constructor(e,t,i,s){this.name=e,this.set=t,this.base=i,this.modified=s,this.id=Zm++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i=typeof e=="string"?e:"?";if(e instanceof qe&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let s=new qe(i,[],null,[]);if(s.set.push(s),t)for(let r of t.set)s.set.push(r);return s}static defineModifier(e){let t=new fs(e);return i=>i.modified.indexOf(t)>-1?i:fs.get(i.base||i,i.modified.concat(t).sort((s,r)=>s.id-r.id))}}let Ym=0;class fs{constructor(e){this.name=e,this.instances=[],this.id=Ym++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&Km(t,l.modified));if(i)return i;let s=[],r=new qe(e.name,s,e,t);for(let l of t)l.instances.push(r);let o=Jm(t);for(let l of e.set)if(!l.modified.length)for(let a of o)s.push(fs.get(l,a));return r}}function Km(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function Jm(n){let e=[[]];for(let t=0;ti.length-t.length)}function Lo(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let s of t.split(" "))if(s){let r=[],o=2,l=s;for(let f=0;;){if(l=="..."&&f>0&&f+3==s.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+s);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==s.length)break;let d=s[f++];if(f==s.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+s);l=s.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+s);let c=new _i(i,o,a>0?r.slice(0,a):null);e[h]=c.sort(e[h])}}return Zc.add(e)}const Zc=new L({combine(n,e){let t,i,s;for(;n||e;){if(!n||e&&n.depth>=e.depth?(s=e,e=e.next):(s=n,n=n.next),t&&t.mode==s.mode&&!s.context&&!t.context)continue;let r=new _i(s.tags,s.mode,s.context);t?t.next=r:i=r,t=r}return i}});class _i{constructor(e,t,i,s){this.tags=e,this.mode=t,this.context=i,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=s;for(let l of r)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:i}}function eg(n,e){let t=null;for(let i of n){let s=i.style(e);s&&(t=t?t+" "+s:s)}return t}function tg(n,e,t,i=0,s=n.length){let r=new ig(i,Array.isArray(e)?e:[e],t);r.highlightRange(n.cursor(),i,s,"",r.highlighters),r.flush(s)}class ig{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,s,r){let{type:o,from:l,to:a}=e;if(l>=i||a<=t)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=s,c=ng(e)||_i.empty,f=eg(r,c.tags);if(f&&(h&&(h+=" "),h+=f,c.mode==1&&(s+=(s?" ":"")+f)),this.startSpan(Math.max(t,l),h),c.opaque)return;let u=e.tree&&e.tree.prop(L.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(g=>!g.scope||g.scope(u.tree.type)),m=e.firstChild();for(let g=0,y=l;;g++){let S=g=x||!e.nextSibling())););if(!S||x>i)break;y=S.to+l,y>t&&(this.highlightRange(d.cursor(),Math.max(t,S.from+l),Math.min(i,y),"",p),this.startSpan(Math.min(i,y),h))}m&&e.parent()}else if(e.firstChild()){u&&(s="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,s,r),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}}function ng(n){let e=n.type.prop(Zc);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const C=qe.define,En=C(),bt=C(),pa=C(bt),ma=C(bt),St=C(),qn=C(St),Js=C(St),Ge=C(),Et=C(Ge),He=C(),je=C(),oo=C(),ki=C(oo),$n=C(),O={comment:En,lineComment:C(En),blockComment:C(En),docComment:C(En),name:bt,variableName:C(bt),typeName:pa,tagName:C(pa),propertyName:ma,attributeName:C(ma),className:C(bt),labelName:C(bt),namespace:C(bt),macroName:C(bt),literal:St,string:qn,docString:C(qn),character:C(qn),attributeValue:C(qn),number:Js,integer:C(Js),float:C(Js),bool:C(St),regexp:C(St),escape:C(St),color:C(St),url:C(St),keyword:He,self:C(He),null:C(He),atom:C(He),unit:C(He),modifier:C(He),operatorKeyword:C(He),controlKeyword:C(He),definitionKeyword:C(He),moduleKeyword:C(He),operator:je,derefOperator:C(je),arithmeticOperator:C(je),logicOperator:C(je),bitwiseOperator:C(je),compareOperator:C(je),updateOperator:C(je),definitionOperator:C(je),typeOperator:C(je),controlOperator:C(je),punctuation:oo,separator:C(oo),bracket:ki,angleBracket:C(ki),squareBracket:C(ki),paren:C(ki),brace:C(ki),content:Ge,heading:Et,heading1:C(Et),heading2:C(Et),heading3:C(Et),heading4:C(Et),heading5:C(Et),heading6:C(Et),contentSeparator:C(Ge),list:C(Ge),quote:C(Ge),emphasis:C(Ge),strong:C(Ge),link:C(Ge),monospace:C(Ge),strikethrough:C(Ge),inserted:C(),deleted:C(),changed:C(),invalid:C(),meta:$n,documentMeta:C($n),annotation:C($n),processingInstruction:C($n),definition:qe.defineModifier("definition"),constant:qe.defineModifier("constant"),function:qe.defineModifier("function"),standard:qe.defineModifier("standard"),local:qe.defineModifier("local"),special:qe.defineModifier("special")};for(let n in O){let e=O[n];e instanceof qe&&(e.name=n)}Yc([{tag:O.link,class:"tok-link"},{tag:O.heading,class:"tok-heading"},{tag:O.emphasis,class:"tok-emphasis"},{tag:O.strong,class:"tok-strong"},{tag:O.keyword,class:"tok-keyword"},{tag:O.atom,class:"tok-atom"},{tag:O.bool,class:"tok-bool"},{tag:O.url,class:"tok-url"},{tag:O.labelName,class:"tok-labelName"},{tag:O.inserted,class:"tok-inserted"},{tag:O.deleted,class:"tok-deleted"},{tag:O.literal,class:"tok-literal"},{tag:O.string,class:"tok-string"},{tag:O.number,class:"tok-number"},{tag:[O.regexp,O.escape,O.special(O.string)],class:"tok-string2"},{tag:O.variableName,class:"tok-variableName"},{tag:O.local(O.variableName),class:"tok-variableName tok-local"},{tag:O.definition(O.variableName),class:"tok-variableName tok-definition"},{tag:O.special(O.variableName),class:"tok-variableName2"},{tag:O.definition(O.propertyName),class:"tok-propertyName tok-definition"},{tag:O.typeName,class:"tok-typeName"},{tag:O.namespace,class:"tok-namespace"},{tag:O.className,class:"tok-className"},{tag:O.macroName,class:"tok-macroName"},{tag:O.propertyName,class:"tok-propertyName"},{tag:O.operator,class:"tok-operator"},{tag:O.comment,class:"tok-comment"},{tag:O.meta,class:"tok-meta"},{tag:O.invalid,class:"tok-invalid"},{tag:O.punctuation,class:"tok-punctuation"}]);var er;const Lt=new L;function Kc(n){return A.define({combine:n?e=>e.concat(n):void 0})}const sg=new L;class $e{constructor(e,t,i=[],s=""){this.data=e,this.name=s,I.prototype.hasOwnProperty("tree")||Object.defineProperty(I.prototype,"tree",{get(){return ae(this)}}),this.parser=t,this.extension=[At.of(this),I.languageData.of((r,o,l)=>{let a=ga(r,o,l),h=a.type.prop(Lt);if(!h)return[];let c=r.facet(h),f=a.type.prop(sg);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(i)}isActiveAt(e,t,i=-1){return ga(e,t,i).type.prop(Lt)==this.data}findRegions(e){let t=e.facet(At);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],s=(r,o)=>{if(r.prop(Lt)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(L.mounted);if(l){if(l.tree.prop(Lt)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(s(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;ai.isTop?t:void 0)]}),e.name)}configure(e,t){return new Ui(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ae(n){let e=n.field($e.state,!1);return e?e.tree:j.empty}class rg{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let wi=null;class ui{constructor(e,t,i=[],s,r,o,l,a){this.parser=e,this.state=t,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new ui(e,t,[],j.empty,0,i,[],null)}startParse(){return this.parser.startParse(new rg(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=j.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(It.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=wi;wi=this;try{return e()}finally{wi=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Oa(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),i=It.applyChanges(i,a),s=j.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=Oa(this.fragments,s,r),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Wo{createParse(t,i,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let a=wi;if(a){for(let h of s)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new j(ve.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return wi}}function Oa(n,e,t){return It.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class di{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new di(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=ui.create(e.facet(At).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new di(i)}}$e.state=he.define({create:di.init,update(n,e){for(let t of e.effects)if(t.is($e.setState))return t.value;return e.startState.facet(At)!=e.state.facet(At)?di.init(e.state):n.apply(e)}});let Jc=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Jc=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const tr=typeof navigator<"u"&&(!((er=navigator.scheduling)===null||er===void 0)&&er.isInputPending)?()=>navigator.scheduling.isInputPending():null,og=J.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field($e.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field($e.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Jc(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnds+1e3,a=r.context.work(()=>tr&&tr()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:$e.setState.of(new di(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Pe(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),At=A.define({combine(n){return n.length?n[0]:null},enables:n=>[$e.state,og,P.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class ef{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const lg=A.define(),cn=A.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Ut(n){let e=n.facet(cn);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function Hi(n,e){let t="",i=n.tabSize,s=n.facet(cn)[0];if(s==" "){for(;e>=i;)t+=" ",e-=i;s=" "}for(let r=0;r=e?ag(n,t,e):null}class As{constructor(e,t={}){this.state=e,this.options=t,this.unit=Ut(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:r}=this.options;return s!=null&&s>=i.from&&s<=i.to?r&&s==e?{text:"",from:e}:(t<0?s-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return gi(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:s}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Ms=new L;function ag(n,e,t){let i=e.resolveStack(t),s=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(s!=i.node){let r=[];for(let o=s;o&&!(o.fromi.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)i={node:r[o],next:i}}return tf(i,n,t)}function tf(n,e,t){for(let i=n;i;i=i.next){let s=cg(i.node);if(s)return s(Io.create(e,t,i))}return 0}function hg(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function cg(n){let e=n.type.prop(Ms);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(L.closedBy))){let s=n.lastChild,r=s&&i.indexOf(s.name)>-1;return o=>nf(o,!0,1,void 0,r&&!hg(o)?s.from:void 0)}return n.parent==null?fg:null}function fg(){return 0}class Io extends As{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new Io(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(ug(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return tf(this.context.next,this.base,this.pos)}}function ug(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function dg(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let s=n.options.simulateBreak,r=n.state.doc.lineAt(t.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let h=/^ */.exec(r.text.slice(t.to-r.from))[0].length;return{from:t.from,to:t.to+h}}l=a.to}}function ir({closing:n,align:e=!0,units:t=1}){return i=>nf(i,e,t,n)}function nf(n,e,t,i,s){let r=n.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||s==n.pos+o,a=e?dg(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}function ya({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const pg=200;function mg(){return I.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:i}=n.newSelection.main,s=t.lineAt(i);if(i>s.from+pg)return n;let r=t.sliceString(s.from,i);if(!e.some(h=>h.test(r)))return n;let{state:o}=n,l=-1,a=[];for(let{head:h}of o.selection.ranges){let c=o.doc.lineAt(h);if(c.from==l)continue;l=c.from;let f=zo(o,c.from);if(f==null)continue;let u=/^\s*/.exec(c.text)[0],d=Hi(o,f);u!=d&&a.push({from:c.from,to:c.from+u.length,insert:d})}return a.length?[n,{changes:a,sequential:!0}]:n})}const gg=A.define(),Vo=new L;function sf(n){let e=n.firstChild,t=n.lastChild;return e&&e.tot)continue;if(r&&l.from=e&&h.to>t&&(r=h)}}return r}function yg(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function us(n,e,t){for(let i of n.facet(gg)){let s=i(n,e,t);if(s)return s}return Og(n,e,t)}function rf(n,e){let t=e.mapPos(n.from,1),i=e.mapPos(n.to,-1);return t>=i?void 0:{from:t,to:i}}const Rs=q.define({map:rf}),fn=q.define({map:rf});function of(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(i=>i.from<=t&&i.to>=t)||e.push(n.lineBlockAt(t));return e}const Ht=he.define({create(){return R.none},update(n,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((t,i)=>n=ba(n,t,i)),n=n.map(e.changes);for(let t of e.effects)if(t.is(Rs)&&!bg(n,t.value.from,t.value.to)){let{preparePlaceholder:i}=e.state.facet(hf),s=i?R.replace({widget:new Cg(i(e.state,t.value))}):Sa;n=n.update({add:[s.range(t.value.from,t.value.to)]})}else t.is(fn)&&(n=n.update({filter:(i,s)=>t.value.from!=i||t.value.to!=s,filterFrom:t.value.from,filterTo:t.value.to}));return e.selection&&(n=ba(n,e.selection.main.head)),n},provide:n=>P.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(i,s)=>{t.push(i,s)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{se&&(i=!0)}),i?n.update({filterFrom:e,filterTo:t,filter:(s,r)=>s>=t||r<=e}):n}function ds(n,e,t){var i;let s=null;return(i=n.field(Ht,!1))===null||i===void 0||i.between(e,t,(r,o)=>{(!s||s.from>r)&&(s={from:r,to:o})}),s}function bg(n,e,t){let i=!1;return n.between(e,e,(s,r)=>{s==e&&r==t&&(i=!0)}),i}function lf(n,e){return n.field(Ht,!1)?e:e.concat(q.appendConfig.of(cf()))}const Sg=n=>{for(let e of of(n)){let t=us(n.state,e.from,e.to);if(t)return n.dispatch({effects:lf(n.state,[Rs.of(t),af(n,t)])}),!0}return!1},xg=n=>{if(!n.state.field(Ht,!1))return!1;let e=[];for(let t of of(n)){let i=ds(n.state,t.from,t.to);i&&e.push(fn.of(i),af(n,i,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function af(n,e,t=!0){let i=n.state.doc.lineAt(e.from).number,s=n.state.doc.lineAt(e.to).number;return P.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${i} ${n.state.phrase("to")} ${s}.`)}const kg=n=>{let{state:e}=n,t=[];for(let i=0;i{let e=n.state.field(Ht,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(i,s)=>{t.push(fn.of({from:i,to:s}))}),n.dispatch({effects:t}),!0},vg=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Sg},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:xg},{key:"Ctrl-Alt-[",run:kg},{key:"Ctrl-Alt-]",run:wg}],Tg={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},hf=A.define({combine(n){return rt(n,Tg)}});function cf(n){return[Ht,Ag]}function ff(n,e){let{state:t}=n,i=t.facet(hf),s=o=>{let l=n.lineBlockAt(n.posAtDOM(o.target)),a=ds(n.state,l.from,l.to);a&&n.dispatch({effects:fn.of(a)}),o.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(n,s,e);let r=document.createElement("span");return r.textContent=i.placeholderText,r.setAttribute("aria-label",t.phrase("folded code")),r.title=t.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=s,r}const Sa=R.replace({widget:new class extends ot{toDOM(n){return ff(n,null)}}});class Cg extends ot{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return ff(e,this.value)}}const Pg={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class nr extends yt{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function Qg(n={}){let e={...Pg,...n},t=new nr(e,!0),i=new nr(e,!1),s=J.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(At)!=o.state.facet(At)||o.startState.field(Ht,!1)!=o.state.field(Ht,!1)||ae(o.startState)!=ae(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new gt;for(let a of o.viewportLineBlocks){let h=ds(o.state,a.from,a.to)?i:us(o.state,a.from,a.to)?t:null;h&&l.add(a.from,a.from,h)}return l.finish()}}),{domEventHandlers:r}=e;return[s,Rm({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(s))===null||l===void 0?void 0:l.markers)||N.empty},initialSpacer(){return new nr(e,!1)},domEventHandlers:{...r,click:(o,l,a)=>{if(r.click&&r.click(o,l,a))return!0;let h=ds(o.state,l.from,l.to);if(h)return o.dispatch({effects:fn.of(h)}),!0;let c=us(o.state,l.from,l.to);return c?(o.dispatch({effects:Rs.of(c)}),!0):!1}}}),cf()]}const Ag=P.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class un{constructor(e,t){this.specs=e;let i;function s(l){let a=Tt.newName();return(i||(i=Object.create(null)))["."+a]=l,a}const r=typeof t.all=="string"?t.all:t.all?s(t.all):void 0,o=t.scope;this.scope=o instanceof $e?l=>l.prop(Lt)==o.data:o?l=>l==o:void 0,this.style=Yc(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new Tt(i):null,this.themeType=t.themeType}static define(e,t){return new un(e,t||{})}}const lo=A.define(),uf=A.define({combine(n){return n.length?[n[0]]:null}});function sr(n){let e=n.facet(lo);return e.length?e:n.facet(uf)}function df(n,e){let t=[Rg],i;return n instanceof un&&(n.module&&t.push(P.styleModule.of(n.module)),i=n.themeType),e?.fallback?t.push(uf.of(n)):i?t.push(lo.computeN([P.darkTheme],s=>s.facet(P.darkTheme)==(i=="dark")?[n]:[])):t.push(lo.of(n)),t}class Mg{constructor(e){this.markCache=Object.create(null),this.tree=ae(e.state),this.decorations=this.buildDeco(e,sr(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=ae(e.state),i=sr(e.state),s=i!=sr(e.startState),{viewport:r}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||s)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return R.none;let i=new gt;for(let{from:s,to:r}of e.visibleRanges)tg(this.tree,t,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=R.mark({class:a})))},s,r);return i.finish()}}const Rg=Mt.high(J.fromClass(Mg,{decorations:n=>n.decorations})),Dg=un.define([{tag:O.meta,color:"#404740"},{tag:O.link,textDecoration:"underline"},{tag:O.heading,textDecoration:"underline",fontWeight:"bold"},{tag:O.emphasis,fontStyle:"italic"},{tag:O.strong,fontWeight:"bold"},{tag:O.strikethrough,textDecoration:"line-through"},{tag:O.keyword,color:"#708"},{tag:[O.atom,O.bool,O.url,O.contentSeparator,O.labelName],color:"#219"},{tag:[O.literal,O.inserted],color:"#164"},{tag:[O.string,O.deleted],color:"#a11"},{tag:[O.regexp,O.escape,O.special(O.string)],color:"#e40"},{tag:O.definition(O.variableName),color:"#00f"},{tag:O.local(O.variableName),color:"#30a"},{tag:[O.typeName,O.namespace],color:"#085"},{tag:O.className,color:"#167"},{tag:[O.special(O.variableName),O.macroName],color:"#256"},{tag:O.definition(O.propertyName),color:"#00c"},{tag:O.comment,color:"#940"},{tag:O.invalid,color:"#f00"}]),Eg=P.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),pf=1e4,mf="()[]{}",gf=A.define({combine(n){return rt(n,{afterCursor:!0,brackets:mf,maxScanDistance:pf,renderMatch:Bg})}}),qg=R.mark({class:"cm-matchingBracket"}),$g=R.mark({class:"cm-nonmatchingBracket"});function Bg(n){let e=[],t=n.matched?qg:$g;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const Wg=he.define({create(){return R.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],i=e.state.facet(gf);for(let s of e.state.selection.ranges){if(!s.empty)continue;let r=et(e.state,s.head,-1,i)||s.head>0&&et(e.state,s.head-1,1,i)||i.afterCursor&&(et(e.state,s.head,1,i)||s.headP.decorations.from(n)}),Lg=[Wg,Eg];function zg(n={}){return[gf.of(n),Lg]}const Ig=new L;function ao(n,e,t){let i=n.prop(e<0?L.openedBy:L.closedBy);if(i)return i;if(n.name.length==1){let s=t.indexOf(n.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function ho(n){let e=n.type.prop(Ig);return e?e(n.node):n}function et(n,e,t,i={}){let s=i.maxScanDistance||pf,r=i.brackets||mf,o=ae(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let h=ao(a.type,t,r);if(h&&a.from0?e>=c.from&&ec.from&&e<=c.to))return Vg(n,e,t,a,c,h,r)}}return Ng(n,e,t,o,l.type,s,r)}function Vg(n,e,t,i,s,r,o){let l=i.parent,a={from:s.from,to:s.to},h=0,c=l?.cursor();if(c&&(t<0?c.childBefore(i.from):c.childAfter(i.to)))do if(t<0?c.to<=i.from:c.from>=i.to){if(h==0&&r.indexOf(c.type.name)>-1&&c.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let m=t>0?0:d.length-1,g=t>0?d.length:-1;m!=g;m+=t){let y=o.indexOf(d[m]);if(!(y<0||i.resolveInner(p+m,1).type!=s))if(y%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+m,to:p+m+1},matched:y>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}function xa(n,e,t,i=0,s=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let r=s;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosi?o.toLowerCase():o,r=this.string.substr(this.pos,e.length);return s(r)==s(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function Xg(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||Fg,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||Xo,mergeTokens:n.mergeTokens!==!1}}function Fg(n){if(typeof n!="object")return n;let e={};for(let t in n){let i=n[t];e[t]=i instanceof Array?i.slice():i}return e}const ka=new WeakMap;class yf extends $e{constructor(e){let t=Kc(e.languageData),i=Xg(e),s,r=new class extends Wo{createParse(o,l,a){return new Ug(s,o,l,a)}};super(t,r,[],e.name),this.topNode=Gg(t,this),s=this,this.streamParser=i,this.stateAfter=new L({perNode:!0}),this.tokenTable=e.tokenTable?new kf(i.tokenTable):jg}static define(e){return new yf(e)}getIndent(e){let t,{overrideIndentation:i}=e.options;i&&(t=ka.get(e.state),t!=null&&t1e4)return null;for(;r=i&&t+e.length<=s&&e.prop(n.stateAfter);if(r)return{state:n.streamParser.copyState(r),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=t+e.positions[o],h=l instanceof j&&a=e.length)return e;!s&&t==0&&e.type==n.topNode&&(s=!0);for(let r=e.children.length-1;r>=0;r--){let o=e.positions[r],l=e.children[r],a;if(ot&&No(n,r.tree,0-r.offset,t,l),h;if(a&&a.pos<=i&&(h=bf(n,r.tree,t+r.offset,a.pos+r.offset,!1)))return{state:a.state,tree:h}}return{state:n.streamParser.startState(s?Ut(s):4),tree:j.empty}}let Ug=class{constructor(e,t,i,s){this.lang=e,this.input=t,this.fragments=i,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let r=ui.get(),o=s[0].from,{state:l,tree:a}=_g(e,i,o,this.to,r?.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let h=0;hh.from<=r.viewport.from&&h.to>=r.viewport.from)&&(this.state=this.lang.streamParser.startState(Ut(r.state)),r.skipUntilInView(this.parsedPos,r.viewport.from),this.parsedPos=r.viewport.from),this.moveRangeIndex()}advance(){let e=ui.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(t,this.chunkStart+512);for(e&&(i=Math.min(i,e.viewport.to));this.parsedPos=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==` +`&&(t="");else{let i=t.indexOf(` +`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?s>r:s>=r)break;let o=this.ranges[++this.rangeIndex].from;t+=o-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){s=this.skipGapsTo(t,s,1),t+=s;let l=this.chunk.length;s=this.skipGapsTo(i,s,-1),i+=s,r+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&r==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=i:this.chunk.push(e,t,i,r),s}parseLine(e){let{line:t,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new Of(t,e?e.state.tabSize:4,e?Ut(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=Sf(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPose.start)return s}throw new Error("Stream parser failed to advance stream.")}const Xo=Object.create(null),ji=[ve.none],Hg=new Qs(ji),wa=[],va=Object.create(null),xf=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])xf[n]=wf(Xo,e);class kf{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),xf)}resolve(e){return e?this.table[e]||(this.table[e]=wf(this.extra,e)):0}}const jg=new kf(Xo);function rr(n,e){wa.indexOf(n)>-1||(wa.push(n),console.warn(e))}function wf(n,e){let t=[];for(let l of e.split(" ")){let a=[];for(let h of l.split(".")){let c=n[h]||O[h];c?typeof c=="function"?a.length?a=a.map(c):rr(h,`Modifier ${h} used at start of tag`):a.length?rr(h,`Tag ${h} used as modifier`):a=Array.isArray(c)?c:[c]:rr(h,`Unknown highlighting tag ${h}`)}for(let h of a)t.push(h)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),s=i+" "+t.map(l=>l.id),r=va[s];if(r)return r.id;let o=va[s]=ve.define({id:ji.length,name:i,props:[Lo({[i]:t})]});return ji.push(o),o.id}function Gg(n,e){let t=ve.define({id:ji.length,name:"Document",props:[Lt.add(()=>n),Ms.add(()=>i=>e.getIndent(i))],top:!0});return ji.push(t),t}Z.RTL,Z.LTR;const Zg=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=_o(n.state,t.from);return i.line?Yg(n):i.block?Jg(n):!1};function Fo(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}const Yg=Fo(iO,0),Kg=Fo(vf,0),Jg=Fo((n,e)=>vf(n,e,tO(e)),0);function _o(n,e){let t=n.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const vi=50;function eO(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-vi,i),o=n.sliceDoc(s,s+vi),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,h=r.length-l;if(r.slice(h-e.length,h)==e&&o.slice(a,a+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let c,f;s-i<=2*vi?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+vi),f=n.sliceDoc(s-vi,s));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:s-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function tO(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),s=t.to<=i.to?i:n.doc.lineAt(t.to);s.from>i.from&&s.from==t.to&&(s=t.to==i.to+1?i:n.doc.lineAt(t.to-1));let r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=s.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:s.to})}return e}function vf(n,e,t=e.selection.ranges){let i=t.map(r=>_o(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>eO(e,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;os&&(r==o||o>f.from)){s=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:h,empty:c,single:f}of i)(f||!c)&&r.push({from:l.from+h,insert:a+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let h=o.from+l,c=h+a.length;o.text[c-o.from]==" "&&c++,r.push({from:h,to:c})}return{changes:r}}return null}const co=st.define(),nO=st.define(),sO=A.define(),Tf=A.define({combine(n){return rt(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,s)=>e(i,s)||t(i,s)})}}),Cf=he.define({create(){return tt.empty},update(n,e){let t=e.state.facet(Tf),i=e.annotation(co);if(i){let a=Qe.fromTransaction(e,i.selection),h=i.side,c=h==0?n.undone:n.done;return a?c=ps(c,c.length,t.minDepth,a):c=Af(c,e.startState.selection),new tt(h==0?i.rest:c,h==0?c:i.rest)}let s=e.annotation(nO);if((s=="full"||s=="before")&&(n=n.isolate()),e.annotation(ie.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let r=Qe.fromTransaction(e),o=e.annotation(ie.time),l=e.annotation(ie.userEvent);return r?n=n.addChanges(r,o,l,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new tt(n.done.map(Qe.fromJSON),n.undone.map(Qe.fromJSON))}});function rO(n={}){return[Cf,Tf.of(n),P.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?Pf:e.inputType=="historyRedo"?fo:null;return i?(e.preventDefault(),i(t)):!1}})]}function Ds(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let s=t.field(Cf,!1);if(!s)return!1;let r=s.pop(n,t,e);return r?(i(r),!0):!1}}const Pf=Ds(0,!1),fo=Ds(1,!1),oO=Ds(0,!0),lO=Ds(1,!0);class Qe{constructor(e,t,i,s,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new Qe(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new Qe(e.changes&&se.fromJSON(e.changes),[],e.mapped&&it.fromJSON(e.mapped),e.startSelection&&b.fromJSON(e.startSelection),e.selectionsAfter.map(b.fromJSON))}static fromTransaction(e,t){let i=Be;for(let s of e.startState.facet(sO)){let r=s(e);r.length&&(i=i.concat(r))}return!i.length&&e.changes.empty?null:new Qe(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Be)}static selection(e){return new Qe(void 0,Be,void 0,void 0,e)}}function ps(n,e,t,i){let s=e+1>t+20?e-t-1:0,r=n.slice(s,e);return r.push(i),r}function aO(n,e){let t=[],i=!1;return n.iterChangedRanges((s,r)=>t.push(s,r)),e.iterChangedRanges((s,r,o,l)=>{for(let a=0;a=h&&o<=c&&(i=!0)}}),i}function hO(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function Qf(n,e){return n.length?e.length?n.concat(e):n:e}const Be=[],cO=200;function Af(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-cO));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),ps(n,n.length-1,1e9,t.setSelAfter(i)))}else return[Qe.selection([e])]}function fO(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function or(n,e){if(!n.length)return n;let t=n.length,i=Be;for(;t;){let s=uO(n[t-1],e,i);if(s.changes&&!s.changes.empty||s.effects.length){let r=n.slice(0,t);return r[t-1]=s,r}else e=s.mapped,t--,i=s.selectionsAfter}return i.length?[Qe.selection(i)]:Be}function uO(n,e,t){let i=Qf(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):Be,t);if(!n.changes)return Qe.selection(i);let s=n.changes.map(e),r=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new Qe(s,q.mapEffects(n.effects,e),o,n.startSelection.map(r),i)}const dO=/^(input\.type|delete)($|\.)/;class tt{constructor(e,t,i=0,s=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new tt(this.done,this.undone):this}addChanges(e,t,i,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||dO.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):Es(t,e))}function be(n){return n.textDirectionAt(n.state.selection.main.head)==Z.LTR}const Rf=n=>Mf(n,!be(n)),Df=n=>Mf(n,be(n));function Ef(n,e){return Fe(n,t=>t.empty?n.moveByGroup(t,e):Es(t,e))}const mO=n=>Ef(n,!be(n)),gO=n=>Ef(n,be(n));function OO(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function qs(n,e,t){let i=ae(n).resolveInner(e.head),s=t?L.closedBy:L.openedBy;for(let a=e.head;;){let h=t?i.childAfter(a):i.childBefore(a);if(!h)break;OO(n,h,s)?i=h:a=t?h.to:h.from}let r=i.type.prop(s),o,l;return r&&(o=t?et(n,i.from,1):et(n,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,b.cursor(l,t?-1:1)}const yO=n=>Fe(n,e=>qs(n.state,e,!be(n))),bO=n=>Fe(n,e=>qs(n.state,e,be(n)));function qf(n,e){return Fe(n,t=>{if(!t.empty)return Es(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const $f=n=>qf(n,!1),Bf=n=>qf(n,!0);function Wf(n){let e=n.scrollDOM.clientHeighto.empty?n.moveVertically(o,e,t.height):Es(o,e));if(s.eq(i.selection))return!1;let r;if(t.selfScroll){let o=n.coordsAtPos(i.selection.main.head),l=n.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,h=l.bottom-t.marginBottom;o&&o.top>a&&o.bottomLf(n,!1),uo=n=>Lf(n,!0);function Rt(n,e,t){let i=n.lineBlockAt(e.head),s=n.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?i.to:i.from)&&(s=n.moveToLineBoundary(e,t,!1)),!t&&s.head==i.from&&i.length){let r=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&e.head!=i.from+r&&(s=b.cursor(i.from+r))}return s}const SO=n=>Fe(n,e=>Rt(n,e,!0)),xO=n=>Fe(n,e=>Rt(n,e,!1)),kO=n=>Fe(n,e=>Rt(n,e,!be(n))),wO=n=>Fe(n,e=>Rt(n,e,be(n))),vO=n=>Fe(n,e=>b.cursor(n.lineBlockAt(e.head).from,1)),TO=n=>Fe(n,e=>b.cursor(n.lineBlockAt(e.head).to,-1));function CO(n,e,t){let i=!1,s=Oi(n.selection,r=>{let o=et(n,r.head,-1)||et(n,r.head,1)||r.head>0&&et(n,r.head-1,1)||r.headCO(n,e);function Ie(n,e){let t=Oi(n.state.selection,i=>{let s=e(i);return b.range(i.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(Xe(n.state,t)),!0)}function zf(n,e){return Ie(n,t=>n.moveByChar(t,e))}const If=n=>zf(n,!be(n)),Vf=n=>zf(n,be(n));function Nf(n,e){return Ie(n,t=>n.moveByGroup(t,e))}const QO=n=>Nf(n,!be(n)),AO=n=>Nf(n,be(n)),MO=n=>Ie(n,e=>qs(n.state,e,!be(n))),RO=n=>Ie(n,e=>qs(n.state,e,be(n)));function Xf(n,e){return Ie(n,t=>n.moveVertically(t,e))}const Ff=n=>Xf(n,!1),_f=n=>Xf(n,!0);function Uf(n,e){return Ie(n,t=>n.moveVertically(t,e,Wf(n).height))}const Ca=n=>Uf(n,!1),Pa=n=>Uf(n,!0),DO=n=>Ie(n,e=>Rt(n,e,!0)),EO=n=>Ie(n,e=>Rt(n,e,!1)),qO=n=>Ie(n,e=>Rt(n,e,!be(n))),$O=n=>Ie(n,e=>Rt(n,e,be(n))),BO=n=>Ie(n,e=>b.cursor(n.lineBlockAt(e.head).from)),WO=n=>Ie(n,e=>b.cursor(n.lineBlockAt(e.head).to)),Qa=({state:n,dispatch:e})=>(e(Xe(n,{anchor:0})),!0),Aa=({state:n,dispatch:e})=>(e(Xe(n,{anchor:n.doc.length})),!0),Ma=({state:n,dispatch:e})=>(e(Xe(n,{anchor:n.selection.main.anchor,head:0})),!0),Ra=({state:n,dispatch:e})=>(e(Xe(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),LO=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),zO=({state:n,dispatch:e})=>{let t=$s(n).map(({from:i,to:s})=>b.range(i,Math.min(s+1,n.doc.length)));return e(n.update({selection:b.create(t),userEvent:"select"})),!0},IO=({state:n,dispatch:e})=>{let t=Oi(n.selection,i=>{let s=ae(n),r=s.resolveStack(i.from,1);if(i.empty){let o=s.resolveStack(i.from,-1);o.node.from>=r.node.from&&o.node.to<=r.node.to&&(r=o)}for(let o=r;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return b.range(l.to,l.from)}return i});return t.eq(n.selection)?!1:(e(Xe(n,t)),!0)};function Hf(n,e){let{state:t}=n,i=t.selection,s=t.selection.ranges.slice();for(let r of t.selection.ranges){let o=t.doc.lineAt(r.head);if(e?o.to0)for(let l=r;;){let a=n.moveVertically(l,e);if(a.heado.to){s.some(h=>h.head==a.head)||s.push(a);break}else{if(a.head==l.head)break;l=a}}}return s.length==i.ranges.length?!1:(n.dispatch(Xe(t,b.create(s,s.length-1))),!0)}const VO=n=>Hf(n,!1),NO=n=>Hf(n,!0),XO=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=b.create([t.main]):t.main.empty||(i=b.create([b.cursor(t.main.head)])),i?(e(Xe(n,i)),!0):!1};function dn(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,s=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=e(r);ao&&(t="delete.forward",a=Bn(n,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=Bn(n,o,!1),l=Bn(n,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:b.cursor(o,os(n)))i.between(e,e,(s,r)=>{se&&(e=t?r:s)});return e}const jf=(n,e,t)=>dn(n,i=>{let s=i.from,{state:r}=n,o=r.doc.lineAt(s),l,a;if(t&&!e&&s>o.from&&sjf(n,!1,!0),Gf=n=>jf(n,!0,!1),Zf=(n,e)=>dn(n,t=>{let i=t.head,{state:s}=n,r=s.doc.lineAt(i),o=s.charCategorizer(i);for(let l=null;;){if(i==(e?r.to:r.from)){i==t.head&&r.number!=(e?s.doc.lines:1)&&(i+=e?1:-1);break}let a=pe(r.text,i-r.from,e)+r.from,h=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),c=o(h);if(l!=null&&c!=l)break;(h!=" "||i!=t.head)&&(l=c),i=a}return i}),Yf=n=>Zf(n,!1),FO=n=>Zf(n,!0),_O=n=>dn(n,e=>{let t=n.lineBlockAt(e.head).to;return e.headdn(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),HO=n=>dn(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:V.of(["",""])},range:b.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},GO=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let s=i.from,r=n.doc.lineAt(s),o=s==r.from?s-1:pe(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:pe(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:n.doc.slice(s,l).append(n.doc.slice(o,s))},range:b.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function $s(n){let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.from),r=n.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=n.doc.lineAt(i.to-1)),t>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(i)}else e.push({from:s.from,to:r.to,ranges:[i]});t=r.number+1}return e}function Kf(n,e,t){if(n.readOnly)return!1;let i=[],s=[];for(let r of $s(n)){if(t?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let a of r.ranges)s.push(b.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let a of r.ranges)s.push(b.range(a.anchor-l,a.head-l))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:b.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const ZO=({state:n,dispatch:e})=>Kf(n,e,!1),YO=({state:n,dispatch:e})=>Kf(n,e,!0);function Jf(n,e,t){if(n.readOnly)return!1;let i=[];for(let s of $s(n))t?i.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):i.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});return e(n.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const KO=({state:n,dispatch:e})=>Jf(n,e,!1),JO=({state:n,dispatch:e})=>Jf(n,e,!0),e0=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes($s(e).map(({from:s,to:r})=>(s>0?s--:r{let r;if(n.lineWrapping){let o=n.lineBlockAt(s.head),l=n.coordsAtPos(s.head,s.assoc||1);l&&(r=o.bottom+n.documentTop-l.bottom+n.defaultLineHeight/2)}return n.moveVertically(s,!0,r)}).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function t0(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=ae(n).resolveInner(e),i=t.childBefore(e),s=t.childAfter(e),r;return i&&s&&i.to<=e&&s.from>=e&&(r=i.type.prop(L.closedBy))&&r.indexOf(s.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(s.from).from&&!/\S/.test(n.sliceDoc(i.to,s.from))?{from:i.to,to:s.from}:null}const Da=eu(!1),i0=eu(!0);function eu(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(s=>{let{from:r,to:o}=s,l=e.doc.lineAt(r),a=!n&&r==o&&t0(e,r);n&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new As(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=zo(h,r);for(c==null&&(c=gi(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));ol.from&&r{let s=[];for(let o=i.from;o<=i.to;){let l=n.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,s,i),t=l.number),o=l.to+1}let r=n.changes(s);return{changes:s,range:b.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const n0=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new As(n,{overrideIndentation:r=>{let o=t[r];return o??-1}}),s=Uo(n,(r,o,l)=>{let a=zo(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=Hi(n,a);(h!=c||l.fromn.readOnly?!1:(e(n.update(Uo(n,(t,i)=>{i.push({from:t.from,insert:n.facet(cn)})}),{userEvent:"input.indent"})),!0),iu=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Uo(n,(t,i)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let r=gi(s,n.tabSize),o=0,l=Hi(n,Math.max(0,r-Ut(n)));for(;o(n.setTabFocusMode(),!0),r0=[{key:"Ctrl-b",run:Rf,shift:If,preventDefault:!0},{key:"Ctrl-f",run:Df,shift:Vf},{key:"Ctrl-p",run:$f,shift:Ff},{key:"Ctrl-n",run:Bf,shift:_f},{key:"Ctrl-a",run:vO,shift:BO},{key:"Ctrl-e",run:TO,shift:WO},{key:"Ctrl-d",run:Gf},{key:"Ctrl-h",run:po},{key:"Ctrl-k",run:_O},{key:"Ctrl-Alt-h",run:Yf},{key:"Ctrl-o",run:jO},{key:"Ctrl-t",run:GO},{key:"Ctrl-v",run:uo}],o0=[{key:"ArrowLeft",run:Rf,shift:If,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:mO,shift:QO,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:kO,shift:qO,preventDefault:!0},{key:"ArrowRight",run:Df,shift:Vf,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:gO,shift:AO,preventDefault:!0},{mac:"Cmd-ArrowRight",run:wO,shift:$O,preventDefault:!0},{key:"ArrowUp",run:$f,shift:Ff,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Qa,shift:Ma},{mac:"Ctrl-ArrowUp",run:Ta,shift:Ca},{key:"ArrowDown",run:Bf,shift:_f,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Aa,shift:Ra},{mac:"Ctrl-ArrowDown",run:uo,shift:Pa},{key:"PageUp",run:Ta,shift:Ca},{key:"PageDown",run:uo,shift:Pa},{key:"Home",run:xO,shift:EO,preventDefault:!0},{key:"Mod-Home",run:Qa,shift:Ma},{key:"End",run:SO,shift:DO,preventDefault:!0},{key:"Mod-End",run:Aa,shift:Ra},{key:"Enter",run:Da,shift:Da},{key:"Mod-a",run:LO},{key:"Backspace",run:po,shift:po,preventDefault:!0},{key:"Delete",run:Gf,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Yf,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:FO,preventDefault:!0},{mac:"Mod-Backspace",run:UO,preventDefault:!0},{mac:"Mod-Delete",run:HO,preventDefault:!0}].concat(r0.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),l0=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:yO,shift:MO},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:bO,shift:RO},{key:"Alt-ArrowUp",run:ZO},{key:"Shift-Alt-ArrowUp",run:KO},{key:"Alt-ArrowDown",run:YO},{key:"Shift-Alt-ArrowDown",run:JO},{key:"Mod-Alt-ArrowUp",run:VO},{key:"Mod-Alt-ArrowDown",run:NO},{key:"Escape",run:XO},{key:"Mod-Enter",run:i0},{key:"Alt-l",mac:"Ctrl-l",run:zO},{key:"Mod-i",run:IO,preventDefault:!0},{key:"Mod-[",run:iu},{key:"Mod-]",run:tu},{key:"Mod-Alt-\\",run:n0},{key:"Shift-Mod-k",run:e0},{key:"Shift-Mod-\\",run:PO},{key:"Mod-/",run:Zg},{key:"Alt-A",run:Kg},{key:"Ctrl-m",mac:"Shift-Alt-m",run:s0}].concat(o0),a0={key:"Tab",run:tu,shift:iu},Ea=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class pi{constructor(e,t,i=0,s=e.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,s),this.bufferStart=i,this.normalize=r?l=>r(Ea(l)):Ea,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Te(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=bo(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=Ye(e);let s=this.normalize(t);if(s.length)for(let r=0,o=i;;r++){let l=s.charCodeAt(r),a=this.match(l,o,this.bufferPos+this.bufferStart);if(r==s.length-1){if(a)return this.value=a,this;break}o==i&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,s=i+t[0].length;if(this.matchPos=ms(this.text,s+(i==s?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||s.to<=t){let l=new si(t,e.sliceString(t,i));return lr.set(e,l),l}if(s.from==t&&s.to==i)return s;let{text:r,from:o}=s;return o>t&&(r=e.sliceString(t,o)+r,o=t),s.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,s=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this.matchPos=ms(this.text,s+(i==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=si.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(su.prototype[Symbol.iterator]=ru.prototype[Symbol.iterator]=function(){return this});function h0(n){try{return new RegExp(n,Ho),!0}catch{return!1}}function ms(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}function mo(n){let e=String(n.state.doc.lineAt(n.state.selection.main.head).number),t=U("input",{class:"cm-textfield",name:"line",value:e}),i=U("form",{class:"cm-gotoLine",onkeydown:r=>{r.keyCode==27?(r.preventDefault(),n.dispatch({effects:$i.of(!1)}),n.focus()):r.keyCode==13&&(r.preventDefault(),s())},onsubmit:r=>{r.preventDefault(),s()}},U("label",n.state.phrase("Go to line"),": ",t)," ",U("button",{class:"cm-button",type:"submit"},n.state.phrase("go")),U("button",{name:"close",onclick:()=>{n.dispatch({effects:$i.of(!1)}),n.focus()},"aria-label":n.state.phrase("close"),type:"button"},["×"]));function s(){let r=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!r)return;let{state:o}=n,l=o.doc.lineAt(o.selection.main.head),[,a,h,c,f]=r,u=c?+c.slice(1):0,d=h?+h:l.number;if(h&&f){let g=d/100;a&&(g=g*(a=="-"?-1:1)+l.number/o.doc.lines),d=Math.round(o.doc.lines*g)}else h&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=o.doc.line(Math.max(1,Math.min(o.doc.lines,d))),m=b.cursor(p.from+Math.max(0,Math.min(u,p.length)));n.dispatch({effects:[$i.of(!1),P.scrollIntoView(m.from,{y:"center"})],selection:m}),n.focus()}return{dom:i}}const $i=q.define(),qa=he.define({create(){return!0},update(n,e){for(let t of e.effects)t.is($i)&&(n=t.value);return n},provide:n=>Xi.from(n,e=>e?mo:null)}),c0=n=>{let e=Ni(n,mo);if(!e){let t=[$i.of(!0)];n.state.field(qa,!1)==null&&t.push(q.appendConfig.of([qa,f0])),n.dispatch({effects:t}),e=Ni(n,mo)}return e&&e.dom.querySelector("input").select(),!0},f0=P.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),u0={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},d0=A.define({combine(n){return rt(n,u0,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function p0(n){return[b0,y0]}const m0=R.mark({class:"cm-selectionMatch"}),g0=R.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function $a(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=Y.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=Y.Word)}function O0(n,e,t,i){return n(e.sliceDoc(t,t+1))==Y.Word&&n(e.sliceDoc(i-1,i))==Y.Word}const y0=J.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(d0),{state:t}=n,i=t.selection;if(i.ranges.length>1)return R.none;let s=i.main,r,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return R.none;let a=t.wordAt(s.head);if(!a)return R.none;o=t.charCategorizer(s.head),r=t.sliceDoc(a.from,a.to)}else{let a=s.to-s.from;if(a200)return R.none;if(e.wholeWords){if(r=t.sliceDoc(s.from,s.to),o=t.charCategorizer(s.head),!($a(o,t,s.from,s.to)&&O0(o,t,s.from,s.to)))return R.none}else if(r=t.sliceDoc(s.from,s.to),!r)return R.none}let l=[];for(let a of n.visibleRanges){let h=new pi(t.doc,r,a.from,a.to);for(;!h.next().done;){let{from:c,to:f}=h.value;if((!o||$a(o,t,c,f))&&(s.empty&&c<=s.from&&f>=s.to?l.push(g0.range(c,f)):(c>=s.to||f<=s.from)&&l.push(m0.range(c,f)),l.length>e.maxMatches))return R.none}}return R.set(l)}},{decorations:n=>n.decorations}),b0=P.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),S0=({state:n,dispatch:e})=>{let{selection:t}=n,i=b.create(t.ranges.map(s=>n.wordAt(s.head)||b.cursor(s.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function x0(n,e){let{main:t,ranges:i}=n.selection,s=n.wordAt(t.head),r=s&&s.from==t.from&&s.to==t.to;for(let o=!1,l=new pi(n.doc,e,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new pi(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const k0=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(r=>r.from===r.to))return S0({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(r=>n.sliceDoc(r.from,r.to)!=i))return!1;let s=x0(n,i);return s?(e(n.update({selection:n.selection.addRange(b.range(s.from,s.to),!1),effects:P.scrollIntoView(s.to)})),!0):!1},yi=A.define({combine(n){return rt(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new q0(e),scrollToMatch:e=>P.scrollIntoView(e)})}});class ou{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||h0(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?` +`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new C0(this):new v0(this)}getCursor(e,t=0,i){let s=e.doc?e:I.create({doc:e});return i==null&&(i=s.doc.length),this.regexp?Yt(this,s,t,i):Zt(this,s,t,i)}}class lu{constructor(e){this.spec=e}}function Zt(n,e,t,i){return new pi(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase(),n.wholeWord?w0(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function w0(n,e){return(t,i,s,r)=>((r>t||r+s.length=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Zt(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function Yt(n,e,t,i){return new su(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?T0(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function gs(n,e){return n.slice(pe(n,e,!1),e)}function Os(n,e){return n.slice(e,pe(n,e))}function T0(n){return(e,t,i)=>!i[0].length||(n(gs(i.input,i.index))!=Y.Word||n(Os(i.input,i.index))!=Y.Word)&&(n(Os(i.input,i.index+i[0].length))!=Y.Word||n(gs(i.input,i.index+i[0].length))!=Y.Word)}class C0 extends lu{nextMatch(e,t,i){let s=Yt(this.spec,e,i,e.doc.length).next();return s.done&&(s=Yt(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=Yt(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,i)=>{if(i=="&")return e.match[0];if(i=="$")return"$";for(let s=i.length;s>0;s--){let r=+i.slice(0,s);if(r>0&&r=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Yt(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const Gi=q.define(),jo=q.define(),vt=he.define({create(n){return new ar(go(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Gi)?n=new ar(t.value.create(),n.panel):t.is(jo)&&(n=new ar(n.query,t.value?Go:null));return n},provide:n=>Xi.from(n,e=>e.panel)});class ar{constructor(e,t){this.query=e,this.panel=t}}const P0=R.mark({class:"cm-searchMatch"}),Q0=R.mark({class:"cm-searchMatch cm-searchMatch-selected"}),A0=J.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(vt))}update(n){let e=n.state.field(vt);(e!=n.startState.field(vt)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return R.none;let{view:t}=this,i=new gt;for(let s=0,r=t.visibleRanges,o=r.length;sr[s+1].from-500;)a=r[++s].to;n.highlight(t.state,l,a,(h,c)=>{let f=t.state.selection.ranges.some(u=>u.from==h&&u.to==c);i.add(h,c,f?Q0:P0)})}return i.finish()}},{decorations:n=>n.decorations});function pn(n){return e=>{let t=e.state.field(vt,!1);return t&&t.query.spec.valid?n(e,t):cu(e)}}const ys=pn((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let s=b.single(i.from,i.to),r=n.state.facet(yi);return n.dispatch({selection:s,effects:[Zo(n,i),r.scrollToMatch(s.main,n)],userEvent:"select.search"}),hu(n),!0}),bs=pn((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);if(!s)return!1;let r=b.single(s.from,s.to),o=n.state.facet(yi);return n.dispatch({selection:r,effects:[Zo(n,s),o.scrollToMatch(r.main,n)],userEvent:"select.search"}),hu(n),!0}),M0=pn((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:b.create(t.map(i=>b.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),R0=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:s}=t.main,r=[],o=0;for(let l=new pi(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(b.range(l.value.from,l.value.to))}return e(n.update({selection:b.create(r,o),userEvent:"select.search.matches"})),!0},Ba=pn((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,i,i);if(!r)return!1;let o=r,l=[],a,h,c=[];o.from==i&&o.to==s&&(h=t.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:h}),o=e.nextMatch(t,o.from,o.to),c.push(P.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+".")));let f=n.state.changes(l);return o&&(a=b.single(o.from,o.to).map(f),c.push(Zo(n,o)),c.push(t.facet(yi).scrollToMatch(a.main,n))),n.dispatch({changes:f,selection:a,effects:c,userEvent:"input.replace"}),!0}),D0=pn((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:e.getReplacement(s)}});if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:P.announce.of(i),userEvent:"input.replace.all"}),!0});function Go(n){return n.state.facet(yi).createPanel(n)}function go(n,e){var t,i,s,r,o;let l=n.selection.main,a=l.empty||l.to>l.from+100?"":n.sliceDoc(l.from,l.to);if(e&&!a)return e;let h=n.facet(yi);return new ou({search:((t=e?.literal)!==null&&t!==void 0?t:h.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=e?.caseSensitive)!==null&&i!==void 0?i:h.caseSensitive,literal:(s=e?.literal)!==null&&s!==void 0?s:h.literal,regexp:(r=e?.regexp)!==null&&r!==void 0?r:h.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:h.wholeWord})}function au(n){let e=Ni(n,Go);return e&&e.dom.querySelector("[main-field]")}function hu(n){let e=au(n);e&&e==n.root.activeElement&&e.select()}const cu=n=>{let e=n.state.field(vt,!1);if(e&&e.panel){let t=au(n);if(t&&t!=n.root.activeElement){let i=go(n.state,e.query.spec);i.valid&&n.dispatch({effects:Gi.of(i)}),t.focus(),t.select()}}else n.dispatch({effects:[jo.of(!0),e?Gi.of(go(n.state,e.query.spec)):q.appendConfig.of(B0)]});return!0},fu=n=>{let e=n.state.field(vt,!1);if(!e||!e.panel)return!1;let t=Ni(n,Go);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:jo.of(!1)}),!0},E0=[{key:"Mod-f",run:cu,scope:"editor search-panel"},{key:"F3",run:ys,shift:bs,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:ys,shift:bs,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:fu,scope:"editor search-panel"},{key:"Mod-Shift-l",run:R0},{key:"Mod-Alt-g",run:c0},{key:"Mod-d",run:k0,preventDefault:!0}];class q0{constructor(e){this.view=e;let t=this.query=e.state.field(vt).query.spec;this.commit=this.commit.bind(this),this.searchField=U("input",{value:t.search,placeholder:Me(e,"Find"),"aria-label":Me(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=U("input",{value:t.replace,placeholder:Me(e,"Replace"),"aria-label":Me(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=U("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=U("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=U("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(s,r,o){return U("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=U("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,i("next",()=>ys(e),[Me(e,"next")]),i("prev",()=>bs(e),[Me(e,"previous")]),i("select",()=>M0(e),[Me(e,"all")]),U("label",null,[this.caseField,Me(e,"match case")]),U("label",null,[this.reField,Me(e,"regexp")]),U("label",null,[this.wordField,Me(e,"by word")]),...e.state.readOnly?[]:[U("br"),this.replaceField,i("replace",()=>Ba(e),[Me(e,"replace")]),i("replaceAll",()=>D0(e),[Me(e,"replace all")])],U("button",{name:"close",onclick:()=>fu(e),"aria-label":Me(e,"close"),type:"button"},["×"])])}commit(){let e=new ou({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Gi.of(e)}))}keydown(e){zp(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?bs:ys)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Ba(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(Gi)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(yi).top}}function Me(n,e){return n.state.phrase(e)}const Wn=30,Ln=/[\s\.,:;?!]/;function Zo(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),s=n.state.doc.lineAt(t).to,r=Math.max(i.from,e-Wn),o=Math.min(s,t+Wn),l=n.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;al.length-Wn;a--)if(!Ln.test(l[a-1])&&Ln.test(l[a])){l=l.slice(0,a);break}}return P.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${i.number}.`)}const $0=P.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),B0=[vt,Mt.low(A0),$0];class uu{constructor(e,t,i,s){this.state=e,this.pos=t,this.explicit=i,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=ae(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),s=t.text.slice(i-t.from,this.pos-t.from),r=s.search(pu(e,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,i){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function Wa(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function W0(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let r=1;rtypeof s=="string"?{label:s}:s),[t,i]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:W0(e);return s=>{let r=s.matchBefore(i);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:t}:null}}function L0(n,e){return t=>{for(let i=ae(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}class La{constructor(e,t,i,s){this.completion=e,this.source=t,this.match=i,this.score=s}}function Vt(n){return n.selection.main.from}function pu(n,e){var t;let{source:i}=n,s=e&&i[0]!="^",r=i[i.length-1]!="$";return!s&&!r?n:new RegExp(`${s?"^":""}(?:${i})${r?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const Yo=st.define();function z0(n,e,t,i){let{main:s}=n.selection,r=t-s.from,o=i-s.from;return{...n.changeByRange(l=>{if(l!=s&&t!=i&&n.sliceDoc(l.from+r,l.from+o)!=n.sliceDoc(t,i))return{range:l};let a=n.toText(e);return{changes:{from:l.from+r,to:i==s.from?l.to:l.from+o,insert:a},range:b.cursor(l.from+r+a.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const za=new WeakMap;function I0(n){if(!Array.isArray(n))return n;let e=za.get(n);return e||za.set(n,e=du(n)),e}const Ss=q.define(),Zi=q.define();class V0{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&k<=57||k>=97&&k<=122?2:k>=65&&k<=90?1:0:(v=bo(k))!=v.toLowerCase()?1:v!=v.toUpperCase()?2:0;(!S||T==1&&g||w==0&&T!=0)&&(t[f]==k||i[f]==k&&(u=!0)?o[f++]=S:o.length&&(y=!1)),w=T,S+=Ye(k)}return f==a&&o[0]==0&&y?this.result(-100+(u?-200:0),o,e):d==a&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):d==a?this.ret(-900-e.length,[p,m]):f==a?this.result(-100+(u?-200:0)+-700+(y?0:-1100),o,e):t.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,i){let s=[],r=0;for(let o of t){let l=o+(this.astral?Ye(Te(i,o)):1);r&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return this.ret(e-i.length,s)}}class N0{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:X0,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>Ia(e(i),t(i)),optionClass:(e,t)=>i=>Ia(e(i),t(i)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function Ia(n,e){return n?e?n+" "+e:n:e}function X0(n,e,t,i,s,r){let o=n.textDirection==Z.RTL,l=o,a=!1,h="top",c,f,u=e.left-s.left,d=s.right-e.right,p=i.right-i.left,m=i.bottom-i.top;if(l&&u=m||S>e.top?c=t.bottom-e.top:(h="bottom",c=e.bottom-t.top)}let g=(e.bottom-e.top)/r.offsetHeight,y=(e.right-e.left)/r.offsetWidth;return{style:`${h}: ${c/g}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}function F0(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,s,r){let o=document.createElement("span");o.className="cm-completionLabel";let l=t.displayLabel||t.label,a=0;for(let h=0;ha&&o.appendChild(document.createTextNode(l.slice(a,c)));let u=o.appendChild(document.createElement("span"));u.appendChild(document.createTextNode(l.slice(c,f))),u.className="cm-completionMatchedText",a=f}return at.position-i.position).map(t=>t.render)}function hr(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let i=Math.floor((n-e)/t);return{from:n-(i+1)*t,to:n-i*t}}class _0{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let s=e.state.field(t),{options:r,selected:o}=s.open,l=e.state.facet(le);this.optionContent=F0(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=hr(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{let{options:h}=e.state.field(t).open;for(let c=a.target,f;c&&c!=this.dom;c=c.parentNode)if(c.nodeName=="LI"&&(f=/-(\d+)$/.exec(c.id))&&+f[1]{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(le).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:Zi.of(null)})}),this.showOptions(r,s.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let i=e.state.field(this.stateField),s=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=s){let{options:r,selected:o,disabled:l}=i.open;(!s.open||s.open.options!=r)&&(this.range=hr(r.length,o,e.state.facet(le).maxRenderedOptions),this.showOptions(r,i.id)),this.updateSel(),l!=((t=s.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected=this.range.to)&&(this.range=hr(t.options.length,t.selected,this.view.state.facet(le).maxRenderedOptions),this.showOptions(t.options,e.id));let i=this.updateSelectedOption(t.selected);if(i){this.destroyInfo();let{completion:s}=t.options[t.selected],{info:r}=s;if(!r)return;let o=typeof r=="string"?document.createTextNode(r):r(s);if(!o)return;"then"in o?o.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,s)}).catch(l=>Pe(this.view.state,l,"completion info")):(this.addInfoPane(o,s),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:r}=e;i.appendChild(s),this.infoDestroy=r||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)i.nodeName!="LI"||!i.id?s--:s==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby"));return t&&H0(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.documentElement;r={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return s.top>Math.min(r.bottom,t.bottom)-10||s.bottom{o.target==s&&o.preventDefault()});let r=null;for(let o=i.from;oi.from||i.from==0))if(r=u,typeof h!="string"&&h.header)s.appendChild(h.header(h));else{let d=s.appendChild(document.createElement("completion-section"));d.textContent=u}}const c=s.appendChild(document.createElement("li"));c.id=t+"-"+o,c.setAttribute("role","option");let f=this.optionClass(l);f&&(c.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,this.view,a);d&&c.appendChild(d)}}return i.from&&s.classList.add("cm-completionListIncompleteTop"),i.tonew _0(t,n,e)}function H0(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),s=t.height/n.offsetHeight;i.topt.bottom&&(n.scrollTop+=(i.bottom-t.bottom)/s)}function Va(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function j0(n,e){let t=[],i=null,s=null,r=c=>{t.push(c);let{section:f}=c.completion;if(f){i||(i=[]);let u=typeof f=="string"?f:f.name;i.some(d=>d.name==u)||i.push(typeof f=="string"?{name:u}:f)}},o=e.facet(le);for(let c of n)if(c.hasResult()){let f=c.result.getMatch;if(c.result.filter===!1)for(let u of c.result.options)r(new La(u,c.source,f?f(u):[],1e9-t.length));else{let u=e.sliceDoc(c.from,c.to),d,p=o.filterStrict?new N0(u):new V0(u);for(let m of c.result.options)if(d=p.match(m.label)){let g=m.displayLabel?f?f(m,d.matched):[]:d.matched,y=d.score+(m.boost||0);if(r(new La(m,c.source,g,y)),typeof m.section=="object"&&m.section.rank==="dynamic"){let{name:S}=m.section;s||(s=Object.create(null)),s[S]=Math.max(y,s[S]||-1e9)}}}}if(i){let c=Object.create(null),f=0,u=(d,p)=>(d.rank==="dynamic"&&p.rank==="dynamic"?s[p.name]-s[d.name]:0)||(typeof d.rank=="number"?d.rank:1e9)-(typeof p.rank=="number"?p.rank:1e9)||(d.nameu.score-f.score||h(f.completion,u.completion))){let f=c.completion;!a||a.label!=f.label||a.detail!=f.detail||a.type!=null&&f.type!=null&&a.type!=f.type||a.apply!=f.apply||a.boost!=f.boost?l.push(c):Va(c.completion)>Va(a)&&(l[l.length-1]=c),a=c.completion}return l}class ei{constructor(e,t,i,s,r,o){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new ei(this.options,Na(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,s,r,o){if(s&&!o&&e.some(h=>h.isPending))return s.setDisabled();let l=j0(e,t);if(!l.length)return s&&e.some(h=>h.isPending)?s.setDisabled():null;let a=t.facet(le).selectOnOpen?0:-1;if(s&&s.selected!=a&&s.selected!=-1){let h=s.options[s.selected].completion;for(let c=0;cc.hasResult()?Math.min(h,c.from):h,1e8),create:ey,above:r.aboveCursor},s?s.timestamp:Date.now(),a,!1)}map(e){return new ei(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new ei(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class xs{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new xs(K0,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(le),r=(i.override||t.languageDataAt("autocomplete",Vt(t)).map(I0)).map(a=>(this.active.find(c=>c.source==a)||new We(a,this.active.some(c=>c.state!=0)?1:0)).update(e,i));r.length==this.active.length&&r.every((a,h)=>a==this.active[h])&&(r=this.active);let o=this.open,l=e.effects.some(a=>a.is(Ko));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!G0(r,this.active)||l?o=ei.build(r,t,this.id,o,i,l):o&&o.disabled&&!r.some(a=>a.isPending)&&(o=null),!o&&r.every(a=>!a.isPending)&&r.some(a=>a.hasResult())&&(r=r.map(a=>a.hasResult()?new We(a.source,0):a));for(let a of e.effects)a.is(gu)&&(o=o&&o.setSelected(a.value,this.id));return r==this.active&&o==this.open?this:new xs(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Z0:Y0}}function G0(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const K0=[];function mu(n,e){if(n.isUserEvent("input.complete")){let i=n.annotation(Yo);if(i&&e.activateOnCompletion(i))return 12}let t=n.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class We{constructor(e,t,i=!1){this.source=e,this.state=t,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let i=mu(e,t),s=this;(i&8||i&16&&this.touches(e))&&(s=new We(s.source,0)),i&4&&s.state==0&&(s=new We(this.source,1)),s=s.updateFor(e,i);for(let r of e.effects)if(r.is(Ss))s=new We(s.source,1,r.value);else if(r.is(Zi))s=new We(s.source,0);else if(r.is(Ko))for(let o of r.value)o.source==s.source&&(s=o);return s}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Vt(e.state))}}class ri extends We{constructor(e,t,i,s,r,o){super(e,3,t),this.limit=i,this.result=s,this.from=r,this.to=o}hasResult(){return!0}updateFor(e,t){var i;if(!(t&3))return this.map(e.changes);let s=this.result;s.map&&!e.changes.empty&&(s=s.map(s,e.changes));let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=Vt(e.state);if(l>o||!s||t&2&&(Vt(e.startState)==this.from||lt.map(e))}}),gu=q.define(),Ce=he.define({create(){return xs.start()},update(n,e){return n.update(e)},provide:n=>[Eo.from(n,e=>e.tooltip),P.contentAttributes.from(n,e=>e.attrs)]});function Jo(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(Ce).active.find(s=>s.source==e.source);return i instanceof ri?(typeof t=="string"?n.dispatch({...z0(n.state,t,i.from,i.to),annotations:Yo.of(e.completion)}):t(n,e.completion,i.from,i.to),!0):!1}const ey=U0(Ce,Jo);function zn(n,e="option"){return t=>{let i=t.state.field(Ce,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+s*(n?1:-1):n?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:gu.of(l)}),!0}}const ty=n=>{let e=n.state.field(Ce,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampn.state.field(Ce,!1)?(n.dispatch({effects:Ss.of(!0)}),!0):!1,iy=n=>{let e=n.state.field(Ce,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:Zi.of(null)}),!0)};class ny{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const sy=50,ry=1e3,oy=J.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(Ce).active)e.isPending&&this.startQuery(e)}update(n){let e=n.state.field(Ce),t=n.state.facet(le);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Ce)==e)return;let i=n.transactions.some(r=>{let o=mu(r,t);return o&8||(r.selection||r.docChanged)&&!(o&3)});for(let r=0;rsy&&Date.now()-o.time>ry){for(let l of o.context.abortListeners)try{l()}catch(a){Pe(this.view.state,a)}o.context.abortListeners=null,this.running.splice(r--,1)}else o.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(r=>r.effects.some(o=>o.is(Ss)))&&(this.pendingStart=!0);let s=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(r=>r.isPending&&!this.running.some(o=>o.active.source==r.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let r of n.transactions)r.isUserEvent("input.type")?this.composing=2:this.composing==2&&r.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(Ce);for(let t of e.active)t.isPending&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(le).updateSyncTime))}startQuery(n){let{state:e}=this.view,t=Vt(e),i=new uu(e,t,n.explicit,this.view),s=new ny(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:Zi.of(null)}),Pe(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(le).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(le),i=this.view.state.field(Ce);for(let s=0;sl.source==r.active.source);if(o&&o.isPending)if(r.done==null){let l=new We(r.active.source,0);for(let a of r.updates)l=l.update(a,t);l.isPending||e.push(l)}else this.startQuery(o)}(e.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:Ko.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(Ce,!1);if(e&&e.tooltip&&this.view.state.facet(le).closeOnBlur){let t=e.open&&Nc(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Zi.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Ss.of(!1)}),20),this.composing=0}}}),ly=typeof navigator=="object"&&/Win/.test(navigator.platform),ay=Mt.highest(P.domEventHandlers({keydown(n,e){let t=e.state.field(Ce,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(ly&&n.altKey)||n.metaKey)return!1;let i=t.open.options[t.open.selected],s=t.active.find(o=>o.source==i.source),r=i.completion.commitCharacters||s.result.commitCharacters;return r&&r.indexOf(n.key)>-1&&Jo(e,i),!1}})),Ou=P.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class hy{constructor(e,t,i,s){this.field=e,this.line=t,this.from=i,this.to=s}}class el{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,de.TrackDel),i=e.mapPos(this.to,1,de.TrackDel);return t==null||i==null?null:new el(this.field,t,i)}}class tl{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],s=[t],r=e.doc.lineAt(t),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(i.length){let h=o,c=/^\t*/.exec(a)[0].length;for(let f=0;fnew el(a.field,s[a.line]+a.from,s[a.line]+a.to));return{text:i,ranges:l}}static parse(e){let t=[],i=[],s=[],r;for(let o of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",h=-1,c=a.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=h&&u.field++}for(let f of s)if(f.line==i.length&&f.from>r.index){let u=r[2]?3+(r[1]||"").length:2;f.from-=u,f.to-=u}s.push(new hy(h,i.length,r.index,r.index+c.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}o=o.replace(/\\([{}])/g,(l,a,h)=>{for(let c of s)c.line==i.length&&c.from>h&&(c.from--,c.to--);return a}),i.push(o)}return new tl(i,s)}}let cy=R.widget({widget:new class extends ot{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),fy=R.mark({class:"cm-snippetField"});class bi{constructor(e,t){this.ranges=e,this.active=t,this.deco=R.set(e.map(i=>(i.from==i.to?cy:fy).range(i.from,i.to)),!0)}map(e){let t=[];for(let i of this.ranges){let s=i.map(e);if(!s)return null;t.push(s)}return new bi(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const mn=q.define({map(n,e){return n&&n.map(e)}}),uy=q.define(),Yi=he.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(mn))return t.value;if(t.is(uy)&&n)return new bi(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>P.decorations.from(n,e=>e?e.deco:R.none)});function il(n,e){return b.create(n.filter(t=>t.field==e).map(t=>b.range(t.from,t.to)))}function dy(n){let e=tl.parse(n);return(t,i,s,r)=>{let{text:o,ranges:l}=e.instantiate(t.state,s),{main:a}=t.state.selection,h={changes:{from:s,to:r==a.from?a.to:r,insert:V.of(o)},scrollIntoView:!0,annotations:i?[Yo.of(i),ie.userEvent.of("input.complete")]:void 0};if(l.length&&(h.selection=il(l,0)),l.some(c=>c.field>0)){let c=new bi(l,0),f=h.effects=[mn.of(c)];t.state.field(Yi,!1)===void 0&&f.push(q.appendConfig.of([Yi,yy,by,Ou]))}t.dispatch(t.state.update(h))}}function yu(n){return({state:e,dispatch:t})=>{let i=e.field(Yi,!1);if(!i||n<0&&i.active==0)return!1;let s=i.active+n,r=n>0&&!i.ranges.some(o=>o.field==s+n);return t(e.update({selection:il(i.ranges,s),effects:mn.of(r?null:new bi(i.ranges,s)),scrollIntoView:!0})),!0}}const py=({state:n,dispatch:e})=>n.field(Yi,!1)?(e(n.update({effects:mn.of(null)})),!0):!1,my=yu(1),gy=yu(-1),Oy=[{key:"Tab",run:my,shift:gy},{key:"Escape",run:py}],Xa=A.define({combine(n){return n.length?n[0]:Oy}}),yy=Mt.highest(an.compute([Xa],n=>n.facet(Xa)));function lt(n,e){return{...e,apply:dy(n)}}const by=P.domEventHandlers({mousedown(n,e){let t=e.state.field(Yi,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let s=t.ranges.find(r=>r.from<=i&&r.to>=i);return!s||s.field==t.active?!1:(e.dispatch({selection:il(t.ranges,s.field),effects:mn.of(t.ranges.some(r=>r.field>s.field)?new bi(t.ranges,s.field):null),scrollIntoView:!0}),!0)}}),Ki={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},zt=q.define({map(n,e){let t=e.mapPos(n,-1,de.TrackAfter);return t??void 0}}),nl=new class extends Nt{};nl.startSide=1;nl.endSide=-1;const bu=he.define({create(){return N.empty},update(n,e){if(n=n.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:i=>i>=t.from&&i<=t.to})}for(let t of e.effects)t.is(zt)&&(n=n.update({add:[nl.range(t.value,t.value+1)]}));return n}});function Sy(){return[ky,bu]}const fr="()[]{}<>«»»«[]{}";function Su(n){for(let e=0;e{if((xy?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&&Ye(Te(i,0))==1||e!=s.from||t!=s.to)return!1;let r=Ty(n.state,i);return r?(n.dispatch(r),!0):!1}),wy=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=xu(n,n.selection.main.head).brackets||Ki.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let l=Cy(n.doc,o.head);for(let a of i)if(a==l&&Bs(n.doc,o.head)==Su(Te(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:b.cursor(o.head-a.length)}}return{range:s=o}});return s||e(n.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},vy=[{key:"Backspace",run:wy}];function Ty(n,e){let t=xu(n,n.selection.main.head),i=t.brackets||Ki.brackets;for(let s of i){let r=Su(Te(s,0));if(e==s)return r==s?Ay(n,s,i.indexOf(s+s+s)>-1,t):Py(n,s,r,t.before||Ki.before);if(e==r&&ku(n,n.selection.main.from))return Qy(n,s,r)}return null}function ku(n,e){let t=!1;return n.field(bu).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function Bs(n,e){let t=n.sliceString(e,e+2);return t.slice(0,Ye(Te(t,0)))}function Cy(n,e){let t=n.sliceString(e-2,e);return Ye(Te(t,0))==t.length?t:t.slice(1)}function Py(n,e,t,i){let s=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:zt.of(o.to+e.length),range:b.range(o.anchor+e.length,o.head+e.length)};let l=Bs(n.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:zt.of(o.head+e.length),range:b.cursor(o.head+e.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function Qy(n,e,t){let i=null,s=n.changeByRange(r=>r.empty&&Bs(n.doc,r.head)==t?{changes:{from:r.head,to:r.head+t.length,insert:t},range:b.cursor(r.head+t.length)}:i={range:r});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Ay(n,e,t,i){let s=i.stringPrefixes||Ki.stringPrefixes,r=null,o=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:zt.of(l.to+e.length),range:b.range(l.anchor+e.length,l.head+e.length)};let a=l.head,h=Bs(n.doc,a),c;if(h==e){if(Fa(n,a))return{changes:{insert:e+e,from:a},effects:zt.of(a+e.length),range:b.cursor(a+e.length)};if(ku(n,a)){let u=t&&n.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+u.length,insert:u},range:b.cursor(a+u.length)}}}else{if(t&&n.sliceDoc(a-2*e.length,a)==e+e&&(c=_a(n,a-2*e.length,s))>-1&&Fa(n,c))return{changes:{insert:e+e+e+e,from:a},effects:zt.of(a+e.length),range:b.cursor(a+e.length)};if(n.charCategorizer(a)(h)!=Y.Word&&_a(n,a,s)>-1&&!My(n,a,e,s))return{changes:{insert:e+e,from:a},effects:zt.of(a+e.length),range:b.cursor(a+e.length)}}return{range:r=l}});return r?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Fa(n,e){let t=ae(n).resolveInner(e+1);return t.parent&&t.from==e}function My(n,e,t,i){let s=ae(n).resolveInner(e,-1),r=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=n.sliceDoc(s.from,Math.min(s.to,s.from+t.length+r)),a=l.indexOf(t);if(!a||a>-1&&i.indexOf(l.slice(0,a))>-1){let c=s.firstChild;for(;c&&c.from==s.from&&c.to-c.from>t.length+a;){if(n.sliceDoc(c.to-t.length,c.to)==t)return!1;c=c.firstChild}return!0}let h=s.to==e&&s.parent;if(!h)break;s=h}return!1}function _a(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=Y.Word)return e;for(let s of t){let r=e-s.length;if(n.sliceDoc(r,e)==s&&i(n.sliceDoc(r-1,r))!=Y.Word)return r}return-1}function Ry(n={}){return[ay,Ce,le.of(n),oy,Dy,Ou]}const wu=[{key:"Ctrl-Space",run:cr},{mac:"Alt-`",run:cr},{mac:"Alt-i",run:cr},{key:"Escape",run:iy},{key:"ArrowDown",run:zn(!0)},{key:"ArrowUp",run:zn(!1)},{key:"PageDown",run:zn(!0,"page")},{key:"PageUp",run:zn(!1,"page")},{key:"Enter",run:ty}],Dy=Mt.highest(an.computeN([le],n=>n.facet(le).defaultKeymap?[wu]:[]));class Ua{constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}}class Bt{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let s=i.facet(Ji).markerFilter;s&&(e=s(e,i));let r=e.slice().sort((d,p)=>d.from-p.from||d.to-p.to),o=new gt,l=[],a=0,h=i.doc.iter(),c=0,f=i.doc.length;for(let d=0;;){let p=d==r.length?null:r[d];if(!p&&!l.length)break;let m,g;if(l.length)m=a,g=l.reduce((x,w)=>Math.min(x,w.to),p&&p.from>m?p.from:1e8);else{if(m=p.from,m>f)break;g=p.to,l.push(p),d++}for(;dx.from||x.to==m))l.push(x),d++,g=Math.min(x.to,g);else{g=Math.min(x.from,g);break}}g=Math.min(g,f);let y=!1;if(l.some(x=>x.from==m&&(x.to==g||g==f))&&(y=m==g,!y&&g-m<10)){let x=m-(c+h.value.length);x>0&&(h.next(x),c=m);for(let w=m;;){if(w>=g){y=!0;break}if(!h.lineBreak&&c+h.value.length>w)break;w=c+h.value.length,c+=h.value.length,h.next()}}let S=_y(l);if(y)o.add(m,m,R.widget({widget:new Vy(S),diagnostics:l.slice()}));else{let x=l.reduce((w,k)=>k.markClass?w+" "+k.markClass:w,"");o.add(m,g,R.mark({class:"cm-lintRange cm-lintRange-"+S+x,diagnostics:l.slice(),inclusiveEnd:l.some(w=>w.to>g)}))}if(a=g,a==f)break;for(let x=0;x{if(!(e&&o.diagnostics.indexOf(e)<0))if(!i)i=new Ua(s,r,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new Ua(i.from,r,i.diagnostic)}}),i}function Ey(n,e){let t=e.pos,i=e.end||t,s=n.state.facet(Ji).hideOn(n,t,i);if(s!=null)return s;let r=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(o=>o.is(vu))||n.changes.touchesRange(r.from,Math.max(r.to,i)))}function qy(n,e){return n.field(Ee,!1)?e:e.concat(q.appendConfig.of(Uy))}const vu=q.define(),sl=q.define(),Tu=q.define(),Ee=he.define({create(){return new Bt(R.none,null,null)},update(n,e){if(e.docChanged&&n.diagnostics.size){let t=n.diagnostics.map(e.changes),i=null,s=n.panel;if(n.selected){let r=e.changes.mapPos(n.selected.from,1);i=mi(t,n.selected.diagnostic,r)||mi(t,null,r)}!t.size&&s&&e.state.facet(Ji).autoPanel&&(s=null),n=new Bt(t,s,i)}for(let t of e.effects)if(t.is(vu)){let i=e.state.facet(Ji).autoPanel?t.value.length?en.open:null:n.panel;n=Bt.init(t.value,i,e.state)}else t.is(sl)?n=new Bt(n.diagnostics,t.value?en.open:null,n.selected):t.is(Tu)&&(n=new Bt(n.diagnostics,n.panel,t.value));return n},provide:n=>[Xi.from(n,e=>e.panel),P.decorations.from(n,e=>e.diagnostics)]}),$y=R.mark({class:"cm-lintRange cm-lintRange-active"});function By(n,e,t){let{diagnostics:i}=n.state.field(Ee),s,r=-1,o=-1;i.between(e-(t<0?1:0),e+(t>0?1:0),(a,h,{spec:c})=>{if(e>=a&&e<=h&&(a==h||(e>a||t>0)&&(ePu(n,t,!1)))}const Ly=n=>{let e=n.state.field(Ee,!1);(!e||!e.panel)&&n.dispatch({effects:qy(n.state,[sl.of(!0)])});let t=Ni(n,en.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},Ha=n=>{let e=n.state.field(Ee,!1);return!e||!e.panel?!1:(n.dispatch({effects:sl.of(!1)}),!0)},zy=n=>{let e=n.state.field(Ee,!1);if(!e)return!1;let t=n.state.selection.main,i=e.diagnostics.iter(t.to+1);return!i.value&&(i=e.diagnostics.iter(0),!i.value||i.from==t.from&&i.to==t.to)?!1:(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)},Iy=[{key:"Mod-Shift-m",run:Ly,preventDefault:!0},{key:"F8",run:zy}],Ji=A.define({combine(n){return{sources:n.map(e=>e.source).filter(e=>e!=null),...rt(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:ja,tooltipFilter:ja,needsRefresh:(e,t)=>e?t?i=>e(i)||t(i):e:t,hideOn:(e,t)=>e?t?(i,s,r)=>e(i,s,r)||t(i,s,r):e:t,autoPanel:(e,t)=>e||t})}}});function ja(n,e){return n?e?(t,i)=>e(n(t,i),i):n:e}function Cu(n){let e=[];if(n)e:for(let{name:t}of n){for(let i=0;ir.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function Pu(n,e,t){var i;let s=t?Cu(e.actions):[];return U("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},U("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(n):e.message),(i=e.actions)===null||i===void 0?void 0:i.map((r,o)=>{let l=!1,a=d=>{if(d.preventDefault(),l)return;l=!0;let p=mi(n.state.field(Ee).diagnostics,e);p&&r.apply(n,p.from,p.to)},{name:h}=r,c=s[o]?h.indexOf(s[o]):-1,f=c<0?h:[h.slice(0,c),U("u",h.slice(c,c+1)),h.slice(c+1)],u=r.markClass?" "+r.markClass:"";return U("button",{type:"button",class:"cm-diagnosticAction"+u,onclick:a,onmousedown:a,"aria-label":` Action: ${h}${c<0?"":` (access key "${s[o]})"`}.`},f)}),e.source&&U("div",{class:"cm-diagnosticSource"},e.source))}class Vy extends ot{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return U("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Ga{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Pu(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class en{constructor(e){this.view=e,this.items=[];let t=s=>{if(s.keyCode==27)Ha(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:r}=this.items[this.selectedIndex],o=Cu(r.actions);for(let l=0;l{for(let r=0;rHa(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Ee).selected;if(!e)return-1;for(let t=0;t{for(let c of h.diagnostics){if(o.has(c))continue;o.add(c);let f=-1,u;for(let d=i;di&&(this.items.splice(i,f-i),s=!0)),t&&u.diagnostic==t.diagnostic?u.dom.hasAttribute("aria-selected")||(u.dom.setAttribute("aria-selected","true"),r=u):u.dom.hasAttribute("aria-selected")&&u.dom.removeAttribute("aria-selected"),i++}});i({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:a})=>{let h=a.height/this.list.offsetHeight;l.topa.bottom&&(this.list.scrollTop+=(l.bottom-a.bottom)/h)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let e=this.list.firstChild;function t(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Ee),i=mi(t.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:Tu.of(i)})}static open(e){return new en(e)}}function Ny(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(n)}')`}function In(n){return Ny(``,'width="6" height="3"')}const Xy=P.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:In("#d11")},".cm-lintRange-warning":{backgroundImage:In("orange")},".cm-lintRange-info":{backgroundImage:In("#999")},".cm-lintRange-hint":{backgroundImage:In("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function Fy(n){return n=="error"?4:n=="warning"?3:n=="info"?2:1}function _y(n){let e="hint",t=1;for(let i of n){let s=Fy(i.severity);s>t&&(t=s,e=i.severity)}return e}const Uy=[Ee,P.decorations.compute([Ee],n=>{let{selected:e,panel:t}=n.field(Ee);return!e||!t||e.from==e.to?R.none:R.set([$y.range(e.from,e.to)])}),Pm(By,{hideOn:Ey}),Xy];var Za=function(e){e===void 0&&(e={});var{crosshairCursor:t=!1}=e,i=[];e.closeBracketsKeymap!==!1&&(i=i.concat(vy)),e.defaultKeymap!==!1&&(i=i.concat(l0)),e.searchKeymap!==!1&&(i=i.concat(E0)),e.historyKeymap!==!1&&(i=i.concat(pO)),e.foldKeymap!==!1&&(i=i.concat(vg)),e.completionKeymap!==!1&&(i=i.concat(wu)),e.lintKeymap!==!1&&(i=i.concat(Iy));var s=[];return e.lineNumbers!==!1&&s.push(Lm()),e.highlightActiveLineGutter!==!1&&s.push(Vm()),e.highlightSpecialChars!==!1&&s.push(im()),e.history!==!1&&s.push(rO()),e.foldGutter!==!1&&s.push(Qg()),e.drawSelection!==!1&&s.push(_p()),e.dropCursor!==!1&&s.push(Zp()),e.allowMultipleSelections!==!1&&s.push(I.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&s.push(mg()),e.syntaxHighlighting!==!1&&s.push(df(Dg,{fallback:!0})),e.bracketMatching!==!1&&s.push(zg()),e.closeBrackets!==!1&&s.push(Sy()),e.autocompletion!==!1&&s.push(Ry()),e.rectangularSelection!==!1&&s.push(gm()),t!==!1&&s.push(bm()),e.highlightActiveLine!==!1&&s.push(am()),e.highlightSelectionMatches!==!1&&s.push(p0()),e.tabSize&&typeof e.tabSize=="number"&&s.push(cn.of(" ".repeat(e.tabSize))),s.concat([an.of(i.flat())]).filter(Boolean)};const Hy="#e5c07b",Ya="#e06c75",jy="#56b6c2",Gy="#ffffff",Kn="#abb2bf",Oo="#7d8799",Zy="#61afef",Yy="#98c379",Ka="#d19a66",Ky="#c678dd",Jy="#21252b",Ja="#2c313a",eh="#282c34",ur="#353a42",e1="#3E4451",th="#528bff",t1=P.theme({"&":{color:Kn,backgroundColor:eh},".cm-content":{caretColor:th},".cm-cursor, .cm-dropCursor":{borderLeftColor:th},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:e1},".cm-panels":{backgroundColor:Jy,color:Kn},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:eh,color:Oo,border:"none"},".cm-activeLineGutter":{backgroundColor:Ja},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:ur},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:ur,borderBottomColor:ur},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Ja,color:Kn}}},{dark:!0}),i1=un.define([{tag:O.keyword,color:Ky},{tag:[O.name,O.deleted,O.character,O.propertyName,O.macroName],color:Ya},{tag:[O.function(O.variableName),O.labelName],color:Zy},{tag:[O.color,O.constant(O.name),O.standard(O.name)],color:Ka},{tag:[O.definition(O.name),O.separator],color:Kn},{tag:[O.typeName,O.className,O.number,O.changed,O.annotation,O.modifier,O.self,O.namespace],color:Hy},{tag:[O.operator,O.operatorKeyword,O.url,O.escape,O.regexp,O.link,O.special(O.string)],color:jy},{tag:[O.meta,O.comment],color:Oo},{tag:O.strong,fontWeight:"bold"},{tag:O.emphasis,fontStyle:"italic"},{tag:O.strikethrough,textDecoration:"line-through"},{tag:O.link,color:Oo,textDecoration:"underline"},{tag:O.heading,fontWeight:"bold",color:Ya},{tag:[O.atom,O.bool,O.special(O.variableName)],color:Ka},{tag:[O.processingInstruction,O.string,O.inserted],color:Yy},{tag:O.invalid,color:Gy}]),n1=[t1,df(i1)];var s1=P.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),r1=function(e){e===void 0&&(e={});var{indentWithTab:t=!0,editable:i=!0,readOnly:s=!1,theme:r="light",placeholder:o="",basicSetup:l=!0}=e,a=[];switch(t&&a.unshift(an.of([a0])),l&&(typeof l=="boolean"?a.unshift(Za()):a.unshift(Za(l))),o&&a.unshift(um(o)),r){case"light":a.push(s1);break;case"dark":a.push(n1);break;case"none":break;default:a.push(r);break}return i===!1&&a.push(P.editable.of(!1)),s&&a.push(I.readOnly.of(!0)),[...a]},o1=n=>({line:n.state.doc.lineAt(n.state.selection.main.from),lineCount:n.state.doc.lines,lineBreak:n.state.lineBreak,length:n.state.doc.length,readOnly:n.state.readOnly,tabSize:n.state.tabSize,selection:n.state.selection,selectionAsSingle:n.state.selection.asSingle().main,ranges:n.state.selection.ranges,selectionCode:n.state.sliceDoc(n.state.selection.main.from,n.state.selection.main.to),selections:n.state.selection.ranges.map(e=>n.state.sliceDoc(e.from,e.to)),selectedText:n.state.selection.ranges.some(e=>!e.empty)});class l1{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(t=>{try{t()}catch(i){console.error("TimeoutLatch callback error:",i)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class ih{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var dr=null,a1=()=>typeof window>"u"?new ih:(dr||(dr=new ih),dr),nh=st.define(),h1=200,c1=[];function f1(n){var{value:e,selection:t,onChange:i,onStatistics:s,onCreateEditor:r,onUpdate:o,extensions:l=c1,autoFocus:a,theme:h="light",height:c=null,minHeight:f=null,maxHeight:u=null,width:d=null,minWidth:p=null,maxWidth:m=null,placeholder:g="",editable:y=!0,readOnly:S=!1,indentWithTab:x=!0,basicSetup:w=!0,root:k,initialState:v}=n,[T,E]=Se.useState(),[M,z]=Se.useState(),[$,D]=Se.useState(),B=Se.useState(()=>({current:null}))[0],W=Se.useState(()=>({current:null}))[0],X=P.theme({"&":{height:c,minHeight:f,maxHeight:u,width:d,minWidth:p,maxWidth:m},"& .cm-scroller":{height:"100% !important"}}),ne=P.updateListener.of(F=>{if(F.docChanged&&typeof i=="function"&&!F.transactions.some(ge=>ge.annotation(nh))){B.current?B.current.reset():(B.current=new l1(()=>{if(W.current){var ge=W.current;W.current=null,ge()}B.current=null},h1),a1().add(B.current));var ee=F.state.doc,ce=ee.toString();i(ce,F)}s&&s(o1(F))}),oe=r1({theme:h,editable:y,readOnly:S,placeholder:g,indentWithTab:x,basicSetup:w}),me=[ne,X,...oe];return o&&typeof o=="function"&&me.push(P.updateListener.of(o)),me=me.concat(l),Se.useLayoutEffect(()=>{if(T&&!$){var F={doc:e,selection:t,extensions:me},ee=v?I.fromJSON(v.json,F,v.fields):I.create(F);if(D(ee),!M){var ce=new P({state:ee,parent:T,root:k});z(ce),r&&r(ce,ee)}}return()=>{M&&(D(void 0),z(void 0))}},[T,$]),Se.useEffect(()=>{n.container&&E(n.container)},[n.container]),Se.useEffect(()=>()=>{M&&(M.destroy(),z(void 0)),B.current&&(B.current.cancel(),B.current=null)},[M]),Se.useEffect(()=>{a&&M&&M.focus()},[a,M]),Se.useEffect(()=>{M&&M.dispatch({effects:q.reconfigure.of(me)})},[h,l,c,f,u,d,p,m,g,y,S,x,w,i,o]),Se.useEffect(()=>{if(e!==void 0){var F=M?M.state.doc.toString():"";if(M&&e!==F){var ee=B.current&&!B.current.isDone,ce=()=>{M&&e!==M.state.doc.toString()&&M.dispatch({changes:{from:0,to:M.state.doc.toString().length,insert:e||""},annotations:[nh.of(!0)]})};ee?W.current=ce:ce()}}},[e,M]),{state:$,setState:D,view:M,setView:z,container:T,setContainer:E}}var u1=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],d1=Se.forwardRef((n,e)=>{var{className:t,value:i="",selection:s,extensions:r=[],onChange:o,onStatistics:l,onCreateEditor:a,onUpdate:h,autoFocus:c,theme:f="light",height:u,minHeight:d,maxHeight:p,width:m,minWidth:g,maxWidth:y,basicSetup:S,placeholder:x,indentWithTab:w,editable:k,readOnly:v,root:T,initialState:E}=n,M=Lu(n,u1),z=Se.useRef(null),{state:$,view:D,container:B,setContainer:W}=f1({root:T,value:i,autoFocus:c,theme:f,height:u,minHeight:d,maxHeight:p,width:m,minWidth:g,maxWidth:y,basicSetup:S,placeholder:x,indentWithTab:w,editable:k,readOnly:v,selection:s,onChange:o,onStatistics:l,onCreateEditor:a,onUpdate:h,extensions:r,initialState:E});Se.useImperativeHandle(e,()=>({editor:z.current,state:$,view:D}),[z,B,$,D]);var X=Se.useCallback(oe=>{z.current=oe,W(oe)},[W]);if(typeof i!="string")throw new Error("value must be typeof string but got "+typeof i);var ne=typeof f=="string"?"cm-theme-"+f:"cm-theme";return Iu.jsx("div",zu({ref:X,className:""+ne+(t?" "+t:"")},M))});d1.displayName="CodeMirror";var sh={};class ks{constructor(e,t,i,s,r,o,l,a,h,c=0,f){this.p=e,this.stack=t,this.state=i,this.reducePos=s,this.pos=r,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=h,this.lookAhead=c,this.parent=f}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let s=e.parser.context;return new ks(e,[],t,i,i,0,[],0,s?new rh(s,s.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let i=e>>19,s=e&65535,{parser:r}=this.p,o=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[s])===null||t===void 0)&&t.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(s,h)}storeNode(e,t,i,s=4,r=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&o.buffer[l-4]==0&&o.buffer[l-1]>-1){if(t==i)return;if(o.buffer[l-2]>=t){o.buffer[l-2]=i;return}}}if(!r||this.pos==i)this.buffer.push(e,t,i,s);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>i;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,s>4&&(s-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=i,this.buffer[o+3]=s}}shift(e,t,i,s){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let r=e,{parser:o}=this.p;(s>this.pos||t<=o.maxNode)&&(this.pos=s,o.stateFlag(r,1)||(this.reducePos=s)),this.pushState(r,i),this.shiftContext(t,i),t<=o.maxNode&&this.buffer.push(t,i,s,4)}else this.pos=s,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,s,4)}apply(e,t,i,s){e&65536?this.reduce(e):this.shift(e,t,i,s)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let s=this.pos;this.reducePos=this.pos=s+e.length,this.pushState(t,s),this.buffer.push(i,s,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),s=e.bufferBase+t;for(;e&&s==e.bufferBase;)e=e.parent;return new ks(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,s,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new p1(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(i==0)return!1;if((i&65536)==0)return!0;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let s=[];for(let r=0,o;ra&1&&l==o)||s.push(t[r],o)}t=s}let i=[];for(let s=0;s>19,s=t&65535,r=this.stack.length-i*3;if(r<0||e.getGoto(this.stack[r],s,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],i=(s,r)=>{if(!t.includes(s))return t.push(s),e.allActions(s,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-r;if(l>1){let a=o&65535,h=this.stack.length-l*3;if(h>=0&&e.getGoto(this.stack[h],a,!1)>=0)return l<<19|65536|a}}else{let l=i(o,r+1);if(l!=null)return l}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class rh{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class p1{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let s=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=s}}class ws{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new ws(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new ws(this.stack,this.pos,this.index)}}function Vn(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let i=0,s=0;i=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),r+=a,l)break;r*=46}t?t[s++]=r:t=new e(r)}return t}class Jn{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const oh=new Jn;class m1{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=oh,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,s=this.rangeIndex,r=this.pos+e;for(;ri.to:r>=i.to;){if(s==this.ranges.length-1)return null;let o=this.ranges[++s];r+=o.from-i.to,i=o}return r}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,i,s;if(t>=0&&t=this.chunk2Pos&&il.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),s=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),s}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(i==null||i=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=oh,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let s of this.ranges){if(s.from>=t)break;s.to>e&&(i+=this.input.read(Math.max(s.from,e),Math.min(s.to,t)))}return i}}class oi{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:i}=t.p;g1(this.data,e,t,this.id,i.data,i.tokenPrecTable)}}oi.prototype.contextual=oi.prototype.fallback=oi.prototype.extend=!1;oi.prototype.fallback=oi.prototype.extend=!1;class Ws{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function g1(n,e,t,i,s,r){let o=0,l=1<0){let p=n[d];if(a.allows(p)&&(e.token.value==-1||e.token.value==p||O1(p,e.token.value,s,r))){e.acceptToken(p);break}}let c=e.next,f=0,u=n[o+2];if(e.next<0&&u>f&&n[h+u*3-3]==65535){o=n[h+u*3-1];continue e}for(;f>1,p=h+d+(d<<1),m=n[p],g=n[p+1]||65536;if(c=g)f=d+1;else{o=n[p+2],e.advance();continue e}}break}}function lh(n,e,t){for(let i=e,s;(s=n[i])!=65535;i++)if(s==t)return i-e;return-1}function O1(n,e,t,i){let s=lh(t,i,e);return s<0||lh(t,i,n)e)&&!i.type.isError)return t<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(n.length,Math.max(i.from+1,e+25));if(t<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return t<0?0:n.length}}class y1{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?ah(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?ah(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(r instanceof j){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+r.length}}}class b1{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new Jn)}getActions(e){let t=0,i=null,{parser:s}=e.p,{tokenizers:r}=s,o=s.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let h=0;hf.end+25&&(a=Math.max(f.lookAhead,a)),f.value!=0)){let u=t;if(f.extended>-1&&(t=this.addActions(e,f.extended,f.end,t)),t=this.addActions(e,f.value,f.end,t),!c.extend&&(i=f,t>u))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!i&&e.pos==this.stream.end&&(i=new Jn,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Jn,{pos:i,p:s}=e;return t.start=i,t.end=Math.min(i+1,s.stream.end),t.value=i==s.stream.end?s.parser.eofTerm:0,t}updateCachedToken(e,t,i){let s=this.stream.clipPos(i.pos);if(t.token(this.stream.reset(s,e),i),e.value>-1){let{parser:r}=i.p;for(let o=0;o=0&&i.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(s+1)}putAction(e,t,i,s){for(let r=0;re.bufferLength*4?new y1(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,i=this.stacks=[],s,r;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;ot)i.push(l);else{if(this.advanceStack(l,i,e))continue;{s||(s=[],r=[]),s.push(l);let a=this.tokens.getMainToken(l);r.push(a.value,a.end)}}break}}if(!i.length){let o=s&&w1(s);if(o)return Re&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Re&&s&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&s){let o=this.stoppedAt!=null&&s[0].pos>this.stoppedAt?s[0]:this.runRecovery(s,r,i);if(o)return Re&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((l,a)=>a.score-l.score);i.length>o;)i.pop();i.some(l=>l.reducePos>t)&&this.recovering--}else if(i.length>1){e:for(let o=0;o500&&h.buffer.length>500)if((l.score-h.score||l.buffer.length-h.buffer.length)>0)i.splice(a--,1);else{i.splice(o--,1);continue e}}}i.length>12&&i.splice(12,i.length-12)}this.minStackPos=i[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&s>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,c=h?e.curContext.hash:0;for(let f=this.fragments.nodeAt(s);f;){let u=this.parser.nodeSet.types[f.type.id]==f.type?r.getGoto(e.state,f.type.id):-1;if(u>-1&&f.length&&(!h||(f.prop(L.contextHash)||0)==c))return e.useNode(f,u),Re&&console.log(o+this.stackID(e)+` (via reuse of ${r.getName(f.type.id)})`),!0;if(!(f instanceof j)||f.children.length==0||f.positions[0]>0)break;let d=f.children[0];if(d instanceof j&&f.positions[0]==0)f=d;else break}}let l=r.stateSlot(e.state,4);if(l>0)return e.reduce(l),Re&&console.log(o+this.stackID(e)+` (via always-reduce ${r.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let h=0;hs?t.push(p):i.push(p)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return hh(e,t),!0}}runRecovery(e,t,i){let s=null,r=!1;for(let o=0;o ":"";if(l.deadEnd&&(r||(r=!0,l.restart(),Re&&console.log(c+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let f=l.split(),u=c;for(let d=0;d<10&&f.forceReduce()&&(Re&&console.log(u+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));d++)Re&&(u=this.stackID(f)+" -> ");for(let d of l.recoverByInsert(a))Re&&console.log(c+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,i);this.stream.end>l.pos?(h==l.pos&&(h++,a=0),l.recoverByDelete(a,h),Re&&console.log(c+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),hh(l,i)):(!s||s.scoren;class k1{constructor(e){this.start=e.start,this.shift=e.shift||mr,this.reduce=e.reduce||mr,this.reuse=e.reuse||mr,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class tn extends Wo{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;le.topRules[l][1]),s=[];for(let l=0;l=0)r(c,a,l[h++]);else{let f=l[h+-c];for(let u=-c;u>0;u--)r(l[h++],a,f);h++}}}this.nodeSet=new Qs(t.map((l,a)=>ve.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:s[a],top:i.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Uc;let o=Vn(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new oi(o,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let s=new S1(this,e,t,i);for(let r of this.wrappers)s=r(s,e,t,i);return s}getGoto(e,t,i=!1){let s=this.goto;if(t>=s[0])return-1;for(let r=s[t+1];;){let o=s[r++],l=o&1,a=s[r++];if(l&&i)return a;for(let h=r+(o>>1);r0}validAction(e,t){return!!this.allActions(e,i=>i==t?!0:null)}allActions(e,t){let i=this.stateSlot(e,4),s=i?t(i):void 0;for(let r=this.stateSlot(e,1);s==null;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=ut(this.data,r+2);else break;s=t(ut(this.data,r+1))}return s}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=ut(this.data,i+2);else break;if((this.data[i+2]&1)==0){let s=this.data[i+1];t.some((r,o)=>o&1&&r==s)||t.push(this.data[i],s)}}return t}configure(e){let t=Object.assign(Object.create(tn.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=i}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(i=>{let s=e.tokenizers.find(r=>r.from==i);return s?s.to:i})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((i,s)=>{let r=e.specializers.find(l=>l.from==i.external);if(!r)return i;let o=Object.assign(Object.assign({},i),{external:r.to});return t.specializers[s]=ch(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map(()=>!1);if(e)for(let r of e.split(" ")){let o=t.indexOf(r);o>=0&&(i[o]=!0)}let s=null;for(let r=0;ri)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scoren.external(t,i)<<1|e}return n.get}const v1=1,Qu=194,Au=195,T1=196,fh=197,C1=198,P1=199,Q1=200,A1=2,Mu=3,uh=201,M1=24,R1=25,D1=49,E1=50,q1=55,$1=56,B1=57,W1=59,L1=60,z1=61,I1=62,V1=63,N1=65,X1=238,F1=71,_1=241,U1=242,H1=243,j1=244,G1=245,Z1=246,Y1=247,K1=248,Ru=72,J1=249,eb=250,tb=251,ib=252,nb=253,sb=254,rb=255,ob=256,lb=73,ab=77,hb=263,cb=112,fb=130,ub=151,db=152,pb=155,jt=10,nn=13,rl=32,Ls=9,ol=35,mb=40,gb=46,yo=123,dh=125,Du=39,Eu=34,ph=92,Ob=111,yb=120,bb=78,Sb=117,xb=85,kb=new Set([R1,D1,E1,hb,N1,fb,$1,B1,X1,I1,V1,Ru,lb,ab,L1,z1,ub,db,pb,cb]);function gr(n){return n==jt||n==nn}function Or(n){return n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102}const wb=new Ws((n,e)=>{let t;if(n.next<0)n.acceptToken(P1);else if(e.context.flags&es)gr(n.next)&&n.acceptToken(C1,1);else if(((t=n.peek(-1))<0||gr(t))&&e.canShift(fh)){let i=0;for(;n.next==rl||n.next==Ls;)n.advance(),i++;(n.next==jt||n.next==nn||n.next==ol)&&n.acceptToken(fh,-i)}else gr(n.next)&&n.acceptToken(T1,1)},{contextual:!0}),vb=new Ws((n,e)=>{let t=e.context;if(t.flags)return;let i=n.peek(-1);if(i==jt||i==nn){let s=0,r=0;for(;;){if(n.next==rl)s++;else if(n.next==Ls)s+=8-s%8;else break;n.advance(),r++}s!=t.indent&&n.next!=jt&&n.next!=nn&&n.next!=ol&&(s[n,e|qu])),Pb=new k1({start:Tb,reduce(n,e,t,i){return n.flags&es&&kb.has(e)||(e==F1||e==Ru)&&n.flags&qu?n.parent:n},shift(n,e,t,i){return e==Qu?new ts(n,Cb(i.read(i.pos,t.pos)),0):e==Au?n.parent:e==M1||e==q1||e==W1||e==Mu?new ts(n,0,es):mh.has(e)?new ts(n,0,mh.get(e)|n.flags&es):n},hash(n){return n.hash}}),Qb=new Ws(n=>{for(let e=0;e<5;e++){if(n.next!="print".charCodeAt(e))return;n.advance()}if(!/\w/.test(String.fromCharCode(n.next)))for(let e=0;;e++){let t=n.peek(e);if(!(t==rl||t==Ls)){t!=mb&&t!=gb&&t!=jt&&t!=nn&&t!=ol&&n.acceptToken(v1);return}}}),Ab=new Ws((n,e)=>{let{flags:t}=e.context,i=t&at?Eu:Du,s=(t&ht)>0,r=!(t&ct),o=(t&ft)>0,l=n.pos;for(;!(n.next<0);)if(o&&n.next==yo)if(n.peek(1)==yo)n.advance(2);else{if(n.pos==l){n.acceptToken(Mu,1);return}break}else if(r&&n.next==ph){if(n.pos==l){n.advance();let a=n.next;a>=0&&(n.advance(),Mb(n,a)),n.acceptToken(A1);return}break}else if(n.next==ph&&!r&&n.peek(1)>-1)n.advance(2);else if(n.next==i&&(!s||n.peek(1)==i&&n.peek(2)==i)){if(n.pos==l){n.acceptToken(uh,s?3:1);return}break}else if(n.next==jt){if(s)n.advance();else if(n.pos==l){n.acceptToken(uh);return}break}else n.advance();n.pos>l&&n.acceptToken(Q1)});function Mb(n,e){if(e==Ob)for(let t=0;t<2&&n.next>=48&&n.next<=55;t++)n.advance();else if(e==yb)for(let t=0;t<2&&Or(n.next);t++)n.advance();else if(e==Sb)for(let t=0;t<4&&Or(n.next);t++)n.advance();else if(e==xb)for(let t=0;t<8&&Or(n.next);t++)n.advance();else if(e==bb&&n.next==yo){for(n.advance();n.next>=0&&n.next!=dh&&n.next!=Du&&n.next!=Eu&&n.next!=jt;)n.advance();n.next==dh&&n.advance()}}const Rb=Lo({'async "*" "**" FormatConversion FormatSpec':O.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":O.controlKeyword,"in not and or is del":O.operatorKeyword,"from def class global nonlocal lambda":O.definitionKeyword,import:O.moduleKeyword,"with as print":O.keyword,Boolean:O.bool,None:O.null,VariableName:O.variableName,"CallExpression/VariableName":O.function(O.variableName),"FunctionDefinition/VariableName":O.function(O.definition(O.variableName)),"ClassDefinition/VariableName":O.definition(O.className),PropertyName:O.propertyName,"CallExpression/MemberExpression/PropertyName":O.function(O.propertyName),Comment:O.lineComment,Number:O.number,String:O.string,FormatString:O.special(O.string),Escape:O.escape,UpdateOp:O.updateOperator,"ArithOp!":O.arithmeticOperator,BitOp:O.bitwiseOperator,CompareOp:O.compareOperator,AssignOp:O.definitionOperator,Ellipsis:O.punctuation,At:O.meta,"( )":O.paren,"[ ]":O.squareBracket,"{ }":O.brace,".":O.derefOperator,", ;":O.separator}),Db={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},Eb=tn.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:lQdO,59aO'vQdO,59aO:zQdO,59aOOQS,59y,59yO;PQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;_QdO,5:QO;dQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;uQdO,5:UO;zQdO,5:WOOOW'#Fy'#FyOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/[QtO1G.|O!/cQtO1G.|O1lQdO1G.|O!0OQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!0VQdO1G/eO!0gQdO1G/eO!0oQdO1G/fO'vQdO'#H[O!0tQdO'#H[O!0yQtO1G.{O!1ZQdO,59iO!2aQdO,5=zO!2qQdO,5=zO!2yQdO1G/mO!3OQtO1G/mOOQS1G/l1G/lO!3`QdO,5=uO!4VQdO,5=uO0rQdO1G/qO!4tQdO1G/sO!4yQtO1G/sO!5ZQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5kQdO'#HxO0rQdO'#HxO!5|QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6[Q#xO1G2zO!6{QtO1G2zO'vQdO,5kOOQS1G1`1G1`O!8RQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!8WQdO'#FrO!8cQdO,59oO!8kQdO1G/XO!8uQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9fQdO'#GtOOQS,5jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!lO!lO!hO!=VQdO,5>hO!=hQdO'#EpO0rQdO1G0tO!=sQdO1G0tO!=xQgO1G0zO!AvQgO1G0}O!EqQdO,5>oO!E{QdO,5>oO!FTQtO,5>oO0rQdO1G1PO!F_QdO1G1PO4iQdO1G1UO!!vQdO1G1WOOQV,5;a,5;aO!FdQfO,5;aO!FiQgO1G1QO!JjQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JzQdO,5>pO!KXQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KaQdO'#FSO!KrQ!fO1G1WO!KzQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!LPQdO1G1]O!LXQdO'#F^OOQV1G1b1G1bO!#ZQtO1G1bPOOO1G2v1G2vP!L^OSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LfQdO,5=|O!LyQdO,5=|OOQS1G/u1G/uO!MRQdO,5>PO!McQdO,5>PO!MkQdO,5>PO!NOQdO,5>PO!N`QdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8kQdO7+$pO#!RQdO1G.|O#!YQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!aQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!qQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!vQdO7+%PO##OQdO7+%QO##TQdO1G3fOOQS7+%X7+%XO##eQdO1G3fO##mQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##rQdO1G3aOOQS-E9q-E9qO#$iQdO7+%]OOQS7+%_7+%_O#$wQdO1G3aO#%fQdO7+%_O#%kQdO1G3gO#%{QdO1G3gO#&TQdO7+%]O#&YQdO,5>dO#&sQdO,5>dO#&sQdO,5>dOOQS'#Dx'#DxO#'UO&jO'#DzO#'aO`O'#HyOOOW1G3}1G3}O#'fQdO1G3}O#'nQdO1G3}O#'yQ#xO7+(fO#(jQtO1G2UP#)TQdO'#GOOOQS,5nQdO,5sQdO1G4OOOQS-E9y-E9yO#?^QdO1G4OO<[QdO'#H{OOOO'#D{'#D{OOOO'#F|'#F|O#?oO&jO,5:fOOOW,5>e,5>eOOOW7+)i7+)iO#?zQdO7+)iO#@SQdO1G2zO#@mQdO1G2zP'vQdO'#FuO0rQdO<mO#BQQdO,5>mOOQS1G0v1G0vOOQS<rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ oQdO<cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<tO$4{QdO,5>tO1XQdO,5vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5wO$8zQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)nQdO'#GdO$9SQdO1G4bO$9^QdO1G4bO$9fQdO1G4bOOQS7+%T7+%TO$9tQdO1G1tO$:SQtO'#FaO$:ZQdO,5<}OOQS,5<},5<}O$:iQdO1G4cOOQS-E:a-E:aO$)nQdO,5<|O$:pQdO,5<|O$:uQdO7+)|OOQS-E:`-E:`O$;PQdO7+)|O$)nQdO,5S~O%cOS%^OSSOS%]PQ~OPdOVaOfoOhYOopOs!POvqO!PrO!Q{O!T!SO!U!RO!XZO!][O!h`O!r`O!s`O!t`O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#l!QO#o!TO#s!UO#u!VO#z!WO#}hO$P!XO%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~O%]!YO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%j![O%k!]O%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aO~Ok%xXl%xXm%xXn%xXo%xXp%xXs%xXz%xX{%xX!x%xX#g%xX%[%xX%_%xX%z%xXg%xX!T%xX!U%xX%{%xX!W%xX![%xX!Q%xX#[%xXt%xX!m%xX~P%SOfoOhYO!XZO!][O!h`O!r`O!s`O!t`O%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~Oz%wX{%wX#g%wX%[%wX%_%wX%z%wX~Ok!pOl!qOm!oOn!oOo!rOp!sOs!tO!x%wX~P)pOV!zOg!|Oo0cOv0qO!PrO~P'vOV#OOo0cOv0qO!W#PO~P'vOV#SOa#TOo0cOv0qO![#UO~P'vOQ#XO%`#XO%a#ZO~OQ#^OR#[O%`#^O%a#`O~OV%iX_%iXa%iXh%iXk%iXl%iXm%iXn%iXo%iXp%iXs%iXz%iX!X%iX!f%iX%j%iX%k%iX%l%iX%m%iX%n%iX%o%iX%p%iX%q%iX%r%iX%s%iXg%iX!T%iX!U%iX~O&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O{%iX!x%iX#g%iX%[%iX%_%iX%z%iX%{%iX!W%iX![%iX!Q%iX#[%iXt%iX!m%iX~P,eOz#dO{%hX!x%hX#g%hX%[%hX%_%hX%z%hX~Oo0cOv0qO~P'vO#g#gO%[#iO%_#iO~O%uWO~O!T#nO#u!VO#z!WO#}hO~OopO~P'vOV#sOa#tO%uWO{wP~OV#xOo0cOv0qO!Q#yO~P'vO{#{O!x$QO%z#|O#g!yX%[!yX%_!yX~OV#xOo0cOv0qO#g#SX%[#SX%_#SX~P'vOo0cOv0qO#g#WX%[#WX%_#WX~P'vOh$WO%uWO~O!f$YO!r$YO%uWO~OV$eO~P'vO!U$gO#s$hO#u$iO~O{$jO~OV$qO~P'vOS$sO%[$rO%_$rO%c$tO~OV$}Oa$}Og%POo0cOv0qO~P'vOo0cOv0qO{%SO~P'vO&Y%UO~Oa!bOh!iO!X!kO!f!mOVba_bakbalbambanbaobapbasbazba{ba!xba#gba%[ba%_ba%jba%kba%lba%mba%nba%oba%pba%qba%rba%sba%zbagba!Tba!Uba%{ba!Wba![ba!Qba#[batba!mba~On%ZO~Oo%ZO~P'vOo0cO~P'vOk0eOl0fOm0dOn0dOo0mOp0nOs0rOg%wX!T%wX!U%wX%{%wX!W%wX![%wX!Q%wX#[%wX!m%wX~P)pO%{%]Og%vXz%vX!T%vX!U%vX!W%vX{%vX~Og%_Oz%`O!T%dO!U%cO~Og%_O~Oz%gO!T%dO!U%cO!W&SX~O!W%kO~Oz%lO{%nO!T%dO!U%cO![%}X~O![%rO~O![%sO~OQ#XO%`#XO%a%uO~OV%wOo0cOv0qO!PrO~P'vOQ#^OR#[O%`#^O%a%zO~OV!qa_!qaa!qah!qak!qal!qam!qan!qao!qap!qas!qaz!qa{!qa!X!qa!f!qa!x!qa#g!qa%[!qa%_!qa%j!qa%k!qa%l!qa%m!qa%n!qa%o!qa%p!qa%q!qa%r!qa%s!qa%z!qag!qa!T!qa!U!qa%{!qa!W!qa![!qa!Q!qa#[!qat!qa!m!qa~P#yOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P%SOV&OOopOvqO{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P'vOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#g$zX%[$zX%_$zX~P'vO#g#gO%[&TO%_&TO~O!f&UOh&sX%[&sXz&sX#[&sX#g&sX%_&sX#Z&sXg&sX~Oh!iO%[&WO~Okealeameaneaoeapeaseazea{ea!xea#gea%[ea%_ea%zeagea!Tea!Uea%{ea!Wea![ea!Qea#[eatea!mea~P%SOsqazqa{qa#gqa%[qa%_qa%zqa~Ok!pOl!qOm!oOn!oOo!rOp!sO!xqa~PEcO%z&YOz%yX{%yX~O%uWOz%yX{%yX~Oz&]O{wX~O{&_O~Oz%lO#g%}X%[%}X%_%}Xg%}X{%}X![%}X!m%}X%z%}X~OV0lOo0cOv0qO!PrO~P'vO%z#|O#gUa%[Ua%_Ua~Oz&hO#g&PX%[&PX%_&PXn&PX~P%SOz&kO!Q&jO#g#Wa%[#Wa%_#Wa~Oz&lO#[&nO#g&rX%[&rX%_&rXg&rX~O!f$YO!r$YO#Z&qO%uWO~O#Z&qO~Oz&sO#g&tX%[&tX%_&tX~Oz&uO#g&pX%[&pX%_&pX{&pX~O!X&wO%z&xO~Oz&|On&wX~P%SOn'PO~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO%['UO~P'vOt'YO#p'WO#q'XOP#naV#naf#nah#nao#nas#nav#na!P#na!Q#na!T#na!U#na!X#na!]#na!h#na!r#na!s#na!t#na!{#na!}#na#P#na#R#na#T#na#X#na#Z#na#^#na#_#na#a#na#c#na#l#na#o#na#s#na#u#na#z#na#}#na$P#na%X#na%o#na%p#na%t#na%u#na&Z#na&[#na&]#na&^#na&_#na&`#na&a#na&b#na&c#na&d#na&e#na&f#na&g#na&h#na&i#na&j#na%Z#na%_#na~Oz'ZO#[']O{&xX~Oh'_O!X&wO~Oh!iO{$jO!X&wO~O{'eO~P%SO%['hO%_'hO~OS'iO%['hO%_'hO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%k!]O~P!#uO%kWi~P!#uOV!aO_!aOa!bOh!iO!X!kO!f!mO%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%m!_O%n!_O~P!&pO%mWi%nWi~P!&pOa!bOh!iO!X!kO!f!mOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%mWi%nWi%oWi%pWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~OV!aO_!aO%q!aO%r!aO%s!aO~P!)nOVWi_Wi%qWi%rWi%sWi~P!)nO!T%dO!U%cOg&VXz&VX~O%z'kO%{'kO~P,eOz'mOg&UX~Og'oO~Oz'pO{'rO!W&XX~Oo0cOv0qOz'pO{'sO!W&XX~P'vO!W'uO~Om!oOn!oOo!rOp!sOkjisjizji{ji!xji#gji%[ji%_ji%zji~Ol!qO~P!.aOlji~P!.aOk0eOl0fOm0dOn0dOo0mOp0nO~Ot'wO~P!/jOV'|Og'}Oo0cOv0qO~P'vOg'}Oz(OO~Og(QO~O!U(SO~Og(TOz(OO!T%dO!U%cO~P%SOk0eOl0fOm0dOn0dOo0mOp0nOgqa!Tqa!Uqa%{qa!Wqa![qa!Qqa#[qatqa!mqa~PEcOV'|Oo0cOv0qO!W&Sa~P'vOz(WO!W&Sa~O!W(XO~Oz(WO!T%dO!U%cO!W&Sa~P%SOV(]Oo0cOv0qO![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~P'vOz(^O![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~O![(aO~Oz(^O!T%dO!U%cO![%}a~P%SOz(dO!T%dO!U%cO![&Ta~P%SOz(gO{&lX![&lX!m&lX%z&lX~O{(kO![(mO!m(nO%z(jO~OV&OOopOvqO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~P'vOz(pO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~O!f&UOh&sa%[&saz&sa#[&sa#g&sa%_&sa#Z&sag&sa~O%[(uO~OV#sOa#tO%uWO~Oz&]O{wa~OopOvqO~P'vOz(^O#g%}a%[%}a%_%}ag%}a{%}a![%}a!m%}a%z%}a~P%SOz(zO#g%hX%[%hX%_%hX%z%hX~O%z#|O#gUi%[Ui%_Ui~O#g&Pa%[&Pa%_&Pan&Pa~P'vOz(}O#g&Pa%[&Pa%_&Pan&Pa~O%uWO#g&ra%[&ra%_&rag&ra~Oz)SO#g&ra%[&ra%_&rag&ra~Og)VO~OV)WOh$WO%uWO~O#Z)XO~O%uWO#g&ta%[&ta%_&ta~Oz)ZO#g&ta%[&ta%_&ta~Oo0cOv0qO#g&pa%[&pa%_&pa{&pa~P'vOz)^O#g&pa%[&pa%_&pa{&pa~OV)`Oa)`O%uWO~O%z)eO~Ot)hO#j)gOP#hiV#hif#hih#hio#his#hiv#hi!P#hi!Q#hi!T#hi!U#hi!X#hi!]#hi!h#hi!r#hi!s#hi!t#hi!{#hi!}#hi#P#hi#R#hi#T#hi#X#hi#Z#hi#^#hi#_#hi#a#hi#c#hi#l#hi#o#hi#s#hi#u#hi#z#hi#}#hi$P#hi%X#hi%o#hi%p#hi%t#hi%u#hi&Z#hi&[#hi&]#hi&^#hi&_#hi&`#hi&a#hi&b#hi&c#hi&d#hi&e#hi&f#hi&g#hi&h#hi&i#hi&j#hi%Z#hi%_#hi~Ot)iOP#kiV#kif#kih#kio#kis#kiv#ki!P#ki!Q#ki!T#ki!U#ki!X#ki!]#ki!h#ki!r#ki!s#ki!t#ki!{#ki!}#ki#P#ki#R#ki#T#ki#X#ki#Z#ki#^#ki#_#ki#a#ki#c#ki#l#ki#o#ki#s#ki#u#ki#z#ki#}#ki$P#ki%X#ki%o#ki%p#ki%t#ki%u#ki&Z#ki&[#ki&]#ki&^#ki&_#ki&`#ki&a#ki&b#ki&c#ki&d#ki&e#ki&f#ki&g#ki&h#ki&i#ki&j#ki%Z#ki%_#ki~OV)kOn&wa~P'vOz)lOn&wa~Oz)lOn&wa~P%SOn)pO~O%Y)tO~Ot)wO#p'WO#q)vOP#niV#nif#nih#nio#nis#niv#ni!P#ni!Q#ni!T#ni!U#ni!X#ni!]#ni!h#ni!r#ni!s#ni!t#ni!{#ni!}#ni#P#ni#R#ni#T#ni#X#ni#Z#ni#^#ni#_#ni#a#ni#c#ni#l#ni#o#ni#s#ni#u#ni#z#ni#}#ni$P#ni%X#ni%o#ni%p#ni%t#ni%u#ni&Z#ni&[#ni&]#ni&^#ni&_#ni&`#ni&a#ni&b#ni&c#ni&d#ni&e#ni&f#ni&g#ni&h#ni&i#ni&j#ni%Z#ni%_#ni~OV)zOo0cOv0qO{$jO~P'vOo0cOv0qO{&xa~P'vOz*OO{&xa~OV*SOa*TOg*WO%q*UO%uWO~O{$jO&{*YO~Oh'_O~Oh!iO{$jO~O%[*_O~O%[*aO%_*aO~OV$}Oa$}Oo0cOv0qOg&Ua~P'vOz*dOg&Ua~Oo0cOv0qO{*gO!W&Xa~P'vOz*hO!W&Xa~Oo0cOv0qOz*hO{*kO!W&Xa~P'vOo0cOv0qOz*hO!W&Xa~P'vOz*hO{*kO!W&Xa~Om0dOn0dOo0mOp0nOgjikjisjizji!Tji!Uji%{ji!Wji{ji![ji#gji%[ji%_ji!Qji#[jitji!mji%zji~Ol0fO~P!NkOlji~P!NkOV'|Og*pOo0cOv0qO~P'vOn*rO~Og*pOz*tO~Og*uO~OV'|Oo0cOv0qO!W&Si~P'vOz*vO!W&Si~O!W*wO~OV(]Oo0cOv0qO![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~P'vOz*zO!T%dO!U%cO![&Ti~Oz*}O![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~O![+OO~Oa+QOo0cOv0qO![&Ti~P'vOz*zO![&Ti~O![+SO~OV+UOo0cOv0qO{&la![&la!m&la%z&la~P'vOz+VO{&la![&la!m&la%z&la~O!]+YO&n+[O![!nX~O![+^O~O{(kO![+_O~O{(kO![+_O!m+`O~OV&OOopOvqO{%hq!x%hq#g%hq%[%hq%_%hq%z%hq~P'vOz$ri{$ri!x$ri#g$ri%[$ri%_$ri%z$ri~P%SOV&OOopOvqO~P'vOV&OOo0cOv0qO#g%ha%[%ha%_%ha%z%ha~P'vOz+aO#g%ha%[%ha%_%ha%z%ha~Oz$ia#g$ia%[$ia%_$ian$ia~P%SO#g&Pi%[&Pi%_&Pin&Pi~P'vOz+dO#g#Wq%[#Wq%_#Wq~O#[+eOz$va#g$va%[$va%_$vag$va~O%uWO#g&ri%[&ri%_&rig&ri~Oz+gO#g&ri%[&ri%_&rig&ri~OV+iOh$WO%uWO~O%uWO#g&ti%[&ti%_&ti~Oo0cOv0qO#g&pi%[&pi%_&pi{&pi~P'vO{#{Oz#eX!W#eX~Oz+mO!W&uX~O!W+oO~Ot+rO#j)gOP#hqV#hqf#hqh#hqo#hqs#hqv#hq!P#hq!Q#hq!T#hq!U#hq!X#hq!]#hq!h#hq!r#hq!s#hq!t#hq!{#hq!}#hq#P#hq#R#hq#T#hq#X#hq#Z#hq#^#hq#_#hq#a#hq#c#hq#l#hq#o#hq#s#hq#u#hq#z#hq#}#hq$P#hq%X#hq%o#hq%p#hq%t#hq%u#hq&Z#hq&[#hq&]#hq&^#hq&_#hq&`#hq&a#hq&b#hq&c#hq&d#hq&e#hq&f#hq&g#hq&h#hq&i#hq&j#hq%Z#hq%_#hq~On$|az$|a~P%SOV)kOn&wi~P'vOz+yOn&wi~Oz,TO{$jO#[,TO~O#q,VOP#nqV#nqf#nqh#nqo#nqs#nqv#nq!P#nq!Q#nq!T#nq!U#nq!X#nq!]#nq!h#nq!r#nq!s#nq!t#nq!{#nq!}#nq#P#nq#R#nq#T#nq#X#nq#Z#nq#^#nq#_#nq#a#nq#c#nq#l#nq#o#nq#s#nq#u#nq#z#nq#}#nq$P#nq%X#nq%o#nq%p#nq%t#nq%u#nq&Z#nq&[#nq&]#nq&^#nq&_#nq&`#nq&a#nq&b#nq&c#nq&d#nq&e#nq&f#nq&g#nq&h#nq&i#nq&j#nq%Z#nq%_#nq~O#[,WOz%Oa{%Oa~Oo0cOv0qO{&xi~P'vOz,YO{&xi~O{#{O%z,[Og&zXz&zX~O%uWOg&zXz&zX~Oz,`Og&yX~Og,bO~O%Y,eO~O!T%dO!U%cOg&Viz&Vi~OV$}Oa$}Oo0cOv0qOg&Ui~P'vO{,hOz$la!W$la~Oo0cOv0qO{,iOz$la!W$la~P'vOo0cOv0qO{*gO!W&Xi~P'vOz,lO!W&Xi~Oo0cOv0qOz,lO!W&Xi~P'vOz,lO{,oO!W&Xi~Og$hiz$hi!W$hi~P%SOV'|Oo0cOv0qO~P'vOn,qO~OV'|Og,rOo0cOv0qO~P'vOV'|Oo0cOv0qO!W&Sq~P'vOz$gi![$gi#g$gi%[$gi%_$gig$gi{$gi!m$gi%z$gi~P%SOV(]Oo0cOv0qO~P'vOa+QOo0cOv0qO![&Tq~P'vOz,sO![&Tq~O![,tO~OV(]Oo0cOv0qO![%}q#g%}q%[%}q%_%}qg%}q{%}q!m%}q%z%}q~P'vO{,uO~OV+UOo0cOv0qO{&li![&li!m&li%z&li~P'vOz,zO{&li![&li!m&li%z&li~O!]+YO&n+[O![!na~O{(kO![,}O~OV&OOo0cOv0qO#g%hi%[%hi%_%hi%z%hi~P'vOz-OO#g%hi%[%hi%_%hi%z%hi~O%uWO#g&rq%[&rq%_&rqg&rq~Oz-RO#g&rq%[&rq%_&rqg&rq~OV)`Oa)`O%uWO!W&ua~Oz-TO!W&ua~On$|iz$|i~P%SOV)kO~P'vOV)kOn&wq~P'vOt-XOP#myV#myf#myh#myo#mys#myv#my!P#my!Q#my!T#my!U#my!X#my!]#my!h#my!r#my!s#my!t#my!{#my!}#my#P#my#R#my#T#my#X#my#Z#my#^#my#_#my#a#my#c#my#l#my#o#my#s#my#u#my#z#my#}#my$P#my%X#my%o#my%p#my%t#my%u#my&Z#my&[#my&]#my&^#my&_#my&`#my&a#my&b#my&c#my&d#my&e#my&f#my&g#my&h#my&i#my&j#my%Z#my%_#my~O%Z-]O%_-]O~P`O#q-^OP#nyV#nyf#nyh#nyo#nys#nyv#ny!P#ny!Q#ny!T#ny!U#ny!X#ny!]#ny!h#ny!r#ny!s#ny!t#ny!{#ny!}#ny#P#ny#R#ny#T#ny#X#ny#Z#ny#^#ny#_#ny#a#ny#c#ny#l#ny#o#ny#s#ny#u#ny#z#ny#}#ny$P#ny%X#ny%o#ny%p#ny%t#ny%u#ny&Z#ny&[#ny&]#ny&^#ny&_#ny&`#ny&a#ny&b#ny&c#ny&d#ny&e#ny&f#ny&g#ny&h#ny&i#ny&j#ny%Z#ny%_#ny~Oz-aO{$jO#[-aO~Oo0cOv0qO{&xq~P'vOz-dO{&xq~O%z,[Og&zaz&za~O{#{Og&zaz&za~OV*SOa*TO%q*UO%uWOg&ya~Oz-hOg&ya~O$S-lO~OV$}Oa$}Oo0cOv0qO~P'vOo0cOv0qO{-mOz$li!W$li~P'vOo0cOv0qOz$li!W$li~P'vO{-mOz$li!W$li~Oo0cOv0qO{*gO~P'vOo0cOv0qO{*gO!W&Xq~P'vOz-pO!W&Xq~Oo0cOv0qOz-pO!W&Xq~P'vOs-sO!T%dO!U%cOg&Oq!W&Oq![&Oqz&Oq~P!/jOa+QOo0cOv0qO![&Ty~P'vOz$ji![$ji~P%SOa+QOo0cOv0qO~P'vOV+UOo0cOv0qO~P'vOV+UOo0cOv0qO{&lq![&lq!m&lq%z&lq~P'vO{(kO![-xO!m-yO%z-wO~OV&OOo0cOv0qO#g%hq%[%hq%_%hq%z%hq~P'vO%uWO#g&ry%[&ry%_&ryg&ry~OV)`Oa)`O%uWO!W&ui~Ot-}OP#m!RV#m!Rf#m!Rh#m!Ro#m!Rs#m!Rv#m!R!P#m!R!Q#m!R!T#m!R!U#m!R!X#m!R!]#m!R!h#m!R!r#m!R!s#m!R!t#m!R!{#m!R!}#m!R#P#m!R#R#m!R#T#m!R#X#m!R#Z#m!R#^#m!R#_#m!R#a#m!R#c#m!R#l#m!R#o#m!R#s#m!R#u#m!R#z#m!R#}#m!R$P#m!R%X#m!R%o#m!R%p#m!R%t#m!R%u#m!R&Z#m!R&[#m!R&]#m!R&^#m!R&_#m!R&`#m!R&a#m!R&b#m!R&c#m!R&d#m!R&e#m!R&f#m!R&g#m!R&h#m!R&i#m!R&j#m!R%Z#m!R%_#m!R~Oo0cOv0qO{&xy~P'vOV*SOa*TO%q*UO%uWOg&yi~O$S-lO%Z.VO%_.VO~OV.aOh._O!X.^O!].`O!h.YO!s.[O!t.[O%p.XO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O~Oo0cOv0qOz$lq!W$lq~P'vO{.fOz$lq!W$lq~Oo0cOv0qO{*gO!W&Xy~P'vOz.gO!W&Xy~Oo0cOv.kO~P'vOs-sO!T%dO!U%cOg&Oy!W&Oy![&Oyz&Oy~P!/jO{(kO![.nO~O{(kO![.nO!m.oO~OV*SOa*TO%q*UO%uWO~Oh.tO!f.rOz$TX#[$TX%j$TXg$TX~Os$TX{$TX!W$TX![$TX~P$-bO%o.vO%p.vOs$UXz$UX{$UX#[$UX%j$UX!W$UXg$UX![$UX~O!h.xO~Oz.|O#[/OO%j.yOs&|X{&|X!W&|Xg&|X~Oa/RO~P$)zOh.tOs&}Xz&}X{&}X#[&}X%j&}X!W&}Xg&}X![&}X~Os/VO{$jO~Oo0cOv0qOz$ly!W$ly~P'vOo0cOv0qO{*gO!W&X!R~P'vOz/ZO!W&X!R~Og&RXs&RX!T&RX!U&RX!W&RX![&RXz&RX~P!/jOs-sO!T%dO!U%cOg&Qa!W&Qa![&Qaz&Qa~O{(kO![/^O~O!f.rOh$[as$[az$[a{$[a#[$[a%j$[a!W$[ag$[a![$[a~O!h/eO~O%o.vO%p.vOs$Uaz$Ua{$Ua#[$Ua%j$Ua!W$Uag$Ua![$Ua~O%j.yOs$Yaz$Ya{$Ya#[$Ya!W$Yag$Ya![$Ya~Os&|a{&|a!W&|ag&|a~P$)nOz/jOs&|a{&|a!W&|ag&|a~O!W/mO~Og/mO~O{/oO~O![/pO~Oo0cOv0qO{*gO!W&X!Z~P'vO{/sO~O%z/tO~P$-bOz/uO#[/OO%j.yOg'PX~Oz/uOg'PX~Og/wO~O!h/xO~O#[/OOs%Saz%Sa{%Sa%j%Sa!W%Sag%Sa![%Sa~O#[/OO%j.yOs%Waz%Wa{%Wa!W%Wag%Wa~Os&|i{&|i!W&|ig&|i~P$)nOz/zO#[/OO%j.yO!['Oa~Og'Pa~P$)nOz0SOg'Pa~Oa0UO!['Oi~P$)zOz0WO!['Oi~Oz0WO#[/OO%j.yO!['Oi~O#[/OO%j.yOg$biz$bi~O%z0ZO~P$-bO#[/OO%j.yOg%Vaz%Va~Og'Pi~P$)nO{0^O~Oa0UO!['Oq~P$)zOz0`O!['Oq~O#[/OO%j.yOz%Ui![%Ui~Oa0UO~P$)zOa0UO!['Oy~P$)zO#[/OO%j.yOg$ciz$ci~O#[/OO%j.yOz%Uq![%Uq~Oz+aO#g%ha%[%ha%_%ha%z%ha~P%SOV&OOo0cOv0qO~P'vOn0hO~Oo0hO~P'vO{0iO~Ot0jO~P!/jO&]&Z&j&h&i&g&f&d&e&c&b&`&a&_&^&[%u~",goto:"!=j'QPPPPPP'RP'Z*s+[+t,_,y-fP.SP'Z.r.r'ZPPP'Z2[PPPPPP2[5PPP5PP7b7k=sPP=v>h>kPP'Z'ZPP>zPP'Z'ZPP'Z'Z'Z'Z'Z?O?w'ZP?zP@QDXGuGyPG|HWH['ZPPPH_Hk'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHqH}IVPI^IdPI^PI^I^PPPI^PKrPK{LVL]KrPI^LfPI^PLmLsPLwM]MzNeLwLwNkNxLwLwLwLw! ^! d! g! l! o! y!!P!!]!!o!!u!#P!#V!#s!#y!$P!$Z!$a!$g!$y!%T!%Z!%a!%k!%q!%w!%}!&T!&Z!&e!&k!&u!&{!'U!'[!'k!'s!'}!(UPPPPPPPPPPP!([!(_!(e!(n!(x!)TPPPPPPPPPPPP!-u!/Z!3^!6oPP!6w!7W!7a!8Y!8P!8c!8i!8l!8o!8r!8z!9jPPPPPPPPPPPPPPPPP!9m!9q!9wP!:]!:a!:m!:v!;S!;j!;m!;p!;v!;|!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[Qb,vb,wb,Ab,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:n=>Db[n]||-1}],tokenPrec:7668}),gh=new jm,$u=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function Nn(n){return(e,t,i)=>{if(i)return!1;let s=e.node.getChild("VariableName");return s&&t(s,n),!0}}const qb={FunctionDefinition:Nn("function"),ClassDefinition:Nn("class"),ForStatement(n,e,t){if(t){for(let i=n.node.firstChild;i;i=i.nextSibling)if(i.name=="VariableName")e(i,"variable");else if(i.name=="in")break}},ImportStatement(n,e){var t,i;let{node:s}=n,r=((t=s.firstChild)===null||t===void 0?void 0:t.name)=="from";for(let o=s.getChild("import");o;o=o.nextSibling)o.name=="VariableName"&&((i=o.nextSibling)===null||i===void 0?void 0:i.name)!="as"&&e(o,r?"variable":"namespace")},AssignStatement(n,e){for(let t=n.node.firstChild;t;t=t.nextSibling)if(t.name=="VariableName")e(t,"variable");else if(t.name==":"||t.name=="AssignOp")break},ParamList(n,e){for(let t=null,i=n.node.firstChild;i;i=i.nextSibling)i.name=="VariableName"&&(!t||!/\*|AssignOp/.test(t.name))&&e(i,"variable"),t=i},CapturePattern:Nn("variable"),AsPattern:Nn("variable"),__proto__:null};function Bu(n,e){let t=gh.get(e);if(t)return t;let i=[],s=!0;function r(o,l){let a=n.sliceString(o.from,o.to);i.push({label:a,type:l})}return e.cursor(re.IncludeAnonymous).iterate(o=>{if(o.name){let l=qb[o.name];if(l&&l(o,r,s)||!s&&$u.has(o.name))return!1;s=!1}else if(o.to-o.from>8192){for(let l of Bu(n,o.node))i.push(l);return!1}}),gh.set(e,i),i}const Oh=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,Wu=["String","FormatString","Comment","PropertyName"];function $b(n){let e=ae(n.state).resolveInner(n.pos,-1);if(Wu.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&Oh.test(n.state.sliceDoc(e.from,e.to));if(!t&&!n.explicit)return null;let i=[];for(let s=e;s;s=s.parent)$u.has(s.name)&&(i=i.concat(Bu(n.state.doc,s)));return{options:i,from:t?e.from:n.pos,validFor:Oh}}const Bb=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(n=>({label:n,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(n=>({label:n,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(n=>({label:n,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(n=>({label:n,type:"function"}))),Wb=[lt("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),lt("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),lt("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),lt("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),lt(`if \${}: + +`,{label:"if",detail:"block",type:"keyword"}),lt("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),lt("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),lt("import ${module}",{label:"import",detail:"statement",type:"keyword"}),lt("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],Lb=L0(Wu,du(Bb.concat(Wb)));function yr(n){let{node:e,pos:t}=n,i=n.lineIndent(t,-1),s=null;for(;;){let r=e.childBefore(t);if(r)if(r.name=="Comment")t=r.from;else if(r.name=="Body"||r.name=="MatchBody")n.baseIndentFor(r)+n.unit<=i&&(s=r),e=r;else if(r.name=="MatchClause")e=r;else if(r.type.is("Statement"))e=r;else break;else break}return s}function br(n,e){let t=n.baseIndentFor(e),i=n.lineAt(n.pos,-1),s=i.from+i.text.length;return/^\s*($|#)/.test(i.text)&&n.node.tot?null:t+n.unit}const Sr=Ui.define({name:"python",parser:Eb.configure({props:[Ms.add({Body:n=>{var e;let t=/^\s*(#|$)/.test(n.textAfter)&&yr(n)||n.node;return(e=br(n,t))!==null&&e!==void 0?e:n.continue()},MatchBody:n=>{var e;let t=yr(n);return(e=br(n,t||n.node))!==null&&e!==void 0?e:n.continue()},IfStatement:n=>/^\s*(else:|elif )/.test(n.textAfter)?n.baseIndent:n.continue(),"ForStatement WhileStatement":n=>/^\s*else:/.test(n.textAfter)?n.baseIndent:n.continue(),TryStatement:n=>/^\s*(except[ :]|finally:|else:)/.test(n.textAfter)?n.baseIndent:n.continue(),MatchStatement:n=>/^\s*case /.test(n.textAfter)?n.baseIndent+n.unit:n.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":ir({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":ir({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":ir({closing:"]"}),MemberExpression:n=>n.baseIndent+n.unit,"String FormatString":()=>null,Script:n=>{var e;let t=yr(n);return(e=t&&br(n,t))!==null&&e!==void 0?e:n.continue()}}),Vo.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":sf,Body:(n,e)=>({from:n.from+1,to:n.to-(n.to==e.doc.length?0:1)}),"String FormatString":(n,e)=>({from:e.doc.lineAt(n.from).to,to:n.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function jb(){return new ef(Sr,[Sr.data.of({autocomplete:$b}),Sr.data.of({autocomplete:Lb})])}const zb=Lo({String:O.string,Number:O.number,"True False":O.bool,PropertyName:O.propertyName,Null:O.null,", :":O.separator,"[ ]":O.squareBracket,"{ }":O.brace}),Ib=tn.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[zb],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),Gb=()=>n=>{try{JSON.parse(n.state.doc.toString())}catch(e){if(!(e instanceof SyntaxError))throw e;const t=Vb(e,n.state.doc);return[{from:t,message:e.message,severity:"error",to:t}]}return[]};function Vb(n,e){let t;return(t=n.message.match(/at position (\d+)/))?Math.min(+t[1],e.length):(t=n.message.match(/at line (\d+) column (\d+)/))?Math.min(e.line(+t[1]).from+ +t[2]-1,e.length):0}const Nb=Ui.define({name:"json",parser:Ib.configure({props:[Ms.add({Object:ya({except:/^\s*\}/}),Array:ya({except:/^\s*\]/})}),Vo.add({"Object Array":sf})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Zb(){return new ef(Nb)}export{P as E,d1 as R,yf as S,Gb as a,Zb as j,n1 as o,jb as p}; diff --git a/webui/dist/assets/dnd-Dyi3CnuX.js b/webui/dist/assets/dnd-Dyi3CnuX.js new file mode 100644 index 00000000..e0429073 --- /dev/null +++ b/webui/dist/assets/dnd-Dyi3CnuX.js @@ -0,0 +1,5 @@ +import{r as c,R as P,b as Oe}from"./router-CWhjJi2n.js";function Rn(){for(var e=arguments.length,t=new Array(e),n=0;nr=>{t.forEach(o=>o(r))},t)}const et=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function me(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function pt(e){return"nodeType"in e}function B(e){var t,n;return e?me(e)?e:pt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function bt(e){const{Document:t}=B(e);return e instanceof t}function Be(e){return me(e)?!1:e instanceof B(e).HTMLElement}function Ut(e){return e instanceof B(e).SVGElement}function ye(e){return e?me(e)?e.document:pt(e)?bt(e)?e:Be(e)||Ut(e)?e.ownerDocument:document:document:document}const Q=et?c.useLayoutEffect:c.useEffect;function wt(e){const t=c.useRef(e);return Q(()=>{t.current=e}),c.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o{e.current=setInterval(r,o)},[]),n=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function ke(e,t){t===void 0&&(t=[e]);const n=c.useRef(e);return Q(()=>{n.current!==e&&(n.current=e)},t),n}function Fe(e,t){const n=c.useRef();return c.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Ge(e){const t=wt(e),n=c.useRef(null),r=c.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function dt(e){const t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}let at={};function $e(e,t){return c.useMemo(()=>{if(t)return t;const n=at[e]==null?0:at[e]+1;return at[e]=n,e+"-"+n},[e,t])}function Wt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o{const a=Object.entries(s);for(const[l,u]of a){const f=i[l];f!=null&&(i[l]=f+e*u)}return i},{...t})}}const we=Wt(1),ze=Wt(-1);function En(e){return"clientX"in e&&"clientY"in e}function mt(e){if(!e)return!1;const{KeyboardEvent:t}=B(e.target);return t&&e instanceof t}function Mn(e){if(!e)return!1;const{TouchEvent:t}=B(e.target);return t&&e instanceof t}function ft(e){if(Mn(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return En(e)?{x:e.clientX,y:e.clientY}:null}const Je=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Je.Translate.toString(e),Je.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Ot="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function In(e){return e.matches(Ot)?e:e.querySelector(Ot)}const An={display:"none"};function On(e){let{id:t,value:n}=e;return P.createElement("div",{id:t,style:An},n)}function Tn(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return P.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Nn(){const[e,t]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Ht=c.createContext(null);function Ln(e){const t=c.useContext(Ht);c.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)},[e,t])}function kn(){const[e]=c.useState(()=>new Set),t=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:o,event:i}=r;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const zn={draggable:` + To pick up a draggable item, press the space bar. + While dragging, use the arrow keys to move the item. + Press space again to drop the item in its new position, or press escape to cancel. + `},Pn={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Bn(e){let{announcements:t=Pn,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=zn}=e;const{announce:i,announcement:s}=Nn(),a=$e("DndLiveRegion"),[l,u]=c.useState(!1);if(c.useEffect(()=>{u(!0)},[]),Ln(c.useMemo(()=>({onDragStart(d){let{active:g}=d;i(t.onDragStart({active:g}))},onDragMove(d){let{active:g,over:h}=d;t.onDragMove&&i(t.onDragMove({active:g,over:h}))},onDragOver(d){let{active:g,over:h}=d;i(t.onDragOver({active:g,over:h}))},onDragEnd(d){let{active:g,over:h}=d;i(t.onDragEnd({active:g,over:h}))},onDragCancel(d){let{active:g,over:h}=d;i(t.onDragCancel({active:g,over:h}))}}),[i,t])),!l)return null;const f=P.createElement(P.Fragment,null,P.createElement(On,{id:r,value:o.draggable}),P.createElement(Tn,{id:a,announcement:s}));return n?Oe.createPortal(f,n):f}var O;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(O||(O={}));function _e(){}function io(e,t){return c.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function so(){for(var e=arguments.length,t=new Array(e),n=0;n[...t].filter(r=>r!=null),[...t])}const V=Object.freeze({x:0,y:0});function Kt(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Vt(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Fn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Tt(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function qt(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Nt(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const ao=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Nt(t,t.left,t.top),i=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const u=Kt(Nt(l),o);i.push({id:a,data:{droppableContainer:s,value:u}})}}return i.sort(Vt)},$n=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Tt(t),i=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const u=Tt(l),f=o.reduce((g,h,C)=>g+Kt(u[C],h),0),d=Number((f/4).toFixed(4));i.push({id:a,data:{droppableContainer:s,value:d}})}}return i.sort(Vt)};function Xn(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-r,a=i-n;if(r{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:s}=i,a=n.get(s);if(a){const l=Xn(a,t);l>0&&o.push({id:s,data:{droppableContainer:i,value:l}})}}return o.sort(Fn)};function jn(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Gt(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:V}function Un(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...n})}}const Wn=Un(1);function Hn(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Kn(e,t,n){const r=Hn(t);if(!r)return e;const{scaleX:o,scaleY:i,x:s,y:a}=r,l=e.left-s-(1-o)*parseFloat(n),u=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),f=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:f,height:d,top:u,right:l+f,bottom:u+d,left:l}}const Vn={ignoreTransform:!1};function xe(e,t){t===void 0&&(t=Vn);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:f}=B(e).getComputedStyle(e);u&&(n=Kn(n,u,f))}const{top:r,left:o,width:i,height:s,bottom:a,right:l}=n;return{top:r,left:o,width:i,height:s,bottom:a,right:l}}function Lt(e){return xe(e,{ignoreTransform:!0})}function qn(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Gn(e,t){return t===void 0&&(t=B(e).getComputedStyle(e)),t.position==="fixed"}function Jn(e,t){t===void 0&&(t=B(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?n.test(i):!1})}function tt(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(bt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Be(o)||Ut(o)||n.includes(o))return n;const i=B(e).getComputedStyle(o);return o!==e&&Jn(o,i)&&n.push(o),Gn(o,i)?n:r(o.parentNode)}return e?r(e):n}function Jt(e){const[t]=tt(e,1);return t??null}function ct(e){return!et||!e?null:me(e)?e:pt(e)?bt(e)||e===ye(e).scrollingElement?window:Be(e)?e:null:null}function _t(e){return me(e)?e.scrollX:e.scrollLeft}function Qt(e){return me(e)?e.scrollY:e.scrollTop}function ht(e){return{x:_t(e),y:Qt(e)}}var N;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(N||(N={}));function Zt(e){return!et||!e?!1:e===document.scrollingElement}function en(e){const t={x:0,y:0},n=Zt(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:s,isRight:a,maxScroll:r,minScroll:t}}const _n={x:.2,y:.2};function Qn(e,t,n,r,o){let{top:i,left:s,right:a,bottom:l}=n;r===void 0&&(r=10),o===void 0&&(o=_n);const{isTop:u,isBottom:f,isLeft:d,isRight:g}=en(e),h={x:0,y:0},C={x:0,y:0},v={height:t.height*o.y,width:t.width*o.x};return!u&&i<=t.top+v.height?(h.y=N.Backward,C.y=r*Math.abs((t.top+v.height-i)/v.height)):!f&&l>=t.bottom-v.height&&(h.y=N.Forward,C.y=r*Math.abs((t.bottom-v.height-l)/v.height)),!g&&a>=t.right-v.width?(h.x=N.Forward,C.x=r*Math.abs((t.right-v.width-a)/v.width)):!d&&s<=t.left+v.width&&(h.x=N.Backward,C.x=r*Math.abs((t.left+v.width-s)/v.width)),{direction:h,speed:C}}function Zn(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function tn(e){return e.reduce((t,n)=>we(t,ht(n)),V)}function er(e){return e.reduce((t,n)=>t+_t(n),0)}function tr(e){return e.reduce((t,n)=>t+Qt(n),0)}function nr(e,t){if(t===void 0&&(t=xe),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Jt(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const rr=[["x",["left","right"],er],["y",["top","bottom"],tr]];class yt{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=tt(n),o=tn(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of rr)for(const l of s)Object.defineProperty(this,l,{get:()=>{const u=a(r),f=o[i]-u;return this.rect[l]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Te{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function or(e){const{EventTarget:t}=B(e);return e instanceof t?e:ye(e)}function lt(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var W;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(W||(W={}));function kt(e){e.preventDefault()}function ir(e){e.stopPropagation()}var w;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(w||(w={}));const nn={start:[w.Space,w.Enter],cancel:[w.Esc],end:[w.Space,w.Enter,w.Tab]},sr=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case w.Right:return{...n,x:n.x+25};case w.Left:return{...n,x:n.x-25};case w.Down:return{...n,y:n.y+25};case w.Up:return{...n,y:n.y-25}}};class rn{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Te(ye(n)),this.windowListeners=new Te(B(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(W.Resize,this.handleCancel),this.windowListeners.add(W.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(W.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&nr(r),n(V)}handleKeyDown(t){if(mt(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:i=nn,coordinateGetter:s=sr,scrollBehavior:a="smooth"}=o,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=r.current,f=u?{x:u.left,y:u.top}:V;this.referenceCoordinates||(this.referenceCoordinates=f);const d=s(t,{active:n,context:r.current,currentCoordinates:f});if(d){const g=ze(d,f),h={x:0,y:0},{scrollableAncestors:C}=r.current;for(const v of C){const p=t.code,{isTop:m,isRight:y,isLeft:b,isBottom:R,maxScroll:S,minScroll:E}=en(v),x=Zn(v),D={x:Math.min(p===w.Right?x.right-x.width/2:x.right,Math.max(p===w.Right?x.left:x.left+x.width/2,d.x)),y:Math.min(p===w.Down?x.bottom-x.height/2:x.bottom,Math.max(p===w.Down?x.top:x.top+x.height/2,d.y))},A=p===w.Right&&!y||p===w.Left&&!b,T=p===w.Down&&!R||p===w.Up&&!m;if(A&&D.x!==d.x){const I=v.scrollLeft+g.x,H=p===w.Right&&I<=S.x||p===w.Left&&I>=E.x;if(H&&!g.y){v.scrollTo({left:I,behavior:a});return}H?h.x=v.scrollLeft-I:h.x=p===w.Right?v.scrollLeft-S.x:v.scrollLeft-E.x,h.x&&v.scrollBy({left:-h.x,behavior:a});break}else if(T&&D.y!==d.y){const I=v.scrollTop+g.y,H=p===w.Down&&I<=S.y||p===w.Up&&I>=E.y;if(H&&!g.x){v.scrollTo({top:I,behavior:a});return}H?h.y=v.scrollTop-I:h.y=p===w.Down?v.scrollTop-S.y:v.scrollTop-E.y,h.y&&v.scrollBy({top:-h.y,behavior:a});break}}this.handleMove(t,we(ze(d,this.referenceCoordinates),h))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}rn.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=nn,onActivation:o}=t,{active:i}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function zt(e){return!!(e&&"distance"in e)}function Pt(e){return!!(e&&"delay"in e)}class xt{constructor(t,n,r){var o;r===void 0&&(r=or(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:s}=i;this.props=t,this.events=n,this.document=ye(s),this.documentListeners=new Te(this.document),this.listeners=new Te(r),this.windowListeners=new Te(B(s)),this.initialCoordinates=(o=ft(i))!=null?o:V,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(W.Resize,this.handleCancel),this.windowListeners.add(W.DragStart,kt),this.windowListeners.add(W.VisibilityChange,this.handleCancel),this.windowListeners.add(W.ContextMenu,kt),this.documentListeners.add(W.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Pt(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(zt(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(W.Click,ir,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(W.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!o)return;const l=(n=ft(t))!=null?n:V,u=ze(o,l);if(!r&&a){if(zt(a)){if(a.tolerance!=null&<(u,a.tolerance))return this.handleCancel();if(lt(u,a.distance))return this.handleStart()}if(Pt(a)&<(u,a.tolerance))return this.handleCancel();this.handlePending(a,u);return}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===w.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const ar={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class on extends xt{constructor(t){const{event:n}=t,r=ye(n.target);super(t,ar,r)}}on.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const cr={move:{name:"mousemove"},end:{name:"mouseup"}};var gt;(function(e){e[e.RightClick=2]="RightClick"})(gt||(gt={}));class lr extends xt{constructor(t){super(t,cr,ye(t.event.target))}}lr.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===gt.RightClick?!1:(r?.({event:n}),!0)}}];const ut={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class ur extends xt{constructor(t){super(t,ut)}static setup(){return window.addEventListener(ut.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ut.move.name,t)};function t(){}}}ur.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r?.({event:n}),!0)}}];var Ne;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Ne||(Ne={}));var Qe;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Qe||(Qe={}));function dr(e){let{acceleration:t,activator:n=Ne.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:s=5,order:a=Qe.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:f,delta:d,threshold:g}=e;const h=hr({delta:d,disabled:!i}),[C,v]=Sn(),p=c.useRef({x:0,y:0}),m=c.useRef({x:0,y:0}),y=c.useMemo(()=>{switch(n){case Ne.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Ne.DraggableRect:return o}},[n,o,l]),b=c.useRef(null),R=c.useCallback(()=>{const E=b.current;if(!E)return;const x=p.current.x*m.current.x,D=p.current.y*m.current.y;E.scrollBy(x,D)},[]),S=c.useMemo(()=>a===Qe.TreeOrder?[...u].reverse():u,[a,u]);c.useEffect(()=>{if(!i||!u.length||!y){v();return}for(const E of S){if(r?.(E)===!1)continue;const x=u.indexOf(E),D=f[x];if(!D)continue;const{direction:A,speed:T}=Qn(E,D,y,t,g);for(const I of["x","y"])h[I][A[I]]||(T[I]=0,A[I]=0);if(T.x>0||T.y>0){v(),b.current=E,C(R,s),p.current=T,m.current=A;return}}p.current={x:0,y:0},m.current={x:0,y:0},v()},[t,R,r,v,i,s,JSON.stringify(y),JSON.stringify(h),C,u,S,f,JSON.stringify(g)])}const fr={x:{[N.Backward]:!1,[N.Forward]:!1},y:{[N.Backward]:!1,[N.Forward]:!1}};function hr(e){let{delta:t,disabled:n}=e;const r=dt(t);return Fe(o=>{if(n||!r||!o)return fr;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[N.Backward]:o.x[N.Backward]||i.x===-1,[N.Forward]:o.x[N.Forward]||i.x===1},y:{[N.Backward]:o.y[N.Backward]||i.y===-1,[N.Forward]:o.y[N.Forward]||i.y===1}}},[n,t,r])}function gr(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Fe(o=>{var i;return t==null?null:(i=r??o)!=null?i:null},[r,t])}function vr(e,t){return c.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...i]},[]),[e,t])}var Pe;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Pe||(Pe={}));var vt;(function(e){e.Optimized="optimized"})(vt||(vt={}));const Bt=new Map;function pr(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,s]=c.useState(null),{frequency:a,measure:l,strategy:u}=o,f=c.useRef(e),d=p(),g=ke(d),h=c.useCallback(function(m){m===void 0&&(m=[]),!g.current&&s(y=>y===null?m:y.concat(m.filter(b=>!y.includes(b))))},[g]),C=c.useRef(null),v=Fe(m=>{if(d&&!n)return Bt;if(!m||m===Bt||f.current!==e||i!=null){const y=new Map;for(let b of e){if(!b)continue;if(i&&i.length>0&&!i.includes(b.id)&&b.rect.current){y.set(b.id,b.rect.current);continue}const R=b.node.current,S=R?new yt(l(R),R):null;b.rect.current=S,S&&y.set(b.id,S)}return y}return m},[e,i,n,d,l]);return c.useEffect(()=>{f.current=e},[e]),c.useEffect(()=>{d||h()},[n,d]),c.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),c.useEffect(()=>{d||typeof a!="number"||C.current!==null||(C.current=setTimeout(()=>{h(),C.current=null},a))},[a,d,h,...r]),{droppableRects:v,measureDroppableContainers:h,measuringScheduled:i!=null};function p(){switch(u){case Pe.Always:return!1;case Pe.BeforeDragging:return n;default:return!n}}}function sn(e,t){return Fe(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function br(e,t){return sn(e,t)}function wr(e){let{callback:t,disabled:n}=e;const r=wt(t),o=c.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return c.useEffect(()=>()=>o?.disconnect(),[o]),o}function nt(e){let{callback:t,disabled:n}=e;const r=wt(t),o=c.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return c.useEffect(()=>()=>o?.disconnect(),[o]),o}function mr(e){return new yt(xe(e),e)}function Ft(e,t,n){t===void 0&&(t=mr);const[r,o]=c.useState(null);function i(){o(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l??n)!=null?u:null}const f=t(e);return JSON.stringify(l)===JSON.stringify(f)?l:f})}const s=wr({callback(l){if(e)for(const u of l){const{type:f,target:d}=u;if(f==="childList"&&d instanceof HTMLElement&&d.contains(e)){i();break}}}}),a=nt({callback:i});return Q(()=>{i(),e?(a?.observe(e),s?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),s?.disconnect())},[e]),r}function yr(e){const t=sn(e);return Gt(e,t)}const $t=[];function xr(e){const t=c.useRef(e),n=Fe(r=>e?r&&r!==$t&&e&&t.current&&e.parentNode===t.current.parentNode?r:tt(e):$t,[e]);return c.useEffect(()=>{t.current=e},[e]),n}function Dr(e){const[t,n]=c.useState(null),r=c.useRef(e),o=c.useCallback(i=>{const s=ct(i.target);s&&n(a=>a?(a.set(s,ht(s)),new Map(a)):null)},[]);return c.useEffect(()=>{const i=r.current;if(e!==i){s(i);const a=e.map(l=>{const u=ct(l);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,ht(u)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{s(e),s(i)};function s(a){a.forEach(l=>{const u=ct(l);u?.removeEventListener("scroll",o)})}},[o,e]),c.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>we(i,s),V):tn(e):V,[e,t])}function Xt(e,t){t===void 0&&(t=[]);const n=c.useRef(null);return c.useEffect(()=>{n.current=null},t),c.useEffect(()=>{const r=e!==V;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?ze(e,n.current):V}function Cr(e){c.useEffect(()=>{if(!et)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function Rr(e,t){return c.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:i}=r;return n[o]=s=>{i(s,t)},n},{}),[e,t])}function an(e){return c.useMemo(()=>e?qn(e):null,[e])}const Yt=[];function Sr(e,t){t===void 0&&(t=xe);const[n]=e,r=an(n?B(n):null),[o,i]=c.useState(Yt);function s(){i(()=>e.length?e.map(l=>Zt(l)?r:new yt(t(l),l)):Yt)}const a=nt({callback:s});return Q(()=>{a?.disconnect(),s(),e.forEach(l=>a?.observe(l))},[e]),o}function Er(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Be(t)?t:e}function Mr(e){let{measure:t}=e;const[n,r]=c.useState(null),o=c.useCallback(u=>{for(const{target:f}of u)if(Be(f)){r(d=>{const g=t(f);return d?{...d,width:g.width,height:g.height}:g});break}},[t]),i=nt({callback:o}),s=c.useCallback(u=>{const f=Er(u);i?.disconnect(),f&&i?.observe(f),r(f?t(f):null)},[t,i]),[a,l]=Ge(s);return c.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const Ir=[{sensor:on,options:{}},{sensor:rn,options:{}}],Ar={current:{}},qe={draggable:{measure:Lt},droppable:{measure:Lt,strategy:Pe.WhileDragging,frequency:vt.Optimized},dragOverlay:{measure:xe}};class Le extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Or={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Le,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:_e},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:qe,measureDroppableContainers:_e,windowRect:null,measuringScheduled:!1},Tr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:_e,draggableNodes:new Map,over:null,measureDroppableContainers:_e},rt=c.createContext(Tr),cn=c.createContext(Or);function Nr(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Le}}}function Lr(e,t){switch(t.type){case O.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case O.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case O.DragEnd:case O.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case O.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Le(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case O.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new Le(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case O.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Le(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function kr(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=c.useContext(rt),i=dt(r),s=dt(n?.id);return c.useEffect(()=>{if(!t&&!r&&i&&s!=null){if(!mt(i)||document.activeElement===i.target)return;const a=o.get(s);if(!a)return;const{activatorNode:l,node:u}=a;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[l.current,u.current]){if(!f)continue;const d=In(f);if(d){d.focus();break}}})}},[r,t,o,s,i]),null}function zr(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function Pr(e){return c.useMemo(()=>({draggable:{...qe.draggable,...e?.draggable},droppable:{...qe.droppable,...e?.droppable},dragOverlay:{...qe.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Br(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=c.useRef(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;Q(()=>{if(!s&&!a||!t){i.current=!1;return}if(i.current||!r)return;const u=t?.node.current;if(!u||u.isConnected===!1)return;const f=n(u),d=Gt(f,r);if(s||(d.x=0),a||(d.y=0),i.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const g=Jt(u);g&&g.scrollBy({top:d.y,left:d.x})}},[t,s,a,r,n])}const ln=c.createContext({...V,scaleX:1,scaleY:1});var ue;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ue||(ue={}));const co=c.memo(function(t){var n,r,o,i;let{id:s,accessibility:a,autoScroll:l=!0,children:u,sensors:f=Ir,collisionDetection:d=Yn,measuring:g,modifiers:h,...C}=t;const v=c.useReducer(Lr,void 0,Nr),[p,m]=v,[y,b]=kn(),[R,S]=c.useState(ue.Uninitialized),E=R===ue.Initialized,{draggable:{active:x,nodes:D,translate:A},droppable:{containers:T}}=p,I=x!=null?D.get(x):null,H=c.useRef({initial:null,translated:null}),K=c.useMemo(()=>{var k;return x!=null?{id:x,data:(k=I?.data)!=null?k:Ar,rect:H}:null},[x,I]),q=c.useRef(null),[De,Xe]=c.useState(null),[F,Ye]=c.useState(null),Z=ke(C,Object.values(C)),Ce=$e("DndDescribedBy",s),je=c.useMemo(()=>T.getEnabled(),[T]),z=Pr(g),{droppableRects:ee,measureDroppableContainers:de,measuringScheduled:Re}=pr(je,{dragging:E,dependencies:[A.x,A.y],config:z.droppable}),j=gr(D,x),Ue=c.useMemo(()=>F?ft(F):null,[F]),oe=Cn(),te=br(j,z.draggable.measure);Br({activeNode:x!=null?D.get(x):null,config:oe.layoutShiftCompensation,initialRect:te,measure:z.draggable.measure});const M=Ft(j,z.draggable.measure,te),Se=Ft(j?j.parentElement:null),G=c.useRef({activatorEvent:null,active:null,activeNode:j,collisionRect:null,collisions:null,droppableRects:ee,draggableNodes:D,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),fe=T.getNodeFor((n=G.current.over)==null?void 0:n.id),ne=Mr({measure:z.dragOverlay.measure}),he=(r=ne.nodeRef.current)!=null?r:j,ge=E?(o=ne.rect)!=null?o:M:null,Dt=!!(ne.nodeRef.current&&ne.rect),Ct=yr(Dt?null:M),ot=an(he?B(he):null),ie=xr(E?fe??j:null),We=Sr(ie),He=zr(h,{transform:{x:A.x-Ct.x,y:A.y-Ct.y,scaleX:1,scaleY:1},activatorEvent:F,active:K,activeNodeRect:M,containerNodeRect:Se,draggingNodeRect:ge,over:G.current.over,overlayNodeRect:ne.rect,scrollableAncestors:ie,scrollableAncestorRects:We,windowRect:ot}),Rt=Ue?we(Ue,A):null,St=Dr(ie),pn=Xt(St),bn=Xt(St,[M]),ve=we(He,pn),pe=ge?Wn(ge,He):null,Ee=K&&pe?d({active:K,collisionRect:pe,droppableRects:ee,droppableContainers:je,pointerCoordinates:Rt}):null,Et=qt(Ee,"id"),[se,Mt]=c.useState(null),wn=Dt?He:we(He,bn),mn=jn(wn,(i=se?.rect)!=null?i:null,M),it=c.useRef(null),It=c.useCallback((k,$)=>{let{sensor:X,options:ae}=$;if(q.current==null)return;const U=D.get(q.current);if(!U)return;const Y=k.nativeEvent,J=new X({active:q.current,activeNode:U,event:Y,options:ae,context:G,onAbort(L){if(!D.get(L))return;const{onDragAbort:_}=Z.current,re={id:L};_?.(re),y({type:"onDragAbort",event:re})},onPending(L,ce,_,re){if(!D.get(L))return;const{onDragPending:Ie}=Z.current,le={id:L,constraint:ce,initialCoordinates:_,offset:re};Ie?.(le),y({type:"onDragPending",event:le})},onStart(L){const ce=q.current;if(ce==null)return;const _=D.get(ce);if(!_)return;const{onDragStart:re}=Z.current,Me={activatorEvent:Y,active:{id:ce,data:_.data,rect:H}};Oe.unstable_batchedUpdates(()=>{re?.(Me),S(ue.Initializing),m({type:O.DragStart,initialCoordinates:L,active:ce}),y({type:"onDragStart",event:Me}),Xe(it.current),Ye(Y)})},onMove(L){m({type:O.DragMove,coordinates:L})},onEnd:be(O.DragEnd),onCancel:be(O.DragCancel)});it.current=J;function be(L){return async function(){const{active:_,collisions:re,over:Me,scrollAdjustedTranslate:Ie}=G.current;let le=null;if(_&&Ie){const{cancelDrop:Ae}=Z.current;le={activatorEvent:Y,active:_,collisions:re,delta:Ie,over:Me},L===O.DragEnd&&typeof Ae=="function"&&await Promise.resolve(Ae(le))&&(L=O.DragCancel)}q.current=null,Oe.unstable_batchedUpdates(()=>{m({type:L}),S(ue.Uninitialized),Mt(null),Xe(null),Ye(null),it.current=null;const Ae=L===O.DragEnd?"onDragEnd":"onDragCancel";if(le){const st=Z.current[Ae];st?.(le),y({type:Ae,event:le})}})}}},[D]),yn=c.useCallback((k,$)=>(X,ae)=>{const U=X.nativeEvent,Y=D.get(ae);if(q.current!==null||!Y||U.dndKit||U.defaultPrevented)return;const J={active:Y};k(X,$.options,J)===!0&&(U.dndKit={capturedBy:$.sensor},q.current=ae,It(X,$))},[D,It]),At=vr(f,yn);Cr(f),Q(()=>{M&&R===ue.Initializing&&S(ue.Initialized)},[M,R]),c.useEffect(()=>{const{onDragMove:k}=Z.current,{active:$,activatorEvent:X,collisions:ae,over:U}=G.current;if(!$||!X)return;const Y={active:$,activatorEvent:X,collisions:ae,delta:{x:ve.x,y:ve.y},over:U};Oe.unstable_batchedUpdates(()=>{k?.(Y),y({type:"onDragMove",event:Y})})},[ve.x,ve.y]),c.useEffect(()=>{const{active:k,activatorEvent:$,collisions:X,droppableContainers:ae,scrollAdjustedTranslate:U}=G.current;if(!k||q.current==null||!$||!U)return;const{onDragOver:Y}=Z.current,J=ae.get(Et),be=J&&J.rect.current?{id:J.id,rect:J.rect.current,data:J.data,disabled:J.disabled}:null,L={active:k,activatorEvent:$,collisions:X,delta:{x:U.x,y:U.y},over:be};Oe.unstable_batchedUpdates(()=>{Mt(be),Y?.(L),y({type:"onDragOver",event:L})})},[Et]),Q(()=>{G.current={activatorEvent:F,active:K,activeNode:j,collisionRect:pe,collisions:Ee,droppableRects:ee,draggableNodes:D,draggingNode:he,draggingNodeRect:ge,droppableContainers:T,over:se,scrollableAncestors:ie,scrollAdjustedTranslate:ve},H.current={initial:ge,translated:pe}},[K,j,Ee,pe,D,he,ge,ee,T,se,ie,ve]),dr({...oe,delta:A,draggingRect:pe,pointerCoordinates:Rt,scrollableAncestors:ie,scrollableAncestorRects:We});const xn=c.useMemo(()=>({active:K,activeNode:j,activeNodeRect:M,activatorEvent:F,collisions:Ee,containerNodeRect:Se,dragOverlay:ne,draggableNodes:D,droppableContainers:T,droppableRects:ee,over:se,measureDroppableContainers:de,scrollableAncestors:ie,scrollableAncestorRects:We,measuringConfiguration:z,measuringScheduled:Re,windowRect:ot}),[K,j,M,F,Ee,Se,ne,D,T,ee,se,de,ie,We,z,Re,ot]),Dn=c.useMemo(()=>({activatorEvent:F,activators:At,active:K,activeNodeRect:M,ariaDescribedById:{draggable:Ce},dispatch:m,draggableNodes:D,over:se,measureDroppableContainers:de}),[F,At,K,M,m,Ce,D,se,de]);return P.createElement(Ht.Provider,{value:b},P.createElement(rt.Provider,{value:Dn},P.createElement(cn.Provider,{value:xn},P.createElement(ln.Provider,{value:mn},u)),P.createElement(kr,{disabled:a?.restoreFocus===!1})),P.createElement(Bn,{...a,hiddenTextDescribedById:Ce}));function Cn(){const k=De?.autoScrollEnabled===!1,$=typeof l=="object"?l.enabled===!1:l===!1,X=E&&!k&&!$;return typeof l=="object"?{...l,enabled:X}:{enabled:X}}}),Fr=c.createContext(null),jt="button",$r="Draggable";function Xr(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=$e($r),{activators:s,activatorEvent:a,active:l,activeNodeRect:u,ariaDescribedById:f,draggableNodes:d,over:g}=c.useContext(rt),{role:h=jt,roleDescription:C="draggable",tabIndex:v=0}=o??{},p=l?.id===t,m=c.useContext(p?ln:Fr),[y,b]=Ge(),[R,S]=Ge(),E=Rr(s,t),x=ke(n);Q(()=>(d.set(t,{id:t,key:i,node:y,activatorNode:R,data:x}),()=>{const A=d.get(t);A&&A.key===i&&d.delete(t)}),[d,t]);const D=c.useMemo(()=>({role:h,tabIndex:v,"aria-disabled":r,"aria-pressed":p&&h===jt?!0:void 0,"aria-roledescription":C,"aria-describedby":f.draggable}),[r,h,v,p,C,f.draggable]);return{active:l,activatorEvent:a,activeNodeRect:u,attributes:D,isDragging:p,listeners:r?void 0:E,node:y,over:g,setNodeRef:b,setActivatorNodeRef:S,transform:m}}function Yr(){return c.useContext(cn)}const jr="Droppable",Ur={timeout:25};function Wr(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=$e(jr),{active:s,dispatch:a,over:l,measureDroppableContainers:u}=c.useContext(rt),f=c.useRef({disabled:n}),d=c.useRef(!1),g=c.useRef(null),h=c.useRef(null),{disabled:C,updateMeasurementsFor:v,timeout:p}={...Ur,...o},m=ke(v??r),y=c.useCallback(()=>{if(!d.current){d.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(m.current)?m.current:[m.current]),h.current=null},p)},[p]),b=nt({callback:y,disabled:C||!s}),R=c.useCallback((D,A)=>{b&&(A&&(b.unobserve(A),d.current=!1),D&&b.observe(D))},[b]),[S,E]=Ge(R),x=ke(t);return c.useEffect(()=>{!b||!S.current||(b.disconnect(),d.current=!1,b.observe(S.current))},[S,b]),c.useEffect(()=>(a({type:O.RegisterDroppable,element:{id:r,key:i,disabled:n,node:S,rect:g,data:x}}),()=>a({type:O.UnregisterDroppable,key:i,id:r})),[r]),c.useEffect(()=>{n!==f.current.disabled&&(a({type:O.SetDroppableDisabled,id:r,key:i,disabled:n}),f.current.disabled=n)},[r,i,n,a]),{active:s,rect:g,isOver:l?.id===r,node:S,over:l,setNodeRef:E}}function un(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Hr(e,t){return e.reduce((n,r,o)=>{const i=t.get(r);return i&&(n[o]=i),n},Array(e.length))}function Ke(e){return e!==null&&e>=0}function Kr(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:i,index:s}=e;const a=(t=n[o])!=null?t:r;if(!a)return null;const l=qr(n,s,o);if(s===o){const u=n[i];return u?{x:oo&&s<=i?{x:-a.width-l,y:0,...Ve}:s=i?{x:a.width+l,y:0,...Ve}:{x:0,y:0,...Ve}};function qr(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return!r||!o&&!i?0:n{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=un(t,r,n),s=t[o],a=i[o];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},fn="Sortable",hn=P.createContext({activeIndex:-1,containerId:fn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:dn,disabled:{draggable:!1,droppable:!1}});function uo(e){let{children:t,id:n,items:r,strategy:o=dn,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:u,measureDroppableContainers:f}=Yr(),d=$e(fn,n),g=a.rect!==null,h=c.useMemo(()=>r.map(E=>typeof E=="object"&&"id"in E?E.id:E),[r]),C=s!=null,v=s?h.indexOf(s.id):-1,p=u?h.indexOf(u.id):-1,m=c.useRef(h),y=!Kr(h,m.current),b=p!==-1&&v===-1||y,R=Vr(i);Q(()=>{y&&C&&f(h)},[y,h,C,f]),c.useEffect(()=>{m.current=h},[h]);const S=c.useMemo(()=>({activeIndex:v,containerId:d,disabled:R,disableTransforms:b,items:h,overIndex:p,useDragOverlay:g,sortedRects:Hr(h,l),strategy:o}),[v,d,R.draggable,R.droppable,b,h,p,l,g,o]);return P.createElement(hn.Provider,{value:S},t)}const Gr=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return un(n,r,o).indexOf(t)},Jr=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:s,previousItems:a,previousContainerId:l,transition:u}=e;return!u||!r||a!==i&&o===s?!1:n?!0:s!==o&&t===l},_r={duration:200,easing:"ease"},gn="transform",Qr=Je.Transition.toString({property:gn,duration:0,easing:"linear"}),Zr={roleDescription:"sortable"};function eo(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,s]=c.useState(null),a=c.useRef(n);return Q(()=>{if(!t&&n!==a.current&&r.current){const l=o.current;if(l){const u=xe(r.current,{ignoreTransform:!0}),f={x:l.left-u.left,y:l.top-u.top,scaleX:l.width/u.width,scaleY:l.height/u.height};(f.x||f.y)&&s(f)}}n!==a.current&&(a.current=n)},[t,n,r,o]),c.useEffect(()=>{i&&s(null)},[i]),i}function fo(e){let{animateLayoutChanges:t=Jr,attributes:n,disabled:r,data:o,getNewIndex:i=Gr,id:s,strategy:a,resizeObserverConfig:l,transition:u=_r}=e;const{items:f,containerId:d,activeIndex:g,disabled:h,disableTransforms:C,sortedRects:v,overIndex:p,useDragOverlay:m,strategy:y}=c.useContext(hn),b=to(r,h),R=f.indexOf(s),S=c.useMemo(()=>({sortable:{containerId:d,index:R,items:f},...o}),[d,o,R,f]),E=c.useMemo(()=>f.slice(f.indexOf(s)),[f,s]),{rect:x,node:D,isOver:A,setNodeRef:T}=Wr({id:s,data:S,disabled:b.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...l}}),{active:I,activatorEvent:H,activeNodeRect:K,attributes:q,setNodeRef:De,listeners:Xe,isDragging:F,over:Ye,setActivatorNodeRef:Z,transform:Ce}=Xr({id:s,data:S,attributes:{...Zr,...n},disabled:b.draggable}),je=Rn(T,De),z=!!I,ee=z&&!C&&Ke(g)&&Ke(p),de=!m&&F,Re=de&&ee?Ce:null,Ue=ee?Re??(a??y)({rects:v,activeNodeRect:K,activeIndex:g,overIndex:p,index:R}):null,oe=Ke(g)&&Ke(p)?i({id:s,items:f,activeIndex:g,overIndex:p}):R,te=I?.id,M=c.useRef({activeId:te,items:f,newIndex:oe,containerId:d}),Se=f!==M.current.items,G=t({active:I,containerId:d,isDragging:F,isSorting:z,id:s,index:R,items:f,newIndex:M.current.newIndex,previousItems:M.current.items,previousContainerId:M.current.containerId,transition:u,wasDragging:M.current.activeId!=null}),fe=eo({disabled:!G,index:R,node:D,rect:x});return c.useEffect(()=>{z&&M.current.newIndex!==oe&&(M.current.newIndex=oe),d!==M.current.containerId&&(M.current.containerId=d),f!==M.current.items&&(M.current.items=f)},[z,oe,d,f]),c.useEffect(()=>{if(te===M.current.activeId)return;if(te!=null&&M.current.activeId==null){M.current.activeId=te;return}const he=setTimeout(()=>{M.current.activeId=te},50);return()=>clearTimeout(he)},[te]),{active:I,activeIndex:g,attributes:q,data:S,rect:x,index:R,newIndex:oe,items:f,isOver:A,isSorting:z,isDragging:F,listeners:Xe,node:D,overIndex:p,over:Ye,setNodeRef:je,setActivatorNodeRef:Z,setDroppableNodeRef:T,setDraggableNodeRef:De,transform:fe??Ue,transition:ne()};function ne(){if(fe||Se&&M.current.newIndex===R)return Qr;if(!(de&&!mt(H)||!u)&&(z||G))return Je.Transition.toString({...u,property:gn})}}function to(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}function Ze(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const no=[w.Down,w.Right,w.Up,w.Left],ho=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:i,over:s,scrollableAncestors:a}}=t;if(no.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];i.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const g=o.get(d.id);if(g)switch(e.code){case w.Down:r.topg.top&&l.push(d);break;case w.Left:r.left>g.left&&l.push(d);break;case w.Right:r.left1&&(f=u[1].id),f!=null){const d=i.get(n.id),g=i.get(f),h=g?o.get(g.id):null,C=g?.node.current;if(C&&h&&d&&g){const p=tt(C).some((E,x)=>a[x]!==E),m=vn(d,g),y=ro(d,g),b=p||!m?{x:0,y:0}:{x:y?r.width-h.width:0,y:y?r.height-h.height:0},R={x:h.left,y:h.top};return b.x&&b.y?R:ze(R,b)}}}};function vn(e,t){return!Ze(e)||!Ze(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function ro(e,t){return!Ze(e)||!Ze(t)||!vn(e,t)?!1:e.data.current.sortable.indext.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),M=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,c,o)=>o?o.toUpperCase():c.toLowerCase()),h=t=>{const a=M(t);return a.charAt(0).toUpperCase()+a.slice(1)},k=(...t)=>t.filter((a,c,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===c).join(" ").trim(),m=t=>{for(const a in t)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};var v={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"};const x=s.forwardRef(({color:t="currentColor",size:a=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:y="",children:n,iconNode:r,...d},p)=>s.createElement("svg",{ref:p,...v,width:a,height:a,stroke:t,strokeWidth:o?Number(c)*24/Number(a):c,className:k("lucide",y),...!n&&!m(d)&&{"aria-hidden":"true"},...d},[...r.map(([i,l])=>s.createElement(i,l)),...Array.isArray(n)?n:[n]]));const e=(t,a)=>{const c=s.forwardRef(({className:o,...y},n)=>s.createElement(x,{ref:n,iconNode:a,className:k(`lucide-${_(h(t))}`,`lucide-${t}`,o),...y}));return c.displayName=h(t),c};const f=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],y2=e("activity",f);const u=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],d2=e("arrow-left",u);const g=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],h2=e("arrow-right",g);const $=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],k2=e("ban",$);const N=[["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"}]],r2=e("book-open",N);const w=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],p2=e("bot",w);const z=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],i2=e("boxes",z);const b=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],l2=e("bug",b);const q=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],_2=e("calendar",q);const C=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],M2=e("chart-column",C);const j=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],m2=e("check",j);const V=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],v2=e("chevron-down",V);const A=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],x2=e("chevron-left",A);const L=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],f2=e("chevron-right",L);const H=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],u2=e("chevron-up",H);const S=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],g2=e("chevrons-left",S);const P=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],$2=e("chevrons-right",P);const U=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],N2=e("chevrons-up-down",U);const T=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],w2=e("circle-alert",T);const Z=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],z2=e("circle-check",Z);const B=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],b2=e("circle-question-mark",B);const D=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],q2=e("circle-user",D);const R=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],C2=e("circle-x",R);const E=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],j2=e("circle",E);const O=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],V2=e("clock",O);const F=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],A2=e("code-xml",F);const I=[["path",{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z",key:"1t2lqe"}],["path",{d:"M10 21.9V14L2.1 9.1",key:"o7czzq"}],["path",{d:"m10 14 11.9-6.9",key:"zm5e20"}],["path",{d:"M14 19.8v-8.1",key:"159ecu"}],["path",{d:"M18 17.5V9.4",key:"11uown"}]],L2=e("container",I);const W=[["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"}]],H2=e("copy",W);const G=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],S2=e("database",G);const K=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],P2=e("dollar-sign",K);const X=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],U2=e("download",X);const Q=[["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"}]],T2=e("external-link",Q);const J=[["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"}]],Z2=e("eye-off",J);const Y=[["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"}]],B2=e("eye",Y);const e1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]],D2=e("file-search",e1);const a1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],R2=e("file-text",a1);const t1=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],E2=e("folder-open",t1);const c1=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],O2=e("funnel",c1);const o1=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],F2=e("graduation-cap",o1);const n1=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],I2=e("grip-vertical",n1);const s1=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["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"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],W2=e("hard-drive",s1);const y1=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],G2=e("hash",y1);const d1=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],K2=e("house",d1);const h1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],X2=e("image",h1);const k1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Q2=e("info",k1);const r1=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],J2=e("key",r1);const p1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Y2=e("loader-circle",p1);const i1=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],e0=e("lock",i1);const l1=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],a0=e("log-out",l1);const _1=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],t0=e("menu",_1);const M1=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],c0=e("message-square",M1);const m1=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],o0=e("moon",m1);const v1=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],n0=e("network",v1);const x1=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],s0=e("package",x1);const f1=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],y0=e("palette",f1);const u1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],d0=e("panels-top-left",u1);const g1=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],h0=e("pause",g1);const $1=[["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"}]],k0=e("pen",$1);const N1=[["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"}]],r0=e("pencil",N1);const w1=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],p0=e("play",w1);const z1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],i0=e("plus",z1);const b1=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],l0=e("power",b1);const q1=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],_0=e("puzzle",q1);const C1=[["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"}]],M0=e("refresh-cw",C1);const j1=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],m0=e("rotate-ccw",j1);const V1=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],v0=e("rotate-cw",V1);const A1=[["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"}]],x0=e("save",A1);const L1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],f0=e("search",L1);const H1=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],u0=e("send",H1);const S1=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],g0=e("server",S1);const P1=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],$0=e("settings-2",P1);const U1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],N0=e("settings",U1);const T1=[["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"}]],w0=e("shield",T1);const Z1=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],z0=e("skip-forward",Z1);const B1=[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],b0=e("sliders-vertical",B1);const D1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],q0=e("smile",D1);const R1=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],C0=e("sparkles",R1);const E1=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],j0=e("square-pen",E1);const O1=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],V0=e("star",O1);const F1=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],A0=e("sun",F1);const I1=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],L0=e("terminal",I1);const W1=[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]],H0=e("thumbs-up",W1);const G1=[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]],S0=e("thumbs-down",G1);const K1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],P0=e("trash-2",K1);const X1=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],U0=e("trending-up",X1);const Q1=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],T0=e("triangle-alert",Q1);const J1=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],Z0=e("type",J1);const Y1=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],B0=e("upload",Y1);const e2=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],D0=e("user",e2);const a2=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],R0=e("users",a2);const t2=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],E0=e("wifi-off",t2);const c2=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],O0=e("wifi",c2);const o2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],F0=e("x",o2);const n2=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],I0=e("zap",n2);export{r0 as $,y2 as A,p2 as B,z2 as C,P2 as D,Z2 as E,R2 as F,K2 as G,W2 as H,Q2 as I,d2 as J,J2 as K,e0 as L,c0 as M,v2 as N,u2 as O,l0 as P,d0 as Q,M0 as R,N0 as S,U0 as T,B0 as U,A2 as V,x0 as W,F0 as X,i0 as Y,I0 as Z,D2 as _,w2 as a,g2 as a0,x2 as a1,f2 as a2,$2 as a3,N2 as a4,I2 as a5,F2 as a6,L2 as a7,s0 as a8,E2 as a9,r2 as aA,a0 as aB,v0 as aC,l2 as aD,O2 as aa,j0 as ab,k2 as ac,X2 as ad,G2 as ae,R0 as af,n0 as ag,_2 as ah,h0 as ai,p0 as aj,Z0 as ak,V0 as al,H0 as am,S0 as an,$0 as ao,O0 as ap,E0 as aq,k0 as ar,u0 as as,g0 as at,i2 as au,q2 as av,M2 as aw,j2 as ax,b0 as ay,t0 as az,m0 as b,_0 as c,S2 as d,V2 as e,y0 as f,w0 as g,T0 as h,m2 as i,H2 as j,B2 as k,C2 as l,P0 as m,U2 as n,A0 as o,o0 as p,b2 as q,L0 as r,T2 as s,Y2 as t,C0 as u,D0 as v,q0 as w,z0 as x,h2 as y,f0 as z}; diff --git a/webui/dist/assets/icons-CqUsKJFR.js b/webui/dist/assets/icons-CqUsKJFR.js deleted file mode 100644 index f4df2379..00000000 --- a/webui/dist/assets/icons-CqUsKJFR.js +++ /dev/null @@ -1 +0,0 @@ -import{r as s}from"./router-DQNkr8RI.js";const _=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),M=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,c,o)=>o?o.toUpperCase():c.toLowerCase()),d=t=>{const a=M(t);return a.charAt(0).toUpperCase()+a.slice(1)},k=(...t)=>t.filter((a,c,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===c).join(" ").trim(),m=t=>{for(const a in t)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};var v={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"};const x=s.forwardRef(({color:t="currentColor",size:a=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:y="",children:n,iconNode:r,...h},p)=>s.createElement("svg",{ref:p,...v,width:a,height:a,stroke:t,strokeWidth:o?Number(c)*24/Number(a):c,className:k("lucide",y),...!n&&!m(h)&&{"aria-hidden":"true"},...h},[...r.map(([i,l])=>s.createElement(i,l)),...Array.isArray(n)?n:[n]]));const e=(t,a)=>{const c=s.forwardRef(({className:o,...y},n)=>s.createElement(x,{ref:n,iconNode:a,className:k(`lucide-${_(d(t))}`,`lucide-${t}`,o),...y}));return c.displayName=d(t),c};const f=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],n2=e("activity",f);const u=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],s2=e("arrow-left",u);const g=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],y2=e("arrow-right",g);const $=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],h2=e("ban",$);const N=[["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"}]],d2=e("book-open",N);const w=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],k2=e("bot",w);const z=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],r2=e("boxes",z);const b=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],p2=e("bug",b);const q=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],i2=e("calendar",q);const j=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],l2=e("chart-column",j);const C=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],_2=e("check",C);const V=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],M2=e("chevron-down",V);const A=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],m2=e("chevron-left",A);const L=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],v2=e("chevron-right",L);const H=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],x2=e("chevron-up",H);const S=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],f2=e("chevrons-left",S);const P=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],u2=e("chevrons-right",P);const U=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],g2=e("chevrons-up-down",U);const T=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],$2=e("circle-alert",T);const Z=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],N2=e("circle-check",Z);const B=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],w2=e("circle-question-mark",B);const R=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],z2=e("circle-user",R);const E=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],b2=e("circle-x",E);const D=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],q2=e("circle",D);const O=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],j2=e("clock",O);const F=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],C2=e("code-xml",F);const W=[["path",{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z",key:"1t2lqe"}],["path",{d:"M10 21.9V14L2.1 9.1",key:"o7czzq"}],["path",{d:"m10 14 11.9-6.9",key:"zm5e20"}],["path",{d:"M14 19.8v-8.1",key:"159ecu"}],["path",{d:"M18 17.5V9.4",key:"11uown"}]],V2=e("container",W);const I=[["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"}]],A2=e("copy",I);const G=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],L2=e("database",G);const K=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],H2=e("dollar-sign",K);const X=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],S2=e("download",X);const Q=[["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"}]],P2=e("external-link",Q);const J=[["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"}]],U2=e("eye-off",J);const Y=[["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"}]],T2=e("eye",Y);const e1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]],Z2=e("file-search",e1);const a1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],B2=e("file-text",a1);const t1=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],R2=e("folder-open",t1);const c1=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],E2=e("funnel",c1);const o1=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],D2=e("graduation-cap",o1);const n1=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],O2=e("grip-vertical",n1);const s1=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],F2=e("hash",s1);const y1=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],W2=e("house",y1);const h1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],I2=e("info",h1);const d1=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],G2=e("key",d1);const k1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],K2=e("loader-circle",k1);const r1=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],X2=e("lock",r1);const p1=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Q2=e("log-out",p1);const i1=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],J2=e("menu",i1);const l1=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Y2=e("message-square",l1);const _1=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],e0=e("moon",_1);const M1=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],a0=e("network",M1);const m1=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],t0=e("package",m1);const v1=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],c0=e("palette",v1);const x1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],o0=e("panels-top-left",x1);const f1=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],n0=e("pause",f1);const u1=[["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"}]],s0=e("pen",u1);const g1=[["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"}]],y0=e("pencil",g1);const $1=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],h0=e("play",$1);const N1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],d0=e("plus",N1);const w1=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],k0=e("power",w1);const z1=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],r0=e("puzzle",z1);const b1=[["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"}]],p0=e("refresh-cw",b1);const q1=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],i0=e("rotate-ccw",q1);const j1=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],l0=e("rotate-cw",j1);const C1=[["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"}]],_0=e("save",C1);const V1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],M0=e("search",V1);const A1=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],m0=e("send",A1);const L1=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],v0=e("server",L1);const H1=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],x0=e("settings-2",H1);const S1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],f0=e("settings",S1);const P1=[["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"}]],u0=e("shield",P1);const U1=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],g0=e("skip-forward",U1);const T1=[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],$0=e("sliders-vertical",T1);const Z1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],N0=e("smile",Z1);const B1=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],w0=e("sparkles",B1);const R1=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],z0=e("square-pen",R1);const E1=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],b0=e("star",E1);const D1=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],q0=e("sun",D1);const O1=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],j0=e("terminal",O1);const F1=[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]],C0=e("thumbs-up",F1);const W1=[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]],V0=e("thumbs-down",W1);const I1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],A0=e("trash-2",I1);const G1=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],L0=e("trending-up",G1);const K1=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],H0=e("triangle-alert",K1);const X1=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],S0=e("type",X1);const Q1=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],P0=e("upload",Q1);const J1=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],U0=e("user",J1);const Y1=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],T0=e("users",Y1);const e2=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Z0=e("wifi-off",e2);const a2=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],B0=e("wifi",a2);const t2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],R0=e("x",t2);const c2=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],E0=e("zap",c2);export{v2 as $,n2 as A,k2 as B,N2 as C,H2 as D,U2 as E,B2 as F,o0 as G,W2 as H,I2 as I,C2 as J,G2 as K,X2 as L,Y2 as M,_0 as N,d0 as O,k0 as P,A0 as Q,p0 as R,f0 as S,L0 as T,U0 as U,Z2 as V,y0 as W,R0 as X,f2 as Y,E0 as Z,m2 as _,$2 as a,u2 as a0,g2 as a1,O2 as a2,D2 as a3,V2 as a4,t0 as a5,P0 as a6,R2 as a7,S2 as a8,E2 as a9,l0 as aA,p2 as aB,z0 as aa,h2 as ab,F2 as ac,T0 as ad,a0 as ae,i2 as af,n0 as ag,h0 as ah,S0 as ai,b0 as aj,C0 as ak,V0 as al,x0 as am,B0 as an,Z0 as ao,s0 as ap,m0 as aq,v0 as ar,r2 as as,z2 as at,l2 as au,q2 as av,$0 as aw,J2 as ax,d2 as ay,Q2 as az,i0 as b,r0 as c,L2 as d,j2 as e,c0 as f,u0 as g,H0 as h,_2 as i,A2 as j,T2 as k,b2 as l,q0 as m,e0 as n,w2 as o,j0 as p,P2 as q,K2 as r,w0 as s,N0 as t,g0 as u,y2 as v,M0 as w,s2 as x,M2 as y,x2 as z}; diff --git a/webui/dist/assets/index-CUrrfy9B.css b/webui/dist/assets/index-CUrrfy9B.css new file mode 100644 index 00000000..3696bf9e --- /dev/null +++ b/webui/dist/assets/index-CUrrfy9B.css @@ -0,0 +1 @@ +@charset "UTF-8";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 221.2 83.2% 53.3%;--primary-foreground: 210 40% 98%;--primary-gradient: none;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 221.2 83.2% 53.3%;--radius: .5rem;--chart-1: 221.2 83.2% 53.3%;--chart-2: 160 60% 45%;--chart-3: 30 80% 55%;--chart-4: 280 65% 60%;--chart-5: 340 75% 55%}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--primary: 217.2 91.2% 59.8%;--primary-foreground: 222.2 47.4% 11.2%;--primary-gradient: none;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--ring: 224.3 76.3% 48%;--chart-1: 217.2 91.2% 59.8%;--chart-2: 160 60% 50%;--chart-3: 30 80% 60%;--chart-4: 280 65% 65%;--chart-5: 340 75% 60%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield;-webkit-appearance:textfield;appearance:textfield}.\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.invisible{visibility:hidden}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.bottom-1\/4{bottom:25%}.bottom-4{bottom:1rem}.left-0{left:0}.left-1{left:.25rem}.left-1\/2{left:50%}.left-1\/4{left:25%}.left-2{left:.5rem}.left-2\.5{left:.625rem}.left-3{left:.75rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-1{right:.25rem}.right-1\.5{right:.375rem}.right-1\/4{right:25%}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-1\/4{top:25%}.top-2{top:.5rem}.top-2\.5{top:.625rem}.top-3{top:.75rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.order-1{order:1}.order-2{order:2}.col-span-2{grid-column:span 2 / span 2}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.-mt-2{margin-top:-.5rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-10{margin-left:2.5rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-12{margin-top:3rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-auto{aspect-ratio:auto}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.size-4{width:1rem;height:1rem}.size-\[--cell-size\]{width:var(--cell-size);height:var(--cell-size)}.h-0\.5{height:.125rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-4{height:1rem}.h-40{height:10rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[--cell-size\]{height:var(--cell-size)}.h-\[1\.25rem\]{height:1.25rem}.h-\[1px\]{height:1px}.h-\[200px\]{height:200px}.h-\[250px\]{height:250px}.h-\[280px\]{height:280px}.h-\[300px\]{height:300px}.h-\[350px\]{height:350px}.h-\[400px\]{height:400px}.h-\[calc\(100vh-200px\)\]{height:calc(100vh - 200px)}.h-\[calc\(100vh-240px\)\]{height:calc(100vh - 240px)}.h-\[calc\(100vh-260px\)\]{height:calc(100vh - 260px)}.h-\[calc\(100vh-4rem\)\]{height:calc(100vh - 4rem)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\[--radix-context-menu-content-available-height\]{max-height:var(--radix-context-menu-content-available-height)}.max-h-\[--radix-select-content-available-height\]{max-height:var(--radix-select-content-available-height)}.max-h-\[300px\]{max-height:300px}.max-h-\[80vh\]{max-height:80vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[calc\(90vh-120px\)\]{max-height:calc(90vh - 120px)}.max-h-\[calc\(90vh-8rem\)\]{max-height:calc(90vh - 8rem)}.max-h-full{max-height:100%}.max-h-none{max-height:none}.max-h-screen{max-height:100vh}.min-h-0{min-height:0px}.min-h-10{min-height:2.5rem}.min-h-\[100px\]{min-height:100px}.min-h-\[300px\]{min-height:300px}.min-h-\[60px\]{min-height:60px}.min-h-screen{min-height:100vh}.w-0{width:0px}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\[--cell-size\]{width:var(--cell-size)}.w-\[100px\]{width:100px}.w-\[120px\]{width:120px}.w-\[130px\]{width:130px}.w-\[1px\]{width:1px}.w-\[65px\]{width:65px}.w-\[95vw\]{width:95vw}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-\[--cell-size\]{min-width:var(--cell-size)}.min-w-\[100px\]{min-width:100px}.min-w-\[120px\]{min-width:120px}.min-w-\[80px\]{min-width:80px}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.min-w-full{min-width:100%}.max-w-2xl{max-width:42rem}.max-w-32{max-width:8rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-\[150px\]{max-width:150px}.max-w-\[200px\]{max-width:200px}.max-w-\[60px\]{max-width:60px}.max-w-\[75\%\]{max-width:75%}.max-w-\[90\%\]{max-width:90%}.max-w-\[95vw\]{max-width:95vw}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.origin-\[--radix-context-menu-content-transform-origin\]{transform-origin:var(--radix-context-menu-content-transform-origin)}.origin-\[--radix-popover-content-transform-origin\]{transform-origin:var(--radix-popover-content-transform-origin)}.origin-\[--radix-select-content-transform-origin\]{transform-origin:var(--radix-select-content-transform-origin)}.origin-\[--radix-tooltip-content-transform-origin\]{transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-move{cursor:move}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize{resize:both}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-l-md{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.rounded-r-md{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.rounded-tl-sm{border-top-left-radius:calc(var(--radius) - 4px)}.rounded-tr-sm{border-top-right-radius:calc(var(--radius) - 4px)}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-4{border-width:4px}.border-\[1\.5px\]{border-width:1.5px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[--color-border\]{border-color:var(--color-border)}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-amber-500\/50{border-color:#f59e0b80}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-700{--tw-border-opacity: 1;border-color:rgb(29 78 216 / var(--tw-border-opacity, 1))}.border-border{border-color:hsl(var(--border))}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-current{border-color:currentColor}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-green-300{--tw-border-opacity: 1;border-color:rgb(134 239 172 / var(--tw-border-opacity, 1))}.border-green-500{--tw-border-opacity: 1;border-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}.border-green-600{--tw-border-opacity: 1;border-color:rgb(22 163 74 / var(--tw-border-opacity, 1))}.border-green-700{--tw-border-opacity: 1;border-color:rgb(21 128 61 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-muted{border-color:hsl(var(--muted))}.border-muted-foreground\/30{border-color:hsl(var(--muted-foreground) / .3)}.border-muted-foreground\/50{border-color:hsl(var(--muted-foreground) / .5)}.border-orange-200{--tw-border-opacity: 1;border-color:rgb(254 215 170 / var(--tw-border-opacity, 1))}.border-orange-600{--tw-border-opacity: 1;border-color:rgb(234 88 12 / var(--tw-border-opacity, 1))}.border-primary{border-color:hsl(var(--primary))}.border-primary\/20{border-color:hsl(var(--primary) / .2)}.border-primary\/30{border-color:hsl(var(--primary) / .3)}.border-primary\/50{border-color:hsl(var(--primary) / .5)}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-red-500\/50{border-color:#ef444480}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.border-yellow-500\/50{border-color:#eab30880}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\[--color-bg\]{background-color:var(--color-bg)}.bg-accent{background-color:hsl(var(--accent))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500\/10{background-color:#f59e0b1a}.bg-background{background-color:hsl(var(--background))}.bg-background\/50{background-color:hsl(var(--background) / .5)}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-background\/95{background-color:hsl(var(--background) / .95)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/50{background-color:#00000080}.bg-black\/80{background-color:#000c}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-blue-900\/20{background-color:#1e3a8a33}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-card\/80{background-color:hsl(var(--card) / .8)}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.bg-gray-800\/20{background-color:#1f293733}.bg-gray-800\/30{background-color:#1f29374d}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted-foreground\/50{background-color:hsl(var(--muted-foreground) / .5)}.bg-muted\/20{background-color:hsl(var(--muted) / .2)}.bg-muted\/30{background-color:hsl(var(--muted) / .3)}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-orange-50{--tw-bg-opacity: 1;background-color:rgb(255 247 237 / var(--tw-bg-opacity, 1))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-orange-600{--tw-bg-opacity: 1;background-color:rgb(234 88 12 / var(--tw-bg-opacity, 1))}.bg-pink-500{--tw-bg-opacity: 1;background-color:rgb(236 72 153 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\/5{background-color:hsl(var(--primary) / .05)}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-red-900\/20{background-color:#7f1d1d33}.bg-red-900\/30{background-color:#7f1d1d4d}.bg-secondary{background-color:hsl(var(--secondary))}.bg-secondary\/5{background-color:hsl(var(--secondary) / .05)}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-300{--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}.bg-slate-400{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.bg-slate-700{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(254 240 138 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/10{background-color:#eab3081a}.bg-yellow-500\/5{background-color:#eab3080d}.bg-yellow-900\/20{background-color:#713f1233}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-blue-500{--tw-gradient-from: #3b82f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-500{--tw-gradient-from: #22c55e var(--tw-gradient-from-position);--tw-gradient-to: rgb(34 197 94 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-indigo-500{--tw-gradient-from: #6366f1 var(--tw-gradient-from-position);--tw-gradient-to: rgb(99 102 241 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-orange-500{--tw-gradient-from: #f97316 var(--tw-gradient-from-position);--tw-gradient-to: rgb(249 115 22 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary\/5{--tw-gradient-from: hsl(var(--primary) / .05) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from: #a855f7 var(--tw-gradient-from-position);--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-500{--tw-gradient-from: #ef4444 var(--tw-gradient-from-position);--tw-gradient-to: rgb(239 68 68 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-200{--tw-gradient-from: #e2e8f0 var(--tw-gradient-from-position);--tw-gradient-to: rgb(226 232 240 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-300{--tw-gradient-from: #cbd5e1 var(--tw-gradient-from-position);--tw-gradient-to: rgb(203 213 225 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-400{--tw-gradient-from: #94a3b8 var(--tw-gradient-from-position);--tw-gradient-to: rgb(148 163 184 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-background{--tw-gradient-to: hsl(var(--background) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--background)) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-blue-600{--tw-gradient-to: #2563eb var(--tw-gradient-to-position)}.to-cyan-500{--tw-gradient-to: #06b6d4 var(--tw-gradient-to-position)}.to-emerald-500{--tw-gradient-to: #10b981 var(--tw-gradient-to-position)}.to-green-600{--tw-gradient-to: #16a34a var(--tw-gradient-to-position)}.to-orange-500{--tw-gradient-to: #f97316 var(--tw-gradient-to-position)}.to-pink-500{--tw-gradient-to: #ec4899 var(--tw-gradient-to-position)}.to-primary\/10{--tw-gradient-to: hsl(var(--primary) / .1) var(--tw-gradient-to-position)}.to-purple-500{--tw-gradient-to: #a855f7 var(--tw-gradient-to-position)}.to-secondary\/5{--tw-gradient-to: hsl(var(--secondary) / .05) var(--tw-gradient-to-position)}.to-slate-700{--tw-gradient-to: #334155 var(--tw-gradient-to-position)}.to-slate-800{--tw-gradient-to: #1e293b var(--tw-gradient-to-position)}.to-slate-900{--tw-gradient-to: #0f172a var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.fill-yellow-400{fill:#facc15}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[1px\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\[--cell-size\]{padding-left:var(--cell-size);padding-right:var(--cell-size)}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-0{padding-bottom:0}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pl-10{padding-left:2.5rem}.pl-11{padding-left:2.75rem}.pl-2{padding-left:.5rem}.pl-4{padding-left:1rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-10{padding-right:2.5rem}.pr-16{padding-right:4rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.pr-6{padding-right:1.5rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[0\.8rem\]{font-size:.8rem}.text-\[10px\]{font-size:10px}.text-\[150px\]{font-size:150px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-black{font-weight:900}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.tracking-tight{letter-spacing:-.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-900{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/50{color:hsl(var(--muted-foreground) / .5)}.text-muted-foreground\/60{color:hsl(var(--muted-foreground) / .6)}.text-orange-600{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-orange-900{--tw-text-opacity: 1;color:rgb(124 45 18 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-primary\/10{color:hsl(var(--primary) / .1)}.text-primary\/30{color:hsl(var(--primary) / .3)}.text-primary\/60{color:hsl(var(--primary) / .6)}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.text-yellow-900{--tw-text-opacity: 1;color:rgb(113 63 18 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-primary{--tw-ring-color: hsl(var(--primary))}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.blur-3xl{--tw-blur: blur(64px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-xl{--tw-backdrop-blur: blur(24px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.text-primary-gradient{color:hsl(var(--primary))}.has-gradient .text-primary-gradient{background:var(--primary-gradient);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent}.\[--cell-size\:2rem\]{--cell-size: 2rem}.no-animations *,.no-animations *:before,.no-animations *:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}.no-animations *:hover{transition-duration:.01ms!important}::view-transition-old(root),::view-transition-new(root){animation:none;mix-blend-mode:normal}::view-transition-old(root){z-index:1}::view-transition-new(root){z-index:999}.__floater{z-index:99999!important;pointer-events:auto!important}.react-joyride__overlay,.react-joyride__spotlight{z-index:99998!important}.react-joyride__tooltip{pointer-events:auto!important}#tour-portal-container *{pointer-events:auto}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\:border-muted-foreground\/50:hover{border-color:hsl(var(--muted-foreground) / .5)}.hover\:border-primary\/50:hover{border-color:hsl(var(--primary) / .5)}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-accent\/50:hover{background-color:hsl(var(--accent) / .5)}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-orange-700:hover{--tw-bg-opacity: 1;background-color:rgb(194 65 12 / var(--tw-bg-opacity, 1))}.hover\:bg-primary\/10:hover{background-color:hsl(var(--primary) / .1)}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-secondary\/90:hover{background-color:hsl(var(--secondary) / .9)}.hover\:bg-transparent:hover{background-color:transparent}.hover\:bg-white\/5:hover{background-color:#ffffff0d}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-green-700:hover{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.hover\:text-orange-700:hover{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.hover\:text-primary\/80:hover{color:hsl(var(--primary) / .8)}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.hover\:text-yellow-300:hover{--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.hover\:text-yellow-800:hover{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:ring-2:hover{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.hover\:ring-primary:hover{--tw-ring-color: hsl(var(--primary))}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:bg-gray-100:focus{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-0:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-red-500:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.active\:cursor-grabbing:active{cursor:grabbing}.active\:border-primary\/70:active{border-color:hsl(var(--primary) / .7)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group[open] .group-open\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:opacity-100{opacity:1}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.destructive .group-\[\.destructive\]\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:hover\:text-red-50:hover{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-selected\:text-muted-foreground[aria-selected=true]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true],.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked],.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes fade-out{0%{opacity:1}to{opacity:0}}.data-\[state\=closed\]\:animate-fade-out[data-state=closed]{animation:fade-out .15s ease-in}.data-\[state\=closed\]\:animate-slide-out-to-right[data-state=closed]{animation:slide-out-to-right .2s ease-in}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.data-\[state\=open\]\:animate-fade-in[data-state=open]{animation:fade-in .2s ease-out}@keyframes slide-in-from-right{0%{transform:translate(100%)}to{transform:translate(0)}}.data-\[state\=open\]\:animate-slide-in-from-right[data-state=open]{animation:slide-in-from-right .3s ease-out}@keyframes slide-out-to-right{0%{transform:translate(0)}to{transform:translate(100%)}}.data-\[swipe\=end\]\:animate-slide-out-to-right[data-swipe=end]{animation:slide-out-to-right .2s ease-in}.data-\[range-end\=true\]\:rounded-md[data-range-end=true]{border-radius:calc(var(--radius) - 2px)}.data-\[range-middle\=true\]\:rounded-none[data-range-middle=true]{border-radius:0}.data-\[range-start\=true\]\:rounded-md[data-range-start=true]{border-radius:calc(var(--radius) - 2px)}.data-\[selected\=true\]\:rounded-none[data-selected=true]{border-radius:0}.data-\[range-end\=true\]\:bg-primary[data-range-end=true]{background-color:hsl(var(--primary))}.data-\[range-middle\=true\]\:bg-accent[data-range-middle=true]{background-color:hsl(var(--accent))}.data-\[range-start\=true\]\:bg-primary[data-range-start=true],.data-\[selected-single\=true\]\:bg-primary[data-selected-single=true]{background-color:hsl(var(--primary))}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:hsl(var(--accent))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:hsl(var(--muted-foreground))}.data-\[range-end\=true\]\:text-primary-foreground[data-range-end=true]{color:hsl(var(--primary-foreground))}.data-\[range-middle\=true\]\:text-accent-foreground[data-range-middle=true]{color:hsl(var(--accent-foreground))}.data-\[range-start\=true\]\:text-primary-foreground[data-range-start=true],.data-\[selected-single\=true\]\:text-primary-foreground[data-selected-single=true]{color:hsl(var(--primary-foreground))}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:hsl(var(--accent-foreground))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:hsl(var(--accent-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:opacity-50[data-disabled=true],.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[state\=active\]\:duration-300[data-state=active]{transition-duration:.3s}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:relative{position:relative}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:z-10{z-index:10}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:border-ring{border-color:hsl(var(--ring))}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:ring-\[3px\]{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:ring-ring\/50{--tw-ring-color: hsl(var(--ring) / .5)}@supports (backdrop-filter: var(--tw)){.supports-\[backdrop-filter\]\:bg-background\/60{background-color:hsl(var(--background) / .6)}}.dark\:border-amber-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(146 64 14 / var(--tw-border-opacity, 1))}.dark\:border-blue-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 64 175 / var(--tw-border-opacity, 1))}.dark\:border-gray-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(17 24 39 / var(--tw-border-opacity, 1))}.dark\:border-green-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(22 101 52 / var(--tw-border-opacity, 1))}.dark\:border-orange-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(124 45 18 / var(--tw-border-opacity, 1))}.dark\:border-yellow-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(113 63 18 / var(--tw-border-opacity, 1))}.dark\:bg-amber-950\/30:is(.dark *){background-color:#451a034d}.dark\:bg-blue-500\/20:is(.dark *){background-color:#3b82f633}.dark\:bg-blue-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(23 37 84 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-950\/20:is(.dark *){background-color:#17255433}.dark\:bg-blue-950\/30:is(.dark *){background-color:#1725544d}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-800\/30:is(.dark *){background-color:#1f29374d}.dark\:bg-gray-800\/50:is(.dark *){background-color:#1f293780}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(3 7 18 / var(--tw-bg-opacity, 1))}.dark\:bg-green-900\/30:is(.dark *){background-color:#14532d4d}.dark\:bg-green-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(5 46 22 / var(--tw-bg-opacity, 1))}.dark\:bg-green-950\/20:is(.dark *){background-color:#052e1633}.dark\:bg-orange-950\/20:is(.dark *){background-color:#43140733}.dark\:bg-red-500\/20:is(.dark *){background-color:#ef444433}.dark\:bg-red-600\/30:is(.dark *){background-color:#dc26264d}.dark\:bg-red-900\/30:is(.dark *){background-color:#7f1d1d4d}.dark\:bg-red-950\/50:is(.dark *){background-color:#450a0a80}.dark\:bg-yellow-500\/20:is(.dark *){background-color:#eab30833}.dark\:bg-yellow-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(113 63 18 / var(--tw-bg-opacity, 1))}.dark\:bg-yellow-950\/30:is(.dark *){background-color:#4220064d}.dark\:text-amber-100:is(.dark *){--tw-text-opacity: 1;color:rgb(254 243 199 / var(--tw-text-opacity, 1))}.dark\:text-amber-400:is(.dark *){--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.dark\:text-blue-100:is(.dark *){--tw-text-opacity: 1;color:rgb(219 234 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-200:is(.dark *){--tw-text-opacity: 1;color:rgb(191 219 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\:text-blue-400:is(.dark *){--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.dark\:text-cyan-500:is(.dark *){--tw-text-opacity: 1;color:rgb(6 182 212 / var(--tw-text-opacity, 1))}.dark\:text-gray-100:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-gray-600:is(.dark *){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-orange-100:is(.dark *){--tw-text-opacity: 1;color:rgb(255 237 213 / var(--tw-text-opacity, 1))}.dark\:text-orange-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 215 170 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-red-500:is(.dark *){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.dark\:text-yellow-100:is(.dark *){--tw-text-opacity: 1;color:rgb(254 249 195 / var(--tw-text-opacity, 1))}.dark\:text-yellow-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.dark\:text-yellow-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.dark\:text-yellow-400:is(.dark *){--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.dark\:text-yellow-500:is(.dark *){--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.dark\:hover\:bg-gray-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:hover\:text-yellow-200:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.dark\:focus\:bg-gray-800:focus:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}@media(min-width:640px){.sm\:right-2{right:.5rem}.sm\:right-3{right:.75rem}.sm\:top-2{top:.5rem}.sm\:top-3{top:.75rem}.sm\:order-1{order:1}.sm\:order-2{order:2}.sm\:col-span-2{grid-column:span 2 / span 2}.sm\:mx-0{margin-left:0;margin-right:0}.sm\:mb-3{margin-bottom:.75rem}.sm\:mb-4{margin-bottom:1rem}.sm\:mb-6{margin-bottom:1.5rem}.sm\:ml-0{margin-left:0}.sm\:ml-1{margin-left:.25rem}.sm\:mr-1{margin-right:.25rem}.sm\:mr-2{margin-right:.5rem}.sm\:mt-0{margin-top:0}.sm\:mt-2{margin-top:.5rem}.sm\:mt-3{margin-top:.75rem}.sm\:mt-6{margin-top:1.5rem}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:grid{display:grid}.sm\:hidden{display:none}.sm\:h-10{height:2.5rem}.sm\:h-12{height:3rem}.sm\:h-2{height:.5rem}.sm\:h-24{height:6rem}.sm\:h-3{height:.75rem}.sm\:h-4{height:1rem}.sm\:h-5{height:1.25rem}.sm\:h-8{height:2rem}.sm\:h-\[300px\]{height:300px}.sm\:h-\[400px\]{height:400px}.sm\:h-\[500px\]{height:500px}.sm\:h-\[calc\(100vh-280px\)\]{height:calc(100vh - 280px)}.sm\:w-10{width:2.5rem}.sm\:w-2{width:.5rem}.sm\:w-24{width:6rem}.sm\:w-3{width:.75rem}.sm\:w-4{width:1rem}.sm\:w-5{width:1.25rem}.sm\:w-8{width:2rem}.sm\:w-\[140px\]{width:140px}.sm\:w-\[160px\]{width:160px}.sm\:w-\[200px\]{width:200px}.sm\:w-\[500px\]{width:500px}.sm\:w-auto{width:auto}.sm\:w-full{width:100%}.sm\:min-w-\[120px\]{min-width:120px}.sm\:max-w-2xl{max-width:42rem}.sm\:max-w-\[420px\]{max-width:420px}.sm\:max-w-\[70\%\]{max-width:70%}.sm\:max-w-\[900px\]{max-width:900px}.sm\:max-w-md{max-width:28rem}.sm\:max-w-sm{max-width:24rem}.sm\:flex-1{flex:1 1 0%}.sm\:flex-none{flex:none}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.sm\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-start{align-items:flex-start}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-0{gap:0px}.sm\:gap-1{gap:.25rem}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:gap-6{gap:1.5rem}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.sm\:space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.sm\:space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.sm\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.sm\:space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:p-3{padding:.75rem}.sm\:p-4{padding:1rem}.sm\:p-6{padding:1.5rem}.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:pb-4{padding-bottom:1rem}.sm\:text-left{text-align:left}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}.sm\:text-\[200px\]{font-size:200px}.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.sm\:text-xl{font-size:1.25rem;line-height:1.75rem}.sm\:text-xs{font-size:.75rem;line-height:1rem}}@media(min-width:768px){.md\:top-4{top:1rem}.md\:mb-4{margin-bottom:1rem}.md\:mb-6{margin-bottom:1.5rem}.md\:mb-8{margin-bottom:2rem}.md\:mt-8{margin-top:2rem}.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:h-16{height:4rem}.md\:h-4{height:1rem}.md\:h-5{height:1.25rem}.md\:h-8{height:2rem}.md\:h-96{height:24rem}.md\:h-\[500px\]{height:500px}.md\:min-h-\[400px\]{min-height:400px}.md\:w-16{width:4rem}.md\:w-4{width:1rem}.md\:w-5{width:1.25rem}.md\:w-8{width:2rem}.md\:w-96{width:24rem}.md\:max-w-none{max-width:none}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:gap-2{gap:.5rem}.md\:gap-3{gap:.75rem}.md\:gap-4{gap:1rem}.md\:gap-6{gap:1.5rem}.md\:space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.md\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.md\:whitespace-normal{white-space:normal}.md\:p-12{padding:3rem}.md\:p-4{padding:1rem}.md\:p-6{padding:1.5rem}.md\:p-8{padding:2rem}.md\:text-2xl{font-size:1.5rem;line-height:2rem}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:text-base{font-size:1rem;line-height:1.5rem}.md\:text-lg{font-size:1.125rem;line-height:1.75rem}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:text-xs{font-size:.75rem;line-height:1rem}}@media(min-width:1024px){.lg\:invisible{visibility:hidden}.lg\:relative{position:relative}.lg\:z-0{z-index:0}.lg\:col-span-1{grid-column:span 1 / span 1}.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:mx-auto{margin-left:auto;margin-right:auto}.lg\:mb-1{margin-bottom:.25rem}.lg\:block{display:block}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:w-12{width:3rem}.lg\:w-16{width:4rem}.lg\:w-64{width:16rem}.lg\:w-8{width:2rem}.lg\:w-\[130px\]{width:130px}.lg\:w-\[160px\]{width:160px}.lg\:w-\[180px\]{width:180px}.lg\:w-\[200px\]{width:200px}.lg\:w-\[240px\]{width:240px}.lg\:w-\[75px\]{width:75px}.lg\:w-auto{width:auto}.lg\:w-full{width:100%}.lg\:max-w-0{max-width:0px}.lg\:flex-1{flex:1 1 0%}.lg\:flex-none{flex:none}.lg\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.lg\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.lg\:justify-center{justify-content:center}.lg\:gap-0{gap:0px}.lg\:space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.lg\:overflow-hidden{overflow:hidden}.lg\:p-2{padding:.5rem}.lg\:p-6{padding:1.5rem}.lg\:px-0{padding-left:0;padding-right:0}.lg\:px-6{padding-left:1.5rem;padding-right:1.5rem}.lg\:pb-6{padding-bottom:1.5rem}.lg\:text-3xl{font-size:1.875rem;line-height:2.25rem}.lg\:opacity-0{opacity:0}}@media(min-width:1280px){.xl\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}}.\[\&\+div\]\:text-xs+div{font-size:.75rem;line-height:1rem}.\[\&\:first-child\[data-selected\=true\]_button\]\:rounded-l-md:first-child[data-selected=true] button{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\:last-child\[data-selected\=true\]_button\]\:rounded-r-md:last-child[data-selected=true] button{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y: 2px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>span\]\:text-xs>span{font-size:.75rem;line-height:1rem}.\[\&\>span\]\:opacity-70>span{opacity:.7}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:size-3\.5>svg{width:.875rem;height:.875rem}.\[\&\>svg\]\:h-2\.5>svg{height:.625rem}.\[\&\>svg\]\:h-3>svg{height:.75rem}.\[\&\>svg\]\:w-2\.5>svg{width:.625rem}.\[\&\>svg\]\:w-3>svg{width:.75rem}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\]\:text-muted-foreground>svg{color:hsl(var(--muted-foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:hsl(var(--muted-foreground))}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:hsl(var(--border) / .5)}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:hsl(var(--border))}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-layer\]\:outline-none .recharts-layer{outline:2px solid transparent;outline-offset:2px}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:hsl(var(--muted))}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-sector\]\:outline-none .recharts-sector,.\[\&_\.recharts-surface\]\:outline-none .recharts-surface{outline:2px solid transparent;outline-offset:2px}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:invisible svg{visibility:hidden}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}[data-slot=card-content] .\[\[data-slot\=card-content\]_\&\]\:bg-transparent,[data-slot=popover-content] .\[\[data-slot\=popover-content\]_\&\]\:bg-transparent{background-color:transparent}.uppy-Root{box-sizing:border-box;color:#333;font-family:-apple-system,system-ui,BlinkMacSystemFont,Segoe UI,Segoe UI Symbol,Segoe UI Emoji,Apple Color Emoji,Roboto,Helvetica,Arial,sans-serif;line-height:1;position:relative;text-align:left;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.uppy-Root[dir=rtl],[dir=rtl] .uppy-Root{text-align:right}.uppy-Root *,.uppy-Root :after,.uppy-Root :before{box-sizing:inherit}.uppy-Root [hidden]{display:none}.uppy-u-reset{all:initial;-webkit-appearance:none;-moz-appearance:none;appearance:none;box-sizing:border-box;font-family:-apple-system,system-ui,BlinkMacSystemFont,Segoe UI,Segoe UI Symbol,Segoe UI Emoji,Apple Color Emoji,Roboto,Helvetica,Arial,sans-serif;line-height:1}[dir=rtl] .uppy-u-reset{text-align:right}.uppy-c-textInput{background-color:#fff;border:1px solid #ddd;border-radius:4px;font-family:inherit;font-size:14px;line-height:1.5;padding:6px 8px}.uppy-size--md .uppy-c-textInput{padding:8px 10px}.uppy-c-textInput:focus{border-color:#1269cf99;box-shadow:0 0 0 3px #1269cf26;outline:none}[data-uppy-theme=dark] .uppy-c-textInput{background-color:#333;border-color:#333;color:#eaeaea}[data-uppy-theme=dark] .uppy-c-textInput:focus{border-color:#525252;box-shadow:none}.uppy-c-icon{display:inline-block;max-height:100%;max-width:100%;overflow:hidden;fill:currentColor}.uppy-c-btn{align-items:center;color:inherit;display:inline-flex;font-family:inherit;font-size:inherit;font-weight:500;justify-content:center;line-height:1;transition-duration:.3s;transition-property:background-color,color;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.uppy-c-btn,[dir=rtl] .uppy-c-btn{text-align:center}.uppy-c-btn:not(:disabled):not(.disabled){cursor:pointer}.uppy-c-btn::-moz-focus-inner{border:0}.uppy-c-btn-primary{background-color:#1269cf;border-radius:4px;color:#fff;font-size:14px;padding:10px 18px}.uppy-c-btn-primary:not(:disabled):hover{background-color:#0e51a0}.uppy-c-btn-primary:focus{box-shadow:0 0 0 3px #1269cf66;outline:none}.uppy-size--md .uppy-c-btn-primary{padding:13px 22px}[data-uppy-theme=dark] .uppy-c-btn-primary{color:#eaeaea}[data-uppy-theme=dark] .uppy-c-btn-primary:focus{outline:none}[data-uppy-theme=dark] .uppy-c-btn-primary::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-c-btn-primary:focus{box-shadow:0 0 0 2px #aae1ffd9}.uppy-c-btn-primary.uppy-c-btn--disabled{background-color:#8eb2db}.uppy-c-btn-link{background-color:initial;border-radius:4px;color:#525252;font-size:14px;line-height:1;padding:10px 15px}.uppy-c-btn-link:hover{color:#333}.uppy-c-btn-link:focus{box-shadow:0 0 0 3px #1269cf40;outline:none}.uppy-size--md .uppy-c-btn-link{padding:13px 18px}[data-uppy-theme=dark] .uppy-c-btn-link{color:#eaeaea}[data-uppy-theme=dark] .uppy-c-btn-link:focus{outline:none}[data-uppy-theme=dark] .uppy-c-btn-link::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-c-btn-link:focus{box-shadow:0 0 0 2px #aae1ffd9}[data-uppy-theme=dark] .uppy-c-btn-link:hover{color:#939393}.uppy-ProviderBrowser-viewType--grid ul.uppy-ProviderBrowser-list,.uppy-ProviderBrowser-viewType--unsplash ul.uppy-ProviderBrowser-list{align-items:flex-start;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;padding:6px}.uppy-ProviderBrowser-viewType--grid ul.uppy-ProviderBrowser-list:after,.uppy-ProviderBrowser-viewType--unsplash ul.uppy-ProviderBrowser-list:after{content:"";flex:auto}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem{margin:0;position:relative;width:50%}.uppy-size--md .uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem,.uppy-size--md .uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem{width:33.3333%}.uppy-size--lg .uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem,.uppy-size--lg .uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem{width:25%}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem:before,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem:before{content:"";display:block;padding-top:100%}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--selected img,.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--selected svg,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--selected img,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--selected svg{opacity:.85}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--disabled,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--disabled{opacity:.5}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--noPreview .uppy-ProviderBrowserItem-inner,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--noPreview .uppy-ProviderBrowserItem-inner{background-color:#93939333}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--noPreview .uppy-ProviderBrowserItem-inner,[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--noPreview .uppy-ProviderBrowserItem-inner{background-color:#eaeaea33}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--noPreview svg,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--noPreview svg{height:30%;width:30%;fill:#000000b3}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--noPreview svg,[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--noPreview svg{fill:#fffc}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-inner,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-inner{border-radius:4px;height:calc(100% - 14px);inset:7px;overflow:hidden;position:absolute;text-align:center;width:calc(100% - 14px)}@media(hover:none){.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-inner .uppy-ProviderBrowserItem-author,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-inner .uppy-ProviderBrowserItem-author{display:block}}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-inner,[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-inner{box-shadow:0 0 0 3px #aae1ffb3}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-inner img,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-inner img{border-radius:4px;height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-author,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-author{background:#0000004d;bottom:0;color:#fff;display:none;font-size:12px;font-weight:500;left:0;margin:0;padding:5px;position:absolute;text-decoration:none;width:100%}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-author:hover,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-author:hover{background:#0006;text-decoration:underline}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox{background-color:#1269cf;border-radius:50%;height:26px;opacity:0;position:absolute;right:16px;top:16px;width:26px;z-index:1002}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox:after,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox:after{height:7px;inset-inline-start:7px;top:8px;width:12px}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem--is-checked .uppy-ProviderBrowserItem-checkbox,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem--is-checked .uppy-ProviderBrowserItem-checkbox{opacity:1}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox--grid:focus+label .uppy-ProviderBrowserItem-author,.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox--grid:hover+label .uppy-ProviderBrowserItem-author,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox--grid:focus+label .uppy-ProviderBrowserItem-author,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox--grid:hover+label .uppy-ProviderBrowserItem-author{display:block}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox--grid:focus+label,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox--grid:focus+label{box-shadow:0 0 0 3px #1269cf80}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox--grid:focus+label:focus,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox--grid:focus+label:focus{outline:none}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox--grid:focus+label::-moz-focus-inner,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox--grid:focus+label::-moz-focus-inner{border:0}.uppy-ProviderBrowser-viewType--list{background-color:#fff}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--list{background-color:#1f1f1f}.uppy-ProviderBrowser-viewType--list li.uppy-ProviderBrowserItem{align-items:center;display:flex;margin:0;padding:7px 15px}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--list li.uppy-ProviderBrowserItem{color:#eaeaea}.uppy-ProviderBrowser-viewType--list li.uppy-ProviderBrowserItem--disabled{opacity:.6}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-checkbox{background-color:#fff;border:1px solid #cfcfcf;border-radius:3px;height:17px;margin-inline-end:15px;width:17px}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-checkbox:focus{border:1px solid #1269cf;box-shadow:0 0 0 3px #1269cf40;outline:none}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-checkbox:after{height:5px;inset-inline-start:3px;opacity:0;top:4px;width:9px}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-checkbox:focus{border-color:#02baf2b3;box-shadow:0 0 0 3px #02baf233}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem--is-checked .uppy-ProviderBrowserItem-checkbox,.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem--is-partial .uppy-ProviderBrowserItem-checkbox{background-color:#1269cf;border-color:#1269cf}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem--is-checked .uppy-ProviderBrowserItem-checkbox:after,.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem--is-partial .uppy-ProviderBrowserItem-checkbox:after{opacity:1}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-inner{align-items:center;color:inherit;display:flex;font-family:-apple-system,system-ui,BlinkMacSystemFont,Segoe UI,Segoe UI Symbol,Segoe UI Emoji,Apple Color Emoji,Roboto,Helvetica,Arial,sans-serif;overflow:hidden;padding:2px;text-overflow:ellipsis;white-space:nowrap}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-inner:focus{outline:none;text-decoration:underline}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-inner img,.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-inner svg{margin-inline-end:8px}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-inner span{line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem--disabled .uppy-ProviderBrowserItem-inner{cursor:default}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-iconWrap{margin-inline-end:7px;width:20px}.uppy-ProviderBrowserItem-checkbox{cursor:pointer;flex-shrink:0;position:relative}.uppy-ProviderBrowserItem-checkbox:disabled,.uppy-ProviderBrowserItem-checkbox:disabled:after{cursor:default}[data-uppy-theme=dark] .uppy-ProviderBrowserItem-checkbox{background-color:#1f1f1f;border-color:#939393}[data-uppy-theme=dark] .uppy-ProviderBrowserItem--is-checked .uppy-ProviderBrowserItem-checkbox{background-color:#333}.uppy-ProviderBrowserItem--is-checked .uppy-ProviderBrowserItem-checkbox:after{border-bottom:2px solid #eaeaea;border-left:2px solid #eaeaea;content:"";cursor:pointer;position:absolute;transform:rotate(-45deg)}.uppy-ProviderBrowserItem--is-partial .uppy-ProviderBrowserItem-checkbox:after{background-color:#eaeaea!important;content:""!important;height:2px!important;left:20%!important;position:absolute!important;right:20%!important;top:50%!important;transform:translateY(-50%)!important}.uppy-SearchProvider{align-items:center;display:flex;flex:1;flex-direction:column;height:100%;justify-content:center;width:100%}[data-uppy-theme=dark] .uppy-SearchProvider{background-color:#1f1f1f}.uppy-SearchProvider-input{margin-bottom:15px;max-width:650px;width:90%}.uppy-size--md .uppy-SearchProvider-input{margin-bottom:20px}.uppy-SearchProvider-input::-webkit-search-cancel-button{display:none}.uppy-SearchProvider-searchButton{padding:13px 25px}.uppy-size--md .uppy-SearchProvider-searchButton{padding:13px 30px}.uppy-DashboardContent-panelBody{align-items:center;display:flex;flex:1;justify-content:center}[data-uppy-theme=dark] .uppy-DashboardContent-panelBody{background-color:#1f1f1f}.uppy-Provider-auth,.uppy-Provider-empty,.uppy-Provider-error,.uppy-Provider-loading{align-items:center;color:#939393;display:flex;flex:1;flex-flow:column wrap;justify-content:center}.uppy-Provider-empty{color:#939393}.uppy-Provider-authIcon svg{height:75px;width:100px}.uppy-Provider-authTitle{color:#757575;font-size:17px;font-weight:400;line-height:1.4;margin-bottom:30px;max-width:500px;padding:0 15px;text-align:center}.uppy-size--md .uppy-Provider-authTitle{font-size:20px}[data-uppy-theme=dark] .uppy-Provider-authTitle{color:#cfcfcf}.uppy-Provider-btn-google{align-items:center;background:#4285f4;display:flex;padding:8px 12px!important}.uppy-Provider-btn-google:hover{background-color:#1266f1}.uppy-Provider-btn-google:focus{box-shadow:0 0 0 3px #4285f466;outline:none}.uppy-Provider-btn-google svg{margin-right:8px}.uppy-Provider-breadcrumbs{color:#525252;flex:1;font-size:12px;margin-bottom:10px;text-align:start}.uppy-size--md .uppy-Provider-breadcrumbs{margin-bottom:0}[data-uppy-theme=dark] .uppy-Provider-breadcrumbs{color:#eaeaea}.uppy-Provider-breadcrumbsIcon{color:#525252;display:inline-block;line-height:1;margin-inline-end:4px;vertical-align:middle}.uppy-Provider-breadcrumbsIcon svg{height:13px;width:13px;fill:#525252}.uppy-Provider-breadcrumbs button{border-radius:3px;display:inline-block;line-height:inherit;padding:4px}.uppy-Provider-breadcrumbs button:focus{outline:none}.uppy-Provider-breadcrumbs button::-moz-focus-inner{border:0}.uppy-Provider-breadcrumbs button:hover{color:#0e51a0}.uppy-Provider-breadcrumbs button:focus{background-color:#dfe6f1}[data-uppy-theme=dark] .uppy-Provider-breadcrumbs button:focus{background-color:#333}.uppy-Provider-breadcrumbs button:not(:last-of-type){text-decoration:underline}.uppy-Provider-breadcrumbs button:last-of-type{color:#333;cursor:normal;font-weight:500;pointer-events:none}.uppy-Provider-breadcrumbs button:hover{cursor:pointer}[data-uppy-theme=dark] .uppy-Provider-breadcrumbs button{color:#eaeaea}.uppy-ProviderBrowser{display:flex;flex:1;flex-direction:column;font-size:14px;font-weight:400;height:100%}.uppy-ProviderBrowser-user{color:#333;font-weight:500;margin:0 8px 0 0}[data-uppy-theme=dark] .uppy-ProviderBrowser-user{color:#eaeaea}.uppy-ProviderBrowser-user:after{color:#939393;content:"·";font-weight:400;inset-inline-start:4px;position:relative}.uppy-ProviderBrowser-header{border-bottom:1px solid #eaeaea;position:relative;z-index:1001}[data-uppy-theme=dark] .uppy-ProviderBrowser-header{border-bottom:1px solid #333}.uppy-ProviderBrowser-headerBar{background-color:#fafafa;color:#757575;font-size:12px;line-height:1.4;padding:7px 15px;z-index:1001}.uppy-size--md .uppy-ProviderBrowser-headerBar{align-items:center;display:flex}[data-uppy-theme=dark] .uppy-ProviderBrowser-headerBar{background-color:#1f1f1f}.uppy-ProviderBrowser-headerBar--simple{display:block;justify-content:center;text-align:center}.uppy-ProviderBrowser-headerBar--simple .uppy-Provider-breadcrumbsWrap{display:inline-block;flex:none;vertical-align:middle}.uppy-ProviderBrowser-searchFilter{align-items:center;display:flex;height:30px;margin-bottom:15px;margin-top:15px;padding-left:8px;padding-right:8px;position:relative;width:100%}.uppy-ProviderBrowser-searchFilterInput{background-color:#eaeaea;border:0;border-radius:4px;color:#333;font-family:-apple-system,system-ui,BlinkMacSystemFont,Segoe UI,Segoe UI Symbol,Segoe UI Emoji,Apple Color Emoji,Roboto,Helvetica,Arial,sans-serif;font-size:13px;height:30px;line-height:1.4;outline:0;padding-inline-end:30px;padding-inline-start:30px;width:100%;z-index:1001}.uppy-ProviderBrowser-searchFilterInput::-webkit-search-cancel-button{display:none}[data-uppy-theme=dark] .uppy-ProviderBrowser-searchFilterInput{background-color:#1f1f1f;color:#eaeaea}.uppy-ProviderBrowser-searchFilterInput:focus{background-color:#cfcfcf;border:0}[data-uppy-theme=dark] .uppy-ProviderBrowser-searchFilterInput:focus{background-color:#333}.uppy-ProviderBrowser-searchFilterIcon{color:#757575;height:12px;inset-inline-start:16px;position:absolute;width:12px;z-index:1002}.uppy-ProviderBrowser-searchFilterInput::-moz-placeholder{color:#939393;opacity:1}.uppy-ProviderBrowser-searchFilterInput::placeholder{color:#939393;opacity:1}.uppy-ProviderBrowser-searchFilterReset{border-radius:3px;color:#939393;cursor:pointer;height:22px;inset-inline-end:16px;padding:6px;position:absolute;width:22px;z-index:1002}.uppy-ProviderBrowser-searchFilterReset:focus{outline:none}.uppy-ProviderBrowser-searchFilterReset::-moz-focus-inner{border:0}.uppy-ProviderBrowser-searchFilterReset:focus{box-shadow:0 0 0 3px #1269cf80}.uppy-ProviderBrowser-searchFilterReset:hover{color:#757575}.uppy-ProviderBrowser-searchFilterReset svg{vertical-align:text-top}.uppy-ProviderBrowser-userLogout{border-radius:3px;color:#1269cf;cursor:pointer;line-height:inherit;padding:4px}.uppy-ProviderBrowser-userLogout:focus{outline:none}.uppy-ProviderBrowser-userLogout::-moz-focus-inner{border:0}.uppy-ProviderBrowser-userLogout:hover{color:#0e51a0}.uppy-ProviderBrowser-userLogout:focus{background-color:#dfe6f1}[data-uppy-theme=dark] .uppy-ProviderBrowser-userLogout:focus{background-color:#333}.uppy-ProviderBrowser-userLogout:hover{text-decoration:underline}[data-uppy-theme=dark] .uppy-ProviderBrowser-userLogout{color:#eaeaea}.uppy-ProviderBrowser-body{flex:1;position:relative}.uppy-ProviderBrowser-list{background-color:#fff;border-spacing:0;display:block;flex:1;height:100%;inset:0;list-style:none;margin:0;overflow-x:hidden;overflow-y:auto;padding:0;position:absolute;width:100%;-webkit-overflow-scrolling:touch}[data-uppy-theme=dark] .uppy-ProviderBrowser-list{background-color:#1f1f1f}.uppy-ProviderBrowser-list:focus{outline:none}.uppy-ProviderBrowserItem-inner{cursor:pointer;font-size:13px;font-weight:500}.uppy-ProviderBrowser-footer{align-items:center;background-color:#fff;border-top:1px solid #eaeaea;display:flex;justify-content:space-between;padding:15px}.uppy-ProviderBrowser-footer button{margin-inline-end:8px}[data-uppy-theme=dark] .uppy-ProviderBrowser-footer{background-color:#1f1f1f;border-top:1px solid #333}.uppy-ProviderBrowser-footer-buttons{flex-shrink:0}.uppy-ProviderBrowser-footer-error{color:#e32437;line-height:18px}@media(max-width:426px){.uppy-ProviderBrowser-footer{align-items:stretch;flex-direction:column-reverse}.uppy-ProviderBrowser-footer-error{padding-bottom:10px}}.picker-dialog-bg{z-index:20000!important}.picker-dialog{z-index:20001!important}.uppy-Dashboard-Item-previewInnerWrap{align-items:center;border-radius:3px;box-shadow:0 0 2px #0006;display:flex;flex-direction:column;height:100%;justify-content:center;overflow:hidden;position:relative;width:100%}.uppy-size--md .uppy-Dashboard-Item-previewInnerWrap{box-shadow:0 1px 2px #00000026}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-previewInnerWrap{box-shadow:none}.uppy-Dashboard-Item-previewInnerWrap:after{background-color:#000000a6;content:"";display:none;inset:0;position:absolute;z-index:1001}.uppy-Dashboard-Item-previewLink{inset:0;position:absolute;z-index:1002}.uppy-Dashboard-Item-previewLink:focus{box-shadow:inset 0 0 0 3px #579df0}[data-uppy-theme=dark] .uppy-Dashboard-Item-previewLink:focus{box-shadow:inset 0 0 0 3px #016c8d}.uppy-Dashboard-Item-preview img.uppy-Dashboard-Item-previewImg{border-radius:3px;height:100%;-o-object-fit:cover;object-fit:cover;transform:translateZ(0);width:100%}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-preview img.uppy-Dashboard-Item-previewImg{height:auto;max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain;padding:10px;width:auto}.uppy-Dashboard-Item-progress{color:#fff;left:50%;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%);transition:all .35 ease;width:120px;z-index:1002}.uppy-Dashboard-Item-progressIndicator{color:#fff;display:inline-block;height:38px;opacity:.9;width:38px}.uppy-size--md .uppy-Dashboard-Item-progressIndicator{height:55px;width:55px}button.uppy-Dashboard-Item-progressIndicator{cursor:pointer}button.uppy-Dashboard-Item-progressIndicator:focus{outline:none}button.uppy-Dashboard-Item-progressIndicator::-moz-focus-inner{border:0}button.uppy-Dashboard-Item-progressIndicator:focus .uppy-Dashboard-Item-progressIcon--bg,button.uppy-Dashboard-Item-progressIndicator:focus .uppy-Dashboard-Item-progressIcon--retry{fill:#579df0}.uppy-Dashboard-Item-progressIcon--circle{height:100%;width:100%}.uppy-Dashboard-Item-progressIcon--bg{stroke:#fff6}.uppy-Dashboard-Item-progressIcon--progress{transition:stroke-dashoffset .5s ease-out;stroke:#fff}.uppy-Dashboard-Item-progressIcon--play{transition:all .2s;fill:#fff;stroke:#fff}.uppy-Dashboard-Item-progressIcon--cancel{transition:all .2s;fill:#fff}.uppy-Dashboard-Item-progressIcon--pause{transition:all .2s;fill:#fff;stroke:#fff}.uppy-Dashboard-Item-progressIcon--check{transition:all .2s;fill:#fff}.uppy-Dashboard-Item-progressIcon--retry{fill:#fff}.uppy-Dashboard-Item.is-complete .uppy-Dashboard-Item-progress{inset-inline-end:-8px;inset-inline-start:auto;top:-9px;transform:none;width:auto}.uppy-Dashboard-Item.is-error .uppy-Dashboard-Item-progressIndicator{height:18px;width:18px}.uppy-size--md .uppy-Dashboard-Item.is-error .uppy-Dashboard-Item-progressIndicator{height:28px;width:28px}.uppy-Dashboard-Item.is-complete .uppy-Dashboard-Item-progressIndicator{height:18px;opacity:1;width:18px}.uppy-size--md .uppy-Dashboard-Item.is-complete .uppy-Dashboard-Item-progressIndicator{height:22px;width:22px}.uppy-Dashboard-Item.is-processing .uppy-Dashboard-Item-progress{opacity:0}.uppy-Dashboard-Item-fileInfo{padding-inline-end:5px}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-fileInfo{padding-inline-end:10px}.uppy-size--md.uppy-Dashboard--singleFile .uppy-Dashboard-Item-fileInfo{padding-inline-end:15px}.uppy-Dashboard-Item-name{font-size:12px;font-weight:500;line-height:1.3;margin-bottom:5px;word-wrap:anywhere;word-break:break-all}[data-uppy-theme=dark] .uppy-Dashboard-Item-name{color:#eaeaea}.uppy-size--md.uppy-Dashboard--singleFile .uppy-Dashboard-Item-name{font-size:14px;line-height:1.4}.uppy-Dashboard-Item-fileName{align-items:baseline;display:flex}.uppy-Dashboard-Item-fileName button{margin-left:5px}.uppy-Dashboard-Item-author{color:#757575;display:inline-block;font-size:11px;font-weight:400;line-height:1;margin-bottom:5px;vertical-align:bottom}.uppy-Dashboard-Item-author a{color:#757575}.uppy-Dashboard-Item-status{color:#757575;font-size:11px;font-weight:400;line-height:1}[data-uppy-theme=dark] .uppy-Dashboard-Item-status{color:#bbb}.uppy-Dashboard-Item-statusSize{display:inline-block;margin-bottom:5px;text-transform:uppercase;vertical-align:bottom}.uppy-Dashboard-Item-reSelect{color:#1269cf;font-family:inherit;font-size:inherit;font-weight:600}.uppy-Dashboard-Item-errorMessage{background-color:#fdeff1;color:#a51523;font-size:11px;font-weight:500;line-height:1.3;padding:5px 6px}.uppy-Dashboard-Item-errorMessageBtn{color:#a51523;cursor:pointer;font-size:11px;font-weight:500;text-decoration:underline}.uppy-Dashboard-Item-preview .uppy-Dashboard-Item-errorMessage{display:none}.uppy-size--md .uppy-Dashboard-Item-preview .uppy-Dashboard-Item-errorMessage{border-bottom-left-radius:3px;border-bottom-right-radius:3px;border-top:1px solid #f7c2c8;bottom:0;display:block;left:0;line-height:1.4;padding:6px 8px;position:absolute;right:0}.uppy-Dashboard-Item-fileInfo .uppy-Dashboard-Item-errorMessage{border:1px solid #f7c2c8;border-radius:3px;display:inline-block;position:static}.uppy-size--md .uppy-Dashboard-Item-fileInfo .uppy-Dashboard-Item-errorMessage{display:none}.uppy-Dashboard-Item-action{color:#939393;cursor:pointer}.uppy-Dashboard-Item-action:focus{outline:none}.uppy-Dashboard-Item-action::-moz-focus-inner{border:0}.uppy-Dashboard-Item-action:focus{box-shadow:0 0 0 3px #1269cf80}.uppy-Dashboard-Item-action:hover{color:#1f1f1f;opacity:1}[data-uppy-theme=dark] .uppy-Dashboard-Item-action{color:#cfcfcf}[data-uppy-theme=dark] .uppy-Dashboard-Item-action:focus{outline:none}[data-uppy-theme=dark] .uppy-Dashboard-Item-action::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-Dashboard-Item-action:focus{box-shadow:0 0 0 2px #aae1ffd9}[data-uppy-theme=dark] .uppy-Dashboard-Item-action:hover{color:#eaeaea}.uppy-Dashboard-Item-action--remove{color:#1f1f1f;opacity:.95}.uppy-Dashboard-Item-action--remove:hover{color:#000;opacity:1}.uppy-size--md .uppy-Dashboard-Item-action--remove{height:18px;inset-inline-end:-8px;padding:0;position:absolute;top:-8px;width:18px;z-index:1002}.uppy-size--md .uppy-Dashboard-Item-action--remove:focus{border-radius:50%}.uppy-Dashboard--singleFile.uppy-size--height-md .uppy-Dashboard-Item-action--remove{inset-inline-end:8px;position:absolute;top:8px}[data-uppy-theme=dark] .uppy-Dashboard-Item-action--remove{color:#525252}[data-uppy-theme=dark] .uppy-Dashboard-Item-action--remove:hover{color:#333}.uppy-Dashboard:not(.uppy-size--md):not(.uppy-Dashboard--singleFile.uppy-size--height-md) .uppy-Dashboard-Item-actionWrapper{align-items:center;display:flex}.uppy-Dashboard:not(.uppy-size--md):not(.uppy-Dashboard--singleFile.uppy-size--height-md) .uppy-Dashboard-Item-action{height:22px;margin-left:3px;padding:3px;width:22px}.uppy-Dashboard:not(.uppy-size--md):not(.uppy-Dashboard--singleFile.uppy-size--height-md) .uppy-Dashboard-Item-action:focus{border-radius:3px}.uppy-size--md .uppy-Dashboard-Item-action--copyLink,.uppy-size--md .uppy-Dashboard-Item-action--edit{height:16px;padding:0;width:16px}.uppy-size--md .uppy-Dashboard-Item-action--copyLink:focus,.uppy-size--md .uppy-Dashboard-Item-action--edit:focus{border-radius:3px}.uppy-Dashboard-Item{align-items:center;border-bottom:1px solid #eaeaea;display:flex;padding:10px}.uppy-Dashboard:not(.uppy-Dashboard--singleFile) .uppy-Dashboard-Item{padding-inline-end:0}[data-uppy-theme=dark] .uppy-Dashboard-Item{border-bottom:1px solid #333}.uppy-size--md .uppy-Dashboard-Item{border-bottom:0;display:block;float:inline-start;height:215px;margin:5px 15px;padding:0;position:relative;width:calc(33.333% - 30px)}.uppy-size--lg .uppy-Dashboard-Item{height:190px;margin:5px 15px;padding:0;width:calc(25% - 30px)}.uppy-size--xl .uppy-Dashboard-Item{height:210px;padding:0;width:calc(20% - 30px)}.uppy-Dashboard--singleFile .uppy-Dashboard-Item{border-bottom:0;display:flex;flex-direction:column;height:100%;max-width:400px;padding:15px;position:relative;width:100%}.uppy-Dashboard-Item.is-ghost .uppy-Dashboard-Item-previewInnerWrap{opacity:.2}.uppy-Dashboard-Item.is-ghost .uppy-Dashboard-Item-name{opacity:.7}.uppy-Dashboard-Item.is-ghost .uppy-Dashboard-Item-preview:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='35' height='39' viewBox='0 0 35 39'%3E%3Cpath fill='%2523000' d='M1.708 38.66c1.709 0 3.417-3.417 6.834-3.417s5.125 3.417 8.61 3.417c3.348 0 5.056-3.417 8.473-3.417 4.305 0 5.125 3.417 6.833 3.417.889 0 1.709-.889 1.709-1.709v-19.68C34.167-5.757 0-5.757 0 17.271v19.68c0 .82.888 1.709 1.708 1.709m8.542-17.084a3.383 3.383 0 0 1-3.417-3.416 3.383 3.383 0 0 1 3.417-3.417 3.383 3.383 0 0 1 3.417 3.417 3.383 3.383 0 0 1-3.417 3.416m13.667 0A3.383 3.383 0 0 1 20.5 18.16a3.383 3.383 0 0 1 3.417-3.417 3.383 3.383 0 0 1 3.416 3.417 3.383 3.383 0 0 1-3.416 3.416'/%3E%3C/svg%3E");background-position:50% 10px;background-repeat:no-repeat;background-size:25px;content:"";inset:0;opacity:.5;position:absolute;z-index:1005}.uppy-size--md .uppy-Dashboard-Item.is-ghost .uppy-Dashboard-Item-preview:before{background-position:50% 50%;background-size:40px}.uppy-Dashboard--singleFile .uppy-Dashboard-Item.is-ghost .uppy-Dashboard-Item-preview:before{background-position:50% 50%;background-size:30%}.uppy-Dashboard-Item-preview{flex-grow:0;flex-shrink:0;height:50px;position:relative;width:50px}.uppy-size--md .uppy-Dashboard-Item-preview{height:140px;width:100%}.uppy-size--lg .uppy-Dashboard-Item-preview{height:120px}.uppy-size--xl .uppy-Dashboard-Item-preview{height:140px}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-preview{flex-grow:1;max-height:75%;width:100%}.uppy-Dashboard--singleFile.uppy-size--md .uppy-Dashboard-Item-preview{max-height:100%}.uppy-Dashboard-Item-fileInfoAndButtons{align-items:center;display:flex;flex-grow:1;justify-content:space-between;padding-inline-end:8px;padding-inline-start:12px}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-fileInfoAndButtons,.uppy-size--md .uppy-Dashboard-Item-fileInfoAndButtons{align-items:flex-start;padding:9px 0 0}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-fileInfoAndButtons{flex-grow:0;width:100%}.uppy-Dashboard-Item-fileInfo{flex-grow:1;flex-shrink:1}.uppy-Dashboard-Item-actionWrapper{flex-grow:0;flex-shrink:0}.uppy-Dashboard-Item.is-error .uppy-Dashboard-Item-previewInnerWrap:after,.uppy-Dashboard-Item.is-inprogress .uppy-Dashboard-Item-previewInnerWrap:after{display:block}.uppy-Dashboard-Item-errorDetails{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#939393;border:none;border-radius:50%;color:#fff;cursor:help;flex-shrink:0;font-size:10px;font-weight:600;height:13px;inset-inline-start:2px;line-height:12px;position:relative;text-align:center;top:0;width:13px}.uppy-Dashboard-Item-errorDetails:after{line-height:1.3;word-wrap:break-word}.uppy-Dashboard-FileCard{background-color:#fff;border-radius:5px;box-shadow:0 0 10px 4px #0000001a;display:flex;flex-direction:column;height:100%;inset:0;position:absolute;width:100%;z-index:1005}.uppy-Dashboard-FileCard .uppy-DashboardContent-bar{border-top-left-radius:5px;border-top-right-radius:5px}.uppy-Dashboard-FileCard .uppy-Dashboard-FileCard-actions{border-bottom-left-radius:5px;border-bottom-right-radius:5px}.uppy-Dashboard-FileCard-inner{display:flex;flex-direction:column;flex-grow:1;flex-shrink:1;height:100%;min-height:0}.uppy-Dashboard-FileCard-preview{align-items:center;border-bottom:1px solid #eaeaea;display:flex;flex-grow:0;flex-shrink:1;height:60%;justify-content:center;min-height:0;position:relative}[data-uppy-theme=dark] .uppy-Dashboard-FileCard-preview{background-color:#333;border-bottom:0}.uppy-Dashboard-FileCard-preview img.uppy-Dashboard-Item-previewImg{border-radius:3px;box-shadow:0 3px 20px #00000026;flex:0 0 auto;max-height:90%;max-width:90%;-o-object-fit:cover;object-fit:cover}.uppy-Dashboard-FileCard-edit{background-color:#00000080;border-radius:50px;color:#fff;font-size:13px;inset-inline-end:10px;padding:7px 15px;position:absolute;top:10px}.uppy-Dashboard-FileCard-edit:focus{outline:none}.uppy-Dashboard-FileCard-edit::-moz-focus-inner{border:0}.uppy-Dashboard-FileCard-edit:focus{box-shadow:0 0 0 3px #1269cf80}.uppy-Dashboard-FileCard-edit:hover{background-color:#000c}.uppy-Dashboard-FileCard-info{flex-grow:0;flex-shrink:0;height:40%;overflow-y:auto;padding:30px 20px 20px;-webkit-overflow-scrolling:touch}[data-uppy-theme=dark] .uppy-Dashboard-FileCard-info{background-color:#1f1f1f}.uppy-Dashboard-FileCard-fieldset{border:0;font-size:0;margin:auto auto 12px;max-width:640px;padding:0}.uppy-Dashboard-FileCard-label{color:#525252;display:inline-block;font-size:12px;vertical-align:middle;width:22%}.uppy-size--md .uppy-Dashboard-FileCard-label{font-size:14px}[data-uppy-theme=dark] .uppy-Dashboard-FileCard-label{color:#eaeaea}.uppy-Dashboard-FileCard-input{display:inline-block;vertical-align:middle;width:78%}.uppy-Dashboard-FileCard-actions{align-items:center;background-color:#fafafa;border-top:1px solid #eaeaea;display:flex;flex-grow:0;flex-shrink:0;height:55px;padding:0 15px}.uppy-size--md .uppy-Dashboard-FileCard-actions{height:65px}[data-uppy-theme=dark] .uppy-Dashboard-FileCard-actions{background-color:#1f1f1f;border-top:1px solid #333}.uppy-Dashboard-FileCard-actionsBtn{margin-inline-end:10px}.uppy-Informer{bottom:60px;left:0;position:absolute;right:0;text-align:center;z-index:1005}.uppy-Informer span>div{margin-bottom:6px}.uppy-Informer-animated{opacity:0;transform:translateY(350%);transition:all .3s ease-in;z-index:-1000}.uppy-Informer p{background-color:#757575;border-radius:18px;color:#fff;display:inline-block;font-size:12px;font-weight:400;line-height:1.4;margin:0;max-width:90%;padding:6px 15px}.uppy-size--md .uppy-Informer p{font-size:14px;line-height:1.3;max-width:500px;padding:10px 20px}[data-uppy-theme=dark] .uppy-Informer p{background-color:#333}.uppy-Informer p span{background-color:#fff;border-radius:50%;color:#525252;display:inline-block;font-size:10px;height:13px;inset-inline-start:3px;line-height:12px;margin-inline-start:-1px;position:relative;top:-1px;vertical-align:middle;width:13px}.uppy-Informer p span:hover{cursor:help}.uppy-Informer p span:after{line-height:1.3;word-wrap:break-word}.uppy-Root [aria-label][role~=tooltip]{position:relative}.uppy-Root [aria-label][role~=tooltip]:after,.uppy-Root [aria-label][role~=tooltip]:before{backface-visibility:hidden;box-sizing:border-box;opacity:0;pointer-events:none;position:absolute;transform:translateZ(0);transform-origin:top;transition:all var(--microtip-transition-duration,.18s) var(--microtip-transition-easing,ease-in-out) var(--microtip-transition-delay,0s);will-change:transform;z-index:10}.uppy-Root [aria-label][role~=tooltip]:before{background-size:100% auto!important;content:""}.uppy-Root [aria-label][role~=tooltip]:after{background:#111111e6;border-radius:4px;box-sizing:initial;color:#fff;content:attr(aria-label);font-size:var(--microtip-font-size,13px);font-weight:var(--microtip-font-weight,normal);padding:.5em 1em;text-transform:var(--microtip-text-transform,none);white-space:nowrap}.uppy-Root [aria-label][role~=tooltip]:focus:after,.uppy-Root [aria-label][role~=tooltip]:focus:before,.uppy-Root [aria-label][role~=tooltip]:hover:after,.uppy-Root [aria-label][role~=tooltip]:hover:before{opacity:1;pointer-events:auto}.uppy-Root [role~=tooltip][data-microtip-position|=top]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(17, 17, 17, 0.9)' d='M2.658 0h32.004c-6 0-11.627 12.002-16.002 12.002S8.594 0 2.658 0'/%3E%3C/svg%3E") no-repeat;bottom:100%;height:6px;left:50%;margin-bottom:5px;transform:translate3d(-50%,0,0);width:18px}.uppy-Root [role~=tooltip][data-microtip-position|=top]:after{bottom:100%;left:50%;margin-bottom:11px;transform:translate3d(-50%,0,0)}.uppy-Root [role~=tooltip][data-microtip-position=top]:hover:after,.uppy-Root [role~=tooltip][data-microtip-position|=top]:hover:before{transform:translate3d(-50%,-5px,0)}.uppy-Root [role~=tooltip][data-microtip-position=top-left]:after{bottom:100%;transform:translate3d(calc(-100% + 16px),0,0)}.uppy-Root [role~=tooltip][data-microtip-position=top-left]:hover:after{transform:translate3d(calc(-100% + 16px),-5px,0)}.uppy-Root [role~=tooltip][data-microtip-position=top-right]:after{bottom:100%;transform:translate3d(-16px,0,0)}.uppy-Root [role~=tooltip][data-microtip-position=top-right]:hover:after{transform:translate3d(-16px,-5px,0)}.uppy-Root [role~=tooltip][data-microtip-position|=bottom]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(17, 17, 17, 0.9)' d='M33.342 12H1.338c6 0 11.627-12.002 16.002-12.002S27.406 12 33.342 12'/%3E%3C/svg%3E") no-repeat;bottom:auto;height:6px;left:50%;margin-bottom:0;margin-top:5px;top:100%;transform:translate3d(-50%,-10px,0);width:18px}.uppy-Root [role~=tooltip][data-microtip-position|=bottom]:after{left:50%;margin-top:11px;top:100%;transform:translate3d(-50%,-10px,0)}.uppy-Root [role~=tooltip][data-microtip-position=bottom]:hover:after,.uppy-Root [role~=tooltip][data-microtip-position|=bottom]:hover:before{transform:translate3d(-50%,0,0)}.uppy-Root [role~=tooltip][data-microtip-position=bottom-left]:after{top:100%;transform:translate3d(calc(-100% + 16px),-10px,0)}.uppy-Root [role~=tooltip][data-microtip-position=bottom-left]:hover:after{transform:translate3d(calc(-100% + 16px),0,0)}.uppy-Root [role~=tooltip][data-microtip-position=bottom-right]:after{top:100%;transform:translate3d(-16px,-10px,0)}.uppy-Root [role~=tooltip][data-microtip-position=bottom-right]:hover:after{transform:translate3d(-16px,0,0)}.uppy-Root [role~=tooltip][data-microtip-position=left]:after,.uppy-Root [role~=tooltip][data-microtip-position=left]:before{inset:50% 100% auto auto;transform:translate3d(10px,-50%,0)}.uppy-Root [role~=tooltip][data-microtip-position=left]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(17, 17, 17, 0.9)' d='M0 33.342V1.338c0 6 12.002 11.627 12.002 16.002S0 27.406 0 33.342'/%3E%3C/svg%3E") no-repeat;height:18px;margin-bottom:0;margin-right:5px;width:6px}.uppy-Root [role~=tooltip][data-microtip-position=left]:after{margin-right:11px}.uppy-Root [role~=tooltip][data-microtip-position=left]:hover:after,.uppy-Root [role~=tooltip][data-microtip-position=left]:hover:before{transform:translate3d(0,-50%,0)}.uppy-Root [role~=tooltip][data-microtip-position=right]:after,.uppy-Root [role~=tooltip][data-microtip-position=right]:before{bottom:auto;left:100%;top:50%;transform:translate3d(-10px,-50%,0)}.uppy-Root [role~=tooltip][data-microtip-position=right]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(17, 17, 17, 0.9)' d='M12 2.658v32.004c0-6-12.002-11.627-12.002-16.002S12 8.594 12 2.658'/%3E%3C/svg%3E") no-repeat;height:18px;margin-bottom:0;margin-left:5px;width:6px}.uppy-Root [role~=tooltip][data-microtip-position=right]:after{margin-left:11px}.uppy-Root [role~=tooltip][data-microtip-position=right]:hover:after,.uppy-Root [role~=tooltip][data-microtip-position=right]:hover:before{transform:translate3d(0,-50%,0)}.uppy-Root [role~=tooltip][data-microtip-size=small]:after{white-space:normal;width:80px}.uppy-Root [role~=tooltip][data-microtip-size=medium]:after{white-space:normal;width:150px}.uppy-Root [role~=tooltip][data-microtip-size=large]:after{white-space:normal;width:260px}.uppy-StatusBar{background-color:#fff;color:#fff;display:flex;font-size:12px;font-weight:400;height:46px;line-height:40px;position:relative;transition:height .2s;z-index:1001}[data-uppy-theme=dark] .uppy-StatusBar{background-color:#1f1f1f}.uppy-StatusBar:before{background-color:#eaeaea;content:"";height:2px;inset:0;position:absolute;width:100%}[data-uppy-theme=dark] .uppy-StatusBar:before{background-color:#757575}.uppy-StatusBar[aria-hidden=true]{height:0;overflow-y:hidden}.uppy-StatusBar.is-complete .uppy-StatusBar-progress{background-color:#1bb240}.uppy-StatusBar.is-error .uppy-StatusBar-progress{background-color:#e32437}.uppy-StatusBar.is-complete .uppy-StatusBar-statusIndicator{color:#1bb240}.uppy-StatusBar.is-error .uppy-StatusBar-statusIndicator{color:#e32437}.uppy-StatusBar:not([aria-hidden=true]).is-waiting{background-color:#fff;border-top:1px solid #eaeaea;height:65px}[data-uppy-theme=dark] .uppy-StatusBar:not([aria-hidden=true]).is-waiting{background-color:#1f1f1f;border-top:1px solid #333}.uppy-StatusBar-progress{background-color:#1269cf;height:2px;position:absolute;transition:background-color,width .3s ease-out;z-index:1001}.uppy-StatusBar-progress.is-indeterminate{animation:uppy-StatusBar-ProgressStripes 1s linear infinite;background-image:linear-gradient(45deg,#0000004d 25%,#0000 0 50%,#0000004d 0 75%,#0000 0,#0000);background-size:64px 64px}@keyframes uppy-StatusBar-ProgressStripes{0%{background-position:0 0}to{background-position:64px 0}}.uppy-StatusBar.is-postprocessing .uppy-StatusBar-progress,.uppy-StatusBar.is-preprocessing .uppy-StatusBar-progress{background-color:#f6a623}.uppy-StatusBar.is-waiting .uppy-StatusBar-progress{display:none}.uppy-StatusBar-content{align-items:center;color:#333;display:flex;height:100%;padding-inline-start:10px;position:relative;text-overflow:ellipsis;white-space:nowrap;z-index:1002}.uppy-size--md .uppy-StatusBar-content{padding-inline-start:15px}[data-uppy-theme=dark] .uppy-StatusBar-content{color:#eaeaea}.uppy-StatusBar-status{display:flex;flex-direction:column;font-weight:400;justify-content:center;line-height:1.4;padding-inline-end:.3em}.uppy-StatusBar-statusPrimary{display:flex;font-weight:500;line-height:1}.uppy-StatusBar-statusPrimary button.uppy-StatusBar-details{margin-left:5px}[data-uppy-theme=dark] .uppy-StatusBar-statusPrimary{color:#eaeaea}.uppy-StatusBar-statusSecondary{color:#757575;display:inline-block;font-size:11px;line-height:1.2;margin-top:1px;white-space:nowrap}[data-uppy-theme=dark] .uppy-StatusBar-statusSecondary{color:#bbb}.uppy-StatusBar-statusSecondaryHint{display:inline-block;line-height:1;margin-inline-end:5px;vertical-align:middle}.uppy-size--md .uppy-StatusBar-statusSecondaryHint{margin-inline-end:8px}.uppy-StatusBar-statusIndicator{color:#525252;margin-inline-end:7px;position:relative;top:1px}.uppy-StatusBar-statusIndicator svg{vertical-align:text-bottom}.uppy-StatusBar-actions{align-items:center;bottom:0;display:flex;inset-inline-end:10px;position:absolute;top:0;z-index:1004}.uppy-StatusBar.is-waiting .uppy-StatusBar-actions{background-color:#fafafa;height:100%;padding:0 15px;position:static;width:100%}[data-uppy-theme=dark] .uppy-StatusBar.is-waiting .uppy-StatusBar-actions{background-color:#1f1f1f}.uppy-StatusBar:not([aria-hidden=true]).is-waiting.has-ghosts{flex-direction:column;height:90px}.uppy-size--md .uppy-StatusBar:not([aria-hidden=true]).is-waiting.has-ghosts{flex-direction:row;height:65px}.uppy-StatusBar:not([aria-hidden=true]).is-waiting.has-ghosts .uppy-StatusBar-actions{flex-direction:column;justify-content:center}.uppy-size--md .uppy-StatusBar:not([aria-hidden=true]).is-waiting.has-ghosts .uppy-StatusBar-actions{flex-direction:row;justify-content:normal}.uppy-StatusBar-actionCircleBtn{cursor:pointer;line-height:1;margin:3px;opacity:.9}.uppy-StatusBar-actionCircleBtn:focus{outline:none}.uppy-StatusBar-actionCircleBtn::-moz-focus-inner{border:0}.uppy-StatusBar-actionCircleBtn:focus{box-shadow:0 0 0 3px #1269cf80}[data-uppy-theme=dark] .uppy-StatusBar-actionCircleBtn:focus{outline:none}[data-uppy-theme=dark] .uppy-StatusBar-actionCircleBtn::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-StatusBar-actionCircleBtn:focus{box-shadow:0 0 0 2px #aae1ffd9}.uppy-StatusBar-actionCircleBtn:hover{opacity:1}.uppy-StatusBar-actionCircleBtn:focus{border-radius:50%}.uppy-StatusBar-actionCircleBtn svg{vertical-align:bottom}.uppy-StatusBar-actionBtn{color:#1269cf;display:inline-block;font-size:10px;line-height:inherit;vertical-align:middle}.uppy-size--md .uppy-StatusBar-actionBtn{font-size:11px}.uppy-StatusBar-actionBtn--disabled{opacity:.4}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--disabled{opacity:.7}.uppy-StatusBar-actionBtn--retry{background-color:#ff4b23;border-radius:8px;color:#fff;height:16px;line-height:1;margin-inline-end:6px;padding:1px 6px 3px 18px;position:relative}.uppy-StatusBar-actionBtn--retry:focus{outline:none}.uppy-StatusBar-actionBtn--retry::-moz-focus-inner{border:0}.uppy-StatusBar-actionBtn--retry:focus{box-shadow:0 0 0 3px #1269cf80}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--retry:focus{outline:none}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--retry::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--retry:focus{box-shadow:0 0 0 2px #aae1ffd9}.uppy-StatusBar-actionBtn--retry:hover{background-color:#f92d00}.uppy-StatusBar-actionBtn--retry svg{inset-inline-start:6px;position:absolute;top:3px}.uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload{background-color:#1bb240;color:#fff;font-size:14px;line-height:1;padding:15px 10px;width:100%}.uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload:hover{background-color:#189c38}[data-uppy-theme=dark] .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload{background-color:#1c8b37}[data-uppy-theme=dark] .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload:hover{background-color:#18762f}.uppy-size--md .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload{padding:13px 22px;width:auto}.uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload.uppy-StatusBar-actionBtn--disabled:hover{background-color:#1bb240;cursor:not-allowed}[data-uppy-theme=dark] .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload.uppy-StatusBar-actionBtn--disabled:hover{background-color:#1c8b37}.uppy-StatusBar:not(.is-waiting) .uppy-StatusBar-actionBtn--upload{background-color:initial;color:#1269cf}.uppy-StatusBar-actionBtn--uploadNewlyAdded{border-radius:3px;padding-inline-end:3px;padding-bottom:1px;padding-inline-start:3px}.uppy-StatusBar-actionBtn--uploadNewlyAdded:focus{outline:none}.uppy-StatusBar-actionBtn--uploadNewlyAdded::-moz-focus-inner{border:0}.uppy-StatusBar-actionBtn--uploadNewlyAdded:focus{box-shadow:0 0 0 3px #1269cf80}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--uploadNewlyAdded:focus{outline:none}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--uploadNewlyAdded::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--uploadNewlyAdded:focus{box-shadow:0 0 0 2px #aae1ffd9}.uppy-StatusBar.is-postprocessing .uppy-StatusBar-actionBtn--uploadNewlyAdded,.uppy-StatusBar.is-preprocessing .uppy-StatusBar-actionBtn--uploadNewlyAdded{display:none}.uppy-StatusBar-actionBtn--done{border-radius:3px;line-height:1;padding:7px 8px}.uppy-StatusBar-actionBtn--done:focus{outline:none}.uppy-StatusBar-actionBtn--done::-moz-focus-inner{border:0}.uppy-StatusBar-actionBtn--done:hover{color:#0e51a0}.uppy-StatusBar-actionBtn--done:focus{background-color:#dfe6f1}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--done:focus{background-color:#333}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--done{color:#02baf2}.uppy-size--md .uppy-StatusBar-actionBtn--done{font-size:14px}.uppy-StatusBar-serviceMsg{color:#000;font-size:11px;line-height:1.1;padding-left:10px}.uppy-size--md .uppy-StatusBar-serviceMsg{font-size:14px;padding-left:15px}[data-uppy-theme=dark] .uppy-StatusBar-serviceMsg{color:#eaeaea}.uppy-StatusBar-serviceMsg-ghostsIcon{left:6px;opacity:.5;position:relative;top:2px;vertical-align:text-bottom;width:10px}.uppy-size--md .uppy-StatusBar-serviceMsg-ghostsIcon{left:10px;top:1px;width:15px}.uppy-StatusBar-details{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#939393;border-radius:50%;color:#fff;cursor:help;display:inline-block;font-size:10px;font-weight:600;height:13px;inset-inline-start:2px;line-height:12px;position:relative;text-align:center;top:0;vertical-align:middle;width:13px}.uppy-StatusBar-details:after{line-height:1.3;word-wrap:break-word}.uppy-StatusBar-spinner{animation-duration:1s;animation-iteration-count:infinite;animation-name:uppy-StatusBar-spinnerAnimation;animation-timing-function:linear;fill:#1269cf;margin-inline-end:10px}.uppy-StatusBar.is-postprocessing .uppy-StatusBar-spinner,.uppy-StatusBar.is-preprocessing .uppy-StatusBar-spinner{fill:#f6a623}@keyframes uppy-StatusBar-spinnerAnimation{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.uppy-transition-slideDownUp-enter{opacity:.01;transform:translate3d(0,-105%,0);transition:transform .25s ease-in-out,opacity .25s ease-in-out}.uppy-transition-slideDownUp-enter.uppy-transition-slideDownUp-enter-active{opacity:1;transform:translateZ(0)}.uppy-transition-slideDownUp-leave{opacity:1;transform:translateZ(0);transition:transform .25s ease-in-out,opacity .25s ease-in-out}.uppy-transition-slideDownUp-leave.uppy-transition-slideDownUp-leave-active{opacity:.01;transform:translate3d(0,-105%,0)}@keyframes uppy-Dashboard-fadeIn{0%{opacity:0}to{opacity:1}}@keyframes uppy-Dashboard-fadeOut{0%{opacity:1}to{opacity:0}}@keyframes uppy-Dashboard-slideDownAndFadeIn{0%{opacity:0;transform:translate3d(-50%,-70%,0)}to{opacity:1;transform:translate3d(-50%,-50%,0)}}@keyframes uppy-Dashboard-slideDownAndFadeIn--small{0%{opacity:0;transform:translate3d(0,-20%,0)}to{opacity:1;transform:translateZ(0)}}@keyframes uppy-Dashboard-slideUpFadeOut{0%{opacity:1;transform:translate3d(-50%,-50%,0)}to{opacity:0;transform:translate3d(-50%,-70%,0)}}@keyframes uppy-Dashboard-slideUpFadeOut--small{0%{opacity:1;transform:translateZ(0)}to{opacity:0;transform:translate3d(0,-20%,0)}}.uppy-Dashboard--modal{z-index:1001}.uppy-Dashboard--modal[aria-hidden=true]{display:none}.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose>.uppy-Dashboard-inner{animation:uppy-Dashboard-slideDownAndFadeIn--small .3s cubic-bezier(0,0,.2,1)}@media only screen and (min-width:820px){.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose>.uppy-Dashboard-inner{animation:uppy-Dashboard-slideDownAndFadeIn .3s cubic-bezier(0,0,.2,1)}}.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose>.uppy-Dashboard-overlay{animation:uppy-Dashboard-fadeIn .3s cubic-bezier(0,0,.2,1)}.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose.uppy-Dashboard--isClosing>.uppy-Dashboard-inner{animation:uppy-Dashboard-slideUpFadeOut--small .3s cubic-bezier(0,0,.2,1)}@media only screen and (min-width:820px){.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose.uppy-Dashboard--isClosing>.uppy-Dashboard-inner{animation:uppy-Dashboard-slideUpFadeOut .3s cubic-bezier(0,0,.2,1)}}.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose.uppy-Dashboard--isClosing>.uppy-Dashboard-overlay{animation:uppy-Dashboard-fadeOut .3s cubic-bezier(0,0,.2,1)}.uppy-Dashboard-isFixed{height:100vh;overflow:hidden}.uppy-Dashboard--modal .uppy-Dashboard-overlay{background-color:#00000080;inset:0;position:fixed;z-index:1001}.uppy-Dashboard-inner{background-color:#f4f4f4;border:1px solid #eaeaea;border-radius:5px;max-height:100%;max-width:100%;outline:none;position:relative}.uppy-size--md .uppy-Dashboard-inner{min-height:auto}@media only screen and (min-width:820px){.uppy-Dashboard-inner{height:500px;width:650px}}.uppy-Dashboard--modal .uppy-Dashboard-inner{z-index:1002}[data-uppy-theme=dark] .uppy-Dashboard-inner{background-color:#1f1f1f}.uppy-Dashboard--isDisabled .uppy-Dashboard-inner{cursor:not-allowed}.uppy-Dashboard-innerWrap{border-radius:5px;display:flex;flex-direction:column;height:100%;opacity:0;overflow:hidden;position:relative}.uppy-Dashboard--isInnerWrapVisible .uppy-Dashboard-innerWrap{opacity:1}.uppy-Dashboard--isDisabled .uppy-Dashboard-innerWrap{cursor:not-allowed;filter:grayscale(100%);opacity:.6;-webkit-user-select:none;-moz-user-select:none;user-select:none}.uppy-Dashboard--isDisabled .uppy-ProviderIconBg{fill:#9f9f9f}.uppy-Dashboard--isDisabled [aria-disabled],.uppy-Dashboard--isDisabled [disabled]{cursor:not-allowed;pointer-events:none}.uppy-Dashboard--modal .uppy-Dashboard-inner{border:none;inset:35px 15px 15px;position:fixed}@media only screen and (min-width:820px){.uppy-Dashboard--modal .uppy-Dashboard-inner{box-shadow:0 5px 15px 4px #00000026;left:50%;right:auto;top:50%;transform:translate(-50%,-50%)}}.uppy-Dashboard-close{color:#ffffffe6;cursor:pointer;display:block;font-size:27px;inset-inline-end:-2px;position:absolute;top:-33px;z-index:1005}.uppy-Dashboard-close:focus{outline:none}.uppy-Dashboard-close::-moz-focus-inner{border:0}.uppy-Dashboard-close:focus{color:#6eabf2}@media only screen and (min-width:820px){.uppy-Dashboard-close{font-size:35px;inset-inline-end:-35px;top:-10px}}.uppy-Dashboard-serviceMsg{background-color:#fffbf7;border-bottom:1px solid #edd4b9;border-top:1px solid #edd4b9;font-size:12px;font-weight:500;line-height:1.3;padding:12px 0;position:relative;top:-1px;z-index:1004}.uppy-size--md .uppy-Dashboard-serviceMsg{font-size:14px;line-height:1.4}[data-uppy-theme=dark] .uppy-Dashboard-serviceMsg{background-color:#1f1f1f;border-bottom:1px solid #333;border-top:1px solid #333;color:#eaeaea}.uppy-Dashboard-serviceMsg-title{display:block;line-height:1;margin-bottom:4px;padding-left:42px}.uppy-Dashboard-serviceMsg-text{padding:0 15px}.uppy-Dashboard-serviceMsg-actionBtn{color:#1269cf;font-size:inherit;font-weight:inherit;vertical-align:initial}[data-uppy-theme=dark] .uppy-Dashboard-serviceMsg-actionBtn{color:#02baf2e6}.uppy-Dashboard-serviceMsg-icon{left:15px;position:absolute;top:10px}.uppy-Dashboard-AddFiles{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;position:relative;text-align:center}[data-uppy-drag-drop-supported=true] .uppy-Dashboard-AddFiles{border:1px dashed #dfdfdf;border-radius:3px;height:calc(100% - 14px);margin:7px}.uppy-Dashboard-AddFilesPanel .uppy-Dashboard-AddFiles{border:none;height:calc(100% - 54px)}.uppy-Dashboard--modal .uppy-Dashboard-AddFiles{border-color:#cfcfcf}[data-uppy-theme=dark] .uppy-Dashboard-AddFiles{border-color:#757575}.uppy-Dashboard-AddFiles-info{display:none;margin-top:auto;padding-bottom:15px;padding-top:15px}.uppy-size--height-md .uppy-Dashboard-AddFiles-info{display:block}.uppy-size--md .uppy-Dashboard-AddFiles-info{bottom:25px;left:0;padding-bottom:0;padding-top:30px;position:absolute;right:0}[data-uppy-num-acquirers="0"] .uppy-Dashboard-AddFiles-info{margin-top:0}.uppy-Dashboard-browse{color:#1269cf;cursor:pointer}.uppy-Dashboard-browse:focus{outline:none}.uppy-Dashboard-browse::-moz-focus-inner{border:0}.uppy-Dashboard-browse:focus,.uppy-Dashboard-browse:hover{border-bottom:1px solid #1269cf}[data-uppy-theme=dark] .uppy-Dashboard-browse{color:#02baf2e6}[data-uppy-theme=dark] .uppy-Dashboard-browse:focus,[data-uppy-theme=dark] .uppy-Dashboard-browse:hover{border-bottom:1px solid #02baf2}.uppy-Dashboard-browseBtn{display:block;font-size:14px;font-weight:500;margin-bottom:5px;margin-top:8px;width:100%}.uppy-size--md .uppy-Dashboard-browseBtn{font-size:15px;margin:15px auto;padding:13px 44px;width:auto}.uppy-Dashboard-AddFiles-list{display:flex;flex:1;flex-direction:column;margin-top:2px;overflow-y:auto;padding:2px 0;width:100%;-webkit-overflow-scrolling:touch}.uppy-size--md .uppy-Dashboard-AddFiles-list{flex:none;flex-direction:row;flex-wrap:wrap;justify-content:center;margin-top:15px;max-width:600px;overflow-y:visible;padding-top:0}.uppy-DashboardTab{border-bottom:1px solid #eaeaea;text-align:center;width:100%}[data-uppy-theme=dark] .uppy-DashboardTab{border-bottom:1px solid #333}.uppy-size--md .uppy-DashboardTab{border-bottom:none;display:inline-block;margin-bottom:10px;width:auto}.uppy-DashboardTab-btn{align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:initial;color:#525252;cursor:pointer;flex-direction:row;height:100%;justify-content:left;padding:12px 15px;width:100%}.uppy-DashboardTab-btn:focus{outline:none}.uppy-size--md .uppy-DashboardTab-btn{border-radius:5px;flex-direction:column;margin-inline-end:1px;padding:10px 3px;width:86px}[data-uppy-theme=dark] .uppy-DashboardTab-btn{color:#eaeaea}.uppy-DashboardTab-btn::-moz-focus-inner{border:0}.uppy-DashboardTab-btn:hover{background-color:#e9ecef}[data-uppy-theme=dark] .uppy-DashboardTab-btn:hover{background-color:#333}.uppy-DashboardTab-btn:active,.uppy-DashboardTab-btn:focus{background-color:#dfe6f1}[data-uppy-theme=dark] .uppy-DashboardTab-btn:active,[data-uppy-theme=dark] .uppy-DashboardTab-btn:focus{background-color:#525252}.uppy-DashboardTab-btn svg{display:inline-block;max-height:100%;max-width:100%;overflow:hidden;transition:transform .15s ease-in-out;vertical-align:text-top}.uppy-DashboardTab-inner{align-items:center;background-color:#fff;border-radius:8px;box-shadow:0 1px 1px #0000001a,0 1px 2px #0000001a,0 2px 3px #00000005;display:flex;height:32px;justify-content:center;margin-inline-end:10px;width:32px}.uppy-size--md .uppy-DashboardTab-inner{margin-inline-end:0}[data-uppy-theme=dark] .uppy-DashboardTab-inner{background-color:#323232;box-shadow:0 1px 1px #0003,0 1px 2px #0003,0 2px 3px #00000014}.uppy-DashboardTab-name{font-size:14px;font-weight:400}.uppy-size--md .uppy-DashboardTab-name{font-size:12px;line-height:15px;margin-bottom:0;margin-top:8px}.uppy-DashboardTab-iconMyDevice{color:#1269cf}[data-uppy-theme=dark] .uppy-DashboardTab-iconMyDevice{color:#02baf2}.uppy-DashboardTab-iconBox{color:#0061d5}[data-uppy-theme=dark] .uppy-DashboardTab-iconBox{color:#eaeaea}.uppy-DashboardTab-iconDropbox{color:#0061fe}[data-uppy-theme=dark] .uppy-DashboardTab-iconDropbox{color:#eaeaea}.uppy-DashboardTab-iconUnsplash{color:#111}[data-uppy-theme=dark] .uppy-DashboardTab-iconUnsplash{color:#eaeaea}.uppy-DashboardTab-iconWebdav{color:#111}[data-uppy-theme=dark] .uppy-DashboardTab-iconWebdav{color:#eaeaea}.uppy-DashboardTab-iconScreenRec{color:#2c3e50}[data-uppy-theme=dark] .uppy-DashboardTab-iconScreenRec{color:#eaeaea}.uppy-DashboardTab-iconAudio{color:#8030a3}[data-uppy-theme=dark] .uppy-DashboardTab-iconAudio{color:#bf6ee3}.uppy-Dashboard-input{height:.1px;opacity:0;overflow:hidden;position:absolute;width:.1px;z-index:-1}.uppy-DashboardContent-bar{align-items:center;background-color:#fafafa;border-bottom:1px solid #eaeaea;display:flex;flex-shrink:0;height:40px;justify-content:space-between;padding:0 10px;position:relative;width:100%;z-index:1004}.uppy-size--md .uppy-DashboardContent-bar{height:50px;padding:0 15px}[data-uppy-theme=dark] .uppy-DashboardContent-bar{background-color:#1f1f1f;border-bottom:1px solid #333}.uppy-DashboardContent-title{font-size:12px;font-weight:500;left:0;line-height:40px;margin:auto;max-width:170px;overflow-x:hidden;position:absolute;right:0;text-align:center;text-overflow:ellipsis;top:0;white-space:nowrap;width:100%}.uppy-size--md .uppy-DashboardContent-title{font-size:14px;line-height:50px;max-width:300px}[data-uppy-theme=dark] .uppy-DashboardContent-title{color:#eaeaea}.uppy-DashboardContent-back,.uppy-DashboardContent-save{-webkit-appearance:none;background:none;border:0;border-radius:3px;color:inherit;color:#1269cf;cursor:pointer;font-family:inherit;font-size:inherit;font-size:12px;font-weight:400;line-height:1;margin:0;margin-inline-start:-6px;padding:7px 6px}.uppy-DashboardContent-back:focus,.uppy-DashboardContent-save:focus{outline:none}.uppy-DashboardContent-back::-moz-focus-inner,.uppy-DashboardContent-save::-moz-focus-inner{border:0}.uppy-DashboardContent-back:hover,.uppy-DashboardContent-save:hover{color:#0e51a0}.uppy-DashboardContent-back:focus,.uppy-DashboardContent-save:focus{background-color:#dfe6f1}[data-uppy-theme=dark] .uppy-DashboardContent-back:focus,[data-uppy-theme=dark] .uppy-DashboardContent-save:focus{background-color:#333}.uppy-size--md .uppy-DashboardContent-back,.uppy-size--md .uppy-DashboardContent-save{font-size:14px}[data-uppy-theme=dark] .uppy-DashboardContent-back,[data-uppy-theme=dark] .uppy-DashboardContent-save{color:#02baf2}.uppy-DashboardContent-addMore{-webkit-appearance:none;background:none;border:0;border-radius:3px;color:inherit;color:#1269cf;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:500;height:29px;line-height:1;margin:0;margin-inline-end:-5px;padding:7px 8px;width:29px}.uppy-DashboardContent-addMore:focus{outline:none}.uppy-DashboardContent-addMore::-moz-focus-inner{border:0}.uppy-DashboardContent-addMore:hover{color:#0e51a0}.uppy-DashboardContent-addMore:focus{background-color:#dfe6f1}[data-uppy-theme=dark] .uppy-DashboardContent-addMore:focus{background-color:#333}.uppy-size--md .uppy-DashboardContent-addMore{font-size:14px;height:auto;margin-inline-end:-8px;width:auto}[data-uppy-theme=dark] .uppy-DashboardContent-addMore{color:#02baf2}.uppy-DashboardContent-addMore svg{margin-inline-end:4px;vertical-align:initial}.uppy-size--md .uppy-DashboardContent-addMore svg{height:11px;width:11px}.uppy-DashboardContent-addMoreCaption{display:none}.uppy-size--md .uppy-DashboardContent-addMoreCaption{display:inline}.uppy-DashboardContent-panel{background-color:#f5f5f5;flex:1}.uppy-Dashboard-AddFilesPanel,.uppy-DashboardContent-panel{border-radius:5px;display:flex;flex-direction:column;inset:0;overflow:hidden;position:absolute;z-index:1005}.uppy-Dashboard-AddFilesPanel{background:#fafafa;background:linear-gradient(0deg,#fafafa 35%,#fafafad9);box-shadow:0 0 10px 5px #00000026}[data-uppy-theme=dark] .uppy-Dashboard-AddFilesPanel{background-color:#333;background-image:linear-gradient(0deg,#1f1f1f 35%,#1f1f1fd9)}.uppy-Dashboard--isAddFilesPanelVisible .uppy-Dashboard-files{filter:blur(2px)}.uppy-Dashboard-progress{bottom:0;height:12%;left:0;position:absolute;width:100%}.uppy-Dashboard-progressBarContainer.is-active{height:100%;left:0;position:absolute;top:0;width:100%;z-index:1004}.uppy-Dashboard-filesContainer{flex:1;margin:0;overflow-y:hidden;position:relative}.uppy-Dashboard-filesContainer:after{clear:both;content:"";display:table}.uppy-Dashboard-files{flex:1;margin:0;overflow-y:auto;padding:0 0 10px;-webkit-overflow-scrolling:touch}.uppy-size--md .uppy-Dashboard-files{padding-top:10px}.uppy-Dashboard--singleFile .uppy-Dashboard-filesInner{align-items:center;display:flex;height:100%;justify-content:center}.uppy-Dashboard-dropFilesHereHint{align-items:center;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath fill='%231269CF' d='M24 1v1C11.85 2 2 11.85 2 24s9.85 22 22 22 22-9.85 22-22S36.15 2 24 2zm0 0V0c13.254 0 24 10.746 24 24S37.254 48 24 48 0 37.254 0 24 10.746 0 24 0zm7.707 19.293a.999.999 0 1 1-1.414 1.414L25 16.414V34a1 1 0 1 1-2 0V16.414l-5.293 5.293a.999.999 0 1 1-1.414-1.414l7-7a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E");background-position:50% 50%;background-repeat:no-repeat;border:1px dashed #1269cf;border-radius:3px;color:#757575;display:flex;font-size:16px;justify-content:center;inset:7px;padding-top:90px;position:absolute;text-align:center;visibility:hidden;z-index:2000}[data-uppy-theme=dark] .uppy-Dashboard-dropFilesHereHint{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath fill='%2302BAF2' d='M24 1v1C11.85 2 2 11.85 2 24s9.85 22 22 22 22-9.85 22-22S36.15 2 24 2zm0 0V0c13.254 0 24 10.746 24 24S37.254 48 24 48 0 37.254 0 24 10.746 0 24 0zm7.707 19.293a.999.999 0 1 1-1.414 1.414L25 16.414V34a1 1 0 1 1-2 0V16.414l-5.293 5.293a.999.999 0 1 1-1.414-1.414l7-7a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E");border-color:#02baf2;color:#bbb}.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-Dashboard-dropFilesHereHint{pointer-events:none;visibility:visible}.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-Dashboard-files,.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-Dashboard-progressindicators,.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-Dashboard-serviceMsg,.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-DashboardContent-bar{opacity:.15}.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-Dashboard-AddFiles{opacity:.03}.uppy-Dashboard-AddFiles-title{color:#000;font-size:17px;font-weight:500;line-height:1.35;margin-bottom:5px;margin-top:15px;padding:0 15px;text-align:inline-start;width:100%}.uppy-size--md .uppy-Dashboard-AddFiles-title{font-size:21px;font-weight:400;margin-top:5px;max-width:480px;padding:0 35px;text-align:center}[data-uppy-num-acquirers="0"] .uppy-Dashboard-AddFiles-title{text-align:center}[data-uppy-theme=dark] .uppy-Dashboard-AddFiles-title{color:#eaeaea}.uppy-Dashboard-AddFiles-title button{font-weight:500}.uppy-size--md .uppy-Dashboard-AddFiles-title button{font-weight:400}.uppy-Dashboard-note{color:#757575;font-size:14px;line-height:1.25;margin:auto;max-width:350px;padding:0 15px;text-align:center}.uppy-size--md .uppy-Dashboard-note{line-height:1.35;max-width:600px}[data-uppy-theme=dark] .uppy-Dashboard-note{color:#cfcfcf}a.uppy-Dashboard-poweredBy{color:#939393;display:inline-block;font-size:11px;margin-top:8px;text-align:center;text-decoration:none}.uppy-Dashboard-poweredByIcon{margin-left:1px;margin-right:1px;opacity:.9;position:relative;top:1px;vertical-align:text-top;fill:none;stroke:#939393}.uppy-Dashboard-Item-previewIcon{height:25px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:25px;z-index:100}.uppy-size--md .uppy-Dashboard-Item-previewIcon{height:38px;width:38px}.uppy-Dashboard-Item-previewIcon svg{height:100%;width:100%}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-previewIcon{height:100%;max-height:60%;max-width:60%;width:100%}.uppy-Dashboard-Item-previewIconWrap{height:76px;max-height:75%;position:relative}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-previewIconWrap{height:100%;width:100%}.uppy-Dashboard-Item-previewIconBg{filter:drop-shadow(rgba(0,0,0,.1) 0 1px 1px);height:100%;width:100%}.uppy-Dashboard-upload{height:50px;position:relative;width:50px}.uppy-size--md .uppy-Dashboard-upload{height:60px;width:60px}.uppy-Dashboard-upload .uppy-c-icon{position:relative;top:1px;width:50%}.uppy-Dashboard-uploadCount{background-color:#1bb240;border-radius:50%;color:#fff;font-size:8px;height:16px;inset-inline-end:-12px;line-height:16px;position:absolute;top:-12px;width:16px}.uppy-size--md .uppy-Dashboard-uploadCount{font-size:9px;height:18px;line-height:18px;width:18px}.uppy-Dashboard-inner{border:none!important;background:transparent!important}.uppy-Dashboard-innerWrap{border-radius:.5rem;overflow:hidden}.uppy-Dashboard-AddFiles{border:2px dashed hsl(var(--border))!important;border-radius:.5rem!important;background:hsl(var(--muted) / .3)!important;transition:all .2s ease}.uppy-Dashboard-AddFiles:hover{border-color:hsl(var(--primary))!important;background:hsl(var(--muted) / .5)!important}.uppy-Dashboard-AddFiles-title{color:hsl(var(--foreground))!important;font-weight:500!important}.uppy-Dashboard-AddFiles-info{color:hsl(var(--muted-foreground))!important}.uppy-Dashboard-browse{color:hsl(var(--primary))!important;font-weight:500!important}.uppy-Dashboard-browse:hover{text-decoration:underline!important}.uppy-Dashboard-files{background:transparent!important}.uppy-Dashboard-Item{border-bottom-color:hsl(var(--border))!important}.uppy-Dashboard-Item-name{color:hsl(var(--foreground))!important}.uppy-Dashboard-Item-status{color:hsl(var(--muted-foreground))!important}.uppy-StatusBar{background:hsl(var(--muted))!important;border-top:1px solid hsl(var(--border))!important}.uppy-StatusBar-progress{background:hsl(var(--primary))!important}.uppy-StatusBar-content{color:hsl(var(--foreground))!important}.uppy-StatusBar-actionBtn--upload{background:hsl(var(--primary))!important;color:hsl(var(--primary-foreground))!important;border-radius:.375rem!important;font-weight:500!important;padding:.5rem 1rem!important}.uppy-StatusBar-actionBtn--upload:hover{background:hsl(var(--primary) / .9)!important}.uppy-Dashboard-note{color:hsl(var(--muted-foreground))!important;font-size:.75rem!important}[data-uppy-theme=dark] .uppy-Dashboard-AddFiles,.dark .uppy-Dashboard-AddFiles{background:hsl(var(--muted) / .2)!important}[data-uppy-theme=dark] .uppy-Dashboard-AddFiles-title,.dark .uppy-Dashboard-AddFiles-title{color:hsl(var(--foreground))!important}[data-uppy-theme=dark] .uppy-StatusBar,.dark .uppy-StatusBar{background:hsl(var(--muted) / .5)!important}.uppy-Dashboard{font-family:inherit!important}.uppy-Dashboard-Item-preview{border-radius:.375rem!important;overflow:hidden}.uppy-Dashboard-Item-action--remove{color:hsl(var(--destructive))!important}.uppy-Dashboard-Item-action--remove:hover{opacity:.8}.uppy-Dashboard-Item.is-complete .uppy-Dashboard-Item-progress{color:hsl(var(--success, 142 76% 36%))!important}.uppy-Dashboard-Item.is-error .uppy-Dashboard-Item-progress{color:hsl(var(--destructive))!important}.uppy-Dashboard-files::-webkit-scrollbar{width:6px}.uppy-Dashboard-files::-webkit-scrollbar-track{background:transparent}.uppy-Dashboard-files::-webkit-scrollbar-thumb{background:hsl(var(--muted-foreground) / .3);border-radius:3px}.uppy-Dashboard-files::-webkit-scrollbar-thumb:hover{background:hsl(var(--muted-foreground) / .5)}@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2) format("woff2"),url(/assets/KaTeX_AMS-Regular-DMm9YOAa.woff) format("woff"),url(/assets/KaTeX_AMS-Regular-DRggAlZN.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff) format("woff"),url(/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff) format("woff"),url(/assets/KaTeX_Fraktur-Regular-CB_wures.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Main-Bold-Cx986IdX.woff2) format("woff2"),url(/assets/KaTeX_Main-Bold-Jm3AIy58.woff) format("woff"),url(/assets/KaTeX_Main-Bold-waoOVXN0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2) format("woff2"),url(/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff) format("woff"),url(/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2) format("woff2"),url(/assets/KaTeX_Main-Italic-BMLOBm91.woff) format("woff"),url(/assets/KaTeX_Main-Italic-3WenGoN9.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Main-Regular-B22Nviop.woff2) format("woff2"),url(/assets/KaTeX_Main-Regular-Dr94JaBh.woff) format("woff"),url(/assets/KaTeX_Main-Regular-ypZvNtVU.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2) format("woff2"),url(/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff) format("woff"),url(/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Math-Italic-t53AETM-.woff2) format("woff2"),url(/assets/KaTeX_Math-Italic-DA0__PXp.woff) format("woff"),url(/assets/KaTeX_Math-Italic-flOr_0UB.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff) format("woff"),url(/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff) format("woff"),url(/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff) format("woff"),url(/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Script-Regular-D3wIWfF6.woff2) format("woff2"),url(/assets/KaTeX_Script-Regular-D5yQViql.woff) format("woff"),url(/assets/KaTeX_Script-Regular-C5JkGWo-.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2) format("woff2"),url(/assets/KaTeX_Size1-Regular-C195tn64.woff) format("woff"),url(/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2) format("woff2"),url(/assets/KaTeX_Size2-Regular-oD1tc_U0.woff) format("woff"),url(/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC) format("woff2"),url(/assets/KaTeX_Size3-Regular-CTq5MqoE.woff) format("woff"),url(/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2) format("woff2"),url(/assets/KaTeX_Size4-Regular-BF-4gkZK.woff) format("woff"),url(/assets/KaTeX_Size4-Regular-DWFBv043.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2) format("woff2"),url(/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff) format("woff"),url(/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf) format("truetype")}.katex{font: 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.25"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}.react-flow{direction:ltr}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;cursor:grab}.react-flow__pane.selection{cursor:pointer}.react-flow__pane.dragging{cursor:grabbing}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow .react-flow__edges{pointer-events:none;overflow:visible}.react-flow__edge-path,.react-flow__connection-path{stroke:#b1b1b7;stroke-width:1;fill:none}.react-flow__edge{pointer-events:visibleStroke;cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge:focus .react-flow__edge-path,.react-flow__edge:focus-visible .react-flow__edge-path{stroke:#555}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge-textbg{fill:#fff}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__connectionline{z-index:1001}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:grab}.react-flow__node.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background:#1a192b;border:1px solid white;border-radius:100%}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:-4px;transform:translate(-50%)}.react-flow__handle-top{left:50%;top:-4px;transform:translate(-50%)}.react-flow__handle-left{top:50%;left:-4px;transform:translateY(-50%)}.react-flow__handle-right{right:-4px;top:50%;transform:translateY(-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.center{left:50%;transform:translate(-50%)}.react-flow__attribution{font-size:10px;background:#ffffff80;padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-default,.react-flow__node-input,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:3px;width:150px;font-size:12px;color:#222;text-align:center;border-width:1px;border-style:solid;border-color:#1a192b;background-color:#fff}.react-flow__node-default.selectable:hover,.react-flow__node-input.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:0 1px 4px 1px #00000014}.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:0 0 0 .5px #1a192b}.react-flow__node-group{background-color:#f0f0f040}.react-flow__nodesselection-rect,.react-flow__selection{background:#0059dc14;border:1px dotted rgba(0,89,220,.8)}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls{box-shadow:0 0 2px 1px #00000014}.react-flow__controls-button{border:none;background:#fefefe;border-bottom:1px solid #eee;box-sizing:content-box;display:flex;justify-content:center;align-items:center;width:16px;height:16px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:5px}.react-flow__controls-button:hover{background:#f4f4f4}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__minimap{background-color:#fff}.react-flow__minimap svg{display:block}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:4px;height:4px;border:1px solid #fff;border-radius:1px;background-color:#3367d9;transform:translate(-50%,-50%)}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:#3367d9;border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%} diff --git a/webui/dist/assets/index-CnFGj4Iv.js b/webui/dist/assets/index-CnFGj4Iv.js deleted file mode 100644 index e6aa6582..00000000 --- a/webui/dist/assets/index-CnFGj4Iv.js +++ /dev/null @@ -1,407 +0,0 @@ -import{r as b,j as o,L as rv,u as na,R as oe,c as sv,b as ya,d as yJ,e as bJ,f as wJ,g as SJ,h as ps,k as kJ,l as OJ,O as Hz,m as jJ}from"./router-DQNkr8RI.js";import{a as NJ,b as CJ,g as yd}from"./react-vendor-Dtc2IqVY.js";import{c as Qz,R as TJ,T as EJ,L as _J,a as AJ,C as Kx,X as Zx,Y as Pm,b as MJ,B as S4,d as Jx,P as RJ,e as DJ,f as PJ,_ as zJ,g as IJ,h as Ge,i as LJ,j as k9,k as BJ,l as O9,m as FJ,n as qJ,o as $J,r as Vz,p as HJ,q as wj,s as Uz,t as bd,u as Sj,v as QJ,w as VJ,x as Wz,y as Gz,z as Xz,A as kj,D as Oj,E as jj,F as UJ,G as WJ,H as GJ,I as XJ,J as YJ,K as KJ,M as ZJ,N as Nj,O as $y,Q as JJ,S as eee,U as Cj,V as tee,W as nee,Z as Yz,$ as Kz,a0 as Zz,a1 as Jz,a2 as Hy,a3 as eI,a4 as tI,a5 as ree,a6 as see,a7 as iee,a8 as aee,a9 as oee,aa as lee,ab as cee,ac as uee,ad as nI,ae as rI,af as dee,ag as hee,ah as fee,ai as mee,aj as pee,ak as gee,al as xee,am as vee,an as yee,ao as bee,ap as wee,aq as See,ar as kee,as as Oee,at as jee,au as Nee}from"./charts-Cdq_Jxe7.js";import{c as Da,a as Qy,u as Gi,P as Sn,b as nt,d as er,e as Rp,f as Kl,g as Rs,h as oi,i as Wh,j as Tj,k as Vy,S as Cee,l as sI,m as iI,R as aI,O as Uy,n as Ej,C as Wy,o as Gy,T as _j,D as Aj,p as Mj,q as oI,r as lI,W as Tee,s as cI,I as Eee,t as uI,v as dI,w as _ee,x as hI,V as Aee,L as fI,y as mI,z as Mee,A as Ree,B as pI,E as Dee,F as Pee,G as Gc,H as Xy,J as vf,K as gI,M as xI,N as vI,Q as yI,U as Rj,X as Dj,Y as Yy,Z as Ky,_ as Pj,$ as bI,a0 as zee,a1 as wI,a2 as Iee,a3 as Lee,a4 as SI,a5 as Bee}from"./ui-vendor-BgfqR_Xz.js";import{R as Qs,P as Dp,C as Ya,a as Lo,Z as Zu,b as zj,F as Po,c as Fee,S as Vc,A as qee,D as $ee,d as sk,e as Mh,M as Gh,T as Hee,X as Pp,f as kI,g as Qee,I as Xi,h as Ga,i as zo,j as Iv,E as I0,k as Ji,l as OI,m as ik,n as ak,L as j9,K as jI,o as Zy,p as Vee,q as w0,r as Us,s as Uee,B as o0,U as Lv,t as Ij,u as Wee,v as Gee,w as ii,H as L0,x as Bv,y as Xc,z as B0,G as Xee,J as Yee,N as zp,O as Is,Q as Cn,V as Fv,W as Ju,Y as Ip,_ as wd,$ as Zl,a0 as Lp,a1 as Lj,a2 as Kee,a3 as Zee,a4 as Jee,a5 as ed,a6 as N9,a7 as ete,a8 as td,a9 as ok,aa as F0,ab as tte,ac as lk,ad as nte,ae as NI,af as C9,ag as rte,ah as ste,ai as ite,aj as Dc,ak as k4,al as T9,am as ate,an as ote,ao as lte,ap as cte,aq as ute,ar as CI,as as TI,at as EI,au as dte,av as hte,aw as E9,ax as fte,ay as mte,az as _9,aA as pte,aB as gte}from"./icons-CqUsKJFR.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var O4={exports:{}},zm={},j4={exports:{}},N4={};var A9;function xte(){return A9||(A9=1,(function(t){function e(L,$){var K=L.length;L.push($);e:for(;0>>1,R=L[Y];if(0>>1;Ys(z,K))Us(te,z)?(L[Y]=te,L[U]=K,Y=U):(L[Y]=z,L[X]=K,Y=X);else if(Us(te,K))L[Y]=te,L[U]=K,Y=U;else break e}}return $}function s(L,$){var K=L.sortIndex-$.sortIndex;return K!==0?K:L.id-$.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var c=[],d=[],h=1,m=null,g=3,x=!1,y=!1,w=!1,S=!1,k=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function T(L){for(var $=n(d);$!==null;){if($.callback===null)r(d);else if($.startTime<=L)r(d),$.sortIndex=$.expirationTime,e(c,$);else break;$=n(d)}}function E(L){if(w=!1,T(L),!y)if(n(c)!==null)y=!0,_||(_=!0,W());else{var $=n(d);$!==null&&V(E,$.startTime-L)}}var _=!1,A=-1,D=5,q=-1;function B(){return S?!0:!(t.unstable_now()-qL&&B());){var Y=m.callback;if(typeof Y=="function"){m.callback=null,g=m.priorityLevel;var R=Y(m.expirationTime<=L);if(L=t.unstable_now(),typeof R=="function"){m.callback=R,T(L),$=!0;break t}m===n(c)&&r(c),T(L)}else r(c);m=n(c)}if(m!==null)$=!0;else{var ie=n(d);ie!==null&&V(E,ie.startTime-L),$=!1}}break e}finally{m=null,g=K,x=!1}$=void 0}}finally{$?W():_=!1}}}var W;if(typeof N=="function")W=function(){N(H)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,I=ee.port2;ee.port1.onmessage=H,W=function(){I.postMessage(null)}}else W=function(){k(H,0)};function V(L,$){A=k(function(){L(t.unstable_now())},$)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(L){L.callback=null},t.unstable_forceFrameRate=function(L){0>L||125Y?(L.sortIndex=K,e(d,L),n(c)===null&&L===n(d)&&(w?(j(A),A=-1):w=!0,V(E,K-Y))):(L.sortIndex=R,e(c,L),y||x||(y=!0,_||(_=!0,W()))),L},t.unstable_shouldYield=B,t.unstable_wrapCallback=function(L){var $=g;return function(){var K=g;g=$;try{return L.apply(this,arguments)}finally{g=K}}}})(N4)),N4}var M9;function vte(){return M9||(M9=1,j4.exports=xte()),j4.exports}var R9;function yte(){if(R9)return zm;R9=1;var t=vte(),e=NJ(),n=CJ();function r(u){var f="https://react.dev/errors/"+u;if(1R||(u.current=Y[R],Y[R]=null,R--)}function z(u,f){R++,Y[R]=u.current,u.current=f}var U=ie(null),te=ie(null),ne=ie(null),G=ie(null);function se(u,f){switch(z(ne,f),z(te,u),z(U,null),f.nodeType){case 9:case 11:u=(u=f.documentElement)&&(u=u.namespaceURI)?UT(u):0;break;default:if(u=f.tagName,f=f.namespaceURI)f=UT(f),u=WT(f,u);else switch(u){case"svg":u=1;break;case"math":u=2;break;default:u=0}}X(U),z(U,u)}function re(){X(U),X(te),X(ne)}function ae(u){u.memoizedState!==null&&z(G,u);var f=U.current,p=WT(f,u.type);f!==p&&(z(te,u),z(U,p))}function _e(u){te.current===u&&(X(U),X(te)),G.current===u&&(X(G),Am._currentValue=K)}var Be,Ye;function Je(u){if(Be===void 0)try{throw Error()}catch(p){var f=p.stack.trim().match(/\n( *(at )?)/);Be=f&&f[1]||"",Ye=-1)":-1O||de[v]!==Se[O]){var Te=` -`+de[v].replace(" at new "," at ");return u.displayName&&Te.includes("")&&(Te=Te.replace("",u.displayName)),Te}while(1<=v&&0<=O);break}}}finally{Oe=!1,Error.prepareStackTrace=p}return(p=u?u.displayName||u.name:"")?Je(p):""}function Ue(u,f){switch(u.tag){case 26:case 27:case 5:return Je(u.type);case 16:return Je("Lazy");case 13:return u.child!==f&&f!==null?Je("Suspense Fallback"):Je("Suspense");case 19:return Je("SuspenseList");case 0:case 15:return Ve(u.type,!1);case 11:return Ve(u.type.render,!1);case 1:return Ve(u.type,!0);case 31:return Je("Activity");default:return""}}function $e(u){try{var f="",p=null;do f+=Ue(u,p),p=u,u=u.return;while(u);return f}catch(v){return` -Error generating stack: `+v.message+` -`+v.stack}}var jt=Object.prototype.hasOwnProperty,vt=t.unstable_scheduleCallback,$n=t.unstable_cancelCallback,qt=t.unstable_shouldYield,un=t.unstable_requestPaint,Mt=t.unstable_now,ct=t.unstable_getCurrentPriorityLevel,Ne=t.unstable_ImmediatePriority,ze=t.unstable_UserBlockingPriority,rt=t.unstable_NormalPriority,bt=t.unstable_LowPriority,zt=t.unstable_IdlePriority,Rt=t.log,Hn=t.unstable_setDisableYieldValue,We=null,ot=null;function dn(u){if(typeof Rt=="function"&&Hn(u),ot&&typeof ot.setStrictMode=="function")try{ot.setStrictMode(We,u)}catch{}}var Pt=Math.clz32?Math.clz32:rn,xn=Math.log,dt=Math.LN2;function rn(u){return u>>>=0,u===0?32:31-(xn(u)/dt|0)|0}var wt=256,Wt=262144,Gt=4194304;function lt(u){var f=u&42;if(f!==0)return f;switch(u&-u){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return u&261888;case 262144:case 524288:case 1048576:case 2097152:return u&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return u&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return u}}function ve(u,f,p){var v=u.pendingLanes;if(v===0)return 0;var O=0,C=u.suspendedLanes,F=u.pingedLanes;u=u.warmLanes;var Z=v&134217727;return Z!==0?(v=Z&~C,v!==0?O=lt(v):(F&=Z,F!==0?O=lt(F):p||(p=Z&~u,p!==0&&(O=lt(p))))):(Z=v&~C,Z!==0?O=lt(Z):F!==0?O=lt(F):p||(p=v&~u,p!==0&&(O=lt(p)))),O===0?0:f!==0&&f!==O&&(f&C)===0&&(C=O&-O,p=f&-f,C>=p||C===32&&(p&4194048)!==0)?f:O}function He(u,f){return(u.pendingLanes&~(u.suspendedLanes&~u.pingedLanes)&f)===0}function ht(u,f){switch(u){case 1:case 2:case 4:case 8:case 64:return f+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function vn(){var u=Gt;return Gt<<=1,(Gt&62914560)===0&&(Gt=4194304),u}function Qn(u){for(var f=[],p=0;31>p;p++)f.push(u);return f}function fr(u,f){u.pendingLanes|=f,f!==268435456&&(u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0)}function ar(u,f,p,v,O,C){var F=u.pendingLanes;u.pendingLanes=p,u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0,u.expiredLanes&=p,u.entangledLanes&=p,u.errorRecoveryDisabledLanes&=p,u.shellSuspendCounter=0;var Z=u.entanglements,de=u.expirationTimes,Se=u.hiddenUpdates;for(p=F&~p;0"u")return null;try{return u.activeElement||u.body}catch{return u.body}}var fK=/[\n"\\]/g;function ia(u){return u.replace(fK,function(f){return"\\"+f.charCodeAt(0).toString(16)+" "})}function gw(u,f,p,v,O,C,F,Z){u.name="",F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?u.type=F:u.removeAttribute("type"),f!=null?F==="number"?(f===0&&u.value===""||u.value!=f)&&(u.value=""+sa(f)):u.value!==""+sa(f)&&(u.value=""+sa(f)):F!=="submit"&&F!=="reset"||u.removeAttribute("value"),f!=null?xw(u,F,sa(f)):p!=null?xw(u,F,sa(p)):v!=null&&u.removeAttribute("value"),O==null&&C!=null&&(u.defaultChecked=!!C),O!=null&&(u.checked=O&&typeof O!="function"&&typeof O!="symbol"),Z!=null&&typeof Z!="function"&&typeof Z!="symbol"&&typeof Z!="boolean"?u.name=""+sa(Z):u.removeAttribute("name")}function F7(u,f,p,v,O,C,F,Z){if(C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(u.type=C),f!=null||p!=null){if(!(C!=="submit"&&C!=="reset"||f!=null)){pw(u);return}p=p!=null?""+sa(p):"",f=f!=null?""+sa(f):p,Z||f===u.value||(u.value=f),u.defaultValue=f}v=v??O,v=typeof v!="function"&&typeof v!="symbol"&&!!v,u.checked=Z?u.checked:!!v,u.defaultChecked=!!v,F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"&&(u.name=F),pw(u)}function xw(u,f,p){f==="number"&&qg(u.ownerDocument)===u||u.defaultValue===""+p||(u.defaultValue=""+p)}function Td(u,f,p,v){if(u=u.options,f){f={};for(var O=0;O"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sw=!1;if(sl)try{var Xf={};Object.defineProperty(Xf,"passive",{get:function(){Sw=!0}}),window.addEventListener("test",Xf,Xf),window.removeEventListener("test",Xf,Xf)}catch{Sw=!1}var ic=null,kw=null,Hg=null;function W7(){if(Hg)return Hg;var u,f=kw,p=f.length,v,O="value"in ic?ic.value:ic.textContent,C=O.length;for(u=0;u=Zf),J7=" ",eC=!1;function tC(u,f){switch(u){case"keyup":return qK.indexOf(f.keyCode)!==-1;case"keydown":return f.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nC(u){return u=u.detail,typeof u=="object"&&"data"in u?u.data:null}var Md=!1;function HK(u,f){switch(u){case"compositionend":return nC(f);case"keypress":return f.which!==32?null:(eC=!0,J7);case"textInput":return u=f.data,u===J7&&eC?null:u;default:return null}}function QK(u,f){if(Md)return u==="compositionend"||!Tw&&tC(u,f)?(u=W7(),Hg=kw=ic=null,Md=!1,u):null;switch(u){case"paste":return null;case"keypress":if(!(f.ctrlKey||f.altKey||f.metaKey)||f.ctrlKey&&f.altKey){if(f.char&&1=f)return{node:p,offset:f-u};u=v}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=uC(p)}}function hC(u,f){return u&&f?u===f?!0:u&&u.nodeType===3?!1:f&&f.nodeType===3?hC(u,f.parentNode):"contains"in u?u.contains(f):u.compareDocumentPosition?!!(u.compareDocumentPosition(f)&16):!1:!1}function fC(u){u=u!=null&&u.ownerDocument!=null&&u.ownerDocument.defaultView!=null?u.ownerDocument.defaultView:window;for(var f=qg(u.document);f instanceof u.HTMLIFrameElement;){try{var p=typeof f.contentWindow.location.href=="string"}catch{p=!1}if(p)u=f.contentWindow;else break;f=qg(u.document)}return f}function Aw(u){var f=u&&u.nodeName&&u.nodeName.toLowerCase();return f&&(f==="input"&&(u.type==="text"||u.type==="search"||u.type==="tel"||u.type==="url"||u.type==="password")||f==="textarea"||u.contentEditable==="true")}var ZK=sl&&"documentMode"in document&&11>=document.documentMode,Rd=null,Mw=null,nm=null,Rw=!1;function mC(u,f,p){var v=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;Rw||Rd==null||Rd!==qg(v)||(v=Rd,"selectionStart"in v&&Aw(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),nm&&tm(nm,v)||(nm=v,v=zx(Mw,"onSelect"),0>=F,O-=F,lo=1<<32-Pt(f)+O|p<Jt?(bn=yt,yt=null):bn=yt.sibling;var Un=ke(pe,yt,be[Jt],Ae);if(Un===null){yt===null&&(yt=bn);break}u&&yt&&Un.alternate===null&&f(pe,yt),fe=C(Un,fe,Jt),Vn===null?Ct=Un:Vn.sibling=Un,Vn=Un,yt=bn}if(Jt===be.length)return p(pe,yt),On&&al(pe,Jt),Ct;if(yt===null){for(;JtJt?(bn=yt,yt=null):bn=yt.sibling;var Cc=ke(pe,yt,Un.value,Ae);if(Cc===null){yt===null&&(yt=bn);break}u&&yt&&Cc.alternate===null&&f(pe,yt),fe=C(Cc,fe,Jt),Vn===null?Ct=Cc:Vn.sibling=Cc,Vn=Cc,yt=bn}if(Un.done)return p(pe,yt),On&&al(pe,Jt),Ct;if(yt===null){for(;!Un.done;Jt++,Un=be.next())Un=Re(pe,Un.value,Ae),Un!==null&&(fe=C(Un,fe,Jt),Vn===null?Ct=Un:Vn.sibling=Un,Vn=Un);return On&&al(pe,Jt),Ct}for(yt=v(yt);!Un.done;Jt++,Un=be.next())Un=Ce(yt,pe,Jt,Un.value,Ae),Un!==null&&(u&&Un.alternate!==null&&yt.delete(Un.key===null?Jt:Un.key),fe=C(Un,fe,Jt),Vn===null?Ct=Un:Vn.sibling=Un,Vn=Un);return u&&yt.forEach(function(vJ){return f(pe,vJ)}),On&&al(pe,Jt),Ct}function rr(pe,fe,be,Ae){if(typeof be=="object"&&be!==null&&be.type===w&&be.key===null&&(be=be.props.children),typeof be=="object"&&be!==null){switch(be.$$typeof){case x:e:{for(var Ct=be.key;fe!==null;){if(fe.key===Ct){if(Ct=be.type,Ct===w){if(fe.tag===7){p(pe,fe.sibling),Ae=O(fe,be.props.children),Ae.return=pe,pe=Ae;break e}}else if(fe.elementType===Ct||typeof Ct=="object"&&Ct!==null&&Ct.$$typeof===D&&Tu(Ct)===fe.type){p(pe,fe.sibling),Ae=O(fe,be.props),lm(Ae,be),Ae.return=pe,pe=Ae;break e}p(pe,fe);break}else f(pe,fe);fe=fe.sibling}be.type===w?(Ae=ku(be.props.children,pe.mode,Ae,be.key),Ae.return=pe,pe=Ae):(Ae=Jg(be.type,be.key,be.props,null,pe.mode,Ae),lm(Ae,be),Ae.return=pe,pe=Ae)}return F(pe);case y:e:{for(Ct=be.key;fe!==null;){if(fe.key===Ct)if(fe.tag===4&&fe.stateNode.containerInfo===be.containerInfo&&fe.stateNode.implementation===be.implementation){p(pe,fe.sibling),Ae=O(fe,be.children||[]),Ae.return=pe,pe=Ae;break e}else{p(pe,fe);break}else f(pe,fe);fe=fe.sibling}Ae=Fw(be,pe.mode,Ae),Ae.return=pe,pe=Ae}return F(pe);case D:return be=Tu(be),rr(pe,fe,be,Ae)}if(V(be))return ut(pe,fe,be,Ae);if(W(be)){if(Ct=W(be),typeof Ct!="function")throw Error(r(150));return be=Ct.call(be),Dt(pe,fe,be,Ae)}if(typeof be.then=="function")return rr(pe,fe,ax(be),Ae);if(be.$$typeof===N)return rr(pe,fe,nx(pe,be),Ae);ox(pe,be)}return typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint"?(be=""+be,fe!==null&&fe.tag===6?(p(pe,fe.sibling),Ae=O(fe,be),Ae.return=pe,pe=Ae):(p(pe,fe),Ae=Bw(be,pe.mode,Ae),Ae.return=pe,pe=Ae),F(pe)):p(pe,fe)}return function(pe,fe,be,Ae){try{om=0;var Ct=rr(pe,fe,be,Ae);return Qd=null,Ct}catch(yt){if(yt===Hd||yt===sx)throw yt;var Vn=Di(29,yt,null,pe.mode);return Vn.lanes=Ae,Vn.return=pe,Vn}finally{}}}var _u=IC(!0),LC=IC(!1),uc=!1;function Zw(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jw(u,f){u=u.updateQueue,f.updateQueue===u&&(f.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,callbacks:null})}function dc(u){return{lane:u,tag:0,payload:null,callback:null,next:null}}function hc(u,f,p){var v=u.updateQueue;if(v===null)return null;if(v=v.shared,(Gn&2)!==0){var O=v.pending;return O===null?f.next=f:(f.next=O.next,O.next=f),v.pending=f,f=Zg(u),wC(u,null,p),f}return Kg(u,v,f,p),Zg(u)}function cm(u,f,p){if(f=f.updateQueue,f!==null&&(f=f.shared,(p&4194048)!==0)){var v=f.lanes;v&=u.pendingLanes,p|=v,f.lanes=p,vs(u,p)}}function e2(u,f){var p=u.updateQueue,v=u.alternate;if(v!==null&&(v=v.updateQueue,p===v)){var O=null,C=null;if(p=p.firstBaseUpdate,p!==null){do{var F={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};C===null?O=C=F:C=C.next=F,p=p.next}while(p!==null);C===null?O=C=f:C=C.next=f}else O=C=f;p={baseState:v.baseState,firstBaseUpdate:O,lastBaseUpdate:C,shared:v.shared,callbacks:v.callbacks},u.updateQueue=p;return}u=p.lastBaseUpdate,u===null?p.firstBaseUpdate=f:u.next=f,p.lastBaseUpdate=f}var t2=!1;function um(){if(t2){var u=$d;if(u!==null)throw u}}function dm(u,f,p,v){t2=!1;var O=u.updateQueue;uc=!1;var C=O.firstBaseUpdate,F=O.lastBaseUpdate,Z=O.shared.pending;if(Z!==null){O.shared.pending=null;var de=Z,Se=de.next;de.next=null,F===null?C=Se:F.next=Se,F=de;var Te=u.alternate;Te!==null&&(Te=Te.updateQueue,Z=Te.lastBaseUpdate,Z!==F&&(Z===null?Te.firstBaseUpdate=Se:Z.next=Se,Te.lastBaseUpdate=de))}if(C!==null){var Re=O.baseState;F=0,Te=Se=de=null,Z=C;do{var ke=Z.lane&-536870913,Ce=ke!==Z.lane;if(Ce?(yn&ke)===ke:(v&ke)===ke){ke!==0&&ke===qd&&(t2=!0),Te!==null&&(Te=Te.next={lane:0,tag:Z.tag,payload:Z.payload,callback:null,next:null});e:{var ut=u,Dt=Z;ke=f;var rr=p;switch(Dt.tag){case 1:if(ut=Dt.payload,typeof ut=="function"){Re=ut.call(rr,Re,ke);break e}Re=ut;break e;case 3:ut.flags=ut.flags&-65537|128;case 0:if(ut=Dt.payload,ke=typeof ut=="function"?ut.call(rr,Re,ke):ut,ke==null)break e;Re=m({},Re,ke);break e;case 2:uc=!0}}ke=Z.callback,ke!==null&&(u.flags|=64,Ce&&(u.flags|=8192),Ce=O.callbacks,Ce===null?O.callbacks=[ke]:Ce.push(ke))}else Ce={lane:ke,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},Te===null?(Se=Te=Ce,de=Re):Te=Te.next=Ce,F|=ke;if(Z=Z.next,Z===null){if(Z=O.shared.pending,Z===null)break;Ce=Z,Z=Ce.next,Ce.next=null,O.lastBaseUpdate=Ce,O.shared.pending=null}}while(!0);Te===null&&(de=Re),O.baseState=de,O.firstBaseUpdate=Se,O.lastBaseUpdate=Te,C===null&&(O.shared.lanes=0),xc|=F,u.lanes=F,u.memoizedState=Re}}function BC(u,f){if(typeof u!="function")throw Error(r(191,u));u.call(f)}function FC(u,f){var p=u.callbacks;if(p!==null)for(u.callbacks=null,u=0;uC?C:8;var F=L.T,Z={};L.T=Z,b2(u,!1,f,p);try{var de=O(),Se=L.S;if(Se!==null&&Se(Z,de),de!==null&&typeof de=="object"&&typeof de.then=="function"){var Te=oZ(de,v);mm(u,f,Te,Bi(u))}else mm(u,f,v,Bi(u))}catch(Re){mm(u,f,{then:function(){},status:"rejected",reason:Re},Bi())}finally{$.p=C,F!==null&&Z.types!==null&&(F.types=Z.types),L.T=F}}function fZ(){}function v2(u,f,p,v){if(u.tag!==5)throw Error(r(476));var O=v8(u).queue;x8(u,O,f,K,p===null?fZ:function(){return y8(u),p(v)})}function v8(u){var f=u.memoizedState;if(f!==null)return f;f={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ul,lastRenderedState:K},next:null};var p={};return f.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ul,lastRenderedState:p},next:null},u.memoizedState=f,u=u.alternate,u!==null&&(u.memoizedState=f),f}function y8(u){var f=v8(u);f.next===null&&(f=u.alternate.memoizedState),mm(u,f.next.queue,{},Bi())}function y2(){return Ts(Am)}function b8(){return Vr().memoizedState}function w8(){return Vr().memoizedState}function mZ(u){for(var f=u.return;f!==null;){switch(f.tag){case 24:case 3:var p=Bi();u=dc(p);var v=hc(f,u,p);v!==null&&(mi(v,f,p),cm(v,f,p)),f={cache:Gw()},u.payload=f;return}f=f.return}}function pZ(u,f,p){var v=Bi();p={lane:v,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},xx(u)?k8(f,p):(p=Iw(u,f,p,v),p!==null&&(mi(p,u,v),O8(p,f,v)))}function S8(u,f,p){var v=Bi();mm(u,f,p,v)}function mm(u,f,p,v){var O={lane:v,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(xx(u))k8(f,O);else{var C=u.alternate;if(u.lanes===0&&(C===null||C.lanes===0)&&(C=f.lastRenderedReducer,C!==null))try{var F=f.lastRenderedState,Z=C(F,p);if(O.hasEagerState=!0,O.eagerState=Z,Ri(Z,F))return Kg(u,f,O,0),or===null&&Yg(),!1}catch{}finally{}if(p=Iw(u,f,O,v),p!==null)return mi(p,u,v),O8(p,f,v),!0}return!1}function b2(u,f,p,v){if(v={lane:2,revertLane:Z2(),gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},xx(u)){if(f)throw Error(r(479))}else f=Iw(u,p,v,2),f!==null&&mi(f,u,2)}function xx(u){var f=u.alternate;return u===Kt||f!==null&&f===Kt}function k8(u,f){Ud=ux=!0;var p=u.pending;p===null?f.next=f:(f.next=p.next,p.next=f),u.pending=f}function O8(u,f,p){if((p&4194048)!==0){var v=f.lanes;v&=u.pendingLanes,p|=v,f.lanes=p,vs(u,p)}}var pm={readContext:Ts,use:fx,useCallback:Br,useContext:Br,useEffect:Br,useImperativeHandle:Br,useLayoutEffect:Br,useInsertionEffect:Br,useMemo:Br,useReducer:Br,useRef:Br,useState:Br,useDebugValue:Br,useDeferredValue:Br,useTransition:Br,useSyncExternalStore:Br,useId:Br,useHostTransitionStatus:Br,useFormState:Br,useActionState:Br,useOptimistic:Br,useMemoCache:Br,useCacheRefresh:Br};pm.useEffectEvent=Br;var j8={readContext:Ts,use:fx,useCallback:function(u,f){return Ks().memoizedState=[u,f===void 0?null:f],u},useContext:Ts,useEffect:l8,useImperativeHandle:function(u,f,p){p=p!=null?p.concat([u]):null,px(4194308,4,h8.bind(null,f,u),p)},useLayoutEffect:function(u,f){return px(4194308,4,u,f)},useInsertionEffect:function(u,f){px(4,2,u,f)},useMemo:function(u,f){var p=Ks();f=f===void 0?null:f;var v=u();if(Au){dn(!0);try{u()}finally{dn(!1)}}return p.memoizedState=[v,f],v},useReducer:function(u,f,p){var v=Ks();if(p!==void 0){var O=p(f);if(Au){dn(!0);try{p(f)}finally{dn(!1)}}}else O=f;return v.memoizedState=v.baseState=O,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:O},v.queue=u,u=u.dispatch=pZ.bind(null,Kt,u),[v.memoizedState,u]},useRef:function(u){var f=Ks();return u={current:u},f.memoizedState=u},useState:function(u){u=f2(u);var f=u.queue,p=S8.bind(null,Kt,f);return f.dispatch=p,[u.memoizedState,p]},useDebugValue:g2,useDeferredValue:function(u,f){var p=Ks();return x2(p,u,f)},useTransition:function(){var u=f2(!1);return u=x8.bind(null,Kt,u.queue,!0,!1),Ks().memoizedState=u,[!1,u]},useSyncExternalStore:function(u,f,p){var v=Kt,O=Ks();if(On){if(p===void 0)throw Error(r(407));p=p()}else{if(p=f(),or===null)throw Error(r(349));(yn&127)!==0||UC(v,f,p)}O.memoizedState=p;var C={value:p,getSnapshot:f};return O.queue=C,l8(GC.bind(null,v,C,u),[u]),v.flags|=2048,Gd(9,{destroy:void 0},WC.bind(null,v,C,p,f),null),p},useId:function(){var u=Ks(),f=or.identifierPrefix;if(On){var p=co,v=lo;p=(v&~(1<<32-Pt(v)-1)).toString(32)+p,f="_"+f+"R_"+p,p=dx++,0<\/script>",C=C.removeChild(C.firstChild);break;case"select":C=typeof v.is=="string"?F.createElement("select",{is:v.is}):F.createElement("select"),v.multiple?C.multiple=!0:v.size&&(C.size=v.size);break;default:C=typeof v.is=="string"?F.createElement(O,{is:v.is}):F.createElement(O)}}C[Mr]=f,C[Rr]=v;e:for(F=f.child;F!==null;){if(F.tag===5||F.tag===6)C.appendChild(F.stateNode);else if(F.tag!==4&&F.tag!==27&&F.child!==null){F.child.return=F,F=F.child;continue}if(F===f)break e;for(;F.sibling===null;){if(F.return===null||F.return===f)break e;F=F.return}F.sibling.return=F.return,F=F.sibling}f.stateNode=C;e:switch(_s(C,O,v),O){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}v&&hl(f)}}return vr(f),D2(f,f.type,u===null?null:u.memoizedProps,f.pendingProps,p),null;case 6:if(u&&f.stateNode!=null)u.memoizedProps!==v&&hl(f);else{if(typeof v!="string"&&f.stateNode===null)throw Error(r(166));if(u=ne.current,Bd(f)){if(u=f.stateNode,p=f.memoizedProps,v=null,O=Cs,O!==null)switch(O.tag){case 27:case 5:v=O.memoizedProps}u[Mr]=f,u=!!(u.nodeValue===p||v!==null&&v.suppressHydrationWarning===!0||QT(u.nodeValue,p)),u||lc(f,!0)}else u=Ix(u).createTextNode(v),u[Mr]=f,f.stateNode=u}return vr(f),null;case 31:if(p=f.memoizedState,u===null||u.memoizedState!==null){if(v=Bd(f),p!==null){if(u===null){if(!v)throw Error(r(318));if(u=f.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(557));u[Mr]=f}else Ou(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;vr(f),u=!1}else p=Qw(),u!==null&&u.memoizedState!==null&&(u.memoizedState.hydrationErrors=p),u=!0;if(!u)return f.flags&256?(zi(f),f):(zi(f),null);if((f.flags&128)!==0)throw Error(r(558))}return vr(f),null;case 13:if(v=f.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(O=Bd(f),v!==null&&v.dehydrated!==null){if(u===null){if(!O)throw Error(r(318));if(O=f.memoizedState,O=O!==null?O.dehydrated:null,!O)throw Error(r(317));O[Mr]=f}else Ou(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;vr(f),O=!1}else O=Qw(),u!==null&&u.memoizedState!==null&&(u.memoizedState.hydrationErrors=O),O=!0;if(!O)return f.flags&256?(zi(f),f):(zi(f),null)}return zi(f),(f.flags&128)!==0?(f.lanes=p,f):(p=v!==null,u=u!==null&&u.memoizedState!==null,p&&(v=f.child,O=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(O=v.alternate.memoizedState.cachePool.pool),C=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(C=v.memoizedState.cachePool.pool),C!==O&&(v.flags|=2048)),p!==u&&p&&(f.child.flags|=8192),Sx(f,f.updateQueue),vr(f),null);case 4:return re(),u===null&&n4(f.stateNode.containerInfo),vr(f),null;case 10:return ll(f.type),vr(f),null;case 19:if(X(Qr),v=f.memoizedState,v===null)return vr(f),null;if(O=(f.flags&128)!==0,C=v.rendering,C===null)if(O)xm(v,!1);else{if(Fr!==0||u!==null&&(u.flags&128)!==0)for(u=f.child;u!==null;){if(C=cx(u),C!==null){for(f.flags|=128,xm(v,!1),u=C.updateQueue,f.updateQueue=u,Sx(f,u),f.subtreeFlags=0,u=p,p=f.child;p!==null;)SC(p,u),p=p.sibling;return z(Qr,Qr.current&1|2),On&&al(f,v.treeForkCount),f.child}u=u.sibling}v.tail!==null&&Mt()>Cx&&(f.flags|=128,O=!0,xm(v,!1),f.lanes=4194304)}else{if(!O)if(u=cx(C),u!==null){if(f.flags|=128,O=!0,u=u.updateQueue,f.updateQueue=u,Sx(f,u),xm(v,!0),v.tail===null&&v.tailMode==="hidden"&&!C.alternate&&!On)return vr(f),null}else 2*Mt()-v.renderingStartTime>Cx&&p!==536870912&&(f.flags|=128,O=!0,xm(v,!1),f.lanes=4194304);v.isBackwards?(C.sibling=f.child,f.child=C):(u=v.last,u!==null?u.sibling=C:f.child=C,v.last=C)}return v.tail!==null?(u=v.tail,v.rendering=u,v.tail=u.sibling,v.renderingStartTime=Mt(),u.sibling=null,p=Qr.current,z(Qr,O?p&1|2:p&1),On&&al(f,v.treeForkCount),u):(vr(f),null);case 22:case 23:return zi(f),r2(),v=f.memoizedState!==null,u!==null?u.memoizedState!==null!==v&&(f.flags|=8192):v&&(f.flags|=8192),v?(p&536870912)!==0&&(f.flags&128)===0&&(vr(f),f.subtreeFlags&6&&(f.flags|=8192)):vr(f),p=f.updateQueue,p!==null&&Sx(f,p.retryQueue),p=null,u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(p=u.memoizedState.cachePool.pool),v=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(v=f.memoizedState.cachePool.pool),v!==p&&(f.flags|=2048),u!==null&&X(Cu),null;case 24:return p=null,u!==null&&(p=u.memoizedState.cache),f.memoizedState.cache!==p&&(f.flags|=2048),ll(Zr),vr(f),null;case 25:return null;case 30:return null}throw Error(r(156,f.tag))}function bZ(u,f){switch($w(f),f.tag){case 1:return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 3:return ll(Zr),re(),u=f.flags,(u&65536)!==0&&(u&128)===0?(f.flags=u&-65537|128,f):null;case 26:case 27:case 5:return _e(f),null;case 31:if(f.memoizedState!==null){if(zi(f),f.alternate===null)throw Error(r(340));Ou()}return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 13:if(zi(f),u=f.memoizedState,u!==null&&u.dehydrated!==null){if(f.alternate===null)throw Error(r(340));Ou()}return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 19:return X(Qr),null;case 4:return re(),null;case 10:return ll(f.type),null;case 22:case 23:return zi(f),r2(),u!==null&&X(Cu),u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 24:return ll(Zr),null;case 25:return null;default:return null}}function X8(u,f){switch($w(f),f.tag){case 3:ll(Zr),re();break;case 26:case 27:case 5:_e(f);break;case 4:re();break;case 31:f.memoizedState!==null&&zi(f);break;case 13:zi(f);break;case 19:X(Qr);break;case 10:ll(f.type);break;case 22:case 23:zi(f),r2(),u!==null&&X(Cu);break;case 24:ll(Zr)}}function vm(u,f){try{var p=f.updateQueue,v=p!==null?p.lastEffect:null;if(v!==null){var O=v.next;p=O;do{if((p.tag&u)===u){v=void 0;var C=p.create,F=p.inst;v=C(),F.destroy=v}p=p.next}while(p!==O)}}catch(Z){Zn(f,f.return,Z)}}function pc(u,f,p){try{var v=f.updateQueue,O=v!==null?v.lastEffect:null;if(O!==null){var C=O.next;v=C;do{if((v.tag&u)===u){var F=v.inst,Z=F.destroy;if(Z!==void 0){F.destroy=void 0,O=f;var de=p,Se=Z;try{Se()}catch(Te){Zn(O,de,Te)}}}v=v.next}while(v!==C)}}catch(Te){Zn(f,f.return,Te)}}function Y8(u){var f=u.updateQueue;if(f!==null){var p=u.stateNode;try{FC(f,p)}catch(v){Zn(u,u.return,v)}}}function K8(u,f,p){p.props=Mu(u.type,u.memoizedProps),p.state=u.memoizedState;try{p.componentWillUnmount()}catch(v){Zn(u,f,v)}}function ym(u,f){try{var p=u.ref;if(p!==null){switch(u.tag){case 26:case 27:case 5:var v=u.stateNode;break;case 30:v=u.stateNode;break;default:v=u.stateNode}typeof p=="function"?u.refCleanup=p(v):p.current=v}}catch(O){Zn(u,f,O)}}function uo(u,f){var p=u.ref,v=u.refCleanup;if(p!==null)if(typeof v=="function")try{v()}catch(O){Zn(u,f,O)}finally{u.refCleanup=null,u=u.alternate,u!=null&&(u.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(O){Zn(u,f,O)}else p.current=null}function Z8(u){var f=u.type,p=u.memoizedProps,v=u.stateNode;try{e:switch(f){case"button":case"input":case"select":case"textarea":p.autoFocus&&v.focus();break e;case"img":p.src?v.src=p.src:p.srcSet&&(v.srcset=p.srcSet)}}catch(O){Zn(u,u.return,O)}}function P2(u,f,p){try{var v=u.stateNode;$Z(v,u.type,p,f),v[Rr]=f}catch(O){Zn(u,u.return,O)}}function J8(u){return u.tag===5||u.tag===3||u.tag===26||u.tag===27&&Sc(u.type)||u.tag===4}function z2(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||J8(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&u.tag!==18;){if(u.tag===27&&Sc(u.type)||u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function I2(u,f,p){var v=u.tag;if(v===5||v===6)u=u.stateNode,f?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(u,f):(f=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,f.appendChild(u),p=p._reactRootContainer,p!=null||f.onclick!==null||(f.onclick=rl));else if(v!==4&&(v===27&&Sc(u.type)&&(p=u.stateNode,f=null),u=u.child,u!==null))for(I2(u,f,p),u=u.sibling;u!==null;)I2(u,f,p),u=u.sibling}function kx(u,f,p){var v=u.tag;if(v===5||v===6)u=u.stateNode,f?p.insertBefore(u,f):p.appendChild(u);else if(v!==4&&(v===27&&Sc(u.type)&&(p=u.stateNode),u=u.child,u!==null))for(kx(u,f,p),u=u.sibling;u!==null;)kx(u,f,p),u=u.sibling}function eT(u){var f=u.stateNode,p=u.memoizedProps;try{for(var v=u.type,O=f.attributes;O.length;)f.removeAttributeNode(O[0]);_s(f,v,p),f[Mr]=u,f[Rr]=p}catch(C){Zn(u,u.return,C)}}var fl=!1,ts=!1,L2=!1,tT=typeof WeakSet=="function"?WeakSet:Set,ys=null;function wZ(u,f){if(u=u.containerInfo,i4=Qx,u=fC(u),Aw(u)){if("selectionStart"in u)var p={start:u.selectionStart,end:u.selectionEnd};else e:{p=(p=u.ownerDocument)&&p.defaultView||window;var v=p.getSelection&&p.getSelection();if(v&&v.rangeCount!==0){p=v.anchorNode;var O=v.anchorOffset,C=v.focusNode;v=v.focusOffset;try{p.nodeType,C.nodeType}catch{p=null;break e}var F=0,Z=-1,de=-1,Se=0,Te=0,Re=u,ke=null;t:for(;;){for(var Ce;Re!==p||O!==0&&Re.nodeType!==3||(Z=F+O),Re!==C||v!==0&&Re.nodeType!==3||(de=F+v),Re.nodeType===3&&(F+=Re.nodeValue.length),(Ce=Re.firstChild)!==null;)ke=Re,Re=Ce;for(;;){if(Re===u)break t;if(ke===p&&++Se===O&&(Z=F),ke===C&&++Te===v&&(de=F),(Ce=Re.nextSibling)!==null)break;Re=ke,ke=Re.parentNode}Re=Ce}p=Z===-1||de===-1?null:{start:Z,end:de}}else p=null}p=p||{start:0,end:0}}else p=null;for(a4={focusedElem:u,selectionRange:p},Qx=!1,ys=f;ys!==null;)if(f=ys,u=f.child,(f.subtreeFlags&1028)!==0&&u!==null)u.return=f,ys=u;else for(;ys!==null;){switch(f=ys,C=f.alternate,u=f.flags,f.tag){case 0:if((u&4)!==0&&(u=f.updateQueue,u=u!==null?u.events:null,u!==null))for(p=0;p title"))),_s(C,v,p),C[Mr]=u,Kr(C),v=C;break e;case"link":var F=o9("link","href",O).get(v+(p.href||""));if(F){for(var Z=0;Zrr&&(F=rr,rr=Dt,Dt=F);var pe=dC(Z,Dt),fe=dC(Z,rr);if(pe&&fe&&(Ce.rangeCount!==1||Ce.anchorNode!==pe.node||Ce.anchorOffset!==pe.offset||Ce.focusNode!==fe.node||Ce.focusOffset!==fe.offset)){var be=Re.createRange();be.setStart(pe.node,pe.offset),Ce.removeAllRanges(),Dt>rr?(Ce.addRange(be),Ce.extend(fe.node,fe.offset)):(be.setEnd(fe.node,fe.offset),Ce.addRange(be))}}}}for(Re=[],Ce=Z;Ce=Ce.parentNode;)Ce.nodeType===1&&Re.push({element:Ce,left:Ce.scrollLeft,top:Ce.scrollTop});for(typeof Z.focus=="function"&&Z.focus(),Z=0;Zp?32:p,L.T=null,p=V2,V2=null;var C=yc,F=vl;if(ls=0,Jd=yc=null,vl=0,(Gn&6)!==0)throw Error(r(331));var Z=Gn;if(Gn|=4,hT(C.current),cT(C,C.current,F,p),Gn=Z,jm(0,!1),ot&&typeof ot.onPostCommitFiberRoot=="function")try{ot.onPostCommitFiberRoot(We,C)}catch{}return!0}finally{$.p=O,L.T=v,_T(u,f)}}function MT(u,f,p){f=oa(p,f),f=O2(u.stateNode,f,2),u=hc(u,f,2),u!==null&&(fr(u,2),ho(u))}function Zn(u,f,p){if(u.tag===3)MT(u,u,p);else for(;f!==null;){if(f.tag===3){MT(f,u,p);break}else if(f.tag===1){var v=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(vc===null||!vc.has(v))){u=oa(p,u),p=R8(2),v=hc(f,p,2),v!==null&&(D8(p,v,f,u),fr(v,2),ho(v));break}}f=f.return}}function X2(u,f,p){var v=u.pingCache;if(v===null){v=u.pingCache=new OZ;var O=new Set;v.set(f,O)}else O=v.get(f),O===void 0&&(O=new Set,v.set(f,O));O.has(p)||(q2=!0,O.add(p),u=EZ.bind(null,u,f,p),f.then(u,u))}function EZ(u,f,p){var v=u.pingCache;v!==null&&v.delete(f),u.pingedLanes|=u.suspendedLanes&p,u.warmLanes&=~p,or===u&&(yn&p)===p&&(Fr===4||Fr===3&&(yn&62914560)===yn&&300>Mt()-Nx?(Gn&2)===0&&eh(u,0):$2|=p,Zd===yn&&(Zd=0)),ho(u)}function RT(u,f){f===0&&(f=vn()),u=Su(u,f),u!==null&&(fr(u,f),ho(u))}function _Z(u){var f=u.memoizedState,p=0;f!==null&&(p=f.retryLane),RT(u,p)}function AZ(u,f){var p=0;switch(u.tag){case 31:case 13:var v=u.stateNode,O=u.memoizedState;O!==null&&(p=O.retryLane);break;case 19:v=u.stateNode;break;case 22:v=u.stateNode._retryCache;break;default:throw Error(r(314))}v!==null&&v.delete(f),RT(u,p)}function MZ(u,f){return vt(u,f)}var Rx=null,nh=null,Y2=!1,Dx=!1,K2=!1,wc=0;function ho(u){u!==nh&&u.next===null&&(nh===null?Rx=nh=u:nh=nh.next=u),Dx=!0,Y2||(Y2=!0,DZ())}function jm(u,f){if(!K2&&Dx){K2=!0;do for(var p=!1,v=Rx;v!==null;){if(u!==0){var O=v.pendingLanes;if(O===0)var C=0;else{var F=v.suspendedLanes,Z=v.pingedLanes;C=(1<<31-Pt(42|u)+1)-1,C&=O&~(F&~Z),C=C&201326741?C&201326741|1:C?C|2:0}C!==0&&(p=!0,IT(v,C))}else C=yn,C=ve(v,v===or?C:0,v.cancelPendingCommit!==null||v.timeoutHandle!==-1),(C&3)===0||He(v,C)||(p=!0,IT(v,C));v=v.next}while(p);K2=!1}}function RZ(){DT()}function DT(){Dx=Y2=!1;var u=0;wc!==0&&QZ()&&(u=wc);for(var f=Mt(),p=null,v=Rx;v!==null;){var O=v.next,C=PT(v,f);C===0?(v.next=null,p===null?Rx=O:p.next=O,O===null&&(nh=p)):(p=v,(u!==0||(C&3)!==0)&&(Dx=!0)),v=O}ls!==0&&ls!==5||jm(u),wc!==0&&(wc=0)}function PT(u,f){for(var p=u.suspendedLanes,v=u.pingedLanes,O=u.expirationTimes,C=u.pendingLanes&-62914561;0Z)break;var Te=de.transferSize,Re=de.initiatorType;Te&&VT(Re)&&(de=de.responseEnd,F+=Te*(de"u"?null:document;function r9(u,f,p){var v=rh;if(v&&typeof f=="string"&&f){var O=ia(f);O='link[rel="'+u+'"][href="'+O+'"]',typeof p=="string"&&(O+='[crossorigin="'+p+'"]'),n9.has(O)||(n9.add(O),u={rel:u,crossOrigin:p,href:f},v.querySelector(O)===null&&(f=v.createElement("link"),_s(f,"link",u),Kr(f),v.head.appendChild(f)))}}function JZ(u){yl.D(u),r9("dns-prefetch",u,null)}function eJ(u,f){yl.C(u,f),r9("preconnect",u,f)}function tJ(u,f,p){yl.L(u,f,p);var v=rh;if(v&&u&&f){var O='link[rel="preload"][as="'+ia(f)+'"]';f==="image"&&p&&p.imageSrcSet?(O+='[imagesrcset="'+ia(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(O+='[imagesizes="'+ia(p.imageSizes)+'"]')):O+='[href="'+ia(u)+'"]';var C=O;switch(f){case"style":C=sh(u);break;case"script":C=ih(u)}fa.has(C)||(u=m({rel:"preload",href:f==="image"&&p&&p.imageSrcSet?void 0:u,as:f},p),fa.set(C,u),v.querySelector(O)!==null||f==="style"&&v.querySelector(Em(C))||f==="script"&&v.querySelector(_m(C))||(f=v.createElement("link"),_s(f,"link",u),Kr(f),v.head.appendChild(f)))}}function nJ(u,f){yl.m(u,f);var p=rh;if(p&&u){var v=f&&typeof f.as=="string"?f.as:"script",O='link[rel="modulepreload"][as="'+ia(v)+'"][href="'+ia(u)+'"]',C=O;switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":C=ih(u)}if(!fa.has(C)&&(u=m({rel:"modulepreload",href:u},f),fa.set(C,u),p.querySelector(O)===null)){switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(_m(C)))return}v=p.createElement("link"),_s(v,"link",u),Kr(v),p.head.appendChild(v)}}}function rJ(u,f,p){yl.S(u,f,p);var v=rh;if(v&&u){var O=sc(v).hoistableStyles,C=sh(u);f=f||"default";var F=O.get(C);if(!F){var Z={loading:0,preload:null};if(F=v.querySelector(Em(C)))Z.loading=5;else{u=m({rel:"stylesheet",href:u,"data-precedence":f},p),(p=fa.get(C))&&f4(u,p);var de=F=v.createElement("link");Kr(de),_s(de,"link",u),de._p=new Promise(function(Se,Te){de.onload=Se,de.onerror=Te}),de.addEventListener("load",function(){Z.loading|=1}),de.addEventListener("error",function(){Z.loading|=2}),Z.loading|=4,Bx(F,f,v)}F={type:"stylesheet",instance:F,count:1,state:Z},O.set(C,F)}}}function sJ(u,f){yl.X(u,f);var p=rh;if(p&&u){var v=sc(p).hoistableScripts,O=ih(u),C=v.get(O);C||(C=p.querySelector(_m(O)),C||(u=m({src:u,async:!0},f),(f=fa.get(O))&&m4(u,f),C=p.createElement("script"),Kr(C),_s(C,"link",u),p.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},v.set(O,C))}}function iJ(u,f){yl.M(u,f);var p=rh;if(p&&u){var v=sc(p).hoistableScripts,O=ih(u),C=v.get(O);C||(C=p.querySelector(_m(O)),C||(u=m({src:u,async:!0,type:"module"},f),(f=fa.get(O))&&m4(u,f),C=p.createElement("script"),Kr(C),_s(C,"link",u),p.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},v.set(O,C))}}function s9(u,f,p,v){var O=(O=ne.current)?Lx(O):null;if(!O)throw Error(r(446));switch(u){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(f=sh(p.href),p=sc(O).hoistableStyles,v=p.get(f),v||(v={type:"style",instance:null,count:0,state:null},p.set(f,v)),v):{type:"void",instance:null,count:0,state:null};case"link":if(p.rel==="stylesheet"&&typeof p.href=="string"&&typeof p.precedence=="string"){u=sh(p.href);var C=sc(O).hoistableStyles,F=C.get(u);if(F||(O=O.ownerDocument||O,F={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},C.set(u,F),(C=O.querySelector(Em(u)))&&!C._p&&(F.instance=C,F.state.loading=5),fa.has(u)||(p={rel:"preload",as:"style",href:p.href,crossOrigin:p.crossOrigin,integrity:p.integrity,media:p.media,hrefLang:p.hrefLang,referrerPolicy:p.referrerPolicy},fa.set(u,p),C||aJ(O,u,p,F.state))),f&&v===null)throw Error(r(528,""));return F}if(f&&v!==null)throw Error(r(529,""));return null;case"script":return f=p.async,p=p.src,typeof p=="string"&&f&&typeof f!="function"&&typeof f!="symbol"?(f=ih(p),p=sc(O).hoistableScripts,v=p.get(f),v||(v={type:"script",instance:null,count:0,state:null},p.set(f,v)),v):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,u))}}function sh(u){return'href="'+ia(u)+'"'}function Em(u){return'link[rel="stylesheet"]['+u+"]"}function i9(u){return m({},u,{"data-precedence":u.precedence,precedence:null})}function aJ(u,f,p,v){u.querySelector('link[rel="preload"][as="style"]['+f+"]")?v.loading=1:(f=u.createElement("link"),v.preload=f,f.addEventListener("load",function(){return v.loading|=1}),f.addEventListener("error",function(){return v.loading|=2}),_s(f,"link",p),Kr(f),u.head.appendChild(f))}function ih(u){return'[src="'+ia(u)+'"]'}function _m(u){return"script[async]"+u}function a9(u,f,p){if(f.count++,f.instance===null)switch(f.type){case"style":var v=u.querySelector('style[data-href~="'+ia(p.href)+'"]');if(v)return f.instance=v,Kr(v),v;var O=m({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return v=(u.ownerDocument||u).createElement("style"),Kr(v),_s(v,"style",O),Bx(v,p.precedence,u),f.instance=v;case"stylesheet":O=sh(p.href);var C=u.querySelector(Em(O));if(C)return f.state.loading|=4,f.instance=C,Kr(C),C;v=i9(p),(O=fa.get(O))&&f4(v,O),C=(u.ownerDocument||u).createElement("link"),Kr(C);var F=C;return F._p=new Promise(function(Z,de){F.onload=Z,F.onerror=de}),_s(C,"link",v),f.state.loading|=4,Bx(C,p.precedence,u),f.instance=C;case"script":return C=ih(p.src),(O=u.querySelector(_m(C)))?(f.instance=O,Kr(O),O):(v=p,(O=fa.get(C))&&(v=m({},p),m4(v,O)),u=u.ownerDocument||u,O=u.createElement("script"),Kr(O),_s(O,"link",v),u.head.appendChild(O),f.instance=O);case"void":return null;default:throw Error(r(443,f.type))}else f.type==="stylesheet"&&(f.state.loading&4)===0&&(v=f.instance,f.state.loading|=4,Bx(v,p.precedence,u));return f.instance}function Bx(u,f,p){for(var v=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),O=v.length?v[v.length-1]:null,C=O,F=0;F title"):null)}function oJ(u,f,p){if(p===1||f.itemProp!=null)return!1;switch(u){case"meta":case"title":return!0;case"style":if(typeof f.precedence!="string"||typeof f.href!="string"||f.href==="")break;return!0;case"link":if(typeof f.rel!="string"||typeof f.href!="string"||f.href===""||f.onLoad||f.onError)break;switch(f.rel){case"stylesheet":return u=f.disabled,typeof f.precedence=="string"&&u==null;default:return!0}case"script":if(f.async&&typeof f.async!="function"&&typeof f.async!="symbol"&&!f.onLoad&&!f.onError&&f.src&&typeof f.src=="string")return!0}return!1}function c9(u){return!(u.type==="stylesheet"&&(u.state.loading&3)===0)}function lJ(u,f,p,v){if(p.type==="stylesheet"&&(typeof v.media!="string"||matchMedia(v.media).matches!==!1)&&(p.state.loading&4)===0){if(p.instance===null){var O=sh(v.href),C=f.querySelector(Em(O));if(C){f=C._p,f!==null&&typeof f=="object"&&typeof f.then=="function"&&(u.count++,u=qx.bind(u),f.then(u,u)),p.state.loading|=4,p.instance=C,Kr(C);return}C=f.ownerDocument||f,v=i9(v),(O=fa.get(O))&&f4(v,O),C=C.createElement("link"),Kr(C);var F=C;F._p=new Promise(function(Z,de){F.onload=Z,F.onerror=de}),_s(C,"link",v),p.instance=C}u.stylesheets===null&&(u.stylesheets=new Map),u.stylesheets.set(p,f),(f=p.state.preload)&&(p.state.loading&3)===0&&(u.count++,p=qx.bind(u),f.addEventListener("load",p),f.addEventListener("error",p))}}var p4=0;function cJ(u,f){return u.stylesheets&&u.count===0&&Hx(u,u.stylesheets),0p4?50:800)+f);return u.unsuspend=p,function(){u.unsuspend=null,clearTimeout(v),clearTimeout(O)}}:null}function qx(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Hx(this,this.stylesheets);else if(this.unsuspend){var u=this.unsuspend;this.unsuspend=null,u()}}}var $x=null;function Hx(u,f){u.stylesheets=null,u.unsuspend!==null&&(u.count++,$x=new Map,f.forEach(uJ,u),$x=null,qx.call(u))}function uJ(u,f){if(!(f.state.loading&4)){var p=$x.get(u);if(p)var v=p.get(null);else{p=new Map,$x.set(u,p);for(var O=u.querySelectorAll("link[data-precedence],style[data-precedence]"),C=0;C"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),O4.exports=yte(),O4.exports}var wte=bte();function _I(t,e){return function(){return t.apply(e,arguments)}}const{toString:Ste}=Object.prototype,{getPrototypeOf:Bj}=Object,{iterator:Jy,toStringTag:AI}=Symbol,eb=(t=>e=>{const n=Ste.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),no=t=>(t=t.toLowerCase(),e=>eb(e)===t),tb=t=>e=>typeof e===t,{isArray:yf}=Array,Xh=tb("undefined");function Bp(t){return t!==null&&!Xh(t)&&t.constructor!==null&&!Xh(t.constructor)&&ki(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const MI=no("ArrayBuffer");function kte(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&MI(t.buffer),e}const Ote=tb("string"),ki=tb("function"),RI=tb("number"),Fp=t=>t!==null&&typeof t=="object",jte=t=>t===!0||t===!1,iv=t=>{if(eb(t)!=="object")return!1;const e=Bj(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(AI in t)&&!(Jy in t)},Nte=t=>{if(!Fp(t)||Bp(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Cte=no("Date"),Tte=no("File"),Ete=no("Blob"),_te=no("FileList"),Ate=t=>Fp(t)&&ki(t.pipe),Mte=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||ki(t.append)&&((e=eb(t))==="formdata"||e==="object"&&ki(t.toString)&&t.toString()==="[object FormData]"))},Rte=no("URLSearchParams"),[Dte,Pte,zte,Ite]=["ReadableStream","Request","Response","Headers"].map(no),Lte=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function qp(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,s;if(typeof t!="object"&&(t=[t]),yf(t))for(r=0,s=t.length;r0;)if(s=n[r],e===s.toLowerCase())return s;return null}const Vu=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,PI=t=>!Xh(t)&&t!==Vu;function ck(){const{caseless:t,skipUndefined:e}=PI(this)&&this||{},n={},r=(s,i)=>{const a=t&&DI(n,i)||i;iv(n[a])&&iv(s)?n[a]=ck(n[a],s):iv(s)?n[a]=ck({},s):yf(s)?n[a]=s.slice():(!e||!Xh(s))&&(n[a]=s)};for(let s=0,i=arguments.length;s(qp(e,(s,i)=>{n&&ki(s)?t[i]=_I(s,n):t[i]=s},{allOwnKeys:r}),t),Fte=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),qte=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},$te=(t,e,n,r)=>{let s,i,a;const l={};if(e=e||{},t==null)return e;do{for(s=Object.getOwnPropertyNames(t),i=s.length;i-- >0;)a=s[i],(!r||r(a,t,e))&&!l[a]&&(e[a]=t[a],l[a]=!0);t=n!==!1&&Bj(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Hte=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},Qte=t=>{if(!t)return null;if(yf(t))return t;let e=t.length;if(!RI(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},Vte=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Bj(Uint8Array)),Ute=(t,e)=>{const r=(t&&t[Jy]).call(t);let s;for(;(s=r.next())&&!s.done;){const i=s.value;e.call(t,i[0],i[1])}},Wte=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},Gte=no("HTMLFormElement"),Xte=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),P9=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Yte=no("RegExp"),zI=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};qp(n,(s,i)=>{let a;(a=e(s,i,t))!==!1&&(r[i]=a||s)}),Object.defineProperties(t,r)},Kte=t=>{zI(t,(e,n)=>{if(ki(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(ki(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Zte=(t,e)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return yf(t)?r(t):r(String(t).split(e)),n},Jte=()=>{},ene=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function tne(t){return!!(t&&ki(t.append)&&t[AI]==="FormData"&&t[Jy])}const nne=t=>{const e=new Array(10),n=(r,s)=>{if(Fp(r)){if(e.indexOf(r)>=0)return;if(Bp(r))return r;if(!("toJSON"in r)){e[s]=r;const i=yf(r)?[]:{};return qp(r,(a,l)=>{const c=n(a,s+1);!Xh(c)&&(i[l]=c)}),e[s]=void 0,i}}return r};return n(t,0)},rne=no("AsyncFunction"),sne=t=>t&&(Fp(t)||ki(t))&&ki(t.then)&&ki(t.catch),II=((t,e)=>t?setImmediate:e?((n,r)=>(Vu.addEventListener("message",({source:s,data:i})=>{s===Vu&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),Vu.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ki(Vu.postMessage)),ine=typeof queueMicrotask<"u"?queueMicrotask.bind(Vu):typeof process<"u"&&process.nextTick||II,ane=t=>t!=null&&ki(t[Jy]),je={isArray:yf,isArrayBuffer:MI,isBuffer:Bp,isFormData:Mte,isArrayBufferView:kte,isString:Ote,isNumber:RI,isBoolean:jte,isObject:Fp,isPlainObject:iv,isEmptyObject:Nte,isReadableStream:Dte,isRequest:Pte,isResponse:zte,isHeaders:Ite,isUndefined:Xh,isDate:Cte,isFile:Tte,isBlob:Ete,isRegExp:Yte,isFunction:ki,isStream:Ate,isURLSearchParams:Rte,isTypedArray:Vte,isFileList:_te,forEach:qp,merge:ck,extend:Bte,trim:Lte,stripBOM:Fte,inherits:qte,toFlatObject:$te,kindOf:eb,kindOfTest:no,endsWith:Hte,toArray:Qte,forEachEntry:Ute,matchAll:Wte,isHTMLForm:Gte,hasOwnProperty:P9,hasOwnProp:P9,reduceDescriptors:zI,freezeMethods:Kte,toObjectSet:Zte,toCamelCase:Xte,noop:Jte,toFiniteNumber:ene,findKey:DI,global:Vu,isContextDefined:PI,isSpecCompliantForm:tne,toJSONObject:nne,isAsyncFn:rne,isThenable:sne,setImmediate:II,asap:ine,isIterable:ane};function Zt(t,e,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}je.inherits(Zt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:je.toJSONObject(this.config),code:this.code,status:this.status}}});const LI=Zt.prototype,BI={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{BI[t]={value:t}});Object.defineProperties(Zt,BI);Object.defineProperty(LI,"isAxiosError",{value:!0});Zt.from=(t,e,n,r,s,i)=>{const a=Object.create(LI);je.toFlatObject(t,a,function(h){return h!==Error.prototype},d=>d!=="isAxiosError");const l=t&&t.message?t.message:"Error",c=e==null&&t?t.code:e;return Zt.call(a,l,c,n,r,s),t&&a.cause==null&&Object.defineProperty(a,"cause",{value:t,configurable:!0}),a.name=t&&t.name||"Error",i&&Object.assign(a,i),a};const one=null;function uk(t){return je.isPlainObject(t)||je.isArray(t)}function FI(t){return je.endsWith(t,"[]")?t.slice(0,-2):t}function z9(t,e,n){return t?t.concat(e).map(function(s,i){return s=FI(s),!n&&i?"["+s+"]":s}).join(n?".":""):e}function lne(t){return je.isArray(t)&&!t.some(uk)}const cne=je.toFlatObject(je,{},null,function(e){return/^is[A-Z]/.test(e)});function nb(t,e,n){if(!je.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=je.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,S){return!je.isUndefined(S[w])});const r=n.metaTokens,s=n.visitor||h,i=n.dots,a=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&je.isSpecCompliantForm(e);if(!je.isFunction(s))throw new TypeError("visitor must be a function");function d(y){if(y===null)return"";if(je.isDate(y))return y.toISOString();if(je.isBoolean(y))return y.toString();if(!c&&je.isBlob(y))throw new Zt("Blob is not supported. Use a Buffer instead.");return je.isArrayBuffer(y)||je.isTypedArray(y)?c&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function h(y,w,S){let k=y;if(y&&!S&&typeof y=="object"){if(je.endsWith(w,"{}"))w=r?w:w.slice(0,-2),y=JSON.stringify(y);else if(je.isArray(y)&&lne(y)||(je.isFileList(y)||je.endsWith(w,"[]"))&&(k=je.toArray(y)))return w=FI(w),k.forEach(function(N,T){!(je.isUndefined(N)||N===null)&&e.append(a===!0?z9([w],T,i):a===null?w:w+"[]",d(N))}),!1}return uk(y)?!0:(e.append(z9(S,w,i),d(y)),!1)}const m=[],g=Object.assign(cne,{defaultVisitor:h,convertValue:d,isVisitable:uk});function x(y,w){if(!je.isUndefined(y)){if(m.indexOf(y)!==-1)throw Error("Circular reference detected in "+w.join("."));m.push(y),je.forEach(y,function(k,j){(!(je.isUndefined(k)||k===null)&&s.call(e,k,je.isString(j)?j.trim():j,w,g))===!0&&x(k,w?w.concat(j):[j])}),m.pop()}}if(!je.isObject(t))throw new TypeError("data must be an object");return x(t),e}function I9(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Fj(t,e){this._pairs=[],t&&nb(t,this,e)}const qI=Fj.prototype;qI.append=function(e,n){this._pairs.push([e,n])};qI.toString=function(e){const n=e?function(r){return e.call(this,r,I9)}:I9;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function une(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function $I(t,e,n){if(!e)return t;const r=n&&n.encode||une;je.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(e,n):i=je.isURLSearchParams(e)?e.toString():new Fj(e,n).toString(r),i){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class L9{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){je.forEach(this.handlers,function(r){r!==null&&e(r)})}}const HI={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},dne=typeof URLSearchParams<"u"?URLSearchParams:Fj,hne=typeof FormData<"u"?FormData:null,fne=typeof Blob<"u"?Blob:null,mne={isBrowser:!0,classes:{URLSearchParams:dne,FormData:hne,Blob:fne},protocols:["http","https","file","blob","url","data"]},qj=typeof window<"u"&&typeof document<"u",dk=typeof navigator=="object"&&navigator||void 0,pne=qj&&(!dk||["ReactNative","NativeScript","NS"].indexOf(dk.product)<0),gne=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",xne=qj&&window.location.href||"http://localhost",vne=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:qj,hasStandardBrowserEnv:pne,hasStandardBrowserWebWorkerEnv:gne,navigator:dk,origin:xne},Symbol.toStringTag,{value:"Module"})),$s={...vne,...mne};function yne(t,e){return nb(t,new $s.classes.URLSearchParams,{visitor:function(n,r,s,i){return $s.isNode&&je.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}function bne(t){return je.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function wne(t){const e={},n=Object.keys(t);let r;const s=n.length;let i;for(r=0;r=n.length;return a=!a&&je.isArray(s)?s.length:a,c?(je.hasOwnProp(s,a)?s[a]=[s[a],r]:s[a]=r,!l):((!s[a]||!je.isObject(s[a]))&&(s[a]=[]),e(n,r,s[a],i)&&je.isArray(s[a])&&(s[a]=wne(s[a])),!l)}if(je.isFormData(t)&&je.isFunction(t.entries)){const n={};return je.forEachEntry(t,(r,s)=>{e(bne(r),s,n,0)}),n}return null}function Sne(t,e,n){if(je.isString(t))try{return(e||JSON.parse)(t),je.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const $p={transitional:HI,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=je.isObject(e);if(i&&je.isHTMLForm(e)&&(e=new FormData(e)),je.isFormData(e))return s?JSON.stringify(QI(e)):e;if(je.isArrayBuffer(e)||je.isBuffer(e)||je.isStream(e)||je.isFile(e)||je.isBlob(e)||je.isReadableStream(e))return e;if(je.isArrayBufferView(e))return e.buffer;if(je.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return yne(e,this.formSerializer).toString();if((l=je.isFileList(e))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return nb(l?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),Sne(e)):e}],transformResponse:[function(e){const n=this.transitional||$p.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(je.isResponse(e)||je.isReadableStream(e))return e;if(e&&je.isString(e)&&(r&&!this.responseType||s)){const a=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(e,this.parseReviver)}catch(l){if(a)throw l.name==="SyntaxError"?Zt.from(l,Zt.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:$s.classes.FormData,Blob:$s.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};je.forEach(["delete","get","head","post","put","patch"],t=>{$p.headers[t]={}});const kne=je.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),One=t=>{const e={};let n,r,s;return t&&t.split(` -`).forEach(function(a){s=a.indexOf(":"),n=a.substring(0,s).trim().toLowerCase(),r=a.substring(s+1).trim(),!(!n||e[n]&&kne[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},B9=Symbol("internals");function Im(t){return t&&String(t).trim().toLowerCase()}function av(t){return t===!1||t==null?t:je.isArray(t)?t.map(av):String(t)}function jne(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const Nne=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function C4(t,e,n,r,s){if(je.isFunction(r))return r.call(this,e,n);if(s&&(e=n),!!je.isString(e)){if(je.isString(r))return e.indexOf(r)!==-1;if(je.isRegExp(r))return r.test(e)}}function Cne(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function Tne(t,e){const n=je.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(s,i,a){return this[r].call(this,e,s,i,a)},configurable:!0})})}let Oi=class{constructor(e){e&&this.set(e)}set(e,n,r){const s=this;function i(l,c,d){const h=Im(c);if(!h)throw new Error("header name must be a non-empty string");const m=je.findKey(s,h);(!m||s[m]===void 0||d===!0||d===void 0&&s[m]!==!1)&&(s[m||c]=av(l))}const a=(l,c)=>je.forEach(l,(d,h)=>i(d,h,c));if(je.isPlainObject(e)||e instanceof this.constructor)a(e,n);else if(je.isString(e)&&(e=e.trim())&&!Nne(e))a(One(e),n);else if(je.isObject(e)&&je.isIterable(e)){let l={},c,d;for(const h of e){if(!je.isArray(h))throw TypeError("Object iterator must return a key-value pair");l[d=h[0]]=(c=l[d])?je.isArray(c)?[...c,h[1]]:[c,h[1]]:h[1]}a(l,n)}else e!=null&&i(n,e,r);return this}get(e,n){if(e=Im(e),e){const r=je.findKey(this,e);if(r){const s=this[r];if(!n)return s;if(n===!0)return jne(s);if(je.isFunction(n))return n.call(this,s,r);if(je.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Im(e),e){const r=je.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||C4(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let s=!1;function i(a){if(a=Im(a),a){const l=je.findKey(r,a);l&&(!n||C4(r,r[l],l,n))&&(delete r[l],s=!0)}}return je.isArray(e)?e.forEach(i):i(e),s}clear(e){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!e||C4(this,this[i],i,e,!0))&&(delete this[i],s=!0)}return s}normalize(e){const n=this,r={};return je.forEach(this,(s,i)=>{const a=je.findKey(r,i);if(a){n[a]=av(s),delete n[i];return}const l=e?Cne(i):String(i).trim();l!==i&&delete n[i],n[l]=av(s),r[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return je.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=e&&je.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(` -`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(s=>r.set(s)),r}static accessor(e){const r=(this[B9]=this[B9]={accessors:{}}).accessors,s=this.prototype;function i(a){const l=Im(a);r[l]||(Tne(s,a),r[l]=!0)}return je.isArray(e)?e.forEach(i):i(e),this}};Oi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);je.reduceDescriptors(Oi.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});je.freezeMethods(Oi);function T4(t,e){const n=this||$p,r=e||n,s=Oi.from(r.headers);let i=r.data;return je.forEach(t,function(l){i=l.call(n,i,s.normalize(),e?e.status:void 0)}),s.normalize(),i}function VI(t){return!!(t&&t.__CANCEL__)}function bf(t,e,n){Zt.call(this,t??"canceled",Zt.ERR_CANCELED,e,n),this.name="CanceledError"}je.inherits(bf,Zt,{__CANCEL__:!0});function UI(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new Zt("Request failed with status code "+n.status,[Zt.ERR_BAD_REQUEST,Zt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Ene(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function _ne(t,e){t=t||10;const n=new Array(t),r=new Array(t);let s=0,i=0,a;return e=e!==void 0?e:1e3,function(c){const d=Date.now(),h=r[i];a||(a=d),n[s]=c,r[s]=d;let m=i,g=0;for(;m!==s;)g+=n[m++],m=m%t;if(s=(s+1)%t,s===i&&(i=(i+1)%t),d-a{n=h,s=null,i&&(clearTimeout(i),i=null),t(...d)};return[(...d)=>{const h=Date.now(),m=h-n;m>=r?a(d,h):(s=d,i||(i=setTimeout(()=>{i=null,a(s)},r-m)))},()=>s&&a(s)]}const qv=(t,e,n=3)=>{let r=0;const s=_ne(50,250);return Ane(i=>{const a=i.loaded,l=i.lengthComputable?i.total:void 0,c=a-r,d=s(c),h=a<=l;r=a;const m={loaded:a,total:l,progress:l?a/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&h?(l-a)/d:void 0,event:i,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(m)},n)},F9=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},q9=t=>(...e)=>je.asap(()=>t(...e)),Mne=$s.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,$s.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL($s.origin),$s.navigator&&/(msie|trident)/i.test($s.navigator.userAgent)):()=>!0,Rne=$s.hasStandardBrowserEnv?{write(t,e,n,r,s,i,a){if(typeof document>"u")return;const l=[`${t}=${encodeURIComponent(e)}`];je.isNumber(n)&&l.push(`expires=${new Date(n).toUTCString()}`),je.isString(r)&&l.push(`path=${r}`),je.isString(s)&&l.push(`domain=${s}`),i===!0&&l.push("secure"),je.isString(a)&&l.push(`SameSite=${a}`),document.cookie=l.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Dne(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Pne(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function WI(t,e,n){let r=!Dne(e);return t&&(r||n==!1)?Pne(t,e):e}const $9=t=>t instanceof Oi?{...t}:t;function ad(t,e){e=e||{};const n={};function r(d,h,m,g){return je.isPlainObject(d)&&je.isPlainObject(h)?je.merge.call({caseless:g},d,h):je.isPlainObject(h)?je.merge({},h):je.isArray(h)?h.slice():h}function s(d,h,m,g){if(je.isUndefined(h)){if(!je.isUndefined(d))return r(void 0,d,m,g)}else return r(d,h,m,g)}function i(d,h){if(!je.isUndefined(h))return r(void 0,h)}function a(d,h){if(je.isUndefined(h)){if(!je.isUndefined(d))return r(void 0,d)}else return r(void 0,h)}function l(d,h,m){if(m in e)return r(d,h);if(m in t)return r(void 0,d)}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(d,h,m)=>s($9(d),$9(h),m,!0)};return je.forEach(Object.keys({...t,...e}),function(h){const m=c[h]||s,g=m(t[h],e[h],h);je.isUndefined(g)&&m!==l||(n[h]=g)}),n}const GI=t=>{const e=ad({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:a,auth:l}=e;if(e.headers=a=Oi.from(a),e.url=$I(WI(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),je.isFormData(n)){if($s.hasStandardBrowserEnv||$s.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(je.isFunction(n.getHeaders)){const c=n.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([h,m])=>{d.includes(h.toLowerCase())&&a.set(h,m)})}}if($s.hasStandardBrowserEnv&&(r&&je.isFunction(r)&&(r=r(e)),r||r!==!1&&Mne(e.url))){const c=s&&i&&Rne.read(i);c&&a.set(s,c)}return e},zne=typeof XMLHttpRequest<"u",Ine=zne&&function(t){return new Promise(function(n,r){const s=GI(t);let i=s.data;const a=Oi.from(s.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=s,h,m,g,x,y;function w(){x&&x(),y&&y(),s.cancelToken&&s.cancelToken.unsubscribe(h),s.signal&&s.signal.removeEventListener("abort",h)}let S=new XMLHttpRequest;S.open(s.method.toUpperCase(),s.url,!0),S.timeout=s.timeout;function k(){if(!S)return;const N=Oi.from("getAllResponseHeaders"in S&&S.getAllResponseHeaders()),E={data:!l||l==="text"||l==="json"?S.responseText:S.response,status:S.status,statusText:S.statusText,headers:N,config:t,request:S};UI(function(A){n(A),w()},function(A){r(A),w()},E),S=null}"onloadend"in S?S.onloadend=k:S.onreadystatechange=function(){!S||S.readyState!==4||S.status===0&&!(S.responseURL&&S.responseURL.indexOf("file:")===0)||setTimeout(k)},S.onabort=function(){S&&(r(new Zt("Request aborted",Zt.ECONNABORTED,t,S)),S=null)},S.onerror=function(T){const E=T&&T.message?T.message:"Network Error",_=new Zt(E,Zt.ERR_NETWORK,t,S);_.event=T||null,r(_),S=null},S.ontimeout=function(){let T=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const E=s.transitional||HI;s.timeoutErrorMessage&&(T=s.timeoutErrorMessage),r(new Zt(T,E.clarifyTimeoutError?Zt.ETIMEDOUT:Zt.ECONNABORTED,t,S)),S=null},i===void 0&&a.setContentType(null),"setRequestHeader"in S&&je.forEach(a.toJSON(),function(T,E){S.setRequestHeader(E,T)}),je.isUndefined(s.withCredentials)||(S.withCredentials=!!s.withCredentials),l&&l!=="json"&&(S.responseType=s.responseType),d&&([g,y]=qv(d,!0),S.addEventListener("progress",g)),c&&S.upload&&([m,x]=qv(c),S.upload.addEventListener("progress",m),S.upload.addEventListener("loadend",x)),(s.cancelToken||s.signal)&&(h=N=>{S&&(r(!N||N.type?new bf(null,t,S):N),S.abort(),S=null)},s.cancelToken&&s.cancelToken.subscribe(h),s.signal&&(s.signal.aborted?h():s.signal.addEventListener("abort",h)));const j=Ene(s.url);if(j&&$s.protocols.indexOf(j)===-1){r(new Zt("Unsupported protocol "+j+":",Zt.ERR_BAD_REQUEST,t));return}S.send(i||null)})},Lne=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,s;const i=function(d){if(!s){s=!0,l();const h=d instanceof Error?d:this.reason;r.abort(h instanceof Zt?h:new bf(h instanceof Error?h.message:h))}};let a=e&&setTimeout(()=>{a=null,i(new Zt(`timeout ${e} of ms exceeded`,Zt.ETIMEDOUT))},e);const l=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),t=null)};t.forEach(d=>d.addEventListener("abort",i));const{signal:c}=r;return c.unsubscribe=()=>je.asap(l),c}},Bne=function*(t,e){let n=t.byteLength;if(n{const s=Fne(t,e);let i=0,a,l=c=>{a||(a=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:d,value:h}=await s.next();if(d){l(),c.close();return}let m=h.byteLength;if(n){let g=i+=m;n(g)}c.enqueue(new Uint8Array(h))}catch(d){throw l(d),d}},cancel(c){return l(c),s.return()}},{highWaterMark:2})},Q9=64*1024,{isFunction:e1}=je,$ne=(({Request:t,Response:e})=>({Request:t,Response:e}))(je.global),{ReadableStream:V9,TextEncoder:U9}=je.global,W9=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Hne=t=>{t=je.merge.call({skipUndefined:!0},$ne,t);const{fetch:e,Request:n,Response:r}=t,s=e?e1(e):typeof fetch=="function",i=e1(n),a=e1(r);if(!s)return!1;const l=s&&e1(V9),c=s&&(typeof U9=="function"?(y=>w=>y.encode(w))(new U9):async y=>new Uint8Array(await new n(y).arrayBuffer())),d=i&&l&&W9(()=>{let y=!1;const w=new n($s.origin,{body:new V9,method:"POST",get duplex(){return y=!0,"half"}}).headers.has("Content-Type");return y&&!w}),h=a&&l&&W9(()=>je.isReadableStream(new r("").body)),m={stream:h&&(y=>y.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!m[y]&&(m[y]=(w,S)=>{let k=w&&w[y];if(k)return k.call(w);throw new Zt(`Response type '${y}' is not supported`,Zt.ERR_NOT_SUPPORT,S)})});const g=async y=>{if(y==null)return 0;if(je.isBlob(y))return y.size;if(je.isSpecCompliantForm(y))return(await new n($s.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(je.isArrayBufferView(y)||je.isArrayBuffer(y))return y.byteLength;if(je.isURLSearchParams(y)&&(y=y+""),je.isString(y))return(await c(y)).byteLength},x=async(y,w)=>{const S=je.toFiniteNumber(y.getContentLength());return S??g(w)};return async y=>{let{url:w,method:S,data:k,signal:j,cancelToken:N,timeout:T,onDownloadProgress:E,onUploadProgress:_,responseType:A,headers:D,withCredentials:q="same-origin",fetchOptions:B}=GI(y),H=e||fetch;A=A?(A+"").toLowerCase():"text";let W=Lne([j,N&&N.toAbortSignal()],T),ee=null;const I=W&&W.unsubscribe&&(()=>{W.unsubscribe()});let V;try{if(_&&d&&S!=="get"&&S!=="head"&&(V=await x(D,k))!==0){let ie=new n(w,{method:"POST",body:k,duplex:"half"}),X;if(je.isFormData(k)&&(X=ie.headers.get("content-type"))&&D.setContentType(X),ie.body){const[z,U]=F9(V,qv(q9(_)));k=H9(ie.body,Q9,z,U)}}je.isString(q)||(q=q?"include":"omit");const L=i&&"credentials"in n.prototype,$={...B,signal:W,method:S.toUpperCase(),headers:D.normalize().toJSON(),body:k,duplex:"half",credentials:L?q:void 0};ee=i&&new n(w,$);let K=await(i?H(ee,B):H(w,$));const Y=h&&(A==="stream"||A==="response");if(h&&(E||Y&&I)){const ie={};["status","statusText","headers"].forEach(te=>{ie[te]=K[te]});const X=je.toFiniteNumber(K.headers.get("content-length")),[z,U]=E&&F9(X,qv(q9(E),!0))||[];K=new r(H9(K.body,Q9,z,()=>{U&&U(),I&&I()}),ie)}A=A||"text";let R=await m[je.findKey(m,A)||"text"](K,y);return!Y&&I&&I(),await new Promise((ie,X)=>{UI(ie,X,{data:R,headers:Oi.from(K.headers),status:K.status,statusText:K.statusText,config:y,request:ee})})}catch(L){throw I&&I(),L&&L.name==="TypeError"&&/Load failed|fetch/i.test(L.message)?Object.assign(new Zt("Network Error",Zt.ERR_NETWORK,y,ee),{cause:L.cause||L}):Zt.from(L,L&&L.code,y,ee)}}},Qne=new Map,XI=t=>{let e=t&&t.env||{};const{fetch:n,Request:r,Response:s}=e,i=[r,s,n];let a=i.length,l=a,c,d,h=Qne;for(;l--;)c=i[l],d=h.get(c),d===void 0&&h.set(c,d=l?new Map:Hne(e)),h=d;return d};XI();const $j={http:one,xhr:Ine,fetch:{get:XI}};je.forEach($j,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const G9=t=>`- ${t}`,Vne=t=>je.isFunction(t)||t===null||t===!1;function Une(t,e){t=je.isArray(t)?t:[t];const{length:n}=t;let r,s;const i={};for(let a=0;a`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=n?a.length>1?`since : -`+a.map(G9).join(` -`):" "+G9(a[0]):"as no adapter specified";throw new Zt("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return s}const YI={getAdapter:Une,adapters:$j};function E4(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new bf(null,t)}function X9(t){return E4(t),t.headers=Oi.from(t.headers),t.data=T4.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),YI.getAdapter(t.adapter||$p.adapter,t)(t).then(function(r){return E4(t),r.data=T4.call(t,t.transformResponse,r),r.headers=Oi.from(r.headers),r},function(r){return VI(r)||(E4(t),r&&r.response&&(r.response.data=T4.call(t,t.transformResponse,r.response),r.response.headers=Oi.from(r.response.headers))),Promise.reject(r)})}const KI="1.13.2",rb={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{rb[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Y9={};rb.transitional=function(e,n,r){function s(i,a){return"[Axios v"+KI+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,l)=>{if(e===!1)throw new Zt(s(a," has been removed"+(n?" in "+n:"")),Zt.ERR_DEPRECATED);return n&&!Y9[a]&&(Y9[a]=!0,console.warn(s(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,a,l):!0}};rb.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function Wne(t,e,n){if(typeof t!="object")throw new Zt("options must be an object",Zt.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let s=r.length;for(;s-- >0;){const i=r[s],a=e[i];if(a){const l=t[i],c=l===void 0||a(l,i,t);if(c!==!0)throw new Zt("option "+i+" must be "+c,Zt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Zt("Unknown option "+i,Zt.ERR_BAD_OPTION)}}const ov={assertOptions:Wne,validators:rb},fo=ov.validators;let nd=class{constructor(e){this.defaults=e||{},this.interceptors={request:new L9,response:new L9}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=` -`+i):r.stack=i}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=ad(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&ov.assertOptions(r,{silentJSONParsing:fo.transitional(fo.boolean),forcedJSONParsing:fo.transitional(fo.boolean),clarifyTimeoutError:fo.transitional(fo.boolean)},!1),s!=null&&(je.isFunction(s)?n.paramsSerializer={serialize:s}:ov.assertOptions(s,{encode:fo.function,serialize:fo.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ov.assertOptions(n,{baseUrl:fo.spelling("baseURL"),withXsrfToken:fo.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&je.merge(i.common,i[n.method]);i&&je.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),n.headers=Oi.concat(a,i);const l=[];let c=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(c=c&&w.synchronous,l.unshift(w.fulfilled,w.rejected))});const d=[];this.interceptors.response.forEach(function(w){d.push(w.fulfilled,w.rejected)});let h,m=0,g;if(!c){const y=[X9.bind(this),void 0];for(y.unshift(...l),y.push(...d),g=y.length,h=Promise.resolve(n);m{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const a=new Promise(l=>{r.subscribe(l),i=l}).then(s);return a.cancel=function(){r.unsubscribe(i)},a},e(function(i,a,l){r.reason||(r.reason=new bf(i,a,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new ZI(function(s){e=s}),cancel:e}}};function Xne(t){return function(n){return t.apply(null,n)}}function Yne(t){return je.isObject(t)&&t.isAxiosError===!0}const hk={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(hk).forEach(([t,e])=>{hk[e]=t});function JI(t){const e=new nd(t),n=_I(nd.prototype.request,e);return je.extend(n,nd.prototype,e,{allOwnKeys:!0}),je.extend(n,e,null,{allOwnKeys:!0}),n.create=function(s){return JI(ad(t,s))},n}const Cr=JI($p);Cr.Axios=nd;Cr.CanceledError=bf;Cr.CancelToken=Gne;Cr.isCancel=VI;Cr.VERSION=KI;Cr.toFormData=nb;Cr.AxiosError=Zt;Cr.Cancel=Cr.CanceledError;Cr.all=function(e){return Promise.all(e)};Cr.spread=Xne;Cr.isAxiosError=Yne;Cr.mergeConfig=ad;Cr.AxiosHeaders=Oi;Cr.formToJSON=t=>QI(je.isHTMLForm(t)?new FormData(t):t);Cr.getAdapter=YI.getAdapter;Cr.HttpStatusCode=hk;Cr.default=Cr;const{Axios:fPe,AxiosError:mPe,CanceledError:pPe,isCancel:gPe,CancelToken:xPe,VERSION:vPe,all:yPe,Cancel:bPe,isAxiosError:wPe,spread:SPe,toFormData:kPe,AxiosHeaders:OPe,HttpStatusCode:jPe,formToJSON:NPe,getAdapter:CPe,mergeConfig:TPe}=Cr,Kne=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r({classGroupId:t,validator:e}),eL=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),$v="-",K9=[],Jne="arbitrary..",ere=t=>{const e=nre(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return tre(a);const l=a.split($v),c=l[0]===""&&l.length>1?1:0;return tL(l,c,e)},getConflictingClassGroupIds:(a,l)=>{if(l){const c=r[a],d=n[a];return c?d?Kne(d,c):c:d||K9}return n[a]||K9}}},tL=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const d=tL(t,e+1,i);if(d)return d}const a=n.validators;if(a===null)return;const l=e===0?t.join($v):t.slice(e).join($v),c=a.length;for(let d=0;dt.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?Jne+r:void 0})(),nre=t=>{const{theme:e,classGroups:n}=t;return rre(n,e)},rre=(t,e)=>{const n=eL();for(const r in t){const s=t[r];Hj(s,n,r,e)}return n},Hj=(t,e,n,r)=>{const s=t.length;for(let i=0;i{if(typeof t=="string"){ire(t,e,n);return}if(typeof t=="function"){are(t,e,n,r);return}ore(t,e,n,r)},ire=(t,e,n)=>{const r=t===""?e:nL(e,t);r.classGroupId=n},are=(t,e,n,r)=>{if(lre(t)){Hj(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(Zne(n,t))},ore=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let a=0;a{let n=t;const r=e.split($v),s=r.length;for(let i=0;i"isThemeGetter"in t&&t.isThemeGetter===!0,cre=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const s=(i,a)=>{n[i]=a,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(i){let a=n[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in n?n[i]=a:s(i,a)}}},fk="!",Z9=":",ure=[],J9=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),dre=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let a=0,l=0,c=0,d;const h=s.length;for(let w=0;wc?d-c:void 0;return J9(i,x,g,y)};if(e){const s=e+Z9,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):J9(ure,!1,a,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},hre=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},fre=t=>({cache:cre(t.cacheSize),parseClassName:dre(t),sortModifiers:hre(t),...ere(t)}),mre=/\s+/,pre=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i}=e,a=[],l=t.trim().split(mre);let c="";for(let d=l.length-1;d>=0;d-=1){const h=l[d],{isExternal:m,modifiers:g,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:w}=n(h);if(m){c=h+(c.length>0?" "+c:c);continue}let S=!!w,k=r(S?y.substring(0,w):y);if(!k){if(!S){c=h+(c.length>0?" "+c:c);continue}if(k=r(y),!k){c=h+(c.length>0?" "+c:c);continue}S=!1}const j=g.length===0?"":g.length===1?g[0]:i(g).join(":"),N=x?j+fk:j,T=N+k;if(a.indexOf(T)>-1)continue;a.push(T);const E=s(k,S);for(let _=0;_0?" "+c:c)}return c},gre=(...t)=>{let e=0,n,r,s="";for(;e{if(typeof t=="string")return t;let e,n="";for(let r=0;r{let n,r,s,i;const a=c=>{const d=e.reduce((h,m)=>m(h),t());return n=fre(d),r=n.cache.get,s=n.cache.set,i=l,l(c)},l=c=>{const d=r(c);if(d)return d;const h=pre(c,n);return s(c,h),h};return i=a,(...c)=>i(gre(...c))},vre=[],cs=t=>{const e=n=>n[t]||vre;return e.isThemeGetter=!0,e},sL=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,iL=/^\((?:(\w[\w-]*):)?(.+)\)$/i,yre=/^\d+\/\d+$/,bre=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wre=/\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$/,Sre=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,kre=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ore=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oh=t=>yre.test(t),sn=t=>!!t&&!Number.isNaN(Number(t)),Tc=t=>!!t&&Number.isInteger(Number(t)),_4=t=>t.endsWith("%")&&sn(t.slice(0,-1)),bl=t=>bre.test(t),jre=()=>!0,Nre=t=>wre.test(t)&&!Sre.test(t),aL=()=>!1,Cre=t=>kre.test(t),Tre=t=>Ore.test(t),Ere=t=>!ft(t)&&!mt(t),_re=t=>wf(t,cL,aL),ft=t=>sL.test(t),Pu=t=>wf(t,uL,Nre),A4=t=>wf(t,Pre,sn),eE=t=>wf(t,oL,aL),Are=t=>wf(t,lL,Tre),t1=t=>wf(t,dL,Cre),mt=t=>iL.test(t),Lm=t=>Sf(t,uL),Mre=t=>Sf(t,zre),tE=t=>Sf(t,oL),Rre=t=>Sf(t,cL),Dre=t=>Sf(t,lL),n1=t=>Sf(t,dL,!0),wf=(t,e,n)=>{const r=sL.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Sf=(t,e,n=!1)=>{const r=iL.exec(t);return r?r[1]?e(r[1]):n:!1},oL=t=>t==="position"||t==="percentage",lL=t=>t==="image"||t==="url",cL=t=>t==="length"||t==="size"||t==="bg-size",uL=t=>t==="length",Pre=t=>t==="number",zre=t=>t==="family-name",dL=t=>t==="shadow",Ire=()=>{const t=cs("color"),e=cs("font"),n=cs("text"),r=cs("font-weight"),s=cs("tracking"),i=cs("leading"),a=cs("breakpoint"),l=cs("container"),c=cs("spacing"),d=cs("radius"),h=cs("shadow"),m=cs("inset-shadow"),g=cs("text-shadow"),x=cs("drop-shadow"),y=cs("blur"),w=cs("perspective"),S=cs("aspect"),k=cs("ease"),j=cs("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...T(),mt,ft],_=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],D=()=>[mt,ft,c],q=()=>[oh,"full","auto",...D()],B=()=>[Tc,"none","subgrid",mt,ft],H=()=>["auto",{span:["full",Tc,mt,ft]},Tc,mt,ft],W=()=>[Tc,"auto",mt,ft],ee=()=>["auto","min","max","fr",mt,ft],I=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...D()],$=()=>[oh,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],K=()=>[t,mt,ft],Y=()=>[...T(),tE,eE,{position:[mt,ft]}],R=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ie=()=>["auto","cover","contain",Rre,_re,{size:[mt,ft]}],X=()=>[_4,Lm,Pu],z=()=>["","none","full",d,mt,ft],U=()=>["",sn,Lm,Pu],te=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>[sn,_4,tE,eE],se=()=>["","none",y,mt,ft],re=()=>["none",sn,mt,ft],ae=()=>["none",sn,mt,ft],_e=()=>[sn,mt,ft],Be=()=>[oh,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[bl],breakpoint:[bl],color:[jre],container:[bl],"drop-shadow":[bl],ease:["in","out","in-out"],font:[Ere],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[bl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[bl],shadow:[bl],spacing:["px",sn],text:[bl],"text-shadow":[bl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",oh,ft,mt,S]}],container:["container"],columns:[{columns:[sn,ft,mt,l]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:q()}],"inset-x":[{"inset-x":q()}],"inset-y":[{"inset-y":q()}],start:[{start:q()}],end:[{end:q()}],top:[{top:q()}],right:[{right:q()}],bottom:[{bottom:q()}],left:[{left:q()}],visibility:["visible","invisible","collapse"],z:[{z:[Tc,"auto",mt,ft]}],basis:[{basis:[oh,"full","auto",l,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[sn,oh,"auto","initial","none",ft]}],grow:[{grow:["",sn,mt,ft]}],shrink:[{shrink:["",sn,mt,ft]}],order:[{order:[Tc,"first","last","none",mt,ft]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:H()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:H()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...I(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...I()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":I()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],w:[{w:[l,"screen",...$()]}],"min-w":[{"min-w":[l,"screen","none",...$()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[a]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",n,Lm,Pu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,mt,A4]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",_4,ft]}],"font-family":[{font:[Mre,ft,e]}],"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:[s,mt,ft]}],"line-clamp":[{"line-clamp":[sn,"none",mt,A4]}],leading:[{leading:[i,...D()]}],"list-image":[{"list-image":["none",mt,ft]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",mt,ft]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:K()}],"text-color":[{text:K()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[sn,"from-font","auto",mt,Pu]}],"text-decoration-color":[{decoration:K()}],"underline-offset":[{"underline-offset":[sn,"auto",mt,ft]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",mt,ft]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",mt,ft]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Y()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Tc,mt,ft],radial:["",mt,ft],conic:[Tc,mt,ft]},Dre,Are]}],"bg-color":[{bg:K()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:K()}],"gradient-via":[{via:K()}],"gradient-to":[{to:K()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:U()}],"border-w-x":[{"border-x":U()}],"border-w-y":[{"border-y":U()}],"border-w-s":[{"border-s":U()}],"border-w-e":[{"border-e":U()}],"border-w-t":[{"border-t":U()}],"border-w-r":[{"border-r":U()}],"border-w-b":[{"border-b":U()}],"border-w-l":[{"border-l":U()}],"divide-x":[{"divide-x":U()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":U()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"hidden","none"]}],"border-color":[{border:K()}],"border-color-x":[{"border-x":K()}],"border-color-y":[{"border-y":K()}],"border-color-s":[{"border-s":K()}],"border-color-e":[{"border-e":K()}],"border-color-t":[{"border-t":K()}],"border-color-r":[{"border-r":K()}],"border-color-b":[{"border-b":K()}],"border-color-l":[{"border-l":K()}],"divide-color":[{divide:K()}],"outline-style":[{outline:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[sn,mt,ft]}],"outline-w":[{outline:["",sn,Lm,Pu]}],"outline-color":[{outline:K()}],shadow:[{shadow:["","none",h,n1,t1]}],"shadow-color":[{shadow:K()}],"inset-shadow":[{"inset-shadow":["none",m,n1,t1]}],"inset-shadow-color":[{"inset-shadow":K()}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:K()}],"ring-offset-w":[{"ring-offset":[sn,Pu]}],"ring-offset-color":[{"ring-offset":K()}],"inset-ring-w":[{"inset-ring":U()}],"inset-ring-color":[{"inset-ring":K()}],"text-shadow":[{"text-shadow":["none",g,n1,t1]}],"text-shadow-color":[{"text-shadow":K()}],opacity:[{opacity:[sn,mt,ft]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[sn]}],"mask-image-linear-from-pos":[{"mask-linear-from":G()}],"mask-image-linear-to-pos":[{"mask-linear-to":G()}],"mask-image-linear-from-color":[{"mask-linear-from":K()}],"mask-image-linear-to-color":[{"mask-linear-to":K()}],"mask-image-t-from-pos":[{"mask-t-from":G()}],"mask-image-t-to-pos":[{"mask-t-to":G()}],"mask-image-t-from-color":[{"mask-t-from":K()}],"mask-image-t-to-color":[{"mask-t-to":K()}],"mask-image-r-from-pos":[{"mask-r-from":G()}],"mask-image-r-to-pos":[{"mask-r-to":G()}],"mask-image-r-from-color":[{"mask-r-from":K()}],"mask-image-r-to-color":[{"mask-r-to":K()}],"mask-image-b-from-pos":[{"mask-b-from":G()}],"mask-image-b-to-pos":[{"mask-b-to":G()}],"mask-image-b-from-color":[{"mask-b-from":K()}],"mask-image-b-to-color":[{"mask-b-to":K()}],"mask-image-l-from-pos":[{"mask-l-from":G()}],"mask-image-l-to-pos":[{"mask-l-to":G()}],"mask-image-l-from-color":[{"mask-l-from":K()}],"mask-image-l-to-color":[{"mask-l-to":K()}],"mask-image-x-from-pos":[{"mask-x-from":G()}],"mask-image-x-to-pos":[{"mask-x-to":G()}],"mask-image-x-from-color":[{"mask-x-from":K()}],"mask-image-x-to-color":[{"mask-x-to":K()}],"mask-image-y-from-pos":[{"mask-y-from":G()}],"mask-image-y-to-pos":[{"mask-y-to":G()}],"mask-image-y-from-color":[{"mask-y-from":K()}],"mask-image-y-to-color":[{"mask-y-to":K()}],"mask-image-radial":[{"mask-radial":[mt,ft]}],"mask-image-radial-from-pos":[{"mask-radial-from":G()}],"mask-image-radial-to-pos":[{"mask-radial-to":G()}],"mask-image-radial-from-color":[{"mask-radial-from":K()}],"mask-image-radial-to-color":[{"mask-radial-to":K()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":T()}],"mask-image-conic-pos":[{"mask-conic":[sn]}],"mask-image-conic-from-pos":[{"mask-conic-from":G()}],"mask-image-conic-to-pos":[{"mask-conic-to":G()}],"mask-image-conic-from-color":[{"mask-conic-from":K()}],"mask-image-conic-to-color":[{"mask-conic-to":K()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Y()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",mt,ft]}],filter:[{filter:["","none",mt,ft]}],blur:[{blur:se()}],brightness:[{brightness:[sn,mt,ft]}],contrast:[{contrast:[sn,mt,ft]}],"drop-shadow":[{"drop-shadow":["","none",x,n1,t1]}],"drop-shadow-color":[{"drop-shadow":K()}],grayscale:[{grayscale:["",sn,mt,ft]}],"hue-rotate":[{"hue-rotate":[sn,mt,ft]}],invert:[{invert:["",sn,mt,ft]}],saturate:[{saturate:[sn,mt,ft]}],sepia:[{sepia:["",sn,mt,ft]}],"backdrop-filter":[{"backdrop-filter":["","none",mt,ft]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[sn,mt,ft]}],"backdrop-contrast":[{"backdrop-contrast":[sn,mt,ft]}],"backdrop-grayscale":[{"backdrop-grayscale":["",sn,mt,ft]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[sn,mt,ft]}],"backdrop-invert":[{"backdrop-invert":["",sn,mt,ft]}],"backdrop-opacity":[{"backdrop-opacity":[sn,mt,ft]}],"backdrop-saturate":[{"backdrop-saturate":[sn,mt,ft]}],"backdrop-sepia":[{"backdrop-sepia":["",sn,mt,ft]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",mt,ft]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[sn,"initial",mt,ft]}],ease:[{ease:["linear","initial",k,mt,ft]}],delay:[{delay:[sn,mt,ft]}],animate:[{animate:["none",j,mt,ft]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,mt,ft]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:_e()}],"skew-x":[{"skew-x":_e()}],"skew-y":[{"skew-y":_e()}],transform:[{transform:[mt,ft,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Be()}],"translate-x":[{"translate-x":Be()}],"translate-y":[{"translate-y":Be()}],"translate-z":[{"translate-z":Be()}],"translate-none":["translate-none"],accent:[{accent:K()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:K()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",mt,ft]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",mt,ft]}],fill:[{fill:["none",...K()]}],"stroke-w":[{stroke:[sn,Lm,Pu,A4]}],stroke:[{stroke:["none",...K()]}],"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-x","border-w-y","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-x","border-color-y","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Lre=xre(Ire);function xe(...t){return Lre(Qz(t))}const Lt=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:xe("rounded-xl border bg-card text-card-foreground shadow",t),...e}));Lt.displayName="Card";const En=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:xe("flex flex-col space-y-1.5 p-6",t),...e}));En.displayName="CardHeader";const _n=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:xe("font-semibold leading-none tracking-tight",t),...e}));_n.displayName="CardTitle";const Wr=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:xe("text-sm text-muted-foreground",t),...e}));Wr.displayName="CardDescription";const Xn=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:xe("p-6 pt-0",t),...e}));Xn.displayName="CardContent";const hL=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:xe("flex items-center p-6 pt-0",t),...e}));hL.displayName="CardFooter";var M4="rovingFocusGroup.onEntryFocus",Bre={bubbles:!1,cancelable:!0},Hp="RovingFocusGroup",[mk,fL,Fre]=Qy(Hp),[qre,sb]=Da(Hp,[Fre]),[$re,Hre]=qre(Hp),mL=b.forwardRef((t,e)=>o.jsx(mk.Provider,{scope:t.__scopeRovingFocusGroup,children:o.jsx(mk.Slot,{scope:t.__scopeRovingFocusGroup,children:o.jsx(Qre,{...t,ref:e})})}));mL.displayName=Hp;var Qre=b.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:h=!1,...m}=t,g=b.useRef(null),x=er(e,g),y=Rp(i),[w,S]=Kl({prop:a,defaultProp:l??null,onChange:c,caller:Hp}),[k,j]=b.useState(!1),N=Rs(d),T=fL(n),E=b.useRef(!1),[_,A]=b.useState(0);return b.useEffect(()=>{const D=g.current;if(D)return D.addEventListener(M4,N),()=>D.removeEventListener(M4,N)},[N]),o.jsx($re,{scope:n,orientation:r,dir:y,loop:s,currentTabStopId:w,onItemFocus:b.useCallback(D=>S(D),[S]),onItemShiftTab:b.useCallback(()=>j(!0),[]),onFocusableItemAdd:b.useCallback(()=>A(D=>D+1),[]),onFocusableItemRemove:b.useCallback(()=>A(D=>D-1),[]),children:o.jsx(Sn.div,{tabIndex:k||_===0?-1:0,"data-orientation":r,...m,ref:x,style:{outline:"none",...t.style},onMouseDown:nt(t.onMouseDown,()=>{E.current=!0}),onFocus:nt(t.onFocus,D=>{const q=!E.current;if(D.target===D.currentTarget&&q&&!k){const B=new CustomEvent(M4,Bre);if(D.currentTarget.dispatchEvent(B),!B.defaultPrevented){const H=T().filter(L=>L.focusable),W=H.find(L=>L.active),ee=H.find(L=>L.id===w),V=[W,ee,...H].filter(Boolean).map(L=>L.ref.current);xL(V,h)}}E.current=!1}),onBlur:nt(t.onBlur,()=>j(!1))})})}),pL="RovingFocusGroupItem",gL=b.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:a,...l}=t,c=Gi(),d=i||c,h=Hre(pL,n),m=h.currentTabStopId===d,g=fL(n),{onFocusableItemAdd:x,onFocusableItemRemove:y,currentTabStopId:w}=h;return b.useEffect(()=>{if(r)return x(),()=>y()},[r,x,y]),o.jsx(mk.ItemSlot,{scope:n,id:d,focusable:r,active:s,children:o.jsx(Sn.span,{tabIndex:m?0:-1,"data-orientation":h.orientation,...l,ref:e,onMouseDown:nt(t.onMouseDown,S=>{r?h.onItemFocus(d):S.preventDefault()}),onFocus:nt(t.onFocus,()=>h.onItemFocus(d)),onKeyDown:nt(t.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){h.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const k=Wre(S,h.orientation,h.dir);if(k!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let N=g().filter(T=>T.focusable).map(T=>T.ref.current);if(k==="last")N.reverse();else if(k==="prev"||k==="next"){k==="prev"&&N.reverse();const T=N.indexOf(S.currentTarget);N=h.loop?Gre(N,T+1):N.slice(T+1)}setTimeout(()=>xL(N))}}),children:typeof a=="function"?a({isCurrentTabStop:m,hasTabStop:w!=null}):a})})});gL.displayName=pL;var Vre={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ure(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Wre(t,e,n){const r=Ure(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Vre[r]}function xL(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function Gre(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var vL=mL,yL=gL,ib="Tabs",[Xre]=Da(ib,[sb]),bL=sb(),[Yre,Qj]=Xre(ib),wL=b.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:a="horizontal",dir:l,activationMode:c="automatic",...d}=t,h=Rp(l),[m,g]=Kl({prop:r,onChange:s,defaultProp:i??"",caller:ib});return o.jsx(Yre,{scope:n,baseId:Gi(),value:m,onValueChange:g,orientation:a,dir:h,activationMode:c,children:o.jsx(Sn.div,{dir:h,"data-orientation":a,...d,ref:e})})});wL.displayName=ib;var SL="TabsList",kL=b.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...s}=t,i=Qj(SL,n),a=bL(n);return o.jsx(vL,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:o.jsx(Sn.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:e})})});kL.displayName=SL;var OL="TabsTrigger",jL=b.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=t,a=Qj(OL,n),l=bL(n),c=TL(a.baseId,r),d=EL(a.baseId,r),h=r===a.value;return o.jsx(yL,{asChild:!0,...l,focusable:!s,active:h,children:o.jsx(Sn.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":d,"data-state":h?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...i,ref:e,onMouseDown:nt(t.onMouseDown,m=>{!s&&m.button===0&&m.ctrlKey===!1?a.onValueChange(r):m.preventDefault()}),onKeyDown:nt(t.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&a.onValueChange(r)}),onFocus:nt(t.onFocus,()=>{const m=a.activationMode!=="manual";!h&&!s&&m&&a.onValueChange(r)})})})});jL.displayName=OL;var NL="TabsContent",CL=b.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...a}=t,l=Qj(NL,n),c=TL(l.baseId,r),d=EL(l.baseId,r),h=r===l.value,m=b.useRef(h);return b.useEffect(()=>{const g=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(g)},[]),o.jsx(oi,{present:s||h,children:({present:g})=>o.jsx(Sn.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!g,id:d,tabIndex:0,...a,ref:e,style:{...t.style,animationDuration:m.current?"0s":void 0},children:g&&i})})});CL.displayName=NL;function TL(t,e){return`${t}-trigger-${e}`}function EL(t,e){return`${t}-content-${e}`}var Kre=wL,_L=kL,AL=jL,ML=CL;const Yi=Kre,ji=b.forwardRef(({className:t,...e},n)=>o.jsx(_L,{ref:n,className:xe("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...e}));ji.displayName=_L.displayName;const Bt=b.forwardRef(({className:t,...e},n)=>o.jsx(AL,{ref:n,className:xe("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all duration-300 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",t),...e}));Bt.displayName=AL.displayName;const ln=b.forwardRef(({className:t,...e},n)=>o.jsx(ML,{ref:n,className:xe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=active]:animate-in data-[state=active]:fade-in data-[state=active]:duration-300",t),...e}));ln.displayName=ML.displayName;function Zre(t,e){return b.useReducer((n,r)=>e[n][r]??n,t)}var Vj="ScrollArea",[RL]=Da(Vj),[Jre,Pa]=RL(Vj),DL=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:i=600,...a}=t,[l,c]=b.useState(null),[d,h]=b.useState(null),[m,g]=b.useState(null),[x,y]=b.useState(null),[w,S]=b.useState(null),[k,j]=b.useState(0),[N,T]=b.useState(0),[E,_]=b.useState(!1),[A,D]=b.useState(!1),q=er(e,H=>c(H)),B=Rp(s);return o.jsx(Jre,{scope:n,type:r,dir:B,scrollHideDelay:i,scrollArea:l,viewport:d,onViewportChange:h,content:m,onContentChange:g,scrollbarX:x,onScrollbarXChange:y,scrollbarXEnabled:E,onScrollbarXEnabledChange:_,scrollbarY:w,onScrollbarYChange:S,scrollbarYEnabled:A,onScrollbarYEnabledChange:D,onCornerWidthChange:j,onCornerHeightChange:T,children:o.jsx(Sn.div,{dir:B,...a,ref:q,style:{position:"relative","--radix-scroll-area-corner-width":k+"px","--radix-scroll-area-corner-height":N+"px",...t.style}})})});DL.displayName=Vj;var PL="ScrollAreaViewport",zL=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,nonce:s,...i}=t,a=Pa(PL,n),l=b.useRef(null),c=er(e,l,a.onViewportChange);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),o.jsx(Sn.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...t.style},children:o.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});zL.displayName=PL;var Ho="ScrollAreaScrollbar",Uj=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Pa(Ho,t.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=s,l=t.orientation==="horizontal";return b.useEffect(()=>(l?i(!0):a(!0),()=>{l?i(!1):a(!1)}),[l,i,a]),s.type==="hover"?o.jsx(ese,{...r,ref:e,forceMount:n}):s.type==="scroll"?o.jsx(tse,{...r,ref:e,forceMount:n}):s.type==="auto"?o.jsx(IL,{...r,ref:e,forceMount:n}):s.type==="always"?o.jsx(Wj,{...r,ref:e}):null});Uj.displayName=Ho;var ese=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Pa(Ho,t.__scopeScrollArea),[i,a]=b.useState(!1);return b.useEffect(()=>{const l=s.scrollArea;let c=0;if(l){const d=()=>{window.clearTimeout(c),a(!0)},h=()=>{c=window.setTimeout(()=>a(!1),s.scrollHideDelay)};return l.addEventListener("pointerenter",d),l.addEventListener("pointerleave",h),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",d),l.removeEventListener("pointerleave",h)}}},[s.scrollArea,s.scrollHideDelay]),o.jsx(oi,{present:n||i,children:o.jsx(IL,{"data-state":i?"visible":"hidden",...r,ref:e})})}),tse=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Pa(Ho,t.__scopeScrollArea),i=t.orientation==="horizontal",a=ob(()=>c("SCROLL_END"),100),[l,c]=Zre("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return b.useEffect(()=>{if(l==="idle"){const d=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(d)}},[l,s.scrollHideDelay,c]),b.useEffect(()=>{const d=s.viewport,h=i?"scrollLeft":"scrollTop";if(d){let m=d[h];const g=()=>{const x=d[h];m!==x&&(c("SCROLL"),a()),m=x};return d.addEventListener("scroll",g),()=>d.removeEventListener("scroll",g)}},[s.viewport,i,c,a]),o.jsx(oi,{present:n||l!=="hidden",children:o.jsx(Wj,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:nt(t.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:nt(t.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),IL=b.forwardRef((t,e)=>{const n=Pa(Ho,t.__scopeScrollArea),{forceMount:r,...s}=t,[i,a]=b.useState(!1),l=t.orientation==="horizontal",c=ob(()=>{if(n.viewport){const d=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=t,s=Pa(Ho,t.__scopeScrollArea),i=b.useRef(null),a=b.useRef(0),[l,c]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=$L(l.viewport,l.content),h={...r,sizes:l,onSizesChange:c,hasThumb:d>0&&d<1,onThumbChange:g=>i.current=g,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:g=>a.current=g};function m(g,x){return ose(g,a.current,l,x)}return n==="horizontal"?o.jsx(nse,{...h,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const g=s.viewport.scrollLeft,x=nE(g,l,s.dir);i.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollLeft=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollLeft=m(g,s.dir))}}):n==="vertical"?o.jsx(rse,{...h,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const g=s.viewport.scrollTop,x=nE(g,l);i.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollTop=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollTop=m(g))}}):null}),nse=b.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=Pa(Ho,t.__scopeScrollArea),[a,l]=b.useState(),c=b.useRef(null),d=er(e,c,i.onScrollbarXChange);return b.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),o.jsx(BL,{"data-orientation":"horizontal",...s,ref:d,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ab(n)+"px",...t.style},onThumbPointerDown:h=>t.onThumbPointerDown(h.x),onDragScroll:h=>t.onDragScroll(h.x),onWheelScroll:(h,m)=>{if(i.viewport){const g=i.viewport.scrollLeft+h.deltaX;t.onWheelScroll(g),QL(g,m)&&h.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Qv(a.paddingLeft),paddingEnd:Qv(a.paddingRight)}})}})}),rse=b.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=Pa(Ho,t.__scopeScrollArea),[a,l]=b.useState(),c=b.useRef(null),d=er(e,c,i.onScrollbarYChange);return b.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),o.jsx(BL,{"data-orientation":"vertical",...s,ref:d,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ab(n)+"px",...t.style},onThumbPointerDown:h=>t.onThumbPointerDown(h.y),onDragScroll:h=>t.onDragScroll(h.y),onWheelScroll:(h,m)=>{if(i.viewport){const g=i.viewport.scrollTop+h.deltaY;t.onWheelScroll(g),QL(g,m)&&h.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Qv(a.paddingTop),paddingEnd:Qv(a.paddingBottom)}})}})}),[sse,LL]=RL(Ho),BL=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:d,onWheelScroll:h,onResize:m,...g}=t,x=Pa(Ho,n),[y,w]=b.useState(null),S=er(e,q=>w(q)),k=b.useRef(null),j=b.useRef(""),N=x.viewport,T=r.content-r.viewport,E=Rs(h),_=Rs(c),A=ob(m,10);function D(q){if(k.current){const B=q.clientX-k.current.left,H=q.clientY-k.current.top;d({x:B,y:H})}}return b.useEffect(()=>{const q=B=>{const H=B.target;y?.contains(H)&&E(B,T)};return document.addEventListener("wheel",q,{passive:!1}),()=>document.removeEventListener("wheel",q,{passive:!1})},[N,y,T,E]),b.useEffect(_,[r,_]),Yh(y,A),Yh(x.content,A),o.jsx(sse,{scope:n,scrollbar:y,hasThumb:s,onThumbChange:Rs(i),onThumbPointerUp:Rs(a),onThumbPositionChange:_,onThumbPointerDown:Rs(l),children:o.jsx(Sn.div,{...g,ref:S,style:{position:"absolute",...g.style},onPointerDown:nt(t.onPointerDown,q=>{q.button===0&&(q.target.setPointerCapture(q.pointerId),k.current=y.getBoundingClientRect(),j.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),D(q))}),onPointerMove:nt(t.onPointerMove,D),onPointerUp:nt(t.onPointerUp,q=>{const B=q.target;B.hasPointerCapture(q.pointerId)&&B.releasePointerCapture(q.pointerId),document.body.style.webkitUserSelect=j.current,x.viewport&&(x.viewport.style.scrollBehavior=""),k.current=null})})})}),Hv="ScrollAreaThumb",FL=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=LL(Hv,t.__scopeScrollArea);return o.jsx(oi,{present:n||s.hasThumb,children:o.jsx(ise,{ref:e,...r})})}),ise=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...s}=t,i=Pa(Hv,n),a=LL(Hv,n),{onThumbPositionChange:l}=a,c=er(e,m=>a.onThumbChange(m)),d=b.useRef(void 0),h=ob(()=>{d.current&&(d.current(),d.current=void 0)},100);return b.useEffect(()=>{const m=i.viewport;if(m){const g=()=>{if(h(),!d.current){const x=lse(m,l);d.current=x,l()}};return l(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[i.viewport,h,l]),o.jsx(Sn.div,{"data-state":a.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:nt(t.onPointerDownCapture,m=>{const x=m.target.getBoundingClientRect(),y=m.clientX-x.left,w=m.clientY-x.top;a.onThumbPointerDown({x:y,y:w})}),onPointerUp:nt(t.onPointerUp,a.onThumbPointerUp)})});FL.displayName=Hv;var Gj="ScrollAreaCorner",qL=b.forwardRef((t,e)=>{const n=Pa(Gj,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?o.jsx(ase,{...t,ref:e}):null});qL.displayName=Gj;var ase=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,s=Pa(Gj,n),[i,a]=b.useState(0),[l,c]=b.useState(0),d=!!(i&&l);return Yh(s.scrollbarX,()=>{const h=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(h),c(h)}),Yh(s.scrollbarY,()=>{const h=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(h),a(h)}),d?o.jsx(Sn.div,{...r,ref:e,style:{width:i,height:l,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function Qv(t){return t?parseInt(t,10):0}function $L(t,e){const n=t/e;return isNaN(n)?0:n}function ab(t){const e=$L(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function ose(t,e,n,r="ltr"){const s=ab(n),i=s/2,a=e||i,l=s-a,c=n.scrollbar.paddingStart+a,d=n.scrollbar.size-n.scrollbar.paddingEnd-l,h=n.content-n.viewport,m=r==="ltr"?[0,h]:[h*-1,0];return HL([c,d],m)(t)}function nE(t,e,n="ltr"){const r=ab(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-s,a=e.content-e.viewport,l=i-r,c=n==="ltr"?[0,a]:[a*-1,0],d=Tj(t,c);return HL([0,a],[0,l])(d)}function HL(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function QL(t,e){return t>0&&t{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return(function s(){const i={left:t.scrollLeft,top:t.scrollTop},a=n.left!==i.left,l=n.top!==i.top;(a||l)&&e(),n=i,r=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(r)};function ob(t,e){const n=Rs(t),r=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),b.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function Yh(t,e){const n=Rs(e);Wh(()=>{let r=0;if(t){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(t),()=>{window.cancelAnimationFrame(r),s.unobserve(t)}}},[t,n])}var VL=DL,cse=zL,use=qL;const pn=b.forwardRef(({className:t,children:e,viewportRef:n,...r},s)=>o.jsxs(VL,{ref:s,className:xe("relative overflow-hidden",t),...r,children:[o.jsx(cse,{ref:n,className:"h-full w-full rounded-[inherit]",children:e}),o.jsx(pk,{}),o.jsx(pk,{orientation:"horizontal"}),o.jsx(use,{})]}));pn.displayName=VL.displayName;const pk=b.forwardRef(({className:t,orientation:e="vertical",...n},r)=>o.jsx(Uj,{ref:r,orientation:e,className:xe("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...n,children:o.jsx(FL,{className:"relative flex-1 rounded-full bg-border"})}));pk.displayName=Uj.displayName;function dse({className:t,...e}){return o.jsx("div",{className:xe("animate-pulse rounded-md bg-primary/10",t),...e})}function hse(t,e=[]){let n=[];function r(i,a){const l=b.createContext(a);l.displayName=i+"Context";const c=n.length;n=[...n,a];const d=m=>{const{scope:g,children:x,...y}=m,w=g?.[t]?.[c]||l,S=b.useMemo(()=>y,Object.values(y));return o.jsx(w.Provider,{value:S,children:x})};d.displayName=i+"Provider";function h(m,g){const x=g?.[t]?.[c]||l,y=b.useContext(x);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${m}\` must be used within \`${i}\``)}return[d,h]}const s=()=>{const i=n.map(a=>b.createContext(a));return function(l){const c=l?.[t]||i;return b.useMemo(()=>({[`__scope${t}`]:{...l,[t]:c}}),[l,c])}};return s.scopeName=t,[r,fse(s,...e)]}function fse(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=r.reduce((l,{useScope:c,scopeName:d})=>{const m=c(i)[`__scope${d}`];return{...l,...m}},{});return b.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var mse=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],UL=mse.reduce((t,e)=>{const n=Vy(`Primitive.${e}`),r=b.forwardRef((s,i)=>{const{asChild:a,...l}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),Xj="Progress",Yj=100,[pse]=hse(Xj),[gse,xse]=pse(Xj),WL=b.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:i=vse,...a}=t;(s||s===0)&&!rE(s)&&console.error(yse(`${s}`,"Progress"));const l=rE(s)?s:Yj;r!==null&&!sE(r,l)&&console.error(bse(`${r}`,"Progress"));const c=sE(r,l)?r:null,d=Vv(c)?i(c,l):void 0;return o.jsx(gse,{scope:n,value:c,max:l,children:o.jsx(UL.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":Vv(c)?c:void 0,"aria-valuetext":d,role:"progressbar","data-state":YL(c,l),"data-value":c??void 0,"data-max":l,...a,ref:e})})});WL.displayName=Xj;var GL="ProgressIndicator",XL=b.forwardRef((t,e)=>{const{__scopeProgress:n,...r}=t,s=xse(GL,n);return o.jsx(UL.div,{"data-state":YL(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:e})});XL.displayName=GL;function vse(t,e){return`${Math.round(t/e*100)}%`}function YL(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function Vv(t){return typeof t=="number"}function rE(t){return Vv(t)&&!isNaN(t)&&t>0}function sE(t,e){return Vv(t)&&!isNaN(t)&&t<=e&&t>=0}function yse(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Yj}\`.`}function bse(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be: - - a positive number - - less than the value passed to \`max\` (or ${Yj} if no \`max\` prop is set) - - \`null\` or \`undefined\` if the progress is indeterminate. - -Defaulting to \`null\`.`}var KL=WL,wse=XL;const Qp=b.forwardRef(({className:t,value:e,...n},r)=>o.jsx(KL,{ref:r,className:xe("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",t),...n,children:o.jsx(wse,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));Qp.displayName=KL.displayName;const Sse={light:"",dark:".dark"},ZL=b.createContext(null);function JL(){const t=b.useContext(ZL);if(!t)throw new Error("useChart must be used within a ");return t}const vh=b.forwardRef(({id:t,className:e,children:n,config:r,...s},i)=>{const a=b.useId(),l=`chart-${t||a.replace(/:/g,"")}`;return o.jsx(ZL.Provider,{value:{config:r},children:o.jsxs("div",{"data-chart":l,ref:i,className:xe("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",e),...s,children:[o.jsx(kse,{id:l,config:r}),o.jsx(TJ,{children:n})]})})});vh.displayName="Chart";const kse=({id:t,config:e})=>{const n=Object.entries(e).filter(([,r])=>r.theme||r.color);return n.length?o.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(Sse).map(([r,s])=>` -${s} [data-chart=${t}] { -${n.map(([i,a])=>{const l=a.theme?.[r]||a.color;return l?` --color-${i}: ${l};`:null}).join(` -`)} -} -`).join(` -`)}}):null},Bm=EJ,yh=b.forwardRef(({active:t,payload:e,className:n,indicator:r="dot",hideLabel:s=!1,hideIndicator:i=!1,label:a,labelFormatter:l,labelClassName:c,formatter:d,color:h,nameKey:m,labelKey:g},x)=>{const{config:y}=JL(),w=b.useMemo(()=>{if(s||!e?.length)return null;const[k]=e,j=`${g||k?.dataKey||k?.name||"value"}`,N=gk(y,k,j),T=!g&&typeof a=="string"?y[a]?.label||a:N?.label;return l?o.jsx("div",{className:xe("font-medium",c),children:l(T,e)}):T?o.jsx("div",{className:xe("font-medium",c),children:T}):null},[a,l,e,s,c,y,g]);if(!t||!e?.length)return null;const S=e.length===1&&r!=="dot";return o.jsxs("div",{ref:x,className:xe("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",n),children:[S?null:w,o.jsx("div",{className:"grid gap-1.5",children:e.filter(k=>k.type!=="none").map((k,j)=>{const N=`${m||k.name||k.dataKey||"value"}`,T=gk(y,k,N),E=h||k.payload.fill||k.color;return o.jsx("div",{className:xe("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",r==="dot"&&"items-center"),children:d&&k?.value!==void 0&&k.name?d(k.value,k.name,k,j,k.payload):o.jsxs(o.Fragment,{children:[T?.icon?o.jsx(T.icon,{}):!i&&o.jsx("div",{className:xe("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":r==="dot","w-1":r==="line","w-0 border-[1.5px] border-dashed bg-transparent":r==="dashed","my-0.5":S&&r==="dashed"}),style:{"--color-bg":E,"--color-border":E}}),o.jsxs("div",{className:xe("flex flex-1 justify-between leading-none",S?"items-end":"items-center"),children:[o.jsxs("div",{className:"grid gap-1.5",children:[S?w:null,o.jsx("span",{className:"text-muted-foreground",children:T?.label||k.name})]}),k.value&&o.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:k.value.toLocaleString()})]})]})},k.dataKey)})})]})});yh.displayName="ChartTooltip";const Ose=_J,eB=b.forwardRef(({className:t,hideIcon:e=!1,payload:n,verticalAlign:r="bottom",nameKey:s},i)=>{const{config:a}=JL();return n?.length?o.jsx("div",{ref:i,className:xe("flex items-center justify-center gap-4",r==="top"?"pb-3":"pt-3",t),children:n.filter(l=>l.type!=="none").map(l=>{const c=`${s||l.dataKey||"value"}`,d=gk(a,l,c);return o.jsxs("div",{className:xe("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[d?.icon&&!e?o.jsx(d.icon,{}):o.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:l.color}}),d?.label]},l.value)})}):null});eB.displayName="ChartLegend";function gk(t,e,n){if(typeof e!="object"||e===null)return;const r="payload"in e&&typeof e.payload=="object"&&e.payload!==null?e.payload:void 0;let s=n;return n in e&&typeof e[n]=="string"?s=e[n]:r&&n in r&&typeof r[n]=="string"&&(s=r[n]),s in t?t[s]:t[n]}const iE=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,aE=Qz,kf=(t,e)=>n=>{var r;if(e?.variants==null)return aE(t,n?.class,n?.className);const{variants:s,defaultVariants:i}=e,a=Object.keys(s).map(d=>{const h=n?.[d],m=i?.[d];if(h===null)return null;const g=iE(h)||iE(m);return s[d][g]}),l=n&&Object.entries(n).reduce((d,h)=>{let[m,g]=h;return g===void 0||(d[m]=g),d},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,h)=>{let{class:m,className:g,...x}=h;return Object.entries(x).every(y=>{let[w,S]=y;return Array.isArray(S)?S.includes({...i,...l}[w]):{...i,...l}[w]===S})?[...d,m,g]:d},[]);return aE(t,a,c,n?.class,n?.className)},q0=kf("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring 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 hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),ue=b.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...s},i)=>{const a=r?Cee:"button";return o.jsx(a,{className:xe(q0({variant:e,size:n,className:t})),ref:i,...s})});ue.displayName="Button";const jse=kf("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function tn({className:t,variant:e,...n}){return o.jsx("div",{className:xe(jse({variant:e}),t),...n})}const Nse=5,Cse=5e3;let R4=0;function Tse(){return R4=(R4+1)%Number.MAX_SAFE_INTEGER,R4.toString()}const D4=new Map,oE=t=>{if(D4.has(t))return;const e=setTimeout(()=>{D4.delete(t),S0({type:"REMOVE_TOAST",toastId:t})},Cse);D4.set(t,e)},Ese=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,Nse)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?oE(n):t.toasts.forEach(r=>{oE(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},lv=[];let cv={toasts:[]};function S0(t){cv=Ese(cv,t),lv.forEach(e=>{e(cv)})}function _se({...t}){const e=Tse(),n=s=>S0({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>S0({type:"DISMISS_TOAST",toastId:e});return S0({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function Lr(){const[t,e]=b.useState(cv);return b.useEffect(()=>(lv.push(e),()=>{const n=lv.indexOf(e);n>-1&&lv.splice(n,1)}),[t]),{...t,toast:_se,dismiss:n=>S0({type:"DISMISS_TOAST",toastId:n})}}const Ase=t=>{const e=[];for(let n=0;n{try{x(!0);const $=await Cr.get("https://v1.hitokoto.cn/?c=a&c=b&c=c&c=d&c=h&c=i&c=k");m({hitokoto:$.data.hitokoto,from:$.data.from||$.data.from_who||"未知"})}catch($){console.error("获取一言失败:",$),m({hitokoto:"人生就像一盒巧克力,你永远不知道下一颗是什么味道。",from:"阿甘正传"})}finally{x(!1)}},[]),T=b.useCallback(async()=>{try{const $=localStorage.getItem("access-token"),K=await Cr.get("/api/webui/system/status",{headers:{Authorization:`Bearer ${$}`}});w(K.data)}catch($){console.error("获取机器人状态失败:",$),w(null)}},[]),E=async()=>{if(!S)try{k(!0);const $=localStorage.getItem("access-token");await Cr.post("/api/webui/system/restart",{},{headers:{Authorization:`Bearer ${$}`}}),j({title:"重启中",description:"麦麦正在重启,请稍候..."}),setTimeout(()=>{T(),k(!1)},3e3)}catch($){console.error("重启失败:",$),j({title:"重启失败",description:"无法重启麦麦,请检查控制台",variant:"destructive"}),k(!1)}},_=b.useCallback(async()=>{try{const $=localStorage.getItem("access-token"),K=await Cr.get(`/api/webui/statistics/dashboard?hours=${a}`,{headers:{Authorization:`Bearer ${$}`}});e(K.data),r(!1),i(100)}catch($){console.error("Failed to fetch dashboard data:",$),r(!1),i(100)}},[a]);if(b.useEffect(()=>{if(!n)return;i(0);const $=setTimeout(()=>i(15),200),K=setTimeout(()=>i(30),800),Y=setTimeout(()=>i(45),2e3),R=setTimeout(()=>i(60),4e3),ie=setTimeout(()=>i(75),6500),X=setTimeout(()=>i(85),9e3),z=setTimeout(()=>i(92),11e3);return()=>{clearTimeout($),clearTimeout(K),clearTimeout(Y),clearTimeout(R),clearTimeout(ie),clearTimeout(X),clearTimeout(z)}},[n]),b.useEffect(()=>{_(),N(),T()},[_,N,T]),b.useEffect(()=>{if(!c)return;const $=setInterval(()=>{_(),T()},3e4);return()=>clearInterval($)},[c,_,T]),n||!t)return o.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:o.jsxs("div",{className:"text-center space-y-6 w-full max-w-md px-4",children:[o.jsx(Qs,{className:"h-12 w-12 animate-spin mx-auto text-primary"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-lg font-medium",children:"加载统计数据中..."}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"正在获取麦麦运行数据"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Qp,{value:s,className:"h-2"}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:[s,"%"]})]})]})});const{summary:A,model_stats:D,hourly_data:q,daily_data:B,recent_activity:H}=t,W=$=>{const K=Math.floor($/3600),Y=Math.floor($%3600/60);return`${K}小时${Y}分钟`},ee=$=>new Date($).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),I=Ase(D.length),V=D.map(($,K)=>({name:$.model_name,value:$.request_count,fill:I[K]})),L={requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"},tokens:{label:"Tokens",color:"hsl(var(--chart-3))"}};return o.jsx(pn,{className:"h-full",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"实时监控面板"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"麦麦运行状态和统计数据一览"})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(Yi,{value:a.toString(),onValueChange:$=>l(Number($)),children:o.jsxs(ji,{className:"grid grid-cols-3 w-full sm:w-auto",children:[o.jsx(Bt,{value:"24",children:"24小时"}),o.jsx(Bt,{value:"168",children:"7天"}),o.jsx(Bt,{value:"720",children:"30天"})]})}),o.jsxs(ue,{variant:c?"default":"outline",size:"sm",onClick:()=>d(!c),className:"gap-2",children:[o.jsx(Qs,{className:`h-4 w-4 ${c?"animate-spin":""}`}),o.jsx("span",{className:"hidden sm:inline",children:"自动刷新"})]}),o.jsx(ue,{variant:"outline",size:"sm",onClick:_,children:o.jsx(Qs,{className:"h-4 w-4"})})]})]}),o.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 rounded-lg border border-dashed border-muted-foreground/30 bg-muted/20",children:[g?o.jsx(dse,{className:"h-5 flex-1"}):h?o.jsxs("p",{className:"flex-1 text-sm text-muted-foreground italic truncate",children:['"',h.hitokoto,'" —— ',h.from]}):null,o.jsx(ue,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",onClick:N,disabled:g,children:o.jsx(Qs,{className:`h-3.5 w-3.5 ${g?"animate-spin":""}`})})]}),o.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-3",children:[o.jsxs(Lt,{className:"lg:col-span-1",children:[o.jsx(En,{className:"pb-3",children:o.jsxs(_n,{className:"text-sm font-medium flex items-center gap-2",children:[o.jsx(Dp,{className:"h-4 w-4"}),"麦麦状态"]})}),o.jsx(Xn,{children:o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"flex items-center gap-2",children:y?.running?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-3 w-3 rounded-full bg-green-500 animate-pulse"}),o.jsxs(tn,{variant:"outline",className:"text-green-600 border-green-300 bg-green-50",children:[o.jsx(Ya,{className:"h-3 w-3 mr-1"}),"运行中"]})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-3 w-3 rounded-full bg-red-500"}),o.jsxs(tn,{variant:"outline",className:"text-red-600 border-red-300 bg-red-50",children:[o.jsx(Lo,{className:"h-3 w-3 mr-1"}),"已停止"]})]})}),y&&o.jsxs("div",{className:"text-xs text-muted-foreground",children:[o.jsxs("span",{children:["v",y.version]}),o.jsx("span",{className:"mx-2",children:"|"}),o.jsxs("span",{children:["运行 ",W(y.uptime)]})]})]})})]}),o.jsxs(Lt,{className:"lg:col-span-2",children:[o.jsx(En,{className:"pb-3",children:o.jsxs(_n,{className:"text-sm font-medium flex items-center gap-2",children:[o.jsx(Zu,{className:"h-4 w-4"}),"快速操作"]})}),o.jsx(Xn,{children:o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsxs(ue,{variant:"outline",size:"sm",onClick:E,disabled:S,className:"gap-2",children:[o.jsx(zj,{className:`h-4 w-4 ${S?"animate-spin":""}`}),S?"重启中...":"重启麦麦"]}),o.jsx(ue,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:o.jsxs(rv,{to:"/logs",children:[o.jsx(Po,{className:"h-4 w-4"}),"查看日志"]})}),o.jsx(ue,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:o.jsxs(rv,{to:"/plugins",children:[o.jsx(Fee,{className:"h-4 w-4"}),"插件管理"]})}),o.jsx(ue,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:o.jsxs(rv,{to:"/settings",children:[o.jsx(Vc,{className:"h-4 w-4"}),"系统设置"]})})]})})]})]}),o.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[o.jsxs(Lt,{children:[o.jsxs(En,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(_n,{className:"text-sm font-medium",children:"总请求数"}),o.jsx(qee,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Xn,{children:[o.jsx("div",{className:"text-2xl font-bold",children:A.total_requests.toLocaleString()}),o.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["最近",a<48?a+"小时":Math.floor(a/24)+"天"]})]})]}),o.jsxs(Lt,{children:[o.jsxs(En,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(_n,{className:"text-sm font-medium",children:"总花费"}),o.jsx($ee,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Xn,{children:[o.jsxs("div",{className:"text-2xl font-bold",children:["¥",A.total_cost.toFixed(2)]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:A.cost_per_hour>0?`¥${A.cost_per_hour.toFixed(2)}/小时`:"暂无数据"})]})]}),o.jsxs(Lt,{children:[o.jsxs(En,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(_n,{className:"text-sm font-medium",children:"Token消耗"}),o.jsx(sk,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Xn,{children:[o.jsxs("div",{className:"text-2xl font-bold",children:[(A.total_tokens/1e3).toFixed(1),"K"]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:A.tokens_per_hour>0?`${(A.tokens_per_hour/1e3).toFixed(1)}K/小时`:"暂无数据"})]})]}),o.jsxs(Lt,{children:[o.jsxs(En,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(_n,{className:"text-sm font-medium",children:"平均响应"}),o.jsx(Zu,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Xn,{children:[o.jsxs("div",{className:"text-2xl font-bold",children:[A.avg_response_time.toFixed(2),"s"]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"API平均耗时"})]})]})]}),o.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-3",children:[o.jsxs(Lt,{children:[o.jsxs(En,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(_n,{className:"text-sm font-medium",children:"在线时长"}),o.jsx(Mh,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsx(Xn,{children:o.jsx("div",{className:"text-xl font-bold",children:W(A.online_time)})})]}),o.jsxs(Lt,{children:[o.jsxs(En,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(_n,{className:"text-sm font-medium",children:"消息处理"}),o.jsx(Gh,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Xn,{children:[o.jsx("div",{className:"text-xl font-bold",children:A.total_messages.toLocaleString()}),o.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["回复 ",A.total_replies.toLocaleString()," 条"]})]})]}),o.jsxs(Lt,{children:[o.jsxs(En,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(_n,{className:"text-sm font-medium",children:"成本效率"}),o.jsx(Hee,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Xn,{children:[o.jsx("div",{className:"text-xl font-bold",children:A.total_messages>0?`¥${(A.total_cost/A.total_messages*100).toFixed(2)}`:"¥0.00"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"每100条消息"})]})]})]}),o.jsxs(Yi,{defaultValue:"trends",className:"space-y-4",children:[o.jsxs(ji,{className:"grid w-full grid-cols-2 sm:grid-cols-4",children:[o.jsx(Bt,{value:"trends",children:"趋势"}),o.jsx(Bt,{value:"models",children:"模型"}),o.jsx(Bt,{value:"activity",children:"活动"}),o.jsx(Bt,{value:"daily",children:"日统计"})]}),o.jsxs(ln,{value:"trends",className:"space-y-4",children:[o.jsxs(Lt,{children:[o.jsxs(En,{children:[o.jsx(_n,{children:"请求趋势"}),o.jsxs(Wr,{children:["最近",a,"小时的请求量变化"]})]}),o.jsx(Xn,{children:o.jsx(vh,{config:L,className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:o.jsxs(AJ,{data:q,children:[o.jsx(Kx,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),o.jsx(Zx,{dataKey:"timestamp",tickFormatter:$=>ee($),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Pm,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Bm,{content:o.jsx(yh,{labelFormatter:$=>ee($)})}),o.jsx(MJ,{type:"monotone",dataKey:"requests",stroke:"var(--color-requests)",strokeWidth:2})]})})})]}),o.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[o.jsxs(Lt,{children:[o.jsxs(En,{children:[o.jsx(_n,{children:"花费趋势"}),o.jsx(Wr,{children:"API调用成本变化"})]}),o.jsx(Xn,{children:o.jsx(vh,{config:L,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:o.jsxs(S4,{data:q,children:[o.jsx(Kx,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),o.jsx(Zx,{dataKey:"timestamp",tickFormatter:$=>ee($),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Pm,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Bm,{content:o.jsx(yh,{labelFormatter:$=>ee($)})}),o.jsx(Jx,{dataKey:"cost",fill:"var(--color-cost)"})]})})})]}),o.jsxs(Lt,{children:[o.jsxs(En,{children:[o.jsx(_n,{children:"Token消耗"}),o.jsx(Wr,{children:"Token使用量变化"})]}),o.jsx(Xn,{children:o.jsx(vh,{config:L,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:o.jsxs(S4,{data:q,children:[o.jsx(Kx,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),o.jsx(Zx,{dataKey:"timestamp",tickFormatter:$=>ee($),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Pm,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Bm,{content:o.jsx(yh,{labelFormatter:$=>ee($)})}),o.jsx(Jx,{dataKey:"tokens",fill:"var(--color-tokens)"})]})})})]})]})]}),o.jsx(ln,{value:"models",className:"space-y-4",children:o.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[o.jsxs(Lt,{children:[o.jsxs(En,{children:[o.jsx(_n,{children:"模型请求分布"}),o.jsxs(Wr,{children:["各模型使用占比 (共 ",D.length," 个模型)"]})]}),o.jsx(Xn,{children:o.jsx(vh,{config:Object.fromEntries(D.map(($,K)=>[$.model_name,{label:$.model_name,color:I[K]}])),className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:o.jsxs(RJ,{children:[o.jsx(Bm,{content:o.jsx(yh,{})}),o.jsx(DJ,{data:V,cx:"50%",cy:"50%",labelLine:!1,label:({name:$,percent:K})=>K&&K<.05?"":`${$} ${K?(K*100).toFixed(0):0}%`,outerRadius:100,dataKey:"value",children:V.map(($,K)=>o.jsx(PJ,{fill:$.fill},`cell-${K}`))})]})})})]}),o.jsxs(Lt,{children:[o.jsxs(En,{children:[o.jsx(_n,{children:"模型详细统计"}),o.jsx(Wr,{children:"请求数、花费和性能"})]}),o.jsx(Xn,{children:o.jsx(pn,{className:"h-[300px] sm:h-[400px]",children:o.jsx("div",{className:"space-y-3",children:D.map(($,K)=>o.jsxs("div",{className:"p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("h4",{className:"font-semibold text-sm truncate flex-1 min-w-0",children:$.model_name}),o.jsx("div",{className:"w-3 h-3 rounded-full ml-2 flex-shrink-0",style:{backgroundColor:`hsl(var(--chart-${K%5+1}))`}})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"请求数:"}),o.jsx("span",{className:"ml-1 font-medium",children:$.request_count.toLocaleString()})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"花费:"}),o.jsxs("span",{className:"ml-1 font-medium",children:["¥",$.total_cost.toFixed(2)]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),o.jsxs("span",{className:"ml-1 font-medium",children:[($.total_tokens/1e3).toFixed(1),"K"]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"平均耗时:"}),o.jsxs("span",{className:"ml-1 font-medium",children:[$.avg_response_time.toFixed(2),"s"]})]})]})]},K))})})})]})]})}),o.jsx(ln,{value:"activity",children:o.jsxs(Lt,{children:[o.jsxs(En,{children:[o.jsx(_n,{children:"最近活动"}),o.jsx(Wr,{children:"最新的API调用记录"})]}),o.jsx(Xn,{children:o.jsx(pn,{className:"h-[400px] sm:h-[500px]",children:o.jsx("div",{className:"space-y-2",children:H.map(($,K)=>o.jsxs("div",{className:"p-3 sm:p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"font-medium text-sm truncate",children:$.model}),o.jsx("div",{className:"text-xs text-muted-foreground",children:$.request_type})]}),o.jsx("div",{className:"text-xs text-muted-foreground flex-shrink-0",children:ee($.timestamp)})]}),o.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-xs",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),o.jsx("span",{className:"ml-1",children:$.tokens})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"花费:"}),o.jsxs("span",{className:"ml-1",children:["¥",$.cost.toFixed(4)]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"耗时:"}),o.jsxs("span",{className:"ml-1",children:[$.time_cost.toFixed(2),"s"]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"状态:"}),o.jsx("span",{className:`ml-1 ${$.status==="success"?"text-green-600":"text-red-600"}`,children:$.status})]})]})]},K))})})})]})}),o.jsx(ln,{value:"daily",children:o.jsxs(Lt,{children:[o.jsxs(En,{children:[o.jsx(_n,{children:"每日统计"}),o.jsx(Wr,{children:"最近7天的数据汇总"})]}),o.jsx(Xn,{children:o.jsx(vh,{config:{requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"}},className:"h-[400px] sm:h-[500px] w-full aspect-auto",children:o.jsxs(S4,{data:B,children:[o.jsx(Kx,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),o.jsx(Zx,{dataKey:"timestamp",tickFormatter:$=>{const K=new Date($);return`${K.getMonth()+1}/${K.getDate()}`},stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Pm,{yAxisId:"left",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Pm,{yAxisId:"right",orientation:"right",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Bm,{content:o.jsx(yh,{labelFormatter:$=>new Date($).toLocaleDateString("zh-CN")})}),o.jsx(Ose,{content:o.jsx(eB,{})}),o.jsx(Jx,{yAxisId:"left",dataKey:"requests",fill:"var(--color-requests)"}),o.jsx(Jx,{yAxisId:"right",dataKey:"cost",fill:"var(--color-cost)"})]})})})]})})]})]})})}const Rse={theme:"system",setTheme:()=>null},tB=b.createContext(Rse),Kj=()=>{const t=b.useContext(tB);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t},Dse=(t,e,n)=>{const r=document.documentElement.classList.contains("no-animations");if(!document.startViewTransition||r){e(t);return}const s=n.clientX,i=n.clientY,a=Math.hypot(Math.max(s,innerWidth-s),Math.max(i,innerHeight-i));document.startViewTransition(()=>{e(t)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${s}px ${i}px)`,`circle(${a}px at ${s}px ${i}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},nB=b.createContext(void 0),rB=()=>{const t=b.useContext(nB);if(t===void 0)throw new Error("useAnimation must be used within an AnimationProvider");return t};var lb="Switch",[Pse]=Da(lb),[zse,Ise]=Pse(lb),sB=b.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:a,disabled:l,value:c="on",onCheckedChange:d,form:h,...m}=t,[g,x]=b.useState(null),y=er(e,N=>x(N)),w=b.useRef(!1),S=g?h||!!g.closest("form"):!0,[k,j]=Kl({prop:s,defaultProp:i??!1,onChange:d,caller:lb});return o.jsxs(zse,{scope:n,checked:k,disabled:l,children:[o.jsx(Sn.button,{type:"button",role:"switch","aria-checked":k,"aria-required":a,"data-state":lB(k),"data-disabled":l?"":void 0,disabled:l,value:c,...m,ref:y,onClick:nt(t.onClick,N=>{j(T=>!T),S&&(w.current=N.isPropagationStopped(),w.current||N.stopPropagation())})}),S&&o.jsx(oB,{control:g,bubbles:!w.current,name:r,value:c,checked:k,required:a,disabled:l,form:h,style:{transform:"translateX(-100%)"}})]})});sB.displayName=lb;var iB="SwitchThumb",aB=b.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,s=Ise(iB,n);return o.jsx(Sn.span,{"data-state":lB(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:e})});aB.displayName=iB;var Lse="SwitchBubbleInput",oB=b.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:r=!0,...s},i)=>{const a=b.useRef(null),l=er(a,i),c=sI(n),d=iI(e);return b.useEffect(()=>{const h=a.current;if(!h)return;const m=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(m,"checked").set;if(c!==n&&x){const y=new Event("click",{bubbles:r});x.call(h,n),h.dispatchEvent(y)}},[c,n,r]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:l,style:{...s.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});oB.displayName=Lse;function lB(t){return t?"checked":"unchecked"}var cB=sB,Bse=aB;const Ft=b.forwardRef(({className:t,...e},n)=>o.jsx(cB,{className:xe("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...e,ref:n,children:o.jsx(Bse,{className:xe("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Ft.displayName=cB.displayName;const Fse=kf("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),he=b.forwardRef(({className:t,...e},n)=>o.jsx(aI,{ref:n,className:xe(Fse(),t),...e}));he.displayName=aI.displayName;const Pe=b.forwardRef(({className:t,type:e,...n},r)=>o.jsx("input",{type:e,className:xe("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...n}));Pe.displayName="Input";const qse=[{id:"minLength",label:"长度至少 10 位",description:"Token 长度必须大于等于 10 个字符",validate:t=>t.length>=10},{id:"hasUppercase",label:"包含大写字母",description:"至少包含一个大写字母 (A-Z)",validate:t=>/[A-Z]/.test(t)},{id:"hasLowercase",label:"包含小写字母",description:"至少包含一个小写字母 (a-z)",validate:t=>/[a-z]/.test(t)},{id:"hasSpecialChar",label:"包含特殊符号",description:"至少包含一个特殊符号 (!@#$%^&*()_+-=[]{}|;:,.<>?/)",validate:t=>/[!@#$%^&*()_+\-=[\]{}|;:,.<>?/]/.test(t)}];function $se(t){const e=qse.map(r=>({id:r.id,label:r.label,description:r.description,passed:r.validate(t)}));return{isValid:e.every(r=>r.passed),rules:e}}const Zj="0.11.6 Beta",Jj="MaiBot Dashboard",Hse=`${Jj} v${Zj}`,Qse=(t="v")=>`${t}${Zj}`,Er=Mj,Of=oI,Vse=Ej,e6=Gy,uB=b.forwardRef(({className:t,...e},n)=>o.jsx(Uy,{ref:n,className:xe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));uB.displayName=Uy.displayName;const wr=b.forwardRef(({className:t,children:e,preventOutsideClose:n=!1,...r},s)=>o.jsxs(Vse,{children:[o.jsx(uB,{}),o.jsxs(Wy,{ref:s,className:xe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),onPointerDownOutside:n?i=>i.preventDefault():void 0,onInteractOutside:n?i=>i.preventDefault():void 0,...r,children:[e,o.jsxs(Gy,{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 data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[o.jsx(Pp,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));wr.displayName=Wy.displayName;const Sr=({className:t,...e})=>o.jsx("div",{className:xe("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});Sr.displayName="DialogHeader";const fs=({className:t,...e})=>o.jsx("div",{className:xe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});fs.displayName="DialogFooter";const kr=b.forwardRef(({className:t,...e},n)=>o.jsx(_j,{ref:n,className:xe("text-lg font-semibold leading-none tracking-tight",t),...e}));kr.displayName=_j.displayName;const Xr=b.forwardRef(({className:t,...e},n)=>o.jsx(Aj,{ref:n,className:xe("text-sm text-muted-foreground",t),...e}));Xr.displayName=Aj.displayName;var Use=Symbol("radix.slottable");function Wse(t){const e=({children:n})=>o.jsx(o.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=Use,e}var dB="AlertDialog",[Gse]=Da(dB,[lI]),Jl=lI(),hB=t=>{const{__scopeAlertDialog:e,...n}=t,r=Jl(e);return o.jsx(Mj,{...r,...n,modal:!0})};hB.displayName=dB;var Xse="AlertDialogTrigger",fB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Jl(n);return o.jsx(oI,{...s,...r,ref:e})});fB.displayName=Xse;var Yse="AlertDialogPortal",mB=t=>{const{__scopeAlertDialog:e,...n}=t,r=Jl(e);return o.jsx(Ej,{...r,...n})};mB.displayName=Yse;var Kse="AlertDialogOverlay",pB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Jl(n);return o.jsx(Uy,{...s,...r,ref:e})});pB.displayName=Kse;var Rh="AlertDialogContent",[Zse,Jse]=Gse(Rh),eie=Wse("AlertDialogContent"),gB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...s}=t,i=Jl(n),a=b.useRef(null),l=er(e,a),c=b.useRef(null);return o.jsx(Tee,{contentName:Rh,titleName:xB,docsSlug:"alert-dialog",children:o.jsx(Zse,{scope:n,cancelRef:c,children:o.jsxs(Wy,{role:"alertdialog",...i,...s,ref:l,onOpenAutoFocus:nt(s.onOpenAutoFocus,d=>{d.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[o.jsx(eie,{children:r}),o.jsx(nie,{contentRef:a})]})})})});gB.displayName=Rh;var xB="AlertDialogTitle",vB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Jl(n);return o.jsx(_j,{...s,...r,ref:e})});vB.displayName=xB;var yB="AlertDialogDescription",bB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Jl(n);return o.jsx(Aj,{...s,...r,ref:e})});bB.displayName=yB;var tie="AlertDialogAction",wB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Jl(n);return o.jsx(Gy,{...s,...r,ref:e})});wB.displayName=tie;var SB="AlertDialogCancel",kB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:s}=Jse(SB,n),i=Jl(n),a=er(e,s);return o.jsx(Gy,{...i,...r,ref:a})});kB.displayName=SB;var nie=({contentRef:t})=>{const e=`\`${Rh}\` requires a description for the component to be accessible for screen reader users. - -You can add a description to the \`${Rh}\` by passing a \`${yB}\` component as a child, which also benefits sighted users by adding visible context to the dialog. - -Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Rh}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. - -For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return b.useEffect(()=>{document.getElementById(t.current?.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},rie=hB,sie=fB,iie=mB,OB=pB,jB=gB,NB=wB,CB=kB,TB=vB,EB=bB;const Fn=rie,is=sie,aie=iie,_B=b.forwardRef(({className:t,...e},n)=>o.jsx(OB,{className:xe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));_B.displayName=OB.displayName;const Mn=b.forwardRef(({className:t,...e},n)=>o.jsxs(aie,{children:[o.jsx(_B,{}),o.jsx(jB,{ref:n,className:xe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...e})]}));Mn.displayName=jB.displayName;const Rn=({className:t,...e})=>o.jsx("div",{className:xe("flex flex-col space-y-2 text-center sm:text-left",t),...e});Rn.displayName="AlertDialogHeader";const Dn=({className:t,...e})=>o.jsx("div",{className:xe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Dn.displayName="AlertDialogFooter";const Pn=b.forwardRef(({className:t,...e},n)=>o.jsx(TB,{ref:n,className:xe("text-lg font-semibold",t),...e}));Pn.displayName=TB.displayName;const zn=b.forwardRef(({className:t,...e},n)=>o.jsx(EB,{ref:n,className:xe("text-sm text-muted-foreground",t),...e}));zn.displayName=EB.displayName;const In=b.forwardRef(({className:t,...e},n)=>o.jsx(NB,{ref:n,className:xe(q0(),t),...e}));In.displayName=NB.displayName;const Ln=b.forwardRef(({className:t,...e},n)=>o.jsx(CB,{ref:n,className:xe(q0({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));Ln.displayName=CB.displayName;function oie(){return o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"系统设置"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理您的应用偏好设置"})]})}),o.jsxs(Yi,{defaultValue:"appearance",className:"w-full",children:[o.jsxs(ji,{className:"grid w-full grid-cols-2 sm:grid-cols-4 gap-0.5 sm:gap-1 h-auto p-1",children:[o.jsxs(Bt,{value:"appearance",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[o.jsx(kI,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),o.jsx("span",{children:"外观"})]}),o.jsxs(Bt,{value:"security",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[o.jsx(Qee,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),o.jsx("span",{children:"安全"})]}),o.jsxs(Bt,{value:"other",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[o.jsx(Vc,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),o.jsx("span",{children:"其他"})]}),o.jsxs(Bt,{value:"about",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[o.jsx(Xi,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),o.jsx("span",{children:"关于"})]})]}),o.jsxs(pn,{className:"h-[calc(100vh-240px)] sm:h-[calc(100vh-280px)] mt-4 sm:mt-6",children:[o.jsx(ln,{value:"appearance",className:"mt-0",children:o.jsx(lie,{})}),o.jsx(ln,{value:"security",className:"mt-0",children:o.jsx(cie,{})}),o.jsx(ln,{value:"other",className:"mt-0",children:o.jsx(uie,{})}),o.jsx(ln,{value:"about",className:"mt-0",children:o.jsx(die,{})})]})]})]})}function lE(t){const e=document.documentElement,r={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%",gradient:null},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%",gradient:null},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%",gradient:null},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%",gradient:null},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%",gradient:null},red:{hsl:"0 84% 60%",darkHsl:"0 90% 70%",gradient:null},"gradient-sunset":{hsl:"15 95% 60%",darkHsl:"15 95% 65%",gradient:"linear-gradient(135deg, hsl(25 95% 53%) 0%, hsl(330 81% 60%) 100%)"},"gradient-ocean":{hsl:"200 90% 55%",darkHsl:"200 90% 60%",gradient:"linear-gradient(135deg, hsl(221.2 83.2% 53.3%) 0%, hsl(189 94% 43%) 100%)"},"gradient-forest":{hsl:"150 70% 45%",darkHsl:"150 75% 40%",gradient:"linear-gradient(135deg, hsl(142 71% 45%) 0%, hsl(158 64% 52%) 100%)"},"gradient-aurora":{hsl:"310 85% 65%",darkHsl:"310 90% 70%",gradient:"linear-gradient(135deg, hsl(271 91% 65%) 0%, hsl(330 81% 60%) 100%)"},"gradient-fire":{hsl:"15 95% 55%",darkHsl:"15 95% 60%",gradient:"linear-gradient(135deg, hsl(0 84% 60%) 0%, hsl(25 95% 53%) 100%)"},"gradient-twilight":{hsl:"250 90% 60%",darkHsl:"250 95% 65%",gradient:"linear-gradient(135deg, hsl(239 84% 67%) 0%, hsl(271 91% 65%) 100%)"}}[t];if(r)e.style.setProperty("--primary",r.hsl),r.gradient?(e.style.setProperty("--primary-gradient",r.gradient),e.classList.add("has-gradient")):(e.style.removeProperty("--primary-gradient"),e.classList.remove("has-gradient"));else if(t.startsWith("#")){const s=i=>{i=i.replace("#","");const a=parseInt(i.substring(0,2),16)/255,l=parseInt(i.substring(2,4),16)/255,c=parseInt(i.substring(4,6),16)/255,d=Math.max(a,l,c),h=Math.min(a,l,c);let m=0,g=0;const x=(d+h)/2;if(d!==h){const y=d-h;switch(g=x>.5?y/(2-d-h):y/(d+h),d){case a:m=((l-c)/y+(llocalStorage.getItem("accent-color")||"blue");b.useEffect(()=>{const d=localStorage.getItem("accent-color")||"blue";lE(d)},[]);const c=d=>{l(d),localStorage.setItem("accent-color",d),lE(d)};return o.jsxs("div",{className:"space-y-6 sm:space-y-8",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题模式"}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-4",children:[o.jsx(P4,{value:"light",current:t,onChange:e,label:"浅色",description:"始终使用浅色主题"}),o.jsx(P4,{value:"dark",current:t,onChange:e,label:"深色",description:"始终使用深色主题"}),o.jsx(P4,{value:"system",current:t,onChange:e,label:"跟随系统",description:"根据系统设置自动切换"})]})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题色"}),o.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"单色"}),o.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[o.jsx(ma,{value:"blue",current:a,onChange:c,label:"蓝色",colorClass:"bg-blue-500"}),o.jsx(ma,{value:"purple",current:a,onChange:c,label:"紫色",colorClass:"bg-purple-500"}),o.jsx(ma,{value:"green",current:a,onChange:c,label:"绿色",colorClass:"bg-green-500"}),o.jsx(ma,{value:"orange",current:a,onChange:c,label:"橙色",colorClass:"bg-orange-500"}),o.jsx(ma,{value:"pink",current:a,onChange:c,label:"粉色",colorClass:"bg-pink-500"}),o.jsx(ma,{value:"red",current:a,onChange:c,label:"红色",colorClass:"bg-red-500"})]})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"渐变色"}),o.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[o.jsx(ma,{value:"gradient-sunset",current:a,onChange:c,label:"日落",colorClass:"bg-gradient-to-r from-orange-500 to-pink-500"}),o.jsx(ma,{value:"gradient-ocean",current:a,onChange:c,label:"海洋",colorClass:"bg-gradient-to-r from-blue-500 to-cyan-500"}),o.jsx(ma,{value:"gradient-forest",current:a,onChange:c,label:"森林",colorClass:"bg-gradient-to-r from-green-500 to-emerald-500"}),o.jsx(ma,{value:"gradient-aurora",current:a,onChange:c,label:"极光",colorClass:"bg-gradient-to-r from-purple-500 to-pink-500"}),o.jsx(ma,{value:"gradient-fire",current:a,onChange:c,label:"烈焰",colorClass:"bg-gradient-to-r from-red-500 to-orange-500"}),o.jsx(ma,{value:"gradient-twilight",current:a,onChange:c,label:"暮光",colorClass:"bg-gradient-to-r from-indigo-500 to-purple-500"})]})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"自定义颜色"}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[o.jsx("div",{className:"flex-1",children:o.jsx("input",{type:"color",value:a.startsWith("#")?a:"#3b82f6",onChange:d=>c(d.target.value),className:"h-10 sm:h-12 w-full rounded-lg border-2 border-border cursor-pointer",title:"选择自定义颜色"})}),o.jsx("div",{className:"flex-1",children:o.jsx(Pe,{type:"text",value:a,onChange:d=>c(d.target.value),placeholder:"#3b82f6",className:"font-mono text-sm"})})]}),o.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground mt-2",children:"点击色块选择颜色,或手动输入 HEX 颜色代码"})]})]})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"动画效果"}),o.jsxs("div",{className:"space-y-2 sm:space-y-3",children:[o.jsx("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5 flex-1",children:[o.jsx(he,{htmlFor:"animations",className:"text-base font-medium cursor-pointer",children:"启用动画效果"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后将禁用所有过渡动画和特效,提升性能"})]}),o.jsx(Ft,{id:"animations",checked:n,onCheckedChange:r})]})}),o.jsx("div",{className:"rounded-lg border bg-card p-4",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5 flex-1",children:[o.jsx(he,{htmlFor:"waves-background",className:"text-base font-medium cursor-pointer",children:"登录页波浪背景"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后登录页将使用纯色背景,适合低性能设备"})]}),o.jsx(Ft,{id:"waves-background",checked:s,onCheckedChange:i})]})})]})]})]})}function cie(){const t=na(),[e,n]=b.useState(""),[r,s]=b.useState(""),[i,a]=b.useState(!1),[l,c]=b.useState(!1),[d,h]=b.useState(!1),[m,g]=b.useState(!1),[x,y]=b.useState(!1),[w,S]=b.useState(!1),[k,j]=b.useState(""),[N,T]=b.useState(!1),{toast:E}=Lr(),_=b.useMemo(()=>$se(r),[r]),A=()=>localStorage.getItem("access-token")||"",D=async I=>{try{await navigator.clipboard.writeText(I),y(!0),E({title:"复制成功",description:"Token 已复制到剪贴板"}),setTimeout(()=>y(!1),2e3)}catch{E({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},q=async()=>{if(!r.trim()){E({title:"输入错误",description:"请输入新的 Token",variant:"destructive"});return}if(!_.isValid){const I=_.rules.filter(V=>!V.passed).map(V=>V.label).join(", ");E({title:"格式错误",description:`Token 不符合要求: ${I}`,variant:"destructive"});return}h(!0);try{const I=A(),V=await fetch("/api/webui/auth/update",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${I}`},body:JSON.stringify({new_token:r.trim()})}),L=await V.json();V.ok&&L.success?(localStorage.setItem("access-token",r.trim()),s(""),e&&n(r.trim()),E({title:"更新成功",description:"Access Token 已更新,即将跳转到登录页"}),setTimeout(()=>{localStorage.removeItem("access-token"),t({to:"/auth"})},1500)):E({title:"更新失败",description:L.message||"无法更新 Token",variant:"destructive"})}catch(I){console.error("更新 Token 错误:",I),E({title:"更新失败",description:"连接服务器失败",variant:"destructive"})}finally{h(!1)}},B=async()=>{g(!0);try{const I=A(),V=await fetch("/api/webui/auth/regenerate",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${I}`}}),L=await V.json();V.ok&&L.success?(localStorage.setItem("access-token",L.token),n(L.token),j(L.token),S(!0),T(!1),E({title:"生成成功",description:"新的 Access Token 已生成,请及时保存"})):E({title:"生成失败",description:L.message||"无法生成新 Token",variant:"destructive"})}catch(I){console.error("生成 Token 错误:",I),E({title:"生成失败",description:"连接服务器失败",variant:"destructive"})}finally{g(!1)}},H=async()=>{try{await navigator.clipboard.writeText(k),T(!0),E({title:"复制成功",description:"Token 已复制到剪贴板"})}catch{E({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},W=()=>{S(!1),setTimeout(()=>{j(""),T(!1)},300),setTimeout(()=>{localStorage.removeItem("access-token"),t({to:"/auth"})},500)},ee=I=>{I||W()};return o.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[o.jsx(Er,{open:w,onOpenChange:ee,children:o.jsxs(wr,{className:"sm:max-w-md",children:[o.jsxs(Sr,{children:[o.jsxs(kr,{className:"flex items-center gap-2",children:[o.jsx(Ga,{className:"h-5 w-5 text-yellow-500"}),"新的 Access Token"]}),o.jsx(Xr,{children:"这是您的新 Token,请立即保存。关闭此窗口后将跳转到登录页面。"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"rounded-lg border-2 border-primary/20 bg-primary/5 p-4",children:[o.jsx(he,{className:"text-xs text-muted-foreground mb-2 block",children:"您的新 Token (64位安全令牌)"}),o.jsx("div",{className:"font-mono text-sm break-all select-all bg-background p-3 rounded border",children:k})]}),o.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Ga,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5"}),o.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[o.jsx("p",{className:"font-semibold",children:"重要提示"}),o.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[o.jsx("li",{children:"此 Token 仅显示一次,关闭后无法再查看"}),o.jsx("li",{children:"请立即复制并保存到安全的位置"}),o.jsx("li",{children:"关闭窗口后将自动跳转到登录页面"}),o.jsx("li",{children:"请使用新 Token 重新登录系统"})]})]})]})})]}),o.jsxs(fs,{className:"gap-2 sm:gap-0",children:[o.jsx(ue,{variant:"outline",onClick:H,className:"gap-2",children:N?o.jsxs(o.Fragment,{children:[o.jsx(zo,{className:"h-4 w-4 text-green-500"}),"已复制"]}):o.jsxs(o.Fragment,{children:[o.jsx(Iv,{className:"h-4 w-4"}),"复制 Token"]})}),o.jsx(ue,{onClick:W,children:"我已保存,关闭"})]})]})}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"当前 Access Token"}),o.jsx("div",{className:"space-y-3 sm:space-y-4",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"current-token",className:"text-sm",children:"您的访问令牌"}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[o.jsxs("div",{className:"relative flex-1",children:[o.jsx(Pe,{id:"current-token",type:i?"text":"password",value:e||A(),readOnly:!0,className:"pr-10 font-mono text-sm",placeholder:"点击查看按钮显示 Token"}),o.jsx("button",{onClick:()=>{e||n(A()),a(!i)},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:i?"隐藏":"显示",children:i?o.jsx(I0,{className:"h-4 w-4 text-muted-foreground"}):o.jsx(Ji,{className:"h-4 w-4 text-muted-foreground"})})]}),o.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[o.jsx(ue,{variant:"outline",size:"icon",onClick:()=>D(A()),title:"复制到剪贴板",className:"flex-shrink-0",children:x?o.jsx(zo,{className:"h-4 w-4 text-green-500"}):o.jsx(Iv,{className:"h-4 w-4"})}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsxs(ue,{variant:"outline",disabled:m,className:"gap-2 flex-1 sm:flex-none",children:[o.jsx(Qs,{className:xe("h-4 w-4",m&&"animate-spin")}),o.jsx("span",{className:"hidden sm:inline",children:"重新生成"}),o.jsx("span",{className:"sm:hidden",children:"生成"})]})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认重新生成 Token"}),o.jsx(zn,{children:"这将生成一个新的 64 位安全令牌,并使当前 Token 立即失效。 您需要使用新 Token 重新登录系统。此操作不可撤销,确定要继续吗?"})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:B,children:"确认生成"})]})]})]})]})]}),o.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground",children:"请妥善保管您的 Access Token,不要泄露给他人"})]})})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"自定义 Access Token"}),o.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"new-token",className:"text-sm",children:"新的访问令牌"}),o.jsxs("div",{className:"relative",children:[o.jsx(Pe,{id:"new-token",type:l?"text":"password",value:r,onChange:I=>s(I.target.value),className:"pr-10 font-mono text-sm",placeholder:"输入自定义 Token"}),o.jsx("button",{onClick:()=>c(!l),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:l?"隐藏":"显示",children:l?o.jsx(I0,{className:"h-4 w-4 text-muted-foreground"}):o.jsx(Ji,{className:"h-4 w-4 text-muted-foreground"})})]}),r&&o.jsxs("div",{className:"mt-3 space-y-2 p-3 rounded-lg bg-muted/50",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"Token 安全要求:"}),o.jsx("div",{className:"space-y-1.5",children:_.rules.map(I=>o.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[I.passed?o.jsx(Ya,{className:"h-4 w-4 text-green-500 flex-shrink-0"}):o.jsx(OI,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),o.jsx("span",{className:xe(I.passed?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:I.label})]},I.id))}),_.isValid&&o.jsx("div",{className:"mt-2 pt-2 border-t border-border",children:o.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[o.jsx(zo,{className:"h-4 w-4"}),o.jsx("span",{className:"font-medium",children:"Token 格式正确,可以使用"})]})})]})]}),o.jsx(ue,{onClick:q,disabled:d||!_.isValid||!r,className:"w-full sm:w-auto",children:d?"更新中...":"更新自定义 Token"})]})]}),o.jsxs("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3 sm:p-4",children:[o.jsx("h4",{className:"text-sm sm:text-base font-semibold text-yellow-900 dark:text-yellow-200 mb-2",children:"安全提示"}),o.jsxs("ul",{className:"text-xs sm:text-sm text-yellow-800 dark:text-yellow-300 space-y-1 list-disc list-inside",children:[o.jsx("li",{children:"重新生成 Token 会创建系统随机生成的 64 位安全令牌"}),o.jsx("li",{children:"自定义 Token 必须满足所有安全要求才能使用"}),o.jsx("li",{children:"更新 Token 后,旧的 Token 将立即失效"}),o.jsx("li",{children:"请在安全的环境下查看和复制 Token"}),o.jsx("li",{children:"如果怀疑 Token 泄露,请立即重新生成或更新"}),o.jsx("li",{children:"建议使用系统生成的 Token 以获得最高安全性"})]})]})]})}function uie(){const t=na(),{toast:e}=Lr(),[n,r]=b.useState(!1),[s,i]=b.useState(!1);if(s)throw new Error("这是一个手动触发的测试错误,用于验证错误边界组件是否正常工作。");const a=async()=>{r(!0);try{const l=localStorage.getItem("access-token"),c=await fetch("/api/webui/setup/reset",{method:"POST",headers:{Authorization:`Bearer ${l}`}}),d=await c.json();c.ok&&d.success?(e({title:"重置成功",description:"即将进入初次配置向导"}),setTimeout(()=>{t({to:"/setup"})},1e3)):e({title:"重置失败",description:d.message||"无法重置配置状态",variant:"destructive"})}catch(l){console.error("重置配置状态错误:",l),e({title:"重置失败",description:"连接服务器失败",variant:"destructive"})}finally{r(!1)}};return o.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"配置向导"}),o.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[o.jsx("div",{className:"space-y-2",children:o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"重新进行初次配置向导,可以帮助您重新设置系统的基础配置。"})}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsxs(ue,{variant:"outline",disabled:n,className:"gap-2",children:[o.jsx(zj,{className:xe("h-4 w-4",n&&"animate-spin")}),"重新进行初次配置"]})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认重新配置"}),o.jsx(zn,{children:"这将带您重新进入初次配置向导。您可以重新设置系统的基础配置项。确定要继续吗?"})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:a,children:"确认重置"})]})]})]})]})]}),o.jsxs("div",{className:"rounded-lg border border-dashed border-yellow-500/50 bg-yellow-500/5 p-4 sm:p-6",children:[o.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4 flex items-center gap-2",children:[o.jsx(Ga,{className:"h-5 w-5 text-yellow-500"}),"开发者工具"]}),o.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[o.jsx("div",{className:"space-y-2",children:o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"以下功能仅供开发调试使用,可能会导致页面崩溃或异常。"})}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsxs(ue,{variant:"destructive",className:"gap-2",children:[o.jsx(Ga,{className:"h-4 w-4"}),"触发测试错误"]})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认触发错误"}),o.jsx(zn,{children:"这将手动触发一个 React 错误,用于测试错误边界组件的显示效果。 页面将显示错误界面,您可以通过刷新页面或点击返回首页来恢复。"})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>i(!0),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"确认触发"})]})]})]})]})]})]})}function die(){return o.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[o.jsx("div",{className:"rounded-lg border-2 border-primary/30 bg-gradient-to-r from-primary/5 to-primary/10 p-4 sm:p-6",children:o.jsxs("div",{className:"flex items-start gap-3 sm:gap-4",children:[o.jsx("div",{className:"flex-shrink-0 rounded-lg bg-primary/10 p-2 sm:p-3",children:o.jsx("svg",{className:"h-6 w-6 sm:h-8 sm:w-8 text-primary",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:o.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("h3",{className:"text-lg sm:text-xl font-bold text-foreground mb-2",children:"开源项目"}),o.jsx("p",{className:"text-sm sm:text-base text-muted-foreground mb-3",children:"本项目在 GitHub 开源,欢迎 Star ⭐ 支持!"}),o.jsxs("a",{href:"https://github.com/Mai-with-u/MaiBot-Dashboard",target:"_blank",rel:"noopener noreferrer",className:xe("inline-flex items-center gap-2 px-4 py-2 rounded-lg","bg-primary text-primary-foreground font-medium text-sm","hover:bg-primary/90 transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),children:[o.jsx("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:o.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})}),"前往 GitHub",o.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]})]})}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:["关于 ",Jj]}),o.jsxs("div",{className:"space-y-2 text-xs sm:text-sm text-muted-foreground",children:[o.jsxs("p",{children:["版本: ",Zj]}),o.jsx("p",{children:"麦麦(MaiBot)的现代化 Web 管理界面"})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"作者"}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-sm font-medium",children:"MaiBot 核心"}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Mai-with-u"})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-sm font-medium",children:"WebUI"}),o.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground",children:["Mai-with-u ",o.jsx("a",{href:"https://github.com/DrSmoothl",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"@MotricSeven"})]})]})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"技术栈"}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs sm:text-sm text-muted-foreground",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("p",{className:"font-medium text-foreground",children:"前端框架"}),o.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[o.jsx("li",{children:"React 19.2.0"}),o.jsx("li",{children:"TypeScript 5.7.2"}),o.jsx("li",{children:"Vite 6.0.7"}),o.jsx("li",{children:"TanStack Router 1.94.2"})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("p",{className:"font-medium text-foreground",children:"UI 组件"}),o.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[o.jsx("li",{children:"shadcn/ui"}),o.jsx("li",{children:"Radix UI"}),o.jsx("li",{children:"Tailwind CSS 3.4.17"}),o.jsx("li",{children:"Lucide Icons"})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("p",{className:"font-medium text-foreground",children:"后端"}),o.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[o.jsx("li",{children:"Python 3.12+"}),o.jsx("li",{children:"FastAPI"}),o.jsx("li",{children:"Uvicorn"}),o.jsx("li",{children:"WebSocket"})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("p",{className:"font-medium text-foreground",children:"构建工具"}),o.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[o.jsx("li",{children:"Bun / npm"}),o.jsx("li",{children:"ESLint 9.17.0"}),o.jsx("li",{children:"PostCSS"})]})]})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源库感谢"}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mb-3",children:"本项目使用了以下优秀的开源库,感谢他们的贡献:"}),o.jsx(pn,{className:"h-[300px] sm:h-[400px]",children:o.jsxs("div",{className:"space-y-4 pr-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"UI 框架与组件"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Dr,{name:"React",description:"用户界面构建库",license:"MIT"}),o.jsx(Dr,{name:"shadcn/ui",description:"优雅的 React 组件库",license:"MIT"}),o.jsx(Dr,{name:"Radix UI",description:"无样式的可访问组件库",license:"MIT"}),o.jsx(Dr,{name:"Tailwind CSS",description:"实用优先的 CSS 框架",license:"MIT"}),o.jsx(Dr,{name:"Lucide React",description:"精美的图标库",license:"ISC"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"路由与状态管理"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Dr,{name:"TanStack Router",description:"类型安全的路由库",license:"MIT"}),o.jsx(Dr,{name:"Zustand",description:"轻量级状态管理",license:"MIT"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"表单处理"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Dr,{name:"React Hook Form",description:"高性能表单库",license:"MIT"}),o.jsx(Dr,{name:"Zod",description:"TypeScript 优先的 schema 验证",license:"MIT"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"工具库"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Dr,{name:"clsx",description:"条件 className 构建工具",license:"MIT"}),o.jsx(Dr,{name:"tailwind-merge",description:"Tailwind 类名合并工具",license:"MIT"}),o.jsx(Dr,{name:"class-variance-authority",description:"组件变体管理",license:"Apache-2.0"}),o.jsx(Dr,{name:"date-fns",description:"现代化日期处理库",license:"MIT"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"动画效果"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Dr,{name:"Framer Motion",description:"React 动画库",license:"MIT"}),o.jsx(Dr,{name:"vaul",description:"抽屉组件动画",license:"MIT"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"后端框架"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Dr,{name:"FastAPI",description:"现代化 Python Web 框架",license:"MIT"}),o.jsx(Dr,{name:"Uvicorn",description:"ASGI 服务器",license:"BSD-3-Clause"}),o.jsx(Dr,{name:"Pydantic",description:"数据验证库",license:"MIT"}),o.jsx(Dr,{name:"python-multipart",description:"文件上传支持",license:"Apache-2.0"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"开发工具"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Dr,{name:"TypeScript",description:"JavaScript 的超集",license:"Apache-2.0"}),o.jsx(Dr,{name:"Vite",description:"下一代前端构建工具",license:"MIT"}),o.jsx(Dr,{name:"ESLint",description:"JavaScript 代码检查工具",license:"MIT"}),o.jsx(Dr,{name:"PostCSS",description:"CSS 转换工具",license:"MIT"})]})]})]})})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源许可"}),o.jsxs("div",{className:"space-y-3",children:[o.jsx("div",{className:"rounded-lg bg-primary/5 border border-primary/20 p-3 sm:p-4",children:o.jsxs("div",{className:"flex items-start gap-2 sm:gap-3",children:[o.jsx("div",{className:"flex-shrink-0 mt-0.5",children:o.jsx("div",{className:"rounded-md bg-primary/10 px-2 py-1",children:o.jsx("span",{className:"text-xs sm:text-sm font-bold text-primary",children:"GPLv3"})})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm sm:text-base font-semibold text-foreground mb-1",children:"MaiBot WebUI"}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目采用 GNU General Public License v3.0 开源许可证。 您可以自由地使用、修改和分发本软件,但必须保持相同的开源许可。"})]})]})}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目依赖的所有开源库均遵循各自的开源许可证(MIT、Apache-2.0、BSD 等)。 感谢所有开源贡献者的无私奉献。"})]})]})]})}function Dr({name:t,description:e,license:n}){return o.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-lg border bg-muted/30 p-2.5 sm:p-3",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"font-medium text-foreground truncate",children:t}),o.jsx("p",{className:"text-muted-foreground text-xs mt-0.5",children:e})]}),o.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-medium text-primary flex-shrink-0",children:n})]})}function P4({value:t,current:e,onChange:n,label:r,description:s}){const i=e===t;return o.jsxs("button",{onClick:()=>n(t),className:xe("relative rounded-lg border-2 p-3 sm:p-4 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",i?"border-primary bg-accent":"border-border"),children:[i&&o.jsx("div",{className:"absolute top-2 right-2 sm:top-3 sm:right-3 h-2 w-2 rounded-full bg-primary"}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("div",{className:"text-sm sm:text-base font-medium",children:r}),o.jsx("div",{className:"text-[10px] sm:text-xs text-muted-foreground",children:s})]}),o.jsxs("div",{className:"mt-2 sm:mt-3 flex gap-1",children:[t==="light"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-200"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-300"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-400"})]}),t==="dark"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-700"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-800"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-900"})]}),t==="system"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-200 to-slate-700"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-300 to-slate-800"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-400 to-slate-900"})]})]})]})}function ma({value:t,current:e,onChange:n,label:r,colorClass:s}){const i=e===t;return o.jsxs("button",{onClick:()=>n(t),className:xe("relative rounded-lg border-2 p-2 sm:p-3 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",i?"border-primary bg-accent":"border-border"),children:[i&&o.jsx("div",{className:"absolute top-1.5 right-1.5 sm:top-2 sm:right-2 h-1.5 w-1.5 sm:h-2 sm:w-2 rounded-full bg-primary"}),o.jsxs("div",{className:"flex flex-col items-center gap-1.5 sm:gap-2",children:[o.jsx("div",{className:xe("h-8 w-8 sm:h-10 sm:w-10 rounded-full",s)}),o.jsx("div",{className:"text-[10px] sm:text-xs font-medium text-center",children:r})]})]})}class hie{grad3;p;perm;constructor(e=0){this.grad3=[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]],this.p=[];for(let n=0;n<256;n++)this.p[n]=Math.floor(Math.random()*256);this.perm=[];for(let n=0;n<512;n++)this.perm[n]=this.p[n&255]}dot(e,n,r){return e[0]*n+e[1]*r}mix(e,n,r){return(1-r)*e+r*n}fade(e){return e*e*e*(e*(e*6-15)+10)}perlin2(e,n){const r=Math.floor(e)&255,s=Math.floor(n)&255;e-=Math.floor(e),n-=Math.floor(n);const i=this.fade(e),a=this.fade(n),l=this.perm[r]+s,c=this.perm[l],d=this.perm[l+1],h=this.perm[r+1]+s,m=this.perm[h],g=this.perm[h+1];return this.mix(this.mix(this.dot(this.grad3[c%12],e,n),this.dot(this.grad3[m%12],e-1,n),i),this.mix(this.dot(this.grad3[d%12],e,n-1),this.dot(this.grad3[g%12],e-1,n-1),i),a)}}function fie(){const t=b.useRef(null),e=b.useRef(null),n=b.useRef(void 0),r=b.useRef({mouse:{x:-10,y:0,lx:0,ly:0,sx:0,sy:0,v:0,vs:0,a:0,set:!1},lines:[],paths:[],noise:new hie(Math.random()),bounding:null});return b.useEffect(()=>{const s=e.current,i=t.current;if(!s||!i)return;const a=r.current,l=()=>{const w=s.getBoundingClientRect();a.bounding=w,i.style.width=`${w.width}px`,i.style.height=`${w.height}px`},c=()=>{if(!a.bounding)return;const{width:w,height:S}=a.bounding;a.lines=[],a.paths.forEach(q=>q.remove()),a.paths=[];const k=10,j=32,N=w+200,T=S+30,E=Math.ceil(N/k),_=Math.ceil(T/j),A=(w-k*E)/2,D=(S-j*_)/2;for(let q=0;q<=E;q++){const B=[];for(let W=0;W<=_;W++){const ee={x:A+k*q,y:D+j*W,wave:{x:0,y:0},cursor:{x:0,y:0,vx:0,vy:0}};B.push(ee)}const H=document.createElementNS("http://www.w3.org/2000/svg","path");i.appendChild(H),a.paths.push(H),a.lines.push(B)}},d=w=>{const{lines:S,mouse:k,noise:j}=a;S.forEach(N=>{N.forEach(T=>{const E=j.perlin2((T.x+w*.0125)*.002,(T.y+w*.005)*.0015)*12;T.wave.x=Math.cos(E)*32,T.wave.y=Math.sin(E)*16;const _=T.x-k.sx,A=T.y-k.sy,D=Math.hypot(_,A),q=Math.max(175,k.vs);if(D{const k={x:w.x+w.wave.x+(S?w.cursor.x:0),y:w.y+w.wave.y+(S?w.cursor.y:0)};return k.x=Math.round(k.x*10)/10,k.y=Math.round(k.y*10)/10,k},m=()=>{const{lines:w,paths:S}=a;w.forEach((k,j)=>{let N=h(k[0],!1),T=`M ${N.x} ${N.y}`;k.forEach((E,_)=>{const A=_===k.length-1;N=h(E,!A),T+=`L ${N.x} ${N.y}`}),S[j].setAttribute("d",T)})},g=w=>{const{mouse:S}=a;S.sx+=(S.x-S.sx)*.1,S.sy+=(S.y-S.sy)*.1;const k=S.x-S.lx,j=S.y-S.ly,N=Math.hypot(k,j);S.v=N,S.vs+=(N-S.vs)*.1,S.vs=Math.min(100,S.vs),S.lx=S.x,S.ly=S.y,S.a=Math.atan2(j,k),s&&(s.style.setProperty("--x",`${S.sx}px`),s.style.setProperty("--y",`${S.sy}px`)),d(w),m(),n.current=requestAnimationFrame(g)},x=w=>{if(!a.bounding)return;const{mouse:S}=a;S.x=w.pageX-a.bounding.left,S.y=w.pageY-a.bounding.top+window.scrollY,S.set||(S.sx=S.x,S.sy=S.y,S.lx=S.x,S.ly=S.y,S.set=!0)},y=()=>{l(),c()};return l(),c(),window.addEventListener("resize",y),window.addEventListener("mousemove",x),n.current=requestAnimationFrame(g),()=>{window.removeEventListener("resize",y),window.removeEventListener("mousemove",x),n.current&&cancelAnimationFrame(n.current)}},[]),o.jsxs("div",{ref:e,className:"waves-background",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",pointerEvents:"none"},children:[o.jsx("div",{className:"waves-cursor",style:{position:"absolute",top:0,left:0,width:"0.5rem",height:"0.5rem",background:"hsl(var(--primary) / 0.3)",borderRadius:"50%",transform:"translate3d(calc(var(--x, -0.5rem) - 50%), calc(var(--y, 50%) - 50%), 0)",willChange:"transform",pointerEvents:"none"}}),o.jsx("svg",{ref:t,style:{display:"block",width:"100%",height:"100%"},children:o.jsx("style",{children:` - path { - fill: none; - stroke: hsl(var(--primary) / 0.20); - stroke-width: 1px; - } - `})})]})}function mie(){const t=na();b.useEffect(()=>{localStorage.getItem("access-token")||t({to:"/auth"})},[t])}function AB(){return!!localStorage.getItem("access-token")}function pie(){const[t,e]=b.useState(""),[n,r]=b.useState(!1),[s,i]=b.useState(""),a=na(),{enableWavesBackground:l,setEnableWavesBackground:c}=rB(),{theme:d,setTheme:h}=Kj();b.useEffect(()=>{AB()&&a({to:"/"})},[a]);const g=d==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":d,x=()=>{h(g==="dark"?"light":"dark")},y=async w=>{if(w.preventDefault(),i(""),!t.trim()){i("请输入 Access Token");return}r(!0);try{const S=await fetch("/api/webui/auth/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t.trim()})}),k=await S.json();if(S.ok&&k.valid){localStorage.setItem("access-token",t.trim());const j=await fetch("/api/webui/setup/status",{method:"GET",headers:{Authorization:`Bearer ${t.trim()}`}}),N=await j.json();j.ok&&N.is_first_setup?a({to:"/setup"}):a({to:"/"})}else i(k.message||"Token 验证失败,请检查后重试")}catch(S){console.error("Token 验证错误:",S),i("连接服务器失败,请检查网络连接")}finally{r(!1)}};return o.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[l&&o.jsx(fie,{}),o.jsxs(Lt,{className:"relative z-10 w-full max-w-md shadow-2xl backdrop-blur-xl bg-card/80 border-border/50",children:[o.jsx("button",{onClick:x,className:"absolute right-4 top-4 rounded-lg p-2 hover:bg-accent transition-colors z-10 text-foreground",title:g==="dark"?"切换到浅色模式":"切换到深色模式",children:g==="dark"?o.jsx(ik,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"}):o.jsx(ak,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"})}),o.jsxs(En,{className:"space-y-4 text-center",children:[o.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10",children:o.jsx(j9,{className:"h-8 w-8 text-primary",strokeWidth:2,fill:"none"})}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(_n,{className:"text-2xl font-bold",children:"欢迎使用 MaiBot"}),o.jsx(Wr,{className:"text-base",children:"请输入您的 Access Token 以继续访问系统"})]})]}),o.jsx(Xn,{children:o.jsxs("form",{onSubmit:y,className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"token",className:"text-sm font-medium",children:"Access Token"}),o.jsxs("div",{className:"relative",children:[o.jsx(jI,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",strokeWidth:2,fill:"none"}),o.jsx(Pe,{id:"token",type:"password",placeholder:"请输入您的 Access Token",value:t,onChange:w=>e(w.target.value),className:xe("pl-10",s&&"border-red-500 focus-visible:ring-red-500"),disabled:n,autoFocus:!0,autoComplete:"off"})]})]}),s&&o.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-red-50 p-3 text-sm text-red-600 dark:bg-red-950/50 dark:text-red-400",children:[o.jsx(Lo,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2,fill:"none"}),o.jsx("span",{children:s})]}),o.jsx(ue,{type:"submit",className:"w-full",disabled:n,children:n?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"验证中..."]}):"验证并进入"}),o.jsxs(Er,{children:[o.jsx(Of,{asChild:!0,children:o.jsxs("button",{className:"w-full text-center text-sm text-primary hover:text-primary/80 transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[o.jsx(Zy,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我没有 Token,我该去哪里获得 Token?"]})}),o.jsxs(wr,{className:"sm:max-w-md",children:[o.jsxs(Sr,{children:[o.jsxs(kr,{className:"flex items-center gap-2",children:[o.jsx(j9,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"如何获取 Access Token"]}),o.jsx(Xr,{children:"Access Token 是访问 MaiBot WebUI 的唯一凭证,请按以下方式获取"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(Vee,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsx("h4",{className:"font-semibold text-sm",children:"方式一:查看启动日志"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"在 MaiBot 启动时,控制台会显示 WebUI Access Token。"}),o.jsxs("div",{className:"rounded bg-background p-2 font-mono text-xs",children:[o.jsx("p",{className:"text-muted-foreground",children:"🔑 WebUI Access Token: abc123..."}),o.jsx("p",{className:"text-muted-foreground",children:"💡 请使用此 Token 登录 WebUI"})]})]})]})}),o.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(Po,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsx("h4",{className:"font-semibold text-sm",children:"方式二:查看配置文件"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Token 保存在项目根目录的配置文件中:"}),o.jsx("div",{className:"rounded bg-background p-2 font-mono text-xs break-all",children:o.jsx("code",{className:"text-primary",children:"data/webui.json"})}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["打开此文件,复制 ",o.jsx("code",{className:"px-1 py-0.5 bg-background rounded",children:"access_token"})," 字段的值"]})]})]})}),o.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Lo,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),o.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[o.jsx("p",{className:"font-semibold",children:"安全提示"}),o.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[o.jsx("li",{children:"请妥善保管您的 Token,不要泄露给他人"}),o.jsx("li",{children:"如需重置 Token,请在登录后前往系统设置"})]})]})]})})]})]})]}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsxs("button",{className:"w-full text-center text-sm text-muted-foreground hover:text-foreground transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[o.jsx(Zu,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我觉得这个界面很卡怎么办?"]})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsxs(Pn,{className:"flex items-center gap-2",children:[o.jsx(Zu,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"关闭背景动画"]}),o.jsx(zn,{children:"背景动画可能会在低性能设备上造成卡顿。关闭动画可以显著提升界面流畅度。"})]}),o.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭动画后,背景将变为纯色,但不影响任何功能的使用。您可以随时在系统设置中重新开启动画。"})}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>c(!1),children:"关闭动画"})]})]})]})]})})]}),o.jsx("div",{className:"absolute bottom-4 left-0 right-0 text-center text-xs text-muted-foreground",children:o.jsx("p",{children:Hse})})]})}const Nr=b.forwardRef(({className:t,...e},n)=>o.jsx("textarea",{className:xe("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:n,...e}));Nr.displayName="Textarea";var gie=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xie=gie.reduce((t,e)=>{const n=Vy(`Primitive.${e}`),r=b.forwardRef((s,i)=>{const{asChild:a,...l}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),vie="Separator",cE="horizontal",yie=["horizontal","vertical"],MB=b.forwardRef((t,e)=>{const{decorative:n,orientation:r=cE,...s}=t,i=bie(r)?r:cE,l=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return o.jsx(xie.div,{"data-orientation":i,...l,...s,ref:e})});MB.displayName=vie;function bie(t){return yie.includes(t)}var RB=MB;const $0=b.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},s)=>o.jsx(RB,{ref:s,decorative:n,orientation:e,className:xe("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));$0.displayName=RB.displayName;function wie({config:t,onChange:e}){const n=s=>{s.trim()&&!t.alias_names.includes(s.trim())&&e({...t,alias_names:[...t.alias_names,s.trim()]})},r=s=>{e({...t,alias_names:t.alias_names.filter((i,a)=>a!==s)})};return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"qq_account",children:"QQ账号 *"}),o.jsx(Pe,{id:"qq_account",type:"number",placeholder:"请输入机器人的QQ账号",value:t.qq_account||"",onChange:s=>e({...t,qq_account:Number(s.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人登录使用的QQ账号"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"nickname",children:"昵称 *"}),o.jsx(Pe,{id:"nickname",placeholder:"请输入机器人的昵称",value:t.nickname,onChange:s=>e({...t,nickname:s.target.value})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的主要称呼名称"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{children:"别名"}),o.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:t.alias_names.map((s,i)=>o.jsxs(tn,{variant:"secondary",className:"gap-1",children:[s,o.jsx("button",{type:"button",onClick:()=>r(i),className:"ml-1 hover:text-destructive",children:o.jsx(Pp,{className:"h-3 w-3"})})]},i))}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Pe,{id:"alias_input",placeholder:"输入别名后按回车添加",onKeyPress:s=>{s.key==="Enter"&&(n(s.target.value),s.target.value="")}}),o.jsx(ue,{type:"button",variant:"outline",onClick:()=>{const s=document.getElementById("alias_input");s&&(n(s.value),s.value="")},children:"添加"})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的其他称呼,可以添加多个"})]})]})}function Sie({config:t,onChange:e}){return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"personality",children:"人格特征 *"}),o.jsx(Nr,{id:"personality",placeholder:"描述机器人的人格特质和身份特征(建议120字以内)",value:t.personality,onChange:n=>e({...t,personality:n.target.value}),rows:3}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:是一个女大学生,现在在读大二,会刷贴吧"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"reply_style",children:"表达风格 *"}),o.jsx(Nr,{id:"reply_style",placeholder:"描述机器人说话的表达风格、表达习惯",value:t.reply_style,onChange:n=>e({...t,reply_style:n.target.value}),rows:3}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:回复平淡一些,简短一些,说中文,参考贴吧、知乎和微博的回复风格"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"interest",children:"兴趣 *"}),o.jsx(Nr,{id:"interest",placeholder:"描述机器人感兴趣的话题",value:t.interest,onChange:n=>e({...t,interest:n.target.value}),rows:2}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"会影响机器人对什么话题进行回复"})]}),o.jsx($0,{}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"plan_style",children:"群聊说话规则 *"}),o.jsx(Nr,{id:"plan_style",placeholder:"机器人在群聊中的行为风格和规则",value:t.plan_style,onChange:n=>e({...t,plan_style:n.target.value}),rows:4}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在群聊中如何行动,例如回复频率、条件等"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"private_plan_style",children:"私聊说话规则 *"}),o.jsx(Nr,{id:"private_plan_style",placeholder:"机器人在私聊中的行为风格和规则",value:t.private_plan_style,onChange:n=>e({...t,private_plan_style:n.target.value}),rows:3}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在私聊中的行为方式"})]})]})}function kie({config:t,onChange:e}){return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{htmlFor:"emoji_chance",children:"表情包激活概率"}),o.jsxs("span",{className:"text-sm text-muted-foreground",children:[(t.emoji_chance*100).toFixed(0),"%"]})]}),o.jsx(Pe,{id:"emoji_chance",type:"range",min:"0",max:"1",step:"0.1",value:t.emoji_chance,onChange:n=>e({...t,emoji_chance:Number(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人发送表情包的概率"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"max_reg_num",children:"最大表情包数量"}),o.jsx(Pe,{id:"max_reg_num",type:"number",min:"1",max:"200",value:t.max_reg_num,onChange:n=>e({...t,max_reg_num:Number(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人最多保存的表情包数量"})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(he,{htmlFor:"do_replace",children:"达到最大数量时替换"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"开启后会删除旧表情包,关闭则不再收集新表情包"})]}),o.jsx(Ft,{id:"do_replace",checked:t.do_replace,onCheckedChange:n=>e({...t,do_replace:n})})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),o.jsx(Pe,{id:"check_interval",type:"number",min:"1",max:"120",value:t.check_interval,onChange:n=>e({...t,check_interval:Number(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包注册、破损、删除的时间间隔"})]}),o.jsx($0,{}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(he,{htmlFor:"steal_emoji",children:"偷取表情包"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人将一些表情包据为己有"})]}),o.jsx(Ft,{id:"steal_emoji",checked:t.steal_emoji,onCheckedChange:n=>e({...t,steal_emoji:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(he,{htmlFor:"content_filtration",children:"启用表情包过滤"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"只保存符合要求的表情包"})]}),o.jsx(Ft,{id:"content_filtration",checked:t.content_filtration,onCheckedChange:n=>e({...t,content_filtration:n})})]}),t.content_filtration&&o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"filtration_prompt",children:"过滤要求"}),o.jsx(Pe,{id:"filtration_prompt",placeholder:"例如:符合公序良俗",value:t.filtration_prompt,onChange:n=>e({...t,filtration_prompt:n.target.value})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"描述表情包应该符合的要求"})]})]})}function Oie({config:t,onChange:e}){return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(he,{htmlFor:"enable_tool",children:"启用工具系统"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人使用各种工具增强功能"})]}),o.jsx(Ft,{id:"enable_tool",checked:t.enable_tool,onCheckedChange:n=>e({...t,enable_tool:n})})]}),o.jsx($0,{}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(he,{htmlFor:"enable_mood",children:"启用情绪系统"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"让机器人具有情绪变化能力"})]}),o.jsx(Ft,{id:"enable_mood",checked:t.enable_mood,onCheckedChange:n=>e({...t,enable_mood:n})})]}),t.enable_mood&&o.jsxs("div",{className:"ml-6 space-y-6 border-l-2 border-primary/20 pl-6",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"mood_update_threshold",children:"情绪更新阈值"}),o.jsx(Pe,{id:"mood_update_threshold",type:"number",min:"0.1",max:"10",step:"0.1",value:t.mood_update_threshold||1,onChange:n=>e({...t,mood_update_threshold:Number(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"值越高,情绪更新越慢"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"emotion_style",children:"情感特征"}),o.jsx(Nr,{id:"emotion_style",placeholder:"描述情绪的变化情况,例如:情绪较为稳定,但遭遇特定事件时起伏较大",value:t.emotion_style||"",onChange:n=>e({...t,emotion_style:n.target.value}),rows:2}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"影响机器人的情绪变化方式"})]})]}),o.jsx($0,{}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(he,{htmlFor:"all_global",children:"启用全局黑话模式"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人学习和使用群组黑话"})]}),o.jsx(Ft,{id:"all_global",checked:t.all_global,onCheckedChange:n=>e({...t,all_global:n})})]})]})}function jie({config:t,onChange:e}){const[n,r]=b.useState(!1);return o.jsxs("div",{className:"space-y-6",children:[o.jsx("div",{className:"rounded-lg bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-4",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:"mt-0.5",children:o.jsx("svg",{className:"h-5 w-5 text-blue-600 dark:text-blue-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),o.jsxs("div",{className:"flex-1 text-sm",children:[o.jsx("p",{className:"font-medium text-blue-900 dark:text-blue-100 mb-1",children:"关于硅基流动 (SiliconFlow)"}),o.jsx("p",{className:"text-blue-700 dark:text-blue-300 mb-2",children:"硅基流动提供了完整的模型覆盖,包括 DeepSeek V3、Qwen、视觉模型、语音识别和嵌入模型。 只需一个 API Key 即可使用麦麦的所有功能!"}),o.jsxs("a",{href:"https://cloud.siliconflow.cn",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-blue-600 dark:text-blue-400 hover:underline font-medium",children:["前往硅基流动获取 API Key",o.jsx(w0,{className:"h-3 w-3"})]})]})]})}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"siliconflow_api_key",children:"SiliconFlow API Key *"}),o.jsxs("div",{className:"relative",children:[o.jsx(Pe,{id:"siliconflow_api_key",type:n?"text":"password",placeholder:"sk-...",value:t.api_key,onChange:s=>e({api_key:s.target.value}),className:"font-mono pr-10"}),o.jsx(ue,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 hover:bg-transparent",onClick:()=>r(!n),children:n?o.jsx(I0,{className:"h-4 w-4 text-muted-foreground"}):o.jsx(Ji,{className:"h-4 w-4 text-muted-foreground"})})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"请输入您的硅基流动 API 密钥。获取后,麦麦将自动配置所有必需的模型。"})]}),o.jsxs("div",{className:"rounded-lg bg-muted/50 p-4 text-sm space-y-2",children:[o.jsx("p",{className:"font-medium",children:"将自动配置以下模型:"}),o.jsxs("ul",{className:"list-disc list-inside space-y-1 text-muted-foreground ml-2",children:[o.jsx("li",{children:"DeepSeek V3 - 主要对话和工具模型"}),o.jsx("li",{children:"Qwen3 30B - 高频小任务和工具调用"}),o.jsx("li",{children:"Qwen3 VL 30B - 图像识别"}),o.jsx("li",{children:"SenseVoice - 语音识别"}),o.jsx("li",{children:"BGE-M3 - 文本嵌入"}),o.jsx("li",{children:"知识库相关模型 (LPMM)"})]})]}),o.jsx("div",{className:"rounded-lg border border-amber-200 dark:border-amber-800 bg-amber-50 dark:bg-amber-950/30 p-4",children:o.jsxs("p",{className:"text-sm text-amber-900 dark:text-amber-100",children:[o.jsx("span",{className:"font-medium",children:"💡 提示:"}),'完成向导后,您可以在"系统设置 → 模型配置"中添加更多 API 提供商和模型。']})})]})}async function gt(t,e){const n=await fetch(t,e);if(n.status===401)throw localStorage.removeItem("access-token"),window.location.href="/auth",new Error("认证失败,请重新登录");return n}function Tt(){return{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("access-token")}`}}async function Nie(){const t=await gt("/api/webui/config/bot",{method:"GET",headers:Tt()});if(!t.ok)throw new Error("读取Bot配置失败");const n=(await t.json()).config.bot||{};return{qq_account:n.qq_account||0,nickname:n.nickname||"",alias_names:n.alias_names||[]}}async function Cie(){const t=await gt("/api/webui/config/bot",{method:"GET",headers:Tt()});if(!t.ok)throw new Error("读取人格配置失败");const n=(await t.json()).config.personality||{};return{personality:n.personality||"",reply_style:n.reply_style||"",interest:n.interest||"",plan_style:n.plan_style||"",private_plan_style:n.private_plan_style||""}}async function Tie(){const t=await gt("/api/webui/config/bot",{method:"GET",headers:Tt()});if(!t.ok)throw new Error("读取表情包配置失败");const n=(await t.json()).config.emoji||{};return{emoji_chance:n.emoji_chance??.4,max_reg_num:n.max_reg_num??40,do_replace:n.do_replace??!0,check_interval:n.check_interval??10,steal_emoji:n.steal_emoji??!0,content_filtration:n.content_filtration??!1,filtration_prompt:n.filtration_prompt||""}}async function Eie(){const t=await gt("/api/webui/config/bot",{method:"GET",headers:Tt()});if(!t.ok)throw new Error("读取其他配置失败");const n=(await t.json()).config,r=n.tool||{},s=n.mood||{},i=n.jargon||{};return{enable_tool:r.enable_tool??!0,enable_mood:s.enable_mood??!1,mood_update_threshold:s.mood_update_threshold,emotion_style:s.emotion_style,all_global:i.all_global??!0}}async function _ie(){const t=await gt("/api/webui/config/model",{method:"GET",headers:Tt()});if(!t.ok)throw new Error("读取模型配置失败");return{api_key:((await t.json()).config.api_providers||[]).find(i=>i.name==="SiliconFlow")?.api_key||""}}async function Aie(t){const e=await gt("/api/webui/config/bot/section/bot",{method:"POST",headers:Tt(),body:JSON.stringify(t)});if(!e.ok){const n=await e.json();throw new Error(n.detail||"保存Bot基础配置失败")}return await e.json()}async function Mie(t){const e=await gt("/api/webui/config/bot/section/personality",{method:"POST",headers:Tt(),body:JSON.stringify(t)});if(!e.ok){const n=await e.json();throw new Error(n.detail||"保存人格配置失败")}return await e.json()}async function Rie(t){const e=await gt("/api/webui/config/bot/section/emoji",{method:"POST",headers:Tt(),body:JSON.stringify(t)});if(!e.ok){const n=await e.json();throw new Error(n.detail||"保存表情包配置失败")}return await e.json()}async function Die(t){const e=[];e.push(gt("/api/webui/config/bot/section/tool",{method:"POST",headers:Tt(),body:JSON.stringify({enable_tool:t.enable_tool})})),e.push(gt("/api/webui/config/bot/section/jargon",{method:"POST",headers:Tt(),body:JSON.stringify({all_global:t.all_global})}));const n={enable_mood:t.enable_mood};t.enable_mood&&(n.mood_update_threshold=t.mood_update_threshold||1,n.emotion_style=t.emotion_style||""),e.push(gt("/api/webui/config/bot/section/mood",{method:"POST",headers:Tt(),body:JSON.stringify(n)}));const r=await Promise.all(e);for(const s of r)if(!s.ok){const i=await s.json();throw new Error(i.detail||"保存其他配置失败")}return{success:!0}}async function Pie(t){const e=await gt("/api/webui/config/model",{method:"GET",headers:Tt()});if(!e.ok)throw new Error("读取模型配置失败");const r=(await e.json()).config,s=r.api_providers||[],i=s.findIndex(c=>c.name==="SiliconFlow");i>=0?s[i]={...s[i],api_key:t.api_key}:s.push({name:"SiliconFlow",base_url:"https://api.siliconflow.cn/v1",api_key:t.api_key,client_type:"openai",max_retry:3,timeout:120,retry_interval:5});const a={...r,api_providers:s},l=await gt("/api/webui/config/model",{method:"POST",headers:Tt(),body:JSON.stringify(a)});if(!l.ok){const c=await l.json();throw new Error(c.detail||"保存模型配置失败")}return await l.json()}async function uE(){const t=localStorage.getItem("access-token"),e=await gt("/api/webui/setup/complete",{method:"POST",headers:{Authorization:`Bearer ${t}`}});if(!e.ok){const n=await e.json();throw new Error(n.message||"标记配置完成失败")}return await e.json()}async function cb(){const t=await gt("/api/webui/system/restart",{method:"POST",headers:Tt()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"重启失败")}return await t.json()}async function zie(){const t=await gt("/api/webui/system/status",{method:"GET",headers:Tt()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"获取状态失败")}return await t.json()}function Iie(){const t=na(),{toast:e}=Lr(),[n,r]=b.useState(0),[s,i]=b.useState(!1),[a,l]=b.useState(!1),[c,d]=b.useState(!0),[h,m]=b.useState({qq_account:0,nickname:"",alias_names:[]}),[g,x]=b.useState({personality:"是一个女大学生,现在在读大二,会刷贴吧。",reply_style:"请回复的平淡一些,简短一些,说中文,不要刻意突出自身学科背景。可以参考贴吧,知乎和微博的回复风格。",interest:"对技术相关话题,游戏和动漫相关话题感兴趣,也对日常话题感兴趣,不喜欢太过沉重严肃的话题",plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用 -2.如果相同的内容已经被执行,请不要重复执行 -3.请控制你的发言频率,不要太过频繁的发言 -4.如果有人对你感到厌烦,请减少回复 -5.如果有人对你进行攻击,或者情绪激动,请你以合适的方法应对`,private_plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用 -2.如果相同的内容已经被执行,请不要重复执行 -3.某句话如果已经被回复过,不要重复回复`}),[y,w]=b.useState({emoji_chance:.4,max_reg_num:40,do_replace:!0,check_interval:10,steal_emoji:!0,content_filtration:!1,filtration_prompt:"符合公序良俗"}),[S,k]=b.useState({enable_tool:!0,enable_mood:!1,mood_update_threshold:1,emotion_style:"情绪较为稳定,但遇遇特定事件的时候起伏较大",all_global:!0}),[j,N]=b.useState({api_key:""}),[T,E]=b.useState(!1),[_,A]=b.useState(""),D=[{id:"bot-basic",title:"Bot基础",description:"配置机器人的基本信息",icon:o0},{id:"personality",title:"人格配置",description:"定义机器人的性格和说话风格",icon:Lv},{id:"emoji",title:"表情包",description:"配置表情包相关设置",icon:Ij},{id:"other",title:"其他设置",description:"工具、情绪系统等配置",icon:Vc},{id:"siliconflow",title:"API配置",description:"配置硅基流动API密钥",icon:jI}],q=(n+1)/D.length*100;b.useEffect(()=>{(async()=>{try{d(!0);const[$,K,Y,R,ie]=await Promise.all([Nie(),Cie(),Tie(),Eie(),_ie()]);m($),x(K),w(Y),k(R),N(ie)}catch($){e({title:"加载配置失败",description:$ instanceof Error?$.message:"无法加载现有配置,将使用默认值",variant:"destructive"})}finally{d(!1)}})()},[e]);const B=async()=>{l(!0);try{switch(n){case 0:await Aie(h);break;case 1:await Mie(g);break;case 2:await Rie(y);break;case 3:await Die(S);break;case 4:await Pie(j);break}return e({title:"保存成功",description:`${D[n].title}配置已保存`}),!0}catch(L){return e({title:"保存失败",description:L instanceof Error?L.message:"未知错误",variant:"destructive"}),!1}finally{l(!1)}},H=async()=>{await B()&&n{n>0&&r(n-1)},ee=async()=>{i(!0),E(!0);try{if(A("正在保存API配置..."),!await B()){i(!1),E(!1);return}A("正在完成初始化..."),await uE(),A("正在重启麦麦..."),await cb(),e({title:"配置完成",description:"麦麦正在重启以应用新配置..."}),A("等待麦麦重启完成...");const $=60;let K=0,Y=!1;for(;K<$&&!Y;){await new Promise(R=>setTimeout(R,1e3));try{(await zie()).running&&(Y=!0,A("重启成功!正在跳转..."))}catch{K++}}if(!Y)throw new Error("重启超时,请手动检查麦麦状态");setTimeout(()=>{t({to:"/"})},1e3)}catch(L){E(!1),e({title:"配置失败",description:L instanceof Error?L.message:"未知错误",variant:"destructive"})}finally{i(!1)}},I=async()=>{try{await uE(),t({to:"/"})}catch(L){e({title:"跳过失败",description:L instanceof Error?L.message:"未知错误",variant:"destructive"})}},V=()=>{switch(n){case 0:return o.jsx(wie,{config:h,onChange:m});case 1:return o.jsx(Sie,{config:g,onChange:x});case 2:return o.jsx(kie,{config:y,onChange:w});case 3:return o.jsx(Oie,{config:S,onChange:k});case 4:return o.jsx(jie,{config:j,onChange:N});default:return null}};return o.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-gradient-to-br from-primary/5 via-background to-secondary/5 p-4 md:p-6",children:[T&&o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:o.jsxs("div",{className:"mx-auto flex max-w-md flex-col items-center space-y-6 rounded-lg border bg-card p-8 text-center shadow-lg",children:[o.jsx("div",{className:"flex h-20 w-20 items-center justify-center rounded-full bg-primary/10",children:o.jsx(Us,{className:"h-10 w-10 animate-spin text-primary"})}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h2",{className:"text-2xl font-bold",children:"正在重启麦麦"}),o.jsx("p",{className:"text-muted-foreground",children:_})]}),o.jsx("div",{className:"w-full",children:o.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-secondary",children:o.jsx("div",{className:"h-full w-full animate-pulse bg-primary",style:{animation:"pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite"}})})}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"请稍候,这可能需要一分钟..."})]})}),o.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[o.jsx("div",{className:"absolute left-1/4 top-1/4 h-64 w-64 md:h-96 md:w-96 rounded-full bg-primary/5 blur-3xl"}),o.jsx("div",{className:"absolute right-1/4 bottom-1/4 h-64 w-64 md:h-96 md:w-96 rounded-full bg-secondary/5 blur-3xl"})]}),c?o.jsxs("div",{className:"relative z-10 text-center",children:[o.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center",children:o.jsx("div",{className:"h-12 w-12 animate-spin rounded-full border-4 border-primary border-t-transparent"})}),o.jsx("p",{className:"text-lg font-medium",children:"加载配置中..."}),o.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"正在读取现有配置"})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"relative z-10 w-full max-w-4xl",children:[o.jsxs("div",{className:"mb-6 md:mb-8 text-center",children:[o.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 md:h-16 md:w-16 items-center justify-center rounded-2xl bg-primary/10",children:o.jsx(Uee,{className:"h-6 w-6 md:h-8 md:w-8 text-primary",strokeWidth:2,fill:"none"})}),o.jsx("h1",{className:"mb-2 text-2xl md:text-3xl font-bold",children:"首次配置向导"}),o.jsxs("p",{className:"text-sm md:text-base text-muted-foreground",children:["让我们一起完成 ",Jj," 的初始配置"]})]}),o.jsxs("div",{className:"mb-6 md:mb-8",children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between text-xs md:text-sm",children:[o.jsxs("span",{className:"text-muted-foreground",children:["步骤 ",n+1," / ",D.length]}),o.jsxs("span",{className:"font-medium text-primary",children:[Math.round(q),"%"]})]}),o.jsx(Qp,{value:q,className:"h-2"})]}),o.jsx("div",{className:"mb-6 md:mb-8 flex justify-between",children:D.map((L,$)=>{const K=L.icon;return o.jsxs("div",{className:xe("flex flex-1 flex-col items-center gap-1 md:gap-2",$t({to:"/"}),className:"gap-2 w-full sm:w-auto",children:[o.jsx(L0,{className:"h-4 w-4"}),"返回首页"]}),o.jsxs(ue,{size:"lg",variant:"outline",onClick:()=>window.history.back(),className:"gap-2 w-full sm:w-auto",children:[o.jsx(Bv,{className:"h-4 w-4"}),"返回上一页"]})]}),o.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"如果您认为这是一个错误,请联系系统管理员"})})]})})}var PB=["PageUp","PageDown"],zB=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],IB={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},jf="Slider",[xk,Lie,Bie]=Qy(jf),[LB]=Da(jf,[Bie]),[Fie,ub]=LB(jf),BB=b.forwardRef((t,e)=>{const{name:n,min:r=0,max:s=100,step:i=1,orientation:a="horizontal",disabled:l=!1,minStepsBetweenThumbs:c=0,defaultValue:d=[r],value:h,onValueChange:m=()=>{},onValueCommit:g=()=>{},inverted:x=!1,form:y,...w}=t,S=b.useRef(new Set),k=b.useRef(0),N=a==="horizontal"?qie:$ie,[T=[],E]=Kl({prop:h,defaultProp:d,onChange:H=>{[...S.current][k.current]?.focus(),m(H)}}),_=b.useRef(T);function A(H){const W=Wie(T,H);B(H,W)}function D(H){B(H,k.current)}function q(){const H=_.current[k.current];T[k.current]!==H&&g(T)}function B(H,W,{commit:ee}={commit:!1}){const I=Kie(i),V=Zie(Math.round((H-r)/i)*i+r,I),L=Tj(V,[r,s]);E(($=[])=>{const K=Vie($,L,W);if(Yie(K,c*i)){k.current=K.indexOf(L);const Y=String(K)!==String($);return Y&&ee&&g(K),Y?K:$}else return $})}return o.jsx(Fie,{scope:t.__scopeSlider,name:n,disabled:l,min:r,max:s,valueIndexToChangeRef:k,thumbs:S.current,values:T,orientation:a,form:y,children:o.jsx(xk.Provider,{scope:t.__scopeSlider,children:o.jsx(xk.Slot,{scope:t.__scopeSlider,children:o.jsx(N,{"aria-disabled":l,"data-disabled":l?"":void 0,...w,ref:e,onPointerDown:nt(w.onPointerDown,()=>{l||(_.current=T)}),min:r,max:s,inverted:x,onSlideStart:l?void 0:A,onSlideMove:l?void 0:D,onSlideEnd:l?void 0:q,onHomeKeyDown:()=>!l&&B(r,0,{commit:!0}),onEndKeyDown:()=>!l&&B(s,T.length-1,{commit:!0}),onStepKeyDown:({event:H,direction:W})=>{if(!l){const V=PB.includes(H.key)||H.shiftKey&&zB.includes(H.key)?10:1,L=k.current,$=T[L],K=i*V*W;B($+K,L,{commit:!0})}}})})})})});BB.displayName=jf;var[FB,qB]=LB(jf,{startEdge:"left",endEdge:"right",size:"width",direction:1}),qie=b.forwardRef((t,e)=>{const{min:n,max:r,dir:s,inverted:i,onSlideStart:a,onSlideMove:l,onSlideEnd:c,onStepKeyDown:d,...h}=t,[m,g]=b.useState(null),x=er(e,N=>g(N)),y=b.useRef(void 0),w=Rp(s),S=w==="ltr",k=S&&!i||!S&&i;function j(N){const T=y.current||m.getBoundingClientRect(),E=[0,T.width],A=t6(E,k?[n,r]:[r,n]);return y.current=T,A(N-T.left)}return o.jsx(FB,{scope:t.__scopeSlider,startEdge:k?"left":"right",endEdge:k?"right":"left",direction:k?1:-1,size:"width",children:o.jsx($B,{dir:w,"data-orientation":"horizontal",...h,ref:x,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:N=>{const T=j(N.clientX);a?.(T)},onSlideMove:N=>{const T=j(N.clientX);l?.(T)},onSlideEnd:()=>{y.current=void 0,c?.()},onStepKeyDown:N=>{const E=IB[k?"from-left":"from-right"].includes(N.key);d?.({event:N,direction:E?-1:1})}})})}),$ie=b.forwardRef((t,e)=>{const{min:n,max:r,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:l,onStepKeyDown:c,...d}=t,h=b.useRef(null),m=er(e,h),g=b.useRef(void 0),x=!s;function y(w){const S=g.current||h.current.getBoundingClientRect(),k=[0,S.height],N=t6(k,x?[r,n]:[n,r]);return g.current=S,N(w-S.top)}return o.jsx(FB,{scope:t.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:o.jsx($B,{"data-orientation":"vertical",...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const S=y(w.clientY);i?.(S)},onSlideMove:w=>{const S=y(w.clientY);a?.(S)},onSlideEnd:()=>{g.current=void 0,l?.()},onStepKeyDown:w=>{const k=IB[x?"from-bottom":"from-top"].includes(w.key);c?.({event:w,direction:k?-1:1})}})})}),$B=b.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:l,onStepKeyDown:c,...d}=t,h=ub(jf,n);return o.jsx(Sn.span,{...d,ref:e,onKeyDown:nt(t.onKeyDown,m=>{m.key==="Home"?(a(m),m.preventDefault()):m.key==="End"?(l(m),m.preventDefault()):PB.concat(zB).includes(m.key)&&(c(m),m.preventDefault())}),onPointerDown:nt(t.onPointerDown,m=>{const g=m.target;g.setPointerCapture(m.pointerId),m.preventDefault(),h.thumbs.has(g)?g.focus():r(m)}),onPointerMove:nt(t.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&s(m)}),onPointerUp:nt(t.onPointerUp,m=>{const g=m.target;g.hasPointerCapture(m.pointerId)&&(g.releasePointerCapture(m.pointerId),i(m))})})}),HB="SliderTrack",QB=b.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=ub(HB,n);return o.jsx(Sn.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:e})});QB.displayName=HB;var vk="SliderRange",VB=b.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=ub(vk,n),i=qB(vk,n),a=b.useRef(null),l=er(e,a),c=s.values.length,d=s.values.map(g=>GB(g,s.min,s.max)),h=c>1?Math.min(...d):0,m=100-Math.max(...d);return o.jsx(Sn.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:l,style:{...t.style,[i.startEdge]:h+"%",[i.endEdge]:m+"%"}})});VB.displayName=vk;var yk="SliderThumb",UB=b.forwardRef((t,e)=>{const n=Lie(t.__scopeSlider),[r,s]=b.useState(null),i=er(e,l=>s(l)),a=b.useMemo(()=>r?n().findIndex(l=>l.ref.current===r):-1,[n,r]);return o.jsx(Hie,{...t,ref:i,index:a})}),Hie=b.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:s,...i}=t,a=ub(yk,n),l=qB(yk,n),[c,d]=b.useState(null),h=er(e,j=>d(j)),m=c?a.form||!!c.closest("form"):!0,g=iI(c),x=a.values[r],y=x===void 0?0:GB(x,a.min,a.max),w=Uie(r,a.values.length),S=g?.[l.size],k=S?Gie(S,y,l.direction):0;return b.useEffect(()=>{if(c)return a.thumbs.add(c),()=>{a.thumbs.delete(c)}},[c,a.thumbs]),o.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${y}% + ${k}px)`},children:[o.jsx(xk.ItemSlot,{scope:t.__scopeSlider,children:o.jsx(Sn.span,{role:"slider","aria-label":t["aria-label"]||w,"aria-valuemin":a.min,"aria-valuenow":x,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...i,ref:h,style:x===void 0?{display:"none"}:t.style,onFocus:nt(t.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),m&&o.jsx(WB,{name:s??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:x},r)]})});UB.displayName=yk;var Qie="RadioBubbleInput",WB=b.forwardRef(({__scopeSlider:t,value:e,...n},r)=>{const s=b.useRef(null),i=er(s,r),a=sI(e);return b.useEffect(()=>{const l=s.current;if(!l)return;const c=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==e&&h){const m=new Event("input",{bubbles:!0});h.call(l,e),l.dispatchEvent(m)}},[a,e]),o.jsx(Sn.input,{style:{display:"none"},...n,ref:i,defaultValue:e})});WB.displayName=Qie;function Vie(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}function GB(t,e,n){const i=100/(n-e)*(t-e);return Tj(i,[0,100])}function Uie(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function Wie(t,e){if(t.length===1)return 0;const n=t.map(s=>Math.abs(s-e)),r=Math.min(...n);return n.indexOf(r)}function Gie(t,e,n){const r=t/2,i=t6([0,50],[0,r]);return(r-i(e)*n)*n}function Xie(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function Yie(t,e){if(e>0){const n=Xie(t);return Math.min(...n)>=e}return!0}function t6(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function Kie(t){return(String(t).split(".")[1]||"").length}function Zie(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var XB=BB,Jie=QB,eae=VB,tae=UB;const Nf=b.forwardRef(({className:t,...e},n)=>o.jsxs(XB,{ref:n,className:xe("relative flex w-full touch-none select-none items-center",t),...e,children:[o.jsx(Jie,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:o.jsx(eae,{className:"absolute h-full bg-primary"})}),o.jsx(tae,{className:"block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"})]}));Nf.displayName=XB.displayName;const Vt=Dee,Ut=Pee,$t=b.forwardRef(({className:t,children:e,...n},r)=>o.jsxs(cI,{ref:r,className:xe("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...n,children:[e,o.jsx(Eee,{asChild:!0,children:o.jsx(Xc,{className:"h-4 w-4 opacity-50"})})]}));$t.displayName=cI.displayName;const YB=b.forwardRef(({className:t,...e},n)=>o.jsx(uI,{ref:n,className:xe("flex cursor-default items-center justify-center py-1",t),...e,children:o.jsx(B0,{className:"h-4 w-4"})}));YB.displayName=uI.displayName;const KB=b.forwardRef(({className:t,...e},n)=>o.jsx(dI,{ref:n,className:xe("flex cursor-default items-center justify-center py-1",t),...e,children:o.jsx(Xc,{className:"h-4 w-4"})}));KB.displayName=dI.displayName;const Ht=b.forwardRef(({className:t,children:e,position:n="popper",...r},s)=>o.jsx(_ee,{children:o.jsxs(hI,{ref:s,className:xe("relative z-[100] max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-hidden rounded-md border border-border bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[o.jsx(YB,{}),o.jsx(Aee,{className:xe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),o.jsx(KB,{})]})}));Ht.displayName=hI.displayName;const nae=b.forwardRef(({className:t,...e},n)=>o.jsx(fI,{ref:n,className:xe("px-2 py-1.5 text-sm font-semibold",t),...e}));nae.displayName=fI.displayName;const De=b.forwardRef(({className:t,children:e,...n},r)=>o.jsxs(mI,{ref:r,className:xe("relative flex w-full cursor-default select-none items-center rounded-sm py-2 pl-2 pr-8 text-sm outline-none bg-white dark:bg-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800 focus:bg-gray-100 dark:focus:bg-gray-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[o.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(Mee,{children:o.jsx(zo,{className:"h-4 w-4"})})}),o.jsx(Ree,{children:e})]}));De.displayName=mI.displayName;const rae=b.forwardRef(({className:t,...e},n)=>o.jsx(pI,{ref:n,className:xe("-mx-1 my-1 h-px bg-muted",t),...e}));rae.displayName=pI.displayName;function sae(t){const e=iae(t),n=b.forwardRef((r,s)=>{const{children:i,...a}=r,l=b.Children.toArray(i),c=l.find(oae);if(c){const d=c.props.children,h=l.map(m=>m===c?b.Children.count(d)>1?b.Children.only(null):b.isValidElement(d)?d.props.children:null:m);return o.jsx(e,{...a,ref:s,children:b.isValidElement(d)?b.cloneElement(d,void 0,h):null})}return o.jsx(e,{...a,ref:s,children:i})});return n.displayName=`${t}.Slot`,n}function iae(t){const e=b.forwardRef((n,r)=>{const{children:s,...i}=n;if(b.isValidElement(s)){const a=cae(s),l=lae(i,s.props);return s.type!==b.Fragment&&(l.ref=r?Gc(r,a):a),b.cloneElement(s,l)}return b.Children.count(s)>1?b.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var aae=Symbol("radix.slottable");function oae(t){return b.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===aae}function lae(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...l)=>{const c=i(...l);return s(...l),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function cae(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var db="Popover",[ZB]=Da(db,[vf]),Vp=vf(),[uae,lu]=ZB(db),JB=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!1}=t,l=Vp(e),c=b.useRef(null),[d,h]=b.useState(!1),[m,g]=Kl({prop:r,defaultProp:s??!1,onChange:i,caller:db});return o.jsx(Yy,{...l,children:o.jsx(uae,{scope:e,contentId:Gi(),triggerRef:c,open:m,onOpenChange:g,onOpenToggle:b.useCallback(()=>g(x=>!x),[g]),hasCustomAnchor:d,onCustomAnchorAdd:b.useCallback(()=>h(!0),[]),onCustomAnchorRemove:b.useCallback(()=>h(!1),[]),modal:a,children:n})})};JB.displayName=db;var eF="PopoverAnchor",dae=b.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=lu(eF,n),i=Vp(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:l}=s;return b.useEffect(()=>(a(),()=>l()),[a,l]),o.jsx(Ky,{...i,...r,ref:e})});dae.displayName=eF;var tF="PopoverTrigger",nF=b.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=lu(tF,n),i=Vp(n),a=er(e,s.triggerRef),l=o.jsx(Sn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":oF(s.open),...r,ref:a,onClick:nt(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?l:o.jsx(Ky,{asChild:!0,...i,children:l})});nF.displayName=tF;var n6="PopoverPortal",[hae,fae]=ZB(n6,{forceMount:void 0}),rF=t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=lu(n6,e);return o.jsx(hae,{scope:e,forceMount:n,children:o.jsx(oi,{present:n||i.open,children:o.jsx(Xy,{asChild:!0,container:s,children:r})})})};rF.displayName=n6;var Kh="PopoverContent",sF=b.forwardRef((t,e)=>{const n=fae(Kh,t.__scopePopover),{forceMount:r=n.forceMount,...s}=t,i=lu(Kh,t.__scopePopover);return o.jsx(oi,{present:r||i.open,children:i.modal?o.jsx(pae,{...s,ref:e}):o.jsx(gae,{...s,ref:e})})});sF.displayName=Kh;var mae=sae("PopoverContent.RemoveScroll"),pae=b.forwardRef((t,e)=>{const n=lu(Kh,t.__scopePopover),r=b.useRef(null),s=er(e,r),i=b.useRef(!1);return b.useEffect(()=>{const a=r.current;if(a)return gI(a)},[]),o.jsx(xI,{as:mae,allowPinchZoom:!0,children:o.jsx(iF,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:nt(t.onCloseAutoFocus,a=>{a.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:nt(t.onPointerDownOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:nt(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),gae=b.forwardRef((t,e)=>{const n=lu(Kh,t.__scopePopover),r=b.useRef(!1),s=b.useRef(!1);return o.jsx(iF,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{t.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{t.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;n.triggerRef.current?.contains(a)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),iF=b.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,...m}=t,g=lu(Kh,n),x=Vp(n);return vI(),o.jsx(yI,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:o.jsx(Rj,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>g.onOpenChange(!1),children:o.jsx(Dj,{"data-state":oF(g.open),role:"dialog",id:g.contentId,...x,...m,ref:e,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),aF="PopoverClose",xae=b.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=lu(aF,n);return o.jsx(Sn.button,{type:"button",...r,ref:e,onClick:nt(t.onClick,()=>s.onOpenChange(!1))})});xae.displayName=aF;var vae="PopoverArrow",yae=b.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=Vp(n);return o.jsx(Pj,{...s,...r,ref:e})});yae.displayName=vae;function oF(t){return t?"open":"closed"}var bae=JB,wae=nF,Sae=rF,lF=sF;const Bo=bae,Fo=wae,Ka=b.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},s)=>o.jsx(Sae,{children:o.jsx(lF,{ref:s,align:e,sideOffset:n,className:xe("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",t),...r})}));Ka.displayName=lF.displayName;const cu="/api/webui/config";async function dE(){const e=await(await gt(`${cu}/bot`)).json();if(!e.success)throw new Error("获取配置数据失败");return e.config}async function Dh(){const e=await(await gt(`${cu}/model`)).json();if(!e.success)throw new Error("获取模型配置数据失败");return e.config}async function hE(t){const n=await(await gt(`${cu}/bot`,{method:"POST",headers:Tt(),body:JSON.stringify(t)})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function kae(){const e=await(await gt(`${cu}/bot/raw`)).json();if(!e.success)throw new Error("获取配置源代码失败");return e.content}async function Oae(t){const n=await(await gt(`${cu}/bot/raw`,{method:"POST",headers:Tt(),body:JSON.stringify({raw_content:t})})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function Uv(t){const n=await(await gt(`${cu}/model`,{method:"POST",headers:Tt(),body:JSON.stringify(t)})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function jae(t,e){const r=await(await gt(`${cu}/bot/section/${t}`,{method:"POST",headers:Tt(),body:JSON.stringify(e)})).json();if(!r.success)throw new Error(r.message||`保存配置节 ${t} 失败`)}async function bk(t,e){const r=await(await gt(`${cu}/model/section/${t}`,{method:"POST",headers:Tt(),body:JSON.stringify(e)})).json();if(!r.success)throw new Error(r.message||`保存配置节 ${t} 失败`)}async function Nae(t,e="openai",n="/models"){const r=new URLSearchParams({provider_name:t,parser:e,endpoint:n}),s=await gt(`/api/webui/models/list?${r}`);if(!s.ok){const a=await s.json().catch(()=>({}));throw new Error(a.detail||`获取模型列表失败 (${s.status})`)}const i=await s.json();if(!i.success)throw new Error("获取模型列表失败");return i.models}async function Cae(t){const e=new URLSearchParams({provider_name:t}),n=await gt(`/api/webui/models/test-connection-by-name?${e}`,{method:"POST"});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.detail||`测试连接失败 (${n.status})`)}return await n.json()}const Tae=kf("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),ba=b.forwardRef(({className:t,variant:e,...n},r)=>o.jsx("div",{ref:r,role:"alert",className:xe(Tae({variant:e}),t),...n}));ba.displayName="Alert";const Eae=b.forwardRef(({className:t,...e},n)=>o.jsx("h5",{ref:n,className:xe("mb-1 font-medium leading-none tracking-tight",t),...e}));Eae.displayName="AlertTitle";const wa=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:xe("text-sm [&_p]:leading-relaxed",t),...e}));wa.displayName="AlertDescription";function r6({onRestartComplete:t,onRestartFailed:e}){const[n,r]=b.useState(0),[s,i]=b.useState("restarting"),[a,l]=b.useState(0),[c,d]=b.useState(0);b.useEffect(()=>{const g=setInterval(()=>{r(w=>w>=90?w:w+1)},200),x=setInterval(()=>{l(w=>w+1)},1e3),y=setTimeout(()=>{i("checking"),h()},3e3);return()=>{clearInterval(g),clearInterval(x),clearTimeout(y)}},[]);const h=()=>{const x=async()=>{try{if(d(w=>w+1),(await fetch("/api/webui/system/status",{method:"GET",headers:{"Content-Type":"application/json"},signal:AbortSignal.timeout(3e3)})).ok)r(100),i("success"),setTimeout(()=>{t?.()},1500);else throw new Error("Status check failed")}catch{c<60?setTimeout(x,2e3):(i("failed"),e?.())}};x()},m=g=>{const x=Math.floor(g/60),y=g%60;return`${x}:${y.toString().padStart(2,"0")}`};return o.jsx("div",{className:"fixed inset-0 bg-background/95 backdrop-blur-sm z-50 flex items-center justify-center",children:o.jsxs("div",{className:"max-w-md w-full mx-4 space-y-8",children:[o.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[s==="restarting"&&o.jsxs(o.Fragment,{children:[o.jsx(Us,{className:"h-16 w-16 text-primary animate-spin"}),o.jsx("h2",{className:"text-2xl font-bold",children:"正在重启麦麦"}),o.jsx("p",{className:"text-muted-foreground text-center",children:"请稍候,麦麦正在重启中..."})]}),s==="checking"&&o.jsxs(o.Fragment,{children:[o.jsx(Us,{className:"h-16 w-16 text-primary animate-spin"}),o.jsx("h2",{className:"text-2xl font-bold",children:"检查服务状态"}),o.jsxs("p",{className:"text-muted-foreground text-center",children:["等待服务恢复... (尝试 ",c,"/60)"]})]}),s==="success"&&o.jsxs(o.Fragment,{children:[o.jsx(Ya,{className:"h-16 w-16 text-green-500"}),o.jsx("h2",{className:"text-2xl font-bold",children:"重启成功"}),o.jsx("p",{className:"text-muted-foreground text-center",children:"正在跳转到登录页面..."})]}),s==="failed"&&o.jsxs(o.Fragment,{children:[o.jsx(Lo,{className:"h-16 w-16 text-destructive"}),o.jsx("h2",{className:"text-2xl font-bold",children:"重启超时"}),o.jsx("p",{className:"text-muted-foreground text-center",children:"服务未能在预期时间内恢复,请手动检查或刷新页面"})]})]}),s!=="failed"&&o.jsxs("div",{className:"space-y-2",children:[o.jsx(Qp,{value:n,className:"h-2"}),o.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[o.jsxs("span",{children:[n,"%"]}),o.jsxs("span",{children:["已用时: ",m(a)]})]})]}),o.jsx("div",{className:"bg-muted/50 rounded-lg p-4 space-y-2",children:o.jsxs("p",{className:"text-sm text-muted-foreground",children:[s==="restarting"&&"🔄 配置已保存,正在重启主程序...",s==="checking"&&"⏳ 正在等待服务恢复,请勿关闭页面...",s==="success"&&"✅ 配置已生效,服务运行正常",s==="failed"&&"⚠️ 如果长时间无响应,请尝试手动重启"]})}),o.jsx("div",{className:"bg-yellow-500/10 border border-yellow-500/50 rounded-lg p-4",children:o.jsxs("p",{className:"text-sm text-yellow-900 dark:text-yellow-100",children:[o.jsx("strong",{children:"⚠️ 重要提示:"})," 由于技术原因,使用重启功能后,将无法再使用 ",o.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。如需结束程序,请使用脚本目录下的进程管理脚本。"]})}),s==="failed"&&o.jsxs("div",{className:"flex gap-2",children:[o.jsx("button",{onClick:()=>window.location.reload(),className:"flex-1 px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90",children:"刷新页面"}),o.jsx("button",{onClick:()=>{i("checking"),d(0),h()},className:"flex-1 px-4 py-2 bg-secondary text-secondary-foreground rounded-md hover:bg-secondary/90",children:"重试检测"})]})]})})}let wk=[],cF=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e>1;if(t=cF[r])e=r+1;else return!0;if(e==n)return!1}}function fE(t){return t>=127462&&t<=127487}const mE=8205;function Aae(t,e,n=!0,r=!0){return(n?uF:Mae)(t,e,r)}function uF(t,e,n){if(e==t.length)return e;e&&dF(t.charCodeAt(e))&&hF(t.charCodeAt(e-1))&&e--;let r=z4(t,e);for(e+=pE(r);e=0&&fE(z4(t,a));)i++,a-=2;if(i%2==0)break;e+=2}else break}return e}function Mae(t,e,n){for(;e>0;){let r=uF(t,e-2,n);if(r=56320&&t<57344}function hF(t){return t>=55296&&t<56320}function pE(t){return t<65536?1:2}class An{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=Zh(this,e,n);let s=[];return this.decompose(0,e,s,2),r.length&&r.decompose(0,r.length,s,3),this.decompose(n,this.length,s,1),uv.from(s,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Zh(this,e,n);let r=[];return this.decompose(e,n,r,0),uv.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),s=new k0(this),i=new k0(e);for(let a=n,l=n;;){if(s.next(a),i.next(a),a=0,s.lineBreak!=i.lineBreak||s.done!=i.done||s.value!=i.value)return!1;if(l+=s.value.length,s.done||l>=r)return!0}}iter(e=1){return new k0(this,e)}iterRange(e,n=this.length){return new fF(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let s=this.line(e).from;r=this.iterRange(s,Math.max(s,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new mF(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?An.empty:e.length<=32?new Ur(e):uv.from(Ur.split(e,[]))}}class Ur extends An{constructor(e,n=Rae(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,s){for(let i=0;;i++){let a=this.text[i],l=s+a.length;if((n?r:l)>=e)return new Dae(s,l,r,a);s=l+1,r++}}decompose(e,n,r,s){let i=e<=0&&n>=this.length?this:new Ur(gE(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(s&1){let a=r.pop(),l=dv(i.text,a.text.slice(),0,i.length);if(l.length<=32)r.push(new Ur(l,a.length+i.length));else{let c=l.length>>1;r.push(new Ur(l.slice(0,c)),new Ur(l.slice(c)))}}else r.push(i)}replace(e,n,r){if(!(r instanceof Ur))return super.replace(e,n,r);[e,n]=Zh(this,e,n);let s=dv(this.text,dv(r.text,gE(this.text,0,e)),n),i=this.length+r.length-(n-e);return s.length<=32?new Ur(s,i):uv.from(Ur.split(s,[]),i)}sliceString(e,n=this.length,r=` -`){[e,n]=Zh(this,e,n);let s="";for(let i=0,a=0;i<=n&&ae&&a&&(s+=r),ei&&(s+=l.slice(Math.max(0,e-i),n-i)),i=c+1}return s}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],s=-1;for(let i of e)r.push(i),s+=i.length+1,r.length==32&&(n.push(new Ur(r,s)),r=[],s=-1);return s>-1&&n.push(new Ur(r,s)),n}}let uv=class bh extends An{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,s){for(let i=0;;i++){let a=this.children[i],l=s+a.length,c=r+a.lines-1;if((n?c:l)>=e)return a.lineInner(e,n,r,s);s=l+1,r=c+1}}decompose(e,n,r,s){for(let i=0,a=0;a<=n&&i=a){let d=s&((a<=e?1:0)|(c>=n?2:0));a>=e&&c<=n&&!d?r.push(l):l.decompose(e-a,n-a,r,d)}a=c+1}}replace(e,n,r){if([e,n]=Zh(this,e,n),r.lines=i&&n<=l){let c=a.replace(e-i,n-i,r),d=this.lines-a.lines+c.lines;if(c.lines>4&&c.lines>d>>6){let h=this.children.slice();return h[s]=c,new bh(h,this.length-(n-e)+r.length)}return super.replace(i,l,c)}i=l+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=` -`){[e,n]=Zh(this,e,n);let s="";for(let i=0,a=0;ie&&i&&(s+=r),ea&&(s+=l.sliceString(e-a,n-a,r)),a=c+1}return s}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof bh))return 0;let r=0,[s,i,a,l]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=n,i+=n){if(s==a||i==l)return r;let c=this.children[s],d=e.children[i];if(c!=d)return r+c.scanIdentical(d,n);r+=c.length+1}}static from(e,n=e.reduce((r,s)=>r+s.length+1,-1)){let r=0;for(let x of e)r+=x.lines;if(r<32){let x=[];for(let y of e)y.flatten(x);return new Ur(x,n)}let s=Math.max(32,r>>5),i=s<<1,a=s>>1,l=[],c=0,d=-1,h=[];function m(x){let y;if(x.lines>i&&x instanceof bh)for(let w of x.children)m(w);else x.lines>a&&(c>a||!c)?(g(),l.push(x)):x instanceof Ur&&c&&(y=h[h.length-1])instanceof Ur&&x.lines+y.lines<=32?(c+=x.lines,d+=x.length+1,h[h.length-1]=new Ur(y.text.concat(x.text),y.length+1+x.length)):(c+x.lines>s&&g(),c+=x.lines,d+=x.length+1,h.push(x))}function g(){c!=0&&(l.push(h.length==1?h[0]:bh.from(h,d)),d=-1,c=h.length=0)}for(let x of e)m(x);return g(),l.length==1?l[0]:new bh(l,n)}};An.empty=new Ur([""],0);function Rae(t){let e=-1;for(let n of t)e+=n.length+1;return e}function dv(t,e,n=0,r=1e9){for(let s=0,i=0,a=!0;i=n&&(c>r&&(l=l.slice(0,r-s)),s0?1:(e instanceof Ur?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,s=this.nodes[r],i=this.offsets[r],a=i>>1,l=s instanceof Ur?s.text.length:s.children.length;if(a==(n>0?l:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=` -`,this;e--}else if(s instanceof Ur){let c=s.text[a+(n<0?-1:0)];if(this.offsets[r]+=n,c.length>Math.max(0,e))return this.value=e==0?c:n>0?c.slice(e):c.slice(0,c.length-e),this;e-=c.length}else{let c=s.children[a+(n<0?-1:0)];e>c.length?(e-=c.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(c),this.offsets.push(n>0?1:(c instanceof Ur?c.text.length:c.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class fF{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new k0(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*n,this.value=s.length<=r?s:n<0?s.slice(s.length-r):s.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class mF{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:s}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(An.prototype[Symbol.iterator]=function(){return this.iter()},k0.prototype[Symbol.iterator]=fF.prototype[Symbol.iterator]=mF.prototype[Symbol.iterator]=function(){return this});class Dae{constructor(e,n,r,s){this.from=e,this.to=n,this.number=r,this.text=s}get length(){return this.to-this.from}}function Zh(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function Ps(t,e,n=!0,r=!0){return Aae(t,e,n,r)}function Pae(t){return t>=56320&&t<57344}function zae(t){return t>=55296&&t<56320}function vi(t,e){let n=t.charCodeAt(e);if(!zae(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return Pae(r)?(n-55296<<10)+(r-56320)+65536:n}function s6(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function ko(t){return t<65536?1:2}const Sk=/\r\n?|\n/;var Ds=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Ds||(Ds={}));class Io{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;ne)return i+(e-s);i+=l}else{if(r!=Ds.Simple&&d>=e&&(r==Ds.TrackDel&&se||r==Ds.TrackBefore&&se))return null;if(d>e||d==e&&n<0&&!l)return e==s||n<0?i:i+c;i+=c}s=d}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return i}touchesRange(e,n=e){for(let r=0,s=0;r=0&&s<=n&&l>=e)return sn?"cover":!0;s=l}return!1}toString(){let e="";for(let n=0;n=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Io(e)}static create(e){return new Io(e)}}class us extends Io{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return kk(this,(n,r,s,i,a)=>e=e.replace(s,s+(r-n),a),!1),e}mapDesc(e,n=!1){return Ok(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let s=0,i=0;s=0){n[s]=l,n[s+1]=a;let c=s>>1;for(;r.length0&&$c(r,n,i.text),i.forward(h),l+=h}let d=e[a++];for(;l>1].toJSON()))}return e}static of(e,n,r){let s=[],i=[],a=0,l=null;function c(h=!1){if(!h&&!s.length)return;ag||m<0||g>n)throw new RangeError(`Invalid change range ${m} to ${g} (in doc of length ${n})`);let y=x?typeof x=="string"?An.of(x.split(r||Sk)):x:An.empty,w=y.length;if(m==g&&w==0)return;ma&&qs(s,m-a,-1),qs(s,g-m,w),$c(i,s,y),a=g}}return d(e),c(!l),l}static empty(e){return new us(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let s=0;sl&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(i.length==1)n.push(i[0],0);else{for(;r.length=0&&n<=0&&n==t[s+1]?t[s]+=e:s>=0&&e==0&&t[s]==0?t[s+1]+=n:r?(t[s]+=e,t[s+1]+=n):t.push(e,n)}function $c(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r>1])),!(n||a==t.sections.length||t.sections[a+1]<0);)l=t.sections[a++],c=t.sections[a++];e(s,d,i,h,m),s=d,i=h}}}function Ok(t,e,n,r=!1){let s=[],i=r?[]:null,a=new H0(t),l=new H0(e);for(let c=-1;;){if(a.done&&l.len||l.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&l.ins==-1){let d=Math.min(a.len,l.len);qs(s,d,-1),a.forward(d),l.forward(d)}else if(l.ins>=0&&(a.ins<0||c==a.i||a.off==0&&(l.len=0&&c=0){let d=0,h=a.len;for(;h;)if(l.ins==-1){let m=Math.min(h,l.len);d+=m,h-=m,l.forward(m)}else if(l.ins==0&&l.lenc||a.ins>=0&&a.len>c)&&(l||r.length>d),i.forward2(c),a.forward(c)}}}}class H0{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return n>=e.length?An.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?An.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Uu{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,s;return this.empty?r=s=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),r==this.from&&s==this.to?this:new Uu(r,s,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return Me.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return Me.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Me.range(e.anchor,e.head)}static create(e,n,r){return new Uu(e,n,r)}}class Me{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Me.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;re.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Me(e.ranges.map(n=>Uu.fromJSON(n)),e.main)}static single(e,n=e){return new Me([Me.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,s=0;se?8:0)|i)}static normalized(e,n=0){let r=e[n];e.sort((s,i)=>s.from-i.from),n=e.indexOf(r);for(let s=1;si.head?Me.range(c,l):Me.range(l,c))}}return new Me(e,n)}}function gF(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let i6=0;class st{constructor(e,n,r,s,i){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=s,this.id=i6++,this.default=e([]),this.extensions=typeof i=="function"?i(this):i}get reader(){return this}static define(e={}){return new st(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:a6),!!e.static,e.enables)}of(e){return new hv([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new hv(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new hv(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function a6(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class hv{constructor(e,n,r,s){this.dependencies=e,this.facet=n,this.type=r,this.value=s,this.id=i6++}dynamicSlot(e){var n;let r=this.value,s=this.facet.compareInput,i=this.id,a=e[i]>>1,l=this.type==2,c=!1,d=!1,h=[];for(let m of this.dependencies)m=="doc"?c=!0:m=="selection"?d=!0:(((n=e[m.id])!==null&&n!==void 0?n:1)&1)==0&&h.push(e[m.id]);return{create(m){return m.values[a]=r(m),1},update(m,g){if(c&&g.docChanged||d&&(g.docChanged||g.selection)||jk(m,h)){let x=r(m);if(l?!xE(x,m.values[a],s):!s(x,m.values[a]))return m.values[a]=x,1}return 0},reconfigure:(m,g)=>{let x,y=g.config.address[i];if(y!=null){let w=Gv(g,y);if(this.dependencies.every(S=>S instanceof st?g.facet(S)===m.facet(S):S instanceof Os?g.field(S,!1)==m.field(S,!1):!0)||(l?xE(x=r(m),w,s):s(x=r(m),w)))return m.values[a]=w,0}else x=r(m);return m.values[a]=x,1}}}}function xE(t,e,n){if(t.length!=e.length)return!1;for(let r=0;rt[c.id]),s=n.map(c=>c.type),i=r.filter(c=>!(c&1)),a=t[e.id]>>1;function l(c){let d=[];for(let h=0;hr===s),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(r1).find(r=>r.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,s)=>{let i=r.values[n],a=this.updateF(i,s);return this.compareF(i,a)?0:(r.values[n]=a,1)},reconfigure:(r,s)=>{let i=r.facet(r1),a=s.facet(r1),l;return(l=i.find(c=>c.field==this))&&l!=a.find(c=>c.field==this)?(r.values[n]=l.create(r),1):s.config.address[this.id]!=null?(r.values[n]=s.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,r1.of({field:this,create:e})]}get extension(){return this}}const Hu={lowest:4,low:3,default:2,high:1,highest:0};function Fm(t){return e=>new xF(e,t)}const uu={highest:Fm(Hu.highest),high:Fm(Hu.high),default:Fm(Hu.default),low:Fm(Hu.low),lowest:Fm(Hu.lowest)};class xF{constructor(e,n){this.inner=e,this.prec=n}}class hb{of(e){return new Nk(this,e)}reconfigure(e){return hb.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Nk{constructor(e,n){this.compartment=e,this.inner=n}}class Wv{constructor(e,n,r,s,i,a){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=s,this.staticValues=i,this.facets=a,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,n,r){let s=[],i=Object.create(null),a=new Map;for(let g of Lae(e,n,a))g instanceof Os?s.push(g):(i[g.facet.id]||(i[g.facet.id]=[])).push(g);let l=Object.create(null),c=[],d=[];for(let g of s)l[g.id]=d.length<<1,d.push(x=>g.slot(x));let h=r?.config.facets;for(let g in i){let x=i[g],y=x[0].facet,w=h&&h[g]||[];if(x.every(S=>S.type==0))if(l[y.id]=c.length<<1|1,a6(w,x))c.push(r.facet(y));else{let S=y.combine(x.map(k=>k.value));c.push(r&&y.compare(S,r.facet(y))?r.facet(y):S)}else{for(let S of x)S.type==0?(l[S.id]=c.length<<1|1,c.push(S.value)):(l[S.id]=d.length<<1,d.push(k=>S.dynamicSlot(k)));l[y.id]=d.length<<1,d.push(S=>Iae(S,y,x))}}let m=d.map(g=>g(l));return new Wv(e,a,m,l,c,i)}}function Lae(t,e,n){let r=[[],[],[],[],[]],s=new Map;function i(a,l){let c=s.get(a);if(c!=null){if(c<=l)return;let d=r[c].indexOf(a);d>-1&&r[c].splice(d,1),a instanceof Nk&&n.delete(a.compartment)}if(s.set(a,l),Array.isArray(a))for(let d of a)i(d,l);else if(a instanceof Nk){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let d=e.get(a.compartment)||a.inner;n.set(a.compartment,d),i(d,l)}else if(a instanceof xF)i(a.inner,a.prec);else if(a instanceof Os)r[l].push(a),a.provides&&i(a.provides,l);else if(a instanceof hv)r[l].push(a),a.facet.extensions&&i(a.facet.extensions,Hu.default);else{let d=a.extension;if(!d)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);i(d,l)}}return i(t,Hu.default),r.reduce((a,l)=>a.concat(l))}function O0(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let s=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|s}function Gv(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const vF=st.define(),Ck=st.define({combine:t=>t.some(e=>e),static:!0}),yF=st.define({combine:t=>t.length?t[0]:void 0,static:!0}),bF=st.define(),wF=st.define(),SF=st.define(),kF=st.define({combine:t=>t.length?t[0]:!1});class Qo{constructor(e,n){this.type=e,this.value=n}static define(){return new Bae}}class Bae{of(e){return new Qo(this,e)}}class Fae{constructor(e){this.map=e}of(e){return new Qt(this,e)}}class Qt{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new Qt(this.type,n)}is(e){return this.type==e}static define(e={}){return new Fae(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let s of e){let i=s.map(n);i&&r.push(i)}return r}}Qt.reconfigure=Qt.define();Qt.appendConfig=Qt.define();class ss{constructor(e,n,r,s,i,a){this.startState=e,this.changes=n,this.selection=r,this.effects=s,this.annotations=i,this.scrollIntoView=a,this._doc=null,this._state=null,r&&gF(r,n.newLength),i.some(l=>l.type==ss.time)||(this.annotations=i.concat(ss.time.of(Date.now())))}static create(e,n,r,s,i,a){return new ss(e,n,r,s,i,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(ss.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}ss.time=Qo.define();ss.userEvent=Qo.define();ss.addToHistory=Qo.define();ss.remote=Qo.define();function qae(t,e){let n=[];for(let r=0,s=0;;){let i,a;if(r=t[r]))i=t[r++],a=t[r++];else if(s=0;s--){let i=r[s](t);i instanceof ss?t=i:Array.isArray(i)&&i.length==1&&i[0]instanceof ss?t=i[0]:t=jF(e,Ph(i),!1)}return t}function Hae(t){let e=t.startState,n=e.facet(SF),r=t;for(let s=n.length-1;s>=0;s--){let i=n[s](t);i&&Object.keys(i).length&&(r=OF(r,Tk(e,i,t.changes.newLength),!0))}return r==t?t:ss.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const Qae=[];function Ph(t){return t==null?Qae:Array.isArray(t)?t:[t]}var Tr=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(Tr||(Tr={}));const Vae=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Ek;try{Ek=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Uae(t){if(Ek)return Ek.test(t);for(let e=0;e"€"&&(n.toUpperCase()!=n.toLowerCase()||Vae.test(n)))return!0}return!1}function Wae(t){return e=>{if(!/\S/.test(e))return Tr.Space;if(Uae(e))return Tr.Word;for(let n=0;n-1)return Tr.Word;return Tr.Other}}class Nn{constructor(e,n,r,s,i,a){this.config=e,this.doc=n,this.selection=r,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=i,a&&(a._state=this);for(let l=0;ls.set(d,c)),n=null),s.set(l.value.compartment,l.value.extension)):l.is(Qt.reconfigure)?(n=null,r=l.value):l.is(Qt.appendConfig)&&(n=null,r=Ph(r).concat(l.value));let i;n?i=e.startState.values.slice():(n=Wv.resolve(r,s,this),i=new Nn(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,d)=>d.reconfigure(c,this),null).values);let a=e.startState.facet(Ck)?e.newSelection:e.newSelection.asSingle();new Nn(n,e.newDoc,a,i,(l,c)=>c.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:Me.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),s=this.changes(r.changes),i=[r.range],a=Ph(r.effects);for(let l=1;la.spec.fromJSON(l,c)))}}return Nn.create({doc:e.doc,selection:Me.fromJSON(e.selection),extensions:n.extensions?s.concat([n.extensions]):s})}static create(e={}){let n=Wv.resolve(e.extensions||[],new Map),r=e.doc instanceof An?e.doc:An.of((e.doc||"").split(n.staticFacet(Nn.lineSeparator)||Sk)),s=e.selection?e.selection instanceof Me?e.selection:Me.single(e.selection.anchor,e.selection.head):Me.single(0);return gF(s,r.length),n.staticFacet(Ck)||(s=s.asSingle()),new Nn(n,r,s,n.dynamicSlots.map(()=>null),(i,a)=>a.create(i),null)}get tabSize(){return this.facet(Nn.tabSize)}get lineBreak(){return this.facet(Nn.lineSeparator)||` -`}get readOnly(){return this.facet(kF)}phrase(e,...n){for(let r of this.facet(Nn.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,s)=>{if(s=="$")return"$";let i=+(s||1);return!i||i>n.length?r:n[i-1]})),e}languageDataAt(e,n,r=-1){let s=[];for(let i of this.facet(vF))for(let a of i(this,n,r))Object.prototype.hasOwnProperty.call(a,e)&&s.push(a[e]);return s}charCategorizer(e){return Wae(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:n,from:r,length:s}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-r,l=e-r;for(;a>0;){let c=Ps(n,a,!1);if(i(n.slice(c,a))!=Tr.Word)break;a=c}for(;lt.length?t[0]:4});Nn.lineSeparator=yF;Nn.readOnly=kF;Nn.phrases=st.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(s=>t[s]==e[s])}});Nn.languageData=vF;Nn.changeFilter=bF;Nn.transactionFilter=wF;Nn.transactionExtender=SF;hb.reconfigure=Qt.define();function Vo(t,e,n={}){let r={};for(let s of t)for(let i of Object.keys(s)){let a=s[i],l=r[i];if(l===void 0)r[i]=a;else if(!(l===a||a===void 0))if(Object.hasOwnProperty.call(n,i))r[i]=n[i](l,a);else throw new Error("Config merge conflict for field "+i)}for(let s in e)r[s]===void 0&&(r[s]=e[s]);return r}class od{eq(e){return this==e}range(e,n=e){return _k.create(e,n,this)}}od.prototype.startSide=od.prototype.endSide=0;od.prototype.point=!1;od.prototype.mapMode=Ds.TrackDel;let _k=class NF{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new NF(e,n,r)}};function Ak(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class o6{constructor(e,n,r,s){this.from=e,this.to=n,this.value=r,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,s=0){let i=r?this.to:this.from;for(let a=s,l=i.length;;){if(a==l)return a;let c=a+l>>1,d=i[c]-e||(r?this.value[c].endSide:this.value[c].startSide)-n;if(c==a)return d>=0?a:l;d>=0?l=c:a=c+1}}between(e,n,r,s){for(let i=this.findIndex(n,-1e9,!0),a=this.findIndex(r,1e9,!1,i);ix||g==x&&d.startSide>0&&d.endSide<=0)continue;(x-g||d.endSide-d.startSide)<0||(a<0&&(a=g),d.point&&(l=Math.max(l,x-g)),r.push(d),s.push(g-a),i.push(x-a))}return{mapped:r.length?new o6(s,i,r,l):null,pos:a}}}class Bn{constructor(e,n,r,s){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=s}static create(e,n,r,s){return new Bn(e,n,r,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:s=0,filterTo:i=this.length}=e,a=e.filter;if(n.length==0&&!a)return this;if(r&&(n=n.slice().sort(Ak)),this.isEmpty)return n.length?Bn.of(n):this;let l=new CF(this,null,-1).goto(0),c=0,d=[],h=new Hl;for(;l.value||c=0){let m=n[c++];h.addInner(m.from,m.to,m.value)||d.push(m)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||il.to||i=i&&e<=i+a.length&&a.between(i,e-i,n-i,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return Q0.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Q0.from(e).goto(n)}static compare(e,n,r,s,i=-1){let a=e.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=i),l=n.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=i),c=vE(a,l,r),d=new qm(a,c,i),h=new qm(l,c,i);r.iterGaps((m,g,x)=>yE(d,m,h,g,x,s)),r.empty&&r.length==0&&yE(d,0,h,0,0,s)}static eq(e,n,r=0,s){s==null&&(s=999999999);let i=e.filter(h=>!h.isEmpty&&n.indexOf(h)<0),a=n.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let l=vE(i,a),c=new qm(i,l,0).goto(r),d=new qm(a,l,0).goto(r);for(;;){if(c.to!=d.to||!Mk(c.active,d.active)||c.point&&(!d.point||!c.point.eq(d.point)))return!1;if(c.to>s)return!0;c.next(),d.next()}}static spans(e,n,r,s,i=-1){let a=new qm(e,null,i).goto(n),l=n,c=a.openStart;for(;;){let d=Math.min(a.to,r);if(a.point){let h=a.activeForPoint(a.to),m=a.pointFroml&&(s.span(l,d,a.active,c),c=a.openEnd(d));if(a.to>r)return c+(a.point&&a.to>r?1:0);l=a.to,a.next()}}static of(e,n=!1){let r=new Hl;for(let s of e instanceof _k?[e]:n?Gae(e):e)r.add(s.from,s.to,s.value);return r.finish()}static join(e){if(!e.length)return Bn.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let s=e[r];s!=Bn.empty;s=s.nextLayer)n=new Bn(s.chunkPos,s.chunk,n,Math.max(s.maxPoint,n.maxPoint));return n}}Bn.empty=new Bn([],[],null,-1);function Gae(t){if(t.length>1)for(let e=t[0],n=1;n0)return t.slice().sort(Ak);e=r}return t}Bn.empty.nextLayer=Bn.empty;class Hl{finishChunk(e){this.chunks.push(new o6(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new Hl)).add(e,n,r)}addInner(e,n,r){let s=e-this.lastTo||r.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(Bn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=Bn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function vE(t,e,n){let r=new Map;for(let i of t)for(let a=0;a=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=r&&s.push(new CF(a,n,r,i));return s.length==1?s[0]:new Q0(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)I4(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)I4(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),I4(this.heap,0)}}}function I4(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let s=t[r];if(r+1=0&&(s=t[r+1],r++),n.compare(s)<0)break;t[r]=n,t[e]=s,e=r}}class qm{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Q0.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){s1(this.active,e),s1(this.activeTo,e),s1(this.activeRank,e),this.minActive=bE(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:s,rank:i}=this.cursor;for(;n0;)n++;i1(this.active,n,r),i1(this.activeTo,n,s),i1(this.activeRank,n,i),e&&i1(e,n,this.cursor.from),this.minActive=bE(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let s=this.minActive;if(s>-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),r&&s1(r,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let i=this.cursor.value;if(!i.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&r[s]=0&&!(this.activeRank[r]e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function yE(t,e,n,r,s,i){t.goto(e),n.goto(r);let a=r+s,l=r,c=r-e;for(;;){let d=t.to+c-n.to,h=d||t.endSide-n.endSide,m=h<0?t.to+c:n.to,g=Math.min(m,a);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&Mk(t.activeForPoint(t.to),n.activeForPoint(n.to))||i.comparePoint(l,g,t.point,n.point):g>l&&!Mk(t.active,n.active)&&i.compareRange(l,g,t.active,n.active),m>a)break;(d||t.openEnd!=n.openEnd)&&i.boundChange&&i.boundChange(m),l=m,h<=0&&t.next(),h>=0&&n.next()}}function Mk(t,e){if(t.length!=e.length)return!1;for(let n=0;n=e;r--)t[r+1]=t[r];t[e]=n}function bE(t,e){let n=-1,r=1e9;for(let s=0;s=e)return s;if(s==t.length)break;i+=t.charCodeAt(s)==9?n-i%n:1,s=Ps(t,s)}return r===!0?-1:t.length}const Dk="ͼ",wE=typeof Symbol>"u"?"__"+Dk:Symbol.for(Dk),Pk=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),SE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Yc{constructor(e,n){this.rules=[];let{finish:r}=n||{};function s(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function i(a,l,c,d){let h=[],m=/^@(\w+)\b/.exec(a[0]),g=m&&m[1]=="keyframes";if(m&&l==null)return c.push(a[0]+";");for(let x in l){let y=l[x];if(/&/.test(x))i(x.split(/,\s*/).map(w=>a.map(S=>w.replace(/&/,S))).reduce((w,S)=>w.concat(S)),y,c);else if(y&&typeof y=="object"){if(!m)throw new RangeError("The value of a property ("+x+") should be a primitive value.");i(s(x),y,h,g)}else y!=null&&h.push(x.replace(/_.*/,"").replace(/[A-Z]/g,w=>"-"+w.toLowerCase())+": "+y+";")}(h.length||g)&&c.push((r&&!m&&!d?a.map(r):a).join(", ")+" {"+h.join(" ")+"}")}for(let a in e)i(s(a),e[a],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let e=SE[wE]||1;return SE[wE]=e+1,Dk+e.toString(36)}static mount(e,n,r){let s=e[Pk],i=r&&r.nonce;s?i&&s.setNonce(i):s=new Xae(e,i),s.mount(Array.isArray(n)?n:[n],e)}}let kE=new Map;class Xae{constructor(e,n){let r=e.ownerDocument||e,s=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let i=kE.get(r);if(i)return e[Pk]=i;this.sheet=new s.CSSStyleSheet,kE.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[Pk]=this}mount(e,n){let r=this.sheet,s=0,i=0;for(let a=0;a-1&&(this.modules.splice(c,1),i--,c=-1),c==-1){if(this.modules.splice(i++,0,l),r)for(let d=0;d",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Yae=typeof navigator<"u"&&/Mac/.test(navigator.platform),Kae=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ms=0;Ms<10;Ms++)Kc[48+Ms]=Kc[96+Ms]=String(Ms);for(var Ms=1;Ms<=24;Ms++)Kc[Ms+111]="F"+Ms;for(var Ms=65;Ms<=90;Ms++)Kc[Ms]=String.fromCharCode(Ms+32),V0[Ms]=String.fromCharCode(Ms);for(var L4 in Kc)V0.hasOwnProperty(L4)||(V0[L4]=Kc[L4]);function Zae(t){var e=Yae&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Kae&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?V0:Kc)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function lr(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var s=n[r];typeof s=="string"?t.setAttribute(r,s):s!=null&&(t[r]=s)}e++}for(;e2);var et={mac:jE||/Mac/.test(Js.platform),windows:/Win/.test(Js.platform),linux:/Linux|X11/.test(Js.platform),ie:fb,ie_version:EF?zk.documentMode||6:Lk?+Lk[1]:Ik?+Ik[1]:0,gecko:OE,gecko_version:OE?+(/Firefox\/(\d+)/.exec(Js.userAgent)||[0,0])[1]:0,chrome:!!B4,chrome_version:B4?+B4[1]:0,ios:jE,android:/Android\b/.test(Js.userAgent),webkit_version:Jae?+(/\bAppleWebKit\/(\d+)/.exec(Js.userAgent)||[0,0])[1]:0,safari:Bk,safari_version:Bk?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Js.userAgent)||[0,0])[1]:0,tabSize:zk.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function U0(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Fk(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function fv(t,e){if(!e.anchorNode)return!1;try{return Fk(t,e.anchorNode)}catch{return!1}}function Jh(t){return t.nodeType==3?cd(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function j0(t,e,n,r){return n?NE(t,e,n,r,-1)||NE(t,e,n,r,1):!1}function ld(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Xv(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function NE(t,e,n,r,s){for(;;){if(t==n&&e==r)return!0;if(e==(s<0?0:qo(t))){if(t.nodeName=="DIV")return!1;let i=t.parentNode;if(!i||i.nodeType!=1)return!1;e=ld(t)+(s<0?0:1),t=i}else if(t.nodeType==1){if(t=t.childNodes[e+(s<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=s<0?qo(t):0}else return!1}}function qo(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Up(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function eoe(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function _F(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function toe(t,e,n,r,s,i,a,l){let c=t.ownerDocument,d=c.defaultView||window;for(let h=t,m=!1;h&&!m;)if(h.nodeType==1){let g,x=h==c.body,y=1,w=1;if(x)g=eoe(d);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(m=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let j=h.getBoundingClientRect();({scaleX:y,scaleY:w}=_F(h,j)),g={left:j.left,right:j.left+h.clientWidth*y,top:j.top,bottom:j.top+h.clientHeight*w}}let S=0,k=0;if(s=="nearest")e.top0&&e.bottom>g.bottom+k&&(k=e.bottom-g.bottom+a)):e.bottom>g.bottom&&(k=e.bottom-g.bottom+a,n<0&&e.top-k0&&e.right>g.right+S&&(S=e.right-g.right+i)):e.right>g.right&&(S=e.right-g.right+i,n<0&&e.leftg.bottom||e.leftg.right)&&(e={left:Math.max(e.left,g.left),right:Math.min(e.right,g.right),top:Math.max(e.top,g.top),bottom:Math.min(e.bottom,g.bottom)}),h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function noe(t){let e=t.ownerDocument,n,r;for(let s=t.parentNode;s&&!(s==e.body||n&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),!n&&s.scrollWidth>s.clientWidth&&(n=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:n,y:r}}class roe{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?qo(n):0),r,Math.min(e.focusOffset,r?qo(r):0))}set(e,n,r,s){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=s}}let Fu=null;et.safari&&et.safari_version>=26&&(Fu=!1);function AF(t){if(t.setActive)return t.setActive();if(Fu)return t.focus(Fu);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(Fu==null?{get preventScroll(){return Fu={preventScroll:!0},!0}}:void 0),!Fu){Fu=!1;for(let n=0;nMath.max(1,t.scrollHeight-t.clientHeight-4)}function DF(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=qo(n)}else if(n.parentNode&&!Xv(n))r=ld(n),n=n.parentNode;else return null}}function PF(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&rn)return m.domBoundsAround(e,n,d);if(g>=e&&s==-1&&(s=c,i=d),d>n&&m.dom.parentNode==this.dom){a=c,l=h;break}h=g,d=g+m.breakAfter}return{from:i,to:l<0?r+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:a=0?this.children[a].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let n=this.parent;n;n=n.parent){if(e&&(n.flags|=2),n.flags&1)return;n.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let n=e.parent;if(!n)return e;e=n}}replaceChildren(e,n,r=l6){this.markDirty();for(let s=e;sthis.pos||e==this.pos&&(n>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function IF(t,e,n,r,s,i,a,l,c){let{children:d}=t,h=d.length?d[e]:null,m=i.length?i[i.length-1]:null,g=m?m.breakAfter:a;if(!(e==r&&h&&!a&&!g&&i.length<2&&h.merge(n,s,i.length?m:null,n==0,l,c))){if(r0&&(!a&&i.length&&h.merge(n,h.length,i[0],!1,l,0)?h.breakAfter=i.shift().breakAfter:(naoe||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(n),this.markDirty(),!0)}split(e){let n=new Za(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),n.flags|=this.flags&8,n}localPosFromDOM(e,n){return e==this.dom?n:n?this.text.length:0}domAtPos(e){return new Hs(this.dom,e)}domBoundsAround(e,n,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,n){return ooe(this.dom,e,n)}}class Ql extends sr{constructor(e,n=[],r=0){super(),this.mark=e,this.children=n,this.length=r;for(let s of n)s.setParent(this)}setAttrs(e){if(MF(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let n in this.mark.attrs)e.setAttribute(n,this.mark.attrs[n]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,n){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,n)}merge(e,n,r,s,i,a){return r&&(!(r instanceof Ql&&r.mark.eq(this.mark))||e&&i<=0||ne&&n.push(r=e&&(s=i),r=c,i++}let a=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new Ql(this.mark,n,a)}domAtPos(e){return BF(this,e)}coordsAt(e,n){return qF(this,e,n)}}function ooe(t,e,n){let r=t.nodeValue.length;e>r&&(e=r);let s=e,i=e,a=0;e==0&&n<0||e==r&&n>=0?et.chrome||et.gecko||(e?(s--,a=1):i=0)?0:l.length-1];return et.safari&&!a&&c.width==0&&(c=Array.prototype.find.call(l,d=>d.width)||c),a?Up(c,a<0):c||null}class Dl extends sr{static create(e,n,r){return new Dl(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=Dl.create(this.widget,this.length-e,this.side);return this.length-=e,n}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,n,r,s,i,a){return r&&(!(r instanceof Dl)||!this.widget.compare(r.widget)||e>0&&i<=0||n0)?Hs.before(this.dom):Hs.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;let s=this.dom.getClientRects(),i=null;if(!s.length)return null;let a=this.side?this.side<0:e>0;for(let l=a?s.length-1:0;i=s[l],!(e>0?l==0:l==s.length-1||i.top0?Hs.before(this.dom):Hs.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return An.empty}get isHidden(){return!0}}Za.prototype.children=Dl.prototype.children=ef.prototype.children=l6;function BF(t,e){let n=t.dom,{children:r}=t,s=0;for(let i=0;si&&e0;i--){let a=r[i-1];if(a.dom.parentNode==n)return a.domAtPos(a.length)}for(let i=s;i0&&e instanceof Ql&&s.length&&(r=s[s.length-1])instanceof Ql&&r.mark.eq(e.mark)?FF(r,e.children[0],n-1):(s.push(e),e.setParent(t)),t.length+=e.length}function qF(t,e,n){let r=null,s=-1,i=null,a=-1;function l(d,h){for(let m=0,g=0;m=h&&(x.children.length?l(x,h-g):(!i||i.isHidden&&(n>0||coe(i,x)))&&(y>h||g==y&&x.getSide()>0)?(i=x,a=h-g):(g-1?1:0)!=s.length-(n&&s.indexOf(n)>-1?1:0))return!1;for(let i of r)if(i!=n&&(s.indexOf(i)==-1||t[i]!==e[i]))return!1;return!0}function $k(t,e,n){let r=!1;if(e)for(let s in e)n&&s in n||(r=!0,s=="style"?t.style.cssText="":t.removeAttribute(s));if(n)for(let s in n)e&&e[s]==n[s]||(r=!0,s=="style"?t.style.cssText=n[s]:t.setAttribute(s,n[s]));return r}function uoe(t){let e=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new Zc(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,s;if(e.isBlockGap)r=-5e8,s=4e8;else{let{start:i,end:a}=$F(e,n);r=(i?n?-3e8:-1:5e8)-1,s=(a?n?2e8:1:-6e8)+1}return new Zc(e,r,s,n,e.widget||null,!0)}static line(e){return new Gp(e)}static set(e,n=!1){return Bn.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ot.none=Bn.empty;class Wp extends Ot{constructor(e){let{start:n,end:r}=$F(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var n,r;return this==e||e instanceof Wp&&this.tagName==e.tagName&&(this.class||((n=this.attrs)===null||n===void 0?void 0:n.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&Yv(this.attrs,e.attrs,"class")}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}Wp.prototype.point=!1;class Gp extends Ot{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Gp&&this.spec.class==e.spec.class&&Yv(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}Gp.prototype.mapMode=Ds.TrackBefore;Gp.prototype.point=!0;class Zc extends Ot{constructor(e,n,r,s,i,a){super(n,r,i,e),this.block=s,this.isReplace=a,this.mapMode=s?n<=0?Ds.TrackBefore:Ds.TrackAfter:Ds.TrackDel}get type(){return this.startSide!=this.endSide?ri.WidgetRange:this.startSide<=0?ri.WidgetBefore:ri.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Zc&&doe(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}Zc.prototype.point=!0;function $F(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function doe(t,e){return t==e||!!(t&&e&&t.compare(e))}function mv(t,e,n,r=0){let s=n.length-1;s>=0&&n[s]+r>=t?n[s]=Math.max(n[s],e):n.push(t,e)}class rs extends sr{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,n,r,s,i,a){if(r){if(!(r instanceof rs))return!1;this.dom||r.transferDOM(this)}return s&&this.setDeco(r?r.attrs:null),LF(this,e,n,r?r.children.slice():[],i,a),!0}split(e){let n=new rs;if(n.breakAfter=this.breakAfter,this.length==0)return n;let{i:r,off:s}=this.childPos(e);s&&(n.append(this.children[r].split(s),0),this.children[r].merge(s,this.children[r].length,null,!1,0,0),r++);for(let i=r;i0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,n}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Yv(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){FF(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=qk(n,this.attrs||{})),r&&(this.attrs=qk({class:r},this.attrs||{}))}domAtPos(e){return BF(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(MF(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&($k(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,n);let s=this.dom.lastChild;for(;s&&sr.get(s)instanceof Ql;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((r=sr.get(s))===null||r===void 0?void 0:r.isEditable)==!1&&(!et.ios||!this.children.some(i=>i instanceof Za))){let i=document.createElement("BR");i.cmIgnore=!0,this.dom.appendChild(i)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,n;for(let r of this.children){if(!(r instanceof Za)||/[^ -~]/.test(r.text))return null;let s=Jh(r.dom);if(s.length!=1)return null;e+=s[0].width,n=s[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:n}:null}coordsAt(e,n){let r=qF(this,e,n);if(!this.children.length&&r&&this.parent){let{heightOracle:s}=this.parent.view.viewState,i=r.bottom-r.top;if(Math.abs(i-s.lineHeight)<2&&s.textHeight=n){if(i instanceof rs)return i;if(a>n)break}s=a+i.breakAfter}return null}}class Bl extends sr{constructor(e,n,r){super(),this.widget=e,this.length=n,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,n,r,s,i,a){return r&&(!(r instanceof Bl)||!this.widget.compare(r.widget)||e>0&&i<=0||n0}}class Hk extends Uo{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class N0{constructor(e,n,r,s){this.doc=e,this.pos=n,this.end=r,this.disallowBlockEffectsFor=s,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=n}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Bl&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new rs),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(a1(new ef(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof Bl)&&this.getLine()}buildText(e,n,r){for(;e>0;){if(this.textOff==this.text.length){let{value:a,lineBreak:l,done:c}=this.cursor.next(this.skip);if(this.skip=0,c)throw new Error("Ran out of text content when drawing inline views");if(l){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=a,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e),i=Math.min(s,512);this.flushBuffer(n.slice(n.length-r)),this.getLine().append(a1(new Za(this.text.slice(this.textOff,this.textOff+i)),n),r),this.atCursorPos=!0,this.textOff+=i,e-=i,r=s<=i?0:n.length}}span(e,n,r,s){this.buildText(n-e,r,s),this.pos=n,this.openStart<0&&(this.openStart=s)}point(e,n,r,s,i,a){if(this.disallowBlockEffectsFor[a]&&r instanceof Zc){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=n-e;if(r instanceof Zc)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Bl(r.widget||tf.block,l,r));else{let c=Dl.create(r.widget||tf.inline,l,l?0:r.startSide),d=this.atCursorPos&&!c.isEditable&&i<=s.length&&(e0),h=!c.isEditable&&(es.length||r.startSide<=0),m=this.getLine();this.pendingBuffer==2&&!d&&!c.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),d&&(m.append(a1(new ef(1),s),i),i=s.length+Math.max(0,i-s.length)),m.append(a1(c,s),i),this.atCursorPos=h,this.pendingBuffer=h?es.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=n),this.openStart<0&&(this.openStart=i)}static build(e,n,r,s,i){let a=new N0(e,n,r,i);return a.openEnd=Bn.spans(s,n,r,a),a.openStart<0&&(a.openStart=a.openEnd),a.finish(a.openEnd),a}}function a1(t,e){for(let n of e)t=new Ql(n,[t],t.length);return t}class tf extends Uo{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}tf.inline=new tf("span");tf.block=new tf("div");var br=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(br||(br={}));const ud=br.LTR,c6=br.RTL;function HF(t){let e=[];for(let n=0;n=n){if(l.level==r)return a;(i<0||(s!=0?s<0?l.fromn:e[i].level>l.level))&&(i=a)}}if(i<0)throw new RangeError("Index out of range");return i}}function VF(t,e){if(t.length!=e.length)return!1;for(let n=0;n=0;w-=3)if(mo[w+1]==-x){let S=mo[w+2],k=S&2?s:S&4?S&1?i:s:0;k&&(cr[m]=cr[mo[w]]=k),l=w;break}}else{if(mo.length==189)break;mo[l++]=m,mo[l++]=g,mo[l++]=c}else if((y=cr[m])==2||y==1){let w=y==s;c=w?0:1;for(let S=l-3;S>=0;S-=3){let k=mo[S+2];if(k&2)break;if(w)mo[S+2]|=2;else{if(k&4)break;mo[S+2]|=4}}}}}function xoe(t,e,n,r){for(let s=0,i=r;s<=n.length;s++){let a=s?n[s-1].to:t,l=sc;)y==S&&(y=n[--w].from,S=w?n[w-1].to:t),cr[--y]=x;c=h}else i=d,c++}}}function Vk(t,e,n,r,s,i,a){let l=r%2?2:1;if(r%2==s%2)for(let c=e,d=0;cc&&a.push(new Hc(c,w.from,x));let S=w.direction==ud!=!(x%2);Uk(t,S?r+1:r,s,w.inner,w.from,w.to,a),c=w.to}y=w.to}else{if(y==n||(h?cr[y]!=l:cr[y]==l))break;y++}g?Vk(t,c,y,r+1,s,g,a):ce;){let h=!0,m=!1;if(!d||c>i[d-1].to){let w=cr[c-1];w!=l&&(h=!1,m=w==16)}let g=!h&&l==1?[]:null,x=h?r:r+1,y=c;e:for(;;)if(d&&y==i[d-1].to){if(m)break e;let w=i[--d];if(!h)for(let S=w.from,k=d;;){if(S==e)break e;if(k&&i[k-1].to==S)S=i[--k].from;else{if(cr[S-1]==l)break e;break}}if(g)g.push(w);else{w.tocr.length;)cr[cr.length]=256;let r=[],s=e==ud?0:1;return Uk(t,s,s,n,0,t.length,r),r}function UF(t){return[new Hc(0,t,0)]}let WF="";function yoe(t,e,n,r,s){var i;let a=r.head-t.from,l=Hc.find(e,a,(i=r.bidiLevel)!==null&&i!==void 0?i:-1,r.assoc),c=e[l],d=c.side(s,n);if(a==d){let g=l+=s?1:-1;if(g<0||g>=e.length)return null;c=e[l=g],a=c.side(!s,n),d=c.side(s,n)}let h=Ps(t.text,a,c.forward(s,n));(hc.to)&&(h=d),WF=t.text.slice(Math.min(a,h),Math.max(a,h));let m=l==(s?e.length-1:0)?null:e[l+(s?1:-1)];return m&&h==d&&m.level+(s?0:1)t.some(e=>e)}),tq=st.define({combine:t=>t.some(e=>e)}),nq=st.define();class Ih{constructor(e,n="nearest",r="nearest",s=5,i=5,a=!1){this.range=e,this.y=n,this.x=r,this.yMargin=s,this.xMargin=i,this.isSnapshot=a}map(e){return e.empty?this:new Ih(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Ih(Me.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const o1=Qt.define({map:(t,e)=>t.map(e)}),rq=Qt.define();function bi(t,e,n){let r=t.facet(KF);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const Ml=st.define({combine:t=>t.length?t[0]:!0});let woe=0;const Th=st.define({combine(t){return t.filter((e,n)=>{for(let r=0;r{let c=[];return a&&c.push(W0.of(d=>{let h=d.plugin(l);return h?a(h):Ot.none})),i&&c.push(i(l)),c})}static fromClass(e,n){return Yr.define((r,s)=>new e(r,s),n)}}class F4{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(bi(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){bi(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){bi(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const sq=st.define(),h6=st.define(),W0=st.define(),iq=st.define(),Xp=st.define(),aq=st.define();function _E(t,e){let n=t.state.facet(aq);if(!n.length)return n;let r=n.map(i=>i instanceof Function?i(t):i),s=[];return Bn.spans(r,e.from,e.to,{point(){},span(i,a,l,c){let d=i-e.from,h=a-e.from,m=s;for(let g=l.length-1;g>=0;g--,c--){let x=l[g].spec.bidiIsolate,y;if(x==null&&(x=boe(e.text,d,h)),c>0&&m.length&&(y=m[m.length-1]).to==d&&y.direction==x)y.to=h,m=y.inner;else{let w={from:d,to:h,direction:x,inner:[]};m.push(w),m=w.inner}}}}),s}const oq=st.define();function f6(t){let e=0,n=0,r=0,s=0;for(let i of t.state.facet(oq)){let a=i(t);a&&(a.left!=null&&(e=Math.max(e,a.left)),a.right!=null&&(n=Math.max(n,a.right)),a.top!=null&&(r=Math.max(r,a.top)),a.bottom!=null&&(s=Math.max(s,a.bottom)))}return{left:e,right:n,top:r,bottom:s}}const l0=st.define();class Ta{constructor(e,n,r,s){this.fromA=e,this.toA=n,this.fromB=r,this.toB=s}join(e){return new Ta(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let s=e[n-1];if(!(s.fromA>r.toA)){if(s.toAh)break;i+=2}if(!c)return r;new Ta(c.fromA,c.toA,c.fromB,c.toB).addToSet(r),a=c.toA,l=c.toB}}}class Kv{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=us.empty(this.startState.doc.length);for(let i of r)this.changes=this.changes.compose(i.changes);let s=[];this.changes.iterChangedRanges((i,a,l,c)=>s.push(new Ta(i,a,l,c))),this.changedRanges=s}static create(e,n,r){return new Kv(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class AE extends sr{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=Ot.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new rs],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Ta(0,0,0,e.state.doc.length)],0,null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:d,toA:h})=>hthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?s=this.domChanged.newSel.head:!Toe(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let i=s>-1?koe(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:d,to:h}=this.hasComposition;r=new Ta(d,h,e.changes.mapPos(d,-1),e.changes.mapPos(h,1)).addToSet(r.slice())}this.hasComposition=i?{from:i.range.fromB,to:i.range.toB}:null,(et.ie||et.chrome)&&!i&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,l=this.updateDeco(),c=Noe(a,l,e.changes);return r=Ta.extendWithRanges(r,c),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,i),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,n,r);let{observer:s}=this.view;s.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let a=et.chrome||et.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,a),this.flags&=-8,a&&(a.written||s.selectionRange.focusNode!=a.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(a=>a.flags&=-9);let i=[];if(this.view.viewport.from||this.view.viewport.to=0?s[a]:null;if(!l)break;let{fromA:c,toA:d,fromB:h,toB:m}=l,g,x,y,w;if(r&&r.range.fromBh){let T=N0.build(this.view.state.doc,h,r.range.fromB,this.decorations,this.dynamicDecorationMap),E=N0.build(this.view.state.doc,r.range.toB,m,this.decorations,this.dynamicDecorationMap);x=T.breakAtStart,y=T.openStart,w=E.openEnd;let _=this.compositionView(r);E.breakAtStart?_.breakAfter=1:E.content.length&&_.merge(_.length,_.length,E.content[0],!1,E.openStart,0)&&(_.breakAfter=E.content[0].breakAfter,E.content.shift()),T.content.length&&_.merge(0,0,T.content[T.content.length-1],!0,0,T.openEnd)&&T.content.pop(),g=T.content.concat(_).concat(E.content)}else({content:g,breakAtStart:x,openStart:y,openEnd:w}=N0.build(this.view.state.doc,h,m,this.decorations,this.dynamicDecorationMap));let{i:S,off:k}=i.findPos(d,1),{i:j,off:N}=i.findPos(c,-1);IF(this,j,N,S,k,g,x,y,w)}r&&this.fixCompositionDOM(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(rq)&&(this.editContextFormatting=r.value)}compositionView(e){let n=new Za(e.text.nodeValue);n.flags|=8;for(let{deco:s}of e.marks)n=new Ql(s,[n],n.length);let r=new rs;return r.append(n,0),r}fixCompositionDOM(e){let n=(i,a)=>{a.flags|=8|(a.children.some(c=>c.flags&7)?1:0),this.markedForComposition.add(a);let l=sr.get(i);l&&l!=a&&(l.dom=null),a.setDOM(i)},r=this.childPos(e.range.fromB,1),s=this.children[r.i];n(e.line,s);for(let i=e.marks.length-1;i>=-1;i--)r=s.childPos(r.off,1),s=s.children[r.i],n(i>=0?e.marks[i].node:e.text,s)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,s=r==this.dom,i=!s&&!(this.view.state.facet(Ml)||this.dom.tabIndex>-1)&&fv(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(s||n||i))return;let a=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,c=this.moveToLine(this.domAtPos(l.anchor)),d=l.empty?c:this.moveToLine(this.domAtPos(l.head));if(et.gecko&&l.empty&&!this.hasComposition&&Soe(c)){let m=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(m,c.node.childNodes[c.offset]||null)),c=d=new Hs(m,0),a=!0}let h=this.view.observer.selectionRange;(a||!h.focusNode||(!j0(c.node,c.offset,h.anchorNode,h.anchorOffset)||!j0(d.node,d.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{et.android&&et.chrome&&this.dom.contains(h.focusNode)&&Coe(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let m=U0(this.view.root);if(m)if(l.empty){if(et.gecko){let g=Ooe(c.node,c.offset);if(g&&g!=3){let x=(g==1?DF:PF)(c.node,c.offset);x&&(c=new Hs(x.node,x.offset))}}m.collapse(c.node,c.offset),l.bidiLevel!=null&&m.caretBidiLevel!==void 0&&(m.caretBidiLevel=l.bidiLevel)}else if(m.extend){m.collapse(c.node,c.offset);try{m.extend(d.node,d.offset)}catch{}}else{let g=document.createRange();l.anchor>l.head&&([c,d]=[d,c]),g.setEnd(d.node,d.offset),g.setStart(c.node,c.offset),m.removeAllRanges(),m.addRange(g)}i&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,d)),this.impreciseAnchor=c.precise?null:new Hs(h.anchorNode,h.anchorOffset),this.impreciseHead=d.precise?null:new Hs(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&j0(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=U0(e.root),{anchorNode:s,anchorOffset:i}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let a=rs.find(this,n.head);if(!a)return;let l=a.posAtStart;if(n.head==l||n.head==l+a.length)return;let c=this.coordsAt(n.head,-1),d=this.coordsAt(n.head,1);if(!c||!d||c.bottom>d.top)return;let h=this.domAtPos(n.head+n.assoc);r.collapse(h.node,h.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let m=e.observer.selectionRange;e.docView.posFromDOM(m.anchorNode,m.anchorOffset)!=n.from&&r.collapse(s,i)}moveToLine(e){let n=this.dom,r;if(e.node!=n)return e;for(let s=e.offset;!r&&s=0;s--){let i=sr.get(n.childNodes[s]);i instanceof rs&&(r=i.domAtPos(i.length))}return r?new Hs(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=sr.get(n);if(r&&r.rootView==this)return r;n=n.parentNode}return null}posFromDOM(e,n){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,n)+r.posAtStart}domAtPos(e){let{i:n,off:r}=this.childCursor().findPos(e,-1);for(;n=0;a--){let l=this.children[a],c=i-l.breakAfter,d=c-l.length;if(ce||l.covers(1))&&(!r||l instanceof rs&&!(r instanceof rs&&n>=0)))r=l,s=d;else if(r&&d==e&&c==e&&l instanceof Bl&&Math.abs(n)<2){if(l.deco.startSide<0)break;a&&(r=null)}i=d}return r?r.coordsAt(e-s,n):null}coordsForChar(e){let{i:n,off:r}=this.childPos(e,1),s=this.children[n];if(!(s instanceof rs))return null;for(;s.children.length;){let{i:l,off:c}=s.childPos(r,1);for(;;l++){if(l==s.children.length)return null;if((s=s.children[l]).length)break}r=c}if(!(s instanceof Za))return null;let i=Ps(s.text,r);if(i==r)return null;let a=cd(s.dom,r,i).getClientRects();for(let l=0;lMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,c=this.view.textDirection==br.LTR;for(let d=0,h=0;hs)break;if(d>=r){let x=m.dom.getBoundingClientRect();if(n.push(x.height),a){let y=m.dom.lastChild,w=y?Jh(y):[];if(w.length){let S=w[w.length-1],k=c?S.right-x.left:x.right-S.left;k>l&&(l=k,this.minWidth=i,this.minWidthFrom=d,this.minWidthTo=g)}}}d=g+m.breakAfter}return n}textDirectionAt(e){let{i:n}=this.childPos(e,1);return getComputedStyle(this.children[n].dom).direction=="rtl"?br.RTL:br.LTR}measureTextSize(){for(let i of this.children)if(i instanceof rs){let a=i.measureTextSize();if(a)return a}let e=document.createElement("div"),n,r,s;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let i=Jh(e.firstChild)[0];n=e.getBoundingClientRect().height,r=i?i.width/27:7,s=i?i.height:n,e.remove()}),{lineHeight:n,charWidth:r,textHeight:s}}childCursor(e=this.length){let n=this.children.length;return n&&(e-=this.children[--n].length),new zF(this.children,e,n)}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,s=0;;s++){let i=s==n.viewports.length?null:n.viewports[s],a=i?i.from-1:this.length;if(a>r){let l=(n.lineBlockAt(a).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(Ot.replace({widget:new Hk(l),block:!0,inclusive:!0,isBlockGap:!0}).range(r,a))}if(!i)break;r=i.to+1}return Ot.set(e)}updateDeco(){let e=1,n=this.view.state.facet(W0).map(i=>(this.dynamicDecorationMap[e++]=typeof i=="function")?i(this.view):i),r=!1,s=this.view.state.facet(iq).map((i,a)=>{let l=typeof i=="function";return l&&(r=!0),l?i(this.view):i});for(s.length&&(this.dynamicDecorationMap[e++]=r,n.push(Bn.join(s))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];en.anchor?-1:1),s;if(!r)return;!n.empty&&(s=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,s.left),top:Math.min(r.top,s.top),right:Math.max(r.right,s.right),bottom:Math.max(r.bottom,s.bottom)});let i=f6(this.view),a={left:r.left-i.left,top:r.top-i.top,right:r.right+i.right,bottom:r.bottom+i.bottom},{offsetWidth:l,offsetHeight:c}=this.view.scrollDOM;toe(this.view.scrollDOM,a,n.heads instanceof Dl||s.children.some(r);return r(this.children[n])}}function Soe(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function lq(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=DF(n.focusNode,n.focusOffset),s=PF(n.focusNode,n.focusOffset),i=r||s;if(s&&r&&s.node!=r.node){let l=sr.get(s.node);if(!l||l instanceof Za&&l.text!=s.node.nodeValue)i=s;else if(t.docView.lastCompositionAfterCursor){let c=sr.get(r.node);!c||c instanceof Za&&c.text!=r.node.nodeValue||(i=s)}}if(t.docView.lastCompositionAfterCursor=i!=r,!i)return null;let a=e-i.offset;return{from:a,to:a+i.node.nodeValue.length,node:i.node}}function koe(t,e,n){let r=lq(t,n);if(!r)return null;let{node:s,from:i,to:a}=r,l=s.nodeValue;if(/[\n\r]/.test(l)||t.state.doc.sliceString(r.from,r.to)!=l)return null;let c=e.invertedDesc,d=new Ta(c.mapPos(i),c.mapPos(a),i,a),h=[];for(let m=s.parentNode;;m=m.parentNode){let g=sr.get(m);if(g instanceof Ql)h.push({node:m,deco:g.mark});else{if(g instanceof rs||m.nodeName=="DIV"&&m.parentNode==t.contentDOM)return{range:d,text:s,marks:h,line:m};if(m!=t.contentDOM)h.push({node:m,deco:new Wp({inclusive:!0,attributes:uoe(m),tagName:m.tagName.toLowerCase()})});else return null}}}function Ooe(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e{re.from&&(n=!0)}),n}function Eoe(t,e,n=1){let r=t.charCategorizer(e),s=t.doc.lineAt(e),i=e-s.from;if(s.length==0)return Me.cursor(e);i==0?n=1:i==s.length&&(n=-1);let a=i,l=i;n<0?a=Ps(s.text,i,!1):l=Ps(s.text,i);let c=r(s.text.slice(a,l));for(;a>0;){let d=Ps(s.text,a,!1);if(r(s.text.slice(d,a))!=c)break;a=d}for(;lt?e.left-t:Math.max(0,t-e.right)}function Aoe(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function q4(t,e){return t.tope.top+1}function ME(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function Gk(t,e,n){let r,s,i,a,l=!1,c,d,h,m;for(let y=t.firstChild;y;y=y.nextSibling){let w=Jh(y);for(let S=0;SN||a==N&&i>j)&&(r=y,s=k,i=j,a=N,l=j?e0:Sk.bottom&&(!h||h.bottomk.top)&&(d=y,m=k):h&&q4(h,k)?h=RE(h,k.bottom):m&&q4(m,k)&&(m=ME(m,k.top))}}if(h&&h.bottom>=n?(r=c,s=h):m&&m.top<=n&&(r=d,s=m),!r)return{node:t,offset:0};let g=Math.max(s.left,Math.min(s.right,e));if(r.nodeType==3)return DE(r,g,n);if(l&&r.contentEditable!="false")return Gk(r,g,n);let x=Array.prototype.indexOf.call(t.childNodes,r)+(e>=(s.left+s.right)/2?1:0);return{node:t,offset:x}}function DE(t,e,n){let r=t.nodeValue.length,s=-1,i=1e9,a=0;for(let l=0;ln?h.top-n:n-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&m=(h.left+h.right)/2,x=g;if(et.chrome||et.gecko){let y=cd(t,l).getBoundingClientRect();Math.abs(y.left-h.right)<.1&&(x=!g)}if(m<=0)return{node:t,offset:l+(x?1:0)};s=l+(x?1:0),i=m}}}return{node:t,offset:s>-1?s:a>0?t.nodeValue.length:0}}function cq(t,e,n,r=-1){var s,i;let a=t.contentDOM.getBoundingClientRect(),l=a.top+t.viewState.paddingTop,c,{docHeight:d}=t.viewState,{x:h,y:m}=e,g=m-l;if(g<0)return 0;if(g>d)return t.state.doc.length;for(let T=t.viewState.heightOracle.textHeight/2,E=!1;c=t.elementAtHeight(g),c.type!=ri.Text;)for(;g=r>0?c.bottom+T:c.top-T,!(g>=0&&g<=d);){if(E)return n?null:0;E=!0,r=-r}m=l+g;let x=c.from;if(xt.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:n?null:PE(t,a,c,h,m);let y=t.dom.ownerDocument,w=t.root.elementFromPoint?t.root:y,S=w.elementFromPoint(h,m);S&&!t.contentDOM.contains(S)&&(S=null),S||(h=Math.max(a.left+1,Math.min(a.right-1,h)),S=w.elementFromPoint(h,m),S&&!t.contentDOM.contains(S)&&(S=null));let k,j=-1;if(S&&((s=t.docView.nearest(S))===null||s===void 0?void 0:s.isEditable)!=!1){if(y.caretPositionFromPoint){let T=y.caretPositionFromPoint(h,m);T&&({offsetNode:k,offset:j}=T)}else if(y.caretRangeFromPoint){let T=y.caretRangeFromPoint(h,m);T&&({startContainer:k,startOffset:j}=T)}k&&(!t.contentDOM.contains(k)||et.safari&&Moe(k,j,h)||et.chrome&&Roe(k,j,h))&&(k=void 0),k&&(j=Math.min(qo(k),j))}if(!k||!t.docView.dom.contains(k)){let T=rs.find(t.docView,x);if(!T)return g>c.top+c.height/2?c.to:c.from;({node:k,offset:j}=Gk(T.dom,h,m))}let N=t.docView.nearest(k);if(!N)return null;if(N.isWidget&&((i=N.dom)===null||i===void 0?void 0:i.nodeType)==1){let T=N.dom.getBoundingClientRect();return e.yt.defaultLineHeight*1.5){let l=t.viewState.heightOracle.textHeight,c=Math.floor((s-n.top-(t.defaultLineHeight-l)*.5)/l);i+=c*t.viewState.heightOracle.lineLength}let a=t.state.sliceDoc(n.from,n.to);return n.from+Rk(a,i,t.state.tabSize)}function uq(t,e,n){let r,s=t;if(t.nodeType!=3||e!=(r=t.nodeValue.length))return!1;for(;;){let i=s.nextSibling;if(i){if(i.nodeName=="BR")break;return!1}else{let a=s.parentNode;if(!a||a.nodeName=="DIV")break;s=a}}return cd(t,r-1,r).getBoundingClientRect().right>n}function Moe(t,e,n){return uq(t,e,n)}function Roe(t,e,n){if(e!=0)return uq(t,e,n);for(let s=t;;){let i=s.parentNode;if(!i||i.nodeType!=1||i.firstChild!=s)return!1;if(i.classList.contains("cm-line"))break;s=i}let r=t.nodeType==1?t.getBoundingClientRect():cd(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function Xk(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let s;for(let i of r.type){if(i.from>e)break;if(!(i.toe)return i;(!s||i.type==ri.Text&&(s.type!=i.type||(n<0?i.frome)))&&(s=i)}}return s||r}return r}function Doe(t,e,n,r){let s=Xk(t,e.head,e.assoc||-1),i=!r||s.type!=ri.Text||!(t.lineWrapping||s.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(i){let a=t.dom.getBoundingClientRect(),l=t.textDirectionAt(s.from),c=t.posAtCoords({x:n==(l==br.LTR)?a.right-1:a.left+1,y:(i.top+i.bottom)/2});if(c!=null)return Me.cursor(c,n?-1:1)}return Me.cursor(n?s.to:s.from,n?-1:1)}function zE(t,e,n,r){let s=t.state.doc.lineAt(e.head),i=t.bidiSpans(s),a=t.textDirectionAt(s.from);for(let l=e,c=null;;){let d=yoe(s,i,a,l,n),h=WF;if(!d){if(s.number==(n?t.state.doc.lines:1))return l;h=` -`,s=t.state.doc.line(s.number+(n?1:-1)),i=t.bidiSpans(s),d=t.visualLineSide(s,!n)}if(c){if(!c(h))return l}else{if(!r)return d;c=r(h)}l=d}}function Poe(t,e,n){let r=t.state.charCategorizer(e),s=r(n);return i=>{let a=r(i);return s==Tr.Space&&(s=a),s==a}}function zoe(t,e,n,r){let s=e.head,i=n?1:-1;if(s==(n?t.state.doc.length:0))return Me.cursor(s,e.assoc);let a=e.goalColumn,l,c=t.contentDOM.getBoundingClientRect(),d=t.coordsAtPos(s,e.assoc||-1),h=t.documentTop;if(d)a==null&&(a=d.left-c.left),l=i<0?d.top:d.bottom;else{let x=t.viewState.lineBlockAt(s);a==null&&(a=Math.min(c.right-c.left,t.defaultCharacterWidth*(s-x.from))),l=(i<0?x.top:x.bottom)+h}let m=c.left+a,g=r??t.viewState.heightOracle.textHeight>>1;for(let x=0;;x+=10){let y=l+(g+x)*i,w=cq(t,{x:m,y},!1,i);if(yc.bottom||(i<0?ws)){let S=t.docView.coordsForChar(w),k=!S||y{if(e>i&&es(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:Me.cursor(r,ri)&&!Boe(a,n)&&this.lineBreak(),s=a}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,a=1,l;if(this.lineSeparator?(i=n.indexOf(this.lineSeparator,r),a=this.lineSeparator.length):(l=s.exec(n))&&(i=l.index,a=l[0].length),this.append(n.slice(r,i<0?n.length:i)),i<0)break;if(this.lineBreak(),a>1)for(let c of this.points)c.node==e&&c.pos>this.text.length&&(c.pos-=a-1);r=i+a}}readNode(e){if(e.cmIgnore)return;let n=sr.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let s=r.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(Loe(e,r.node,r.offset)?n:0))}}function Loe(t,e,n){for(;;){if(!e||n-1;let{impreciseHead:i,impreciseAnchor:a}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let l=i||a?[]:$oe(e),c=new Ioe(l,e.state);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=Hoe(l,this.bounds.from)}else{let l=e.observer.selectionRange,c=i&&i.node==l.focusNode&&i.offset==l.focusOffset||!Fk(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),d=a&&a.node==l.anchorNode&&a.offset==l.anchorOffset||!Fk(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=e.viewport;if((et.ios||et.chrome)&&e.state.selection.main.empty&&c!=d&&(h.from>0||h.to-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(Me.range(d,c)):this.newSel=Me.single(d,c)}}}function hq(t,e){let n,{newSel:r}=e,s=t.state.selection.main,i=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:a,to:l}=e.bounds,c=s.from,d=null;(i===8||et.android&&e.text.length=s.from&&n.to<=s.to&&(n.from!=s.from||n.to!=s.to)&&s.to-s.from-(n.to-n.from)<=4?n={from:s.from,to:s.to,insert:t.state.doc.slice(s.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,s.to))}:t.state.doc.lineAt(s.from).toDate.now()-50?n={from:s.from,to:s.to,insert:t.state.toText(t.inputState.insertingText)}:et.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==` - `&&t.lineWrapping&&(r&&(r=Me.single(r.main.anchor-1,r.main.head-1)),n={from:s.from,to:s.to,insert:An.of([" "])}),n)return m6(t,n,r,i);if(r&&!r.main.eq(s)){let a=!1,l="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(a=!0),l=t.inputState.lastSelectionOrigin,l=="select.pointer"&&(r=dq(t.state.facet(Xp).map(c=>c(t)),r))),t.dispatch({selection:r,scrollIntoView:a,userEvent:l}),!0}else return!1}function m6(t,e,n,r=-1){if(et.ios&&t.inputState.flushIOSKey(e))return!0;let s=t.state.selection.main;if(et.android&&(e.to==s.to&&(e.from==s.from||e.from==s.from-1&&t.state.sliceDoc(e.from,s.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&zh(t.contentDOM,"Enter",13)||(e.from==s.from-1&&e.to==s.to&&e.insert.length==0||r==8&&e.insert.lengths.head)&&zh(t.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&zh(t.contentDOM,"Delete",46)))return!0;let i=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a,l=()=>a||(a=qoe(t,e,n));return t.state.facet(ZF).some(c=>c(t,e.from,e.to,i,l))||t.dispatch(l()),!0}function qoe(t,e,n){let r,s=t.state,i=s.selection.main,a=-1;if(e.from==e.to&&e.fromi.to){let c=e.fromm(t)),d,c);e.from==h&&(a=h)}if(a>-1)r={changes:e,selection:Me.cursor(e.from+e.insert.length,-1)};else if(e.from>=i.from&&e.to<=i.to&&e.to-e.from>=(i.to-i.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let c=i.frome.to?s.sliceDoc(e.to,i.to):"";r=s.replaceSelection(t.state.toText(c+e.insert.sliceString(0,void 0,t.state.lineBreak)+d))}else{let c=s.changes(e),d=n&&n.main.to<=c.newLength?n.main:void 0;if(s.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=i.to+10&&e.to>=i.to-10){let h=t.state.sliceDoc(e.from,e.to),m,g=n&&lq(t,n.main.head);if(g){let y=e.insert.length-(e.to-e.from);m={from:g.from,to:g.to-y}}else m=t.state.doc.lineAt(i.head);let x=i.to-e.to;r=s.changeByRange(y=>{if(y.from==i.from&&y.to==i.to)return{changes:c,range:d||y.map(c)};let w=y.to-x,S=w-h.length;if(t.state.sliceDoc(S,w)!=h||w>=m.from&&S<=m.to)return{range:y};let k=s.changes({from:S,to:w,insert:e.insert}),j=y.to-i.to;return{changes:k,range:d?Me.range(Math.max(0,d.anchor+j),Math.max(0,d.head+j)):y.map(k)}})}else r={changes:c,selection:d&&s.selection.replaceRange(d)}}let l="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,l+=".compose",t.inputState.compositionFirstChange&&(l+=".start",t.inputState.compositionFirstChange=!1)),s.update(r,{userEvent:l,scrollIntoView:!0})}function fq(t,e,n,r){let s=Math.min(t.length,e.length),i=0;for(;i0&&l>0&&t.charCodeAt(a-1)==e.charCodeAt(l-1);)a--,l--;if(r=="end"){let c=Math.max(0,i-Math.min(a,l));n-=a+c-i}if(a=a?i-n:0;i-=c,l=i+(l-a),a=i}else if(l=l?i-n:0;i-=c,a=i+(a-l),l=i}return{from:i,toA:a,toB:l}}function $oe(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:i}=t.observer.selectionRange;return n&&(e.push(new IE(n,r)),(s!=n||i!=r)&&e.push(new IE(s,i))),e}function Hoe(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?Me.single(n+e,r+e):null}class Qoe{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,et.safari&&e.contentDOM.addEventListener("input",()=>null),et.gecko&&ale(e.contentDOM.ownerDocument)}handleEvent(e){!Zoe(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let r=this.handlers[e];if(r){for(let s of r.observers)s(this.view,n);for(let s of r.handlers){if(n.defaultPrevented)break;if(s(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=Voe(e),r=this.handlers,s=this.view.contentDOM;for(let i in n)if(i!="scroll"){let a=!n[i].handlers.length,l=r[i];l&&a!=!l.handlers.length&&(s.removeEventListener(i,this.handleEvent),l=null),l||s.addEventListener(i,this.handleEvent,{passive:a})}for(let i in r)i!="scroll"&&!n[i]&&s.removeEventListener(i,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&pq.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),et.android&&et.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return et.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=mq.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||Uoe.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from0?!0:et.safari&&!et.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function LE(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(s){bi(n.state,s)}}}function Voe(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let s=r.spec,i=s&&s.plugin.domEventHandlers,a=s&&s.plugin.domEventObservers;if(i)for(let l in i){let c=i[l];c&&n(l).handlers.push(LE(r.value,c))}if(a)for(let l in a){let c=a[l];c&&n(l).observers.push(LE(r.value,c))}}for(let r in Ja)n(r).handlers.push(Ja[r]);for(let r in Aa)n(r).observers.push(Aa[r]);return e}const mq=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Uoe="dthko",pq=[16,17,18,20,91,92,224,225],l1=6;function c1(t){return Math.max(0,t)*.7+8}function Woe(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class Goe{constructor(e,n,r,s){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=noe(e.contentDOM),this.atoms=e.state.facet(Xp).map(a=>a(e));let i=e.contentDOM.ownerDocument;i.addEventListener("mousemove",this.move=this.move.bind(this)),i.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(Nn.allowMultipleSelections)&&Xoe(e,n),this.dragging=Koe(e,n)&&vq(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Woe(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,s=0,i=0,a=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=f6(this.view);e.clientX-c.left<=s+l1?n=-c1(s-e.clientX):e.clientX+c.right>=a-l1&&(n=c1(e.clientX-a)),e.clientY-c.top<=i+l1?r=-c1(i-e.clientY):e.clientY+c.bottom>=l-l1&&(r=c1(e.clientY-l)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,r=dq(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Xoe(t,e){let n=t.state.facet(GF);return n.length?n[0](e):et.mac?e.metaKey:e.ctrlKey}function Yoe(t,e){let n=t.state.facet(XF);return n.length?n[0](e):et.mac?!e.altKey:!e.ctrlKey}function Koe(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=U0(t.root);if(!r||r.rangeCount==0)return!0;let s=r.getRangeAt(0).getClientRects();for(let i=0;i=e.clientX&&a.top<=e.clientY&&a.bottom>=e.clientY)return!0}return!1}function Zoe(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=sr.get(n))&&r.ignoreEvent(e))return!1;return!0}const Ja=Object.create(null),Aa=Object.create(null),gq=et.ie&&et.ie_version<15||et.ios&&et.webkit_version<604;function Joe(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),xq(t,n.value)},50)}function mb(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function xq(t,e){e=mb(t.state,u6,e);let{state:n}=t,r,s=1,i=n.toText(e),a=i.lines==n.selection.ranges.length;if(Yk!=null&&n.selection.ranges.every(c=>c.empty)&&Yk==i.toString()){let c=-1;r=n.changeByRange(d=>{let h=n.doc.lineAt(d.from);if(h.from==c)return{range:d};c=h.from;let m=n.toText((a?i.line(s++).text:e)+n.lineBreak);return{changes:{from:h.from,insert:m},range:Me.cursor(d.from+m.length)}})}else a?r=n.changeByRange(c=>{let d=i.line(s++);return{changes:{from:c.from,to:c.to,insert:d.text},range:Me.cursor(c.from+d.length)}}):r=n.replaceSelection(i);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Aa.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Ja.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);Aa.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};Aa.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Ja.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(YF))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=nle(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new Goe(t,e,n,r)),r&&t.observer.ignore(()=>{AF(t.contentDOM);let i=t.root.activeElement;i&&!i.contains(t.contentDOM)&&i.blur()});let s=t.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function BE(t,e,n,r){if(r==1)return Me.cursor(e,n);if(r==2)return Eoe(t.state,e,n);{let s=rs.find(t.docView,e),i=t.state.doc.lineAt(s?s.posAtEnd:e),a=s?s.posAtStart:i.from,l=s?s.posAtEnd:i.to;return le>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right;function ele(t,e,n,r){let s=rs.find(t.docView,e);if(!s)return 1;let i=e-s.posAtStart;if(i==0)return 1;if(i==s.length)return-1;let a=s.coordsAt(i,-1);if(a&&FE(n,r,a))return-1;let l=s.coordsAt(i,1);return l&&FE(n,r,l)?1:a&&a.bottom>=r?-1:1}function qE(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:ele(t,n,e.clientX,e.clientY)}}const tle=et.ie&&et.ie_version<=11;let $E=null,HE=0,QE=0;function vq(t){if(!tle)return t.detail;let e=$E,n=QE;return $E=t,QE=Date.now(),HE=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(HE+1)%3:1}function nle(t,e){let n=qE(t,e),r=vq(e),s=t.state.selection;return{update(i){i.docChanged&&(n.pos=i.changes.mapPos(n.pos),s=s.map(i.changes))},get(i,a,l){let c=qE(t,i),d,h=BE(t,c.pos,c.bias,r);if(n.pos!=c.pos&&!a){let m=BE(t,n.pos,n.bias,r),g=Math.min(m.from,h.from),x=Math.max(m.to,h.to);h=g1&&(d=rle(s,c.pos))?d:l?s.addRange(h):Me.create([h])}}}function rle(t,e){for(let n=0;n=e)return Me.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}Ja.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let s=t.docView.nearest(e.target);if(s&&s.isWidget){let i=s.posAtStart,a=i+s.length;(i>=n.to||a<=n.from)&&(n=Me.range(i,a))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",mb(t.state,d6,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Ja.dragend=t=>(t.inputState.draggedContent=null,!1);function VE(t,e,n,r){if(n=mb(t.state,u6,n),!n)return;let s=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:i}=t.inputState,a=r&&i&&Yoe(t,e)?{from:i.from,to:i.to}:null,l={from:s,insert:n},c=t.state.changes(a?[a,l]:l);t.focus(),t.dispatch({changes:c,selection:{anchor:c.mapPos(s,-1),head:c.mapPos(s,1)},userEvent:a?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Ja.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),s=0,i=()=>{++s==n.length&&VE(t,e,r.filter(a=>a!=null).join(t.state.lineBreak),!1)};for(let a=0;a{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(r[a]=l.result),i()},l.readAsText(n[a])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return VE(t,e,r,!0),!0}return!1};Ja.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=gq?null:e.clipboardData;return n?(xq(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(Joe(t),!1)};function sle(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function ile(t){let e=[],n=[],r=!1;for(let s of t.selection.ranges)s.empty||(e.push(t.sliceDoc(s.from,s.to)),n.push(s));if(!e.length){let s=-1;for(let{from:i}of t.selection.ranges){let a=t.doc.lineAt(i);a.number>s&&(e.push(a.text),n.push({from:a.from,to:Math.min(t.doc.length,a.to+1)})),s=a.number}r=!0}return{text:mb(t,d6,e.join(t.lineBreak)),ranges:n,linewise:r}}let Yk=null;Ja.copy=Ja.cut=(t,e)=>{let{text:n,ranges:r,linewise:s}=ile(t.state);if(!n&&!s)return!1;Yk=s?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let i=gq?null:e.clipboardData;return i?(i.clearData(),i.setData("text/plain",n),!0):(sle(t,n),!1)};const yq=Qo.define();function bq(t,e){let n=[];for(let r of t.facet(JF)){let s=r(t,e);s&&n.push(s)}return n.length?t.update({effects:n,annotations:yq.of(!0)}):null}function wq(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=bq(t.state,e);n?t.dispatch(n):t.update([])}},10)}Aa.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),wq(t)};Aa.blur=t=>{t.observer.clearSelectionRange(),wq(t)};Aa.compositionstart=Aa.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};Aa.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,et.chrome&&et.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};Aa.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Ja.beforeinput=(t,e)=>{var n,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let i=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),a=e.getTargetRanges();if(i&&a.length){let l=a[0],c=t.posAtDOM(l.startContainer,l.startOffset),d=t.posAtDOM(l.endContainer,l.endOffset);return m6(t,{from:c,to:d,insert:t.state.toText(i)},null),!0}}let s;if(et.chrome&&et.android&&(s=mq.find(i=>i.inputType==e.inputType))&&(t.observer.delayAndroidKey(s.key,s.keyCode),s.key=="Backspace"||s.key=="Delete")){let i=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>i+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return et.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),et.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>Aa.compositionend(t,e),20),!1};const UE=new Set;function ale(t){UE.has(t)||(UE.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const WE=["pre-wrap","normal","pre-line","break-spaces"];let nf=!1;function GE(){nf=!1}class ole{constructor(e){this.lineWrapping=e,this.doc=An.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return WE.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r-1,c=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=r,this.textHeight=s,this.lineLength=i,c){this.heightSamples={};for(let d=0;d0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>pv&&(nf=!0),this.height=e)}replace(e,n,r){return si.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,s){let i=this,a=r.doc;for(let l=s.length-1;l>=0;l--){let{fromA:c,toA:d,fromB:h,toB:m}=s[l],g=i.lineAt(c,yr.ByPosNoHeight,r.setDoc(n),0,0),x=g.to>=d?g:i.lineAt(d,yr.ByPosNoHeight,r,0,0);for(m+=x.to-d,d=x.to;l>0&&g.from<=s[l-1].toA;)c=s[l-1].fromA,h=s[l-1].fromB,l--,ci*2){let l=e[n-1];l.break?e.splice(--n,1,l.left,null,l.right):e.splice(--n,1,l.left,l.right),r+=1+l.break,s-=l.size}else if(i>s*2){let l=e[r];l.break?e.splice(r,1,l.left,null,l.right):e.splice(r,1,l.left,l.right),r+=2+l.break,i-=l.size}else break;else if(s=i&&a(this.blockAt(0,r,s,i))}updateHeight(e,n=0,r=!1,s){return s&&s.from<=n&&s.more&&this.setHeight(s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Qi extends Sq{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,s){return new Oo(s,this.length,r,this.height,this.breaks)}replace(e,n,r){let s=r[0];return r.length==1&&(s instanceof Qi||s instanceof As&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof As?s=new Qi(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):si.of(r)}updateHeight(e,n=0,r=!1,s){return s&&s.from<=n&&s.more?this.setHeight(s.heights[s.index++]):(r||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class As extends si{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,s=e.doc.lineAt(n+this.length).number,i=s-r+1,a,l=0;if(e.lineWrapping){let c=Math.min(this.height,e.lineHeight*i);a=c/i,this.length>i+1&&(l=(this.height-c)/(this.length-i-1))}else a=this.height/i;return{firstLine:r,lastLine:s,perLine:a,perChar:l}}blockAt(e,n,r,s){let{firstLine:i,lastLine:a,perLine:l,perChar:c}=this.heightMetrics(n,s);if(n.lineWrapping){let d=s+(e0){let i=r[r.length-1];i instanceof As?r[r.length-1]=new As(i.length+s):r.push(null,new As(s-1))}if(e>0){let i=r[0];i instanceof As?r[0]=new As(e+i.length):r.unshift(new As(e-1),null)}return si.of(r)}decomposeLeft(e,n){n.push(new As(e-1),null)}decomposeRight(e,n){n.push(null,new As(this.length-e-1))}updateHeight(e,n=0,r=!1,s){let i=n+this.length;if(s&&s.from<=n+this.length&&s.more){let a=[],l=Math.max(n,s.from),c=-1;for(s.from>n&&a.push(new As(s.from-n-1).updateHeight(e,n));l<=i&&s.more;){let h=e.doc.lineAt(l).length;a.length&&a.push(null);let m=s.heights[s.index++];c==-1?c=m:Math.abs(m-c)>=pv&&(c=-2);let g=new Qi(h,m);g.outdated=!1,a.push(g),l+=h+1}l<=i&&a.push(null,new As(i-l).updateHeight(e,l));let d=si.of(a);return(c<0||Math.abs(d.height-this.height)>=pv||Math.abs(c-this.heightMetrics(e,n).perLine)>=pv)&&(nf=!0),Zv(this,d)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class cle extends si{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,s){let i=r+this.left.height;return el))return d;let h=n==yr.ByPosNoHeight?yr.ByPosNoHeight:yr.ByPos;return c?d.join(this.right.lineAt(l,h,r,a,l)):this.left.lineAt(l,h,r,s,i).join(d)}forEachLine(e,n,r,s,i,a){let l=s+this.left.height,c=i+this.left.length+this.break;if(this.break)e=c&&this.right.forEachLine(e,n,r,l,c,a);else{let d=this.lineAt(c,yr.ByPos,r,s,i);e=e&&d.from<=n&&a(d),n>d.to&&this.right.forEachLine(d.to+1,n,r,l,c,a)}}replace(e,n,r){let s=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(e-s,n-s,r));let i=[];e>0&&this.decomposeLeft(e,i);let a=i.length;for(let l of r)i.push(l);if(e>0&&XE(i,a-1),n=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,s=r+this.break;if(e>=s)return this.right.decomposeRight(e-s,n);e2*n.size||n.size>2*e.size?si.of(this.break?[e,null,n]:[e,n]):(this.left=Zv(this.left,e),this.right=Zv(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,s){let{left:i,right:a}=this,l=n+i.length+this.break,c=null;return s&&s.from<=n+i.length&&s.more?c=i=i.updateHeight(e,n,r,s):i.updateHeight(e,n,r),s&&s.from<=l+a.length&&s.more?c=a=a.updateHeight(e,l,r,s):a.updateHeight(e,l,r),c?this.balanced(i,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function XE(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof As&&(r=t[e+1])instanceof As&&t.splice(e-1,3,new As(n.length+1+r.length))}const ule=5;class p6{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof Qi?s.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Qi(r-this.pos,-1)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e=ule)&&this.addLineDeco(s,i,a)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenToe&&this.nodes.push(new Qi(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,n){let r=new As(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Qi)return e;let n=new Qi(0,-1);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let s=this.ensureLine();s.length+=r,s.collapsed+=r,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Qi)&&!this.isCovered?this.nodes.push(new Qi(0,-1)):(this.writtenToh.clientHeight||h.scrollWidth>h.clientWidth)&&m.overflow!="visible"){let g=h.getBoundingClientRect();i=Math.max(i,g.left),a=Math.min(a,g.right),l=Math.max(l,g.top),c=Math.min(d==t.parentNode?s.innerHeight:c,g.bottom)}d=m.position=="absolute"||m.position=="fixed"?h.offsetParent:h.parentNode}else if(d.nodeType==11)d=d.host;else break;return{left:i-n.left,right:Math.max(i,a)-n.left,top:l-(n.top+e),bottom:Math.max(l,c)-(n.top+e)}}function mle(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left0&&e.top0}function ple(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class H4{constructor(e,n,r,s){this.from=e,this.to=n,this.size=r,this.displaySize=s}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;rtypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new ole(n),this.stateDeco=e.facet(W0).filter(r=>typeof r!="function"),this.heightMap=si.empty().applyChanges(this.stateDeco,An.empty,this.heightOracle.setDoc(e.doc),[new Ta(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ot.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let s=r?n.head:n.anchor;if(!e.some(({from:i,to:a})=>s>=i&&s<=a)){let{from:i,to:a}=this.lineBlockAt(s);e.push(new u1(i,a))}}return this.viewports=e.sort((r,s)=>r.from-s.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?KE:new g6(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(u0(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(W0).filter(h=>typeof h!="function");let s=e.changedRanges,i=Ta.extendWithRanges(s,dle(r,this.stateDeco,e?e.changes:us.empty(this.state.doc.length))),a=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);GE(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=a||nf)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let c=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.headc.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,n));let d=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,e.flags|=this.updateForViewport(),(d||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(tq)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),s=this.heightOracle,i=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?br.RTL:br.LTR;let a=this.heightOracle.mustRefreshForWrapping(i),l=n.getBoundingClientRect(),c=a||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let d=0,h=0;if(l.width&&l.height){let{scaleX:T,scaleY:E}=_F(n,l);(T>.005&&Math.abs(this.scaleX-T)>.005||E>.005&&Math.abs(this.scaleY-E)>.005)&&(this.scaleX=T,this.scaleY=E,d|=16,a=c=!0)}let m=(parseInt(r.paddingTop)||0)*this.scaleY,g=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=m||this.paddingBottom!=g)&&(this.paddingTop=m,this.paddingBottom=g,d|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(c=!0),this.editorWidth=e.scrollDOM.clientWidth,d|=16);let x=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=x&&(this.scrollAnchorHeight=-1,this.scrollTop=x),this.scrolledToBottom=RF(e.scrollDOM);let y=(this.printing?ple:fle)(n,this.paddingTop),w=y.top-this.pixelViewport.top,S=y.bottom-this.pixelViewport.bottom;this.pixelViewport=y;let k=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(k!=this.inView&&(this.inView=k,k&&(c=!0)),!this.inView&&!this.scrollTarget&&!mle(e.dom))return 0;let j=l.width;if((this.contentDOMWidth!=j||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,d|=16),c){let T=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(T)&&(a=!0),a||s.lineWrapping&&Math.abs(j-this.contentDOMWidth)>s.charWidth){let{lineHeight:E,charWidth:_,textHeight:A}=e.docView.measureTextSize();a=E>0&&s.refresh(i,E,_,A,Math.max(5,j/_),T),a&&(e.docView.minWidth=0,d|=16)}w>0&&S>0?h=Math.max(w,S):w<0&&S<0&&(h=Math.min(w,S)),GE();for(let E of this.viewports){let _=E.from==this.viewport.from?T:e.docView.measureVisibleLineHeights(E);this.heightMap=(a?si.empty().applyChanges(this.stateDeco,An.empty,this.heightOracle,[new Ta(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,a,new lle(E.from,_))}nf&&(d|=2)}let N=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return N&&(d&2&&(d|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),d|=this.updateForViewport()),(d&2||N)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),d|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),d}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,i=this.heightOracle,{visibleTop:a,visibleBottom:l}=this,c=new u1(s.lineAt(a-r*1e3,yr.ByHeight,i,0,0).from,s.lineAt(l+(1-r)*1e3,yr.ByHeight,i,0,0).to);if(n){let{head:d}=n.range;if(dc.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),m=s.lineAt(d,yr.ByPos,i,0,0),g;n.y=="center"?g=(m.top+m.bottom)/2-h/2:n.y=="start"||n.y=="nearest"&&d=l+Math.max(10,Math.min(r,250)))&&s>a-2*1e3&&i>1,a=s<<1;if(this.defaultTextDirection!=br.LTR&&!r)return[];let l=[],c=(h,m,g,x)=>{if(m-hh&&kk.from>=g.from&&k.to<=g.to&&Math.abs(k.from-h)k.fromj));if(!S){if(mN.from<=m&&N.to>=m)){let N=n.moveToLineBoundary(Me.cursor(m),!1,!0).head;N>h&&(m=N)}let k=this.gapSize(g,h,m,x),j=r||k<2e6?k:2e6;S=new H4(h,m,k,j)}l.push(S)},d=h=>{if(h.length2e6)for(let _ of e)_.from>=h.from&&_.fromh.from&&c(h.from,x,h,m),yn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];Bn.spans(n,this.viewport.from,this.viewport.to,{span(i,a){r.push({from:i,to:a})},point(){}},20);let s=0;if(r.length!=this.visibleRanges.length)s=12;else for(let i=0;i=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||u0(this.heightMap.lineAt(e,yr.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||u0(this.heightMap.lineAt(this.scaler.fromDOM(e),yr.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return u0(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}let u1=class{constructor(e,n){this.from=e,this.to=n}};function xle(t,e,n){let r=[],s=t,i=0;return Bn.spans(n,t,e,{span(){},point(a,l){a>s&&(r.push({from:s,to:a}),i+=a-s),s=l}},20),s=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let s=0;;s++){let{from:i,to:a}=e[s],l=a-i;if(r<=l)return i+r;r-=l}}function h1(t,e){let n=0;for(let{from:r,to:s}of t.ranges){if(e<=s){n+=e-r;break}n+=s-r}return n/t.total}function vle(t,e){for(let n of t)if(e(n))return n}const KE={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};class g6{constructor(e,n,r){let s=0,i=0,a=0;this.viewports=r.map(({from:l,to:c})=>{let d=n.lineAt(l,yr.ByPos,e,0,0).top,h=n.lineAt(c,yr.ByPos,e,0,0).bottom;return s+=h-d,{from:l,to:c,top:d,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(n.height-s);for(let l of this.viewports)l.domTop=a+(l.top-i)*this.scale,a=l.domBottom=l.domTop+(l.bottom-l.top),i=l.bottom}toDOM(e){for(let n=0,r=0,s=0;;n++){let i=nn.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function u0(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new Oo(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(s=>u0(s,e)):t._content)}const f1=st.define({combine:t=>t.join(" ")}),Kk=st.define({combine:t=>t.indexOf(!0)>-1}),Zk=Yc.newName(),kq=Yc.newName(),Oq=Yc.newName(),jq={"&light":"."+kq,"&dark":"."+Oq};function Jk(t,e,n){return new Yc(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,s=>{if(s=="&")return t;if(!n||!n[s])throw new RangeError(`Unsupported selector: ${s}`);return n[s]}):t+" "+r}})}const yle=Jk("."+Zk,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},jq),ble={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Q4=et.ie&&et.ie_version<=11;class wle{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new roe,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(et.ie&&et.ie_version<=11||et.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&et.android&&e.constructor.EDIT_CONTEXT!==!1&&!(et.chrome&&et.chrome_version<126)&&(this.editContext=new kle(e),e.state.facet(Ml)&&(e.contentDOM.editContext=this.editContext.editContext)),Q4&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,s=this.selectionRange;if(r.state.facet(Ml)?r.root.activeElement!=this.dom:!fv(this.dom,s))return;let i=s.anchorNode&&r.docView.nearest(s.anchorNode);if(i&&i.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(et.ie&&et.ie_version<=11||et.android&&et.chrome)&&!r.state.selection.main.empty&&s.focusNode&&j0(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=U0(e.root);if(!n)return!1;let r=et.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Sle(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let s=fv(this.dom,r);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let i=this.delayedAndroidKey;i&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=i.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&i.force&&zh(this.dom,i.key,i.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,s=!1;for(let i of e){let a=this.readMutation(i);a&&(a.typeOver&&(s=!0),n==-1?{from:n,to:r}=a:(n=Math.min(a.from,n),r=Math.max(a.to,r)))}return{from:n,to:r,typeOver:s}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),s=this.selectionChanged&&fv(this.dom,this.selectionRange);if(e<0&&!s)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new Foe(this.view,e,n,r);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,s=hq(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!n.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),s}readMutation(e){let n=this.view.docView.nearest(e.target);if(!n||n.ignoreMutation(e))return null;if(n.markDirty(e.type=="attributes"),e.type=="attributes"&&(n.flags|=4),e.type=="childList"){let r=ZE(n,e.previousSibling||e.target.previousSibling,-1),s=ZE(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:s?n.posBefore(s):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Ml)!=e.state.facet(Ml)&&(e.view.contentDOM.editContext=e.state.facet(Ml)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function ZE(t,e,n){for(;e;){let r=sr.get(e);if(r&&r.parent==t)return r;let s=e.parentNode;e=s!=t.dom?s:n>0?e.nextSibling:e.previousSibling}return null}function JE(t,e){let n=e.startContainer,r=e.startOffset,s=e.endContainer,i=e.endOffset,a=t.docView.domAtPos(t.state.selection.main.anchor);return j0(a.node,a.offset,s,i)&&([n,r,s,i]=[s,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:i}}function Sle(t,e){if(e.getComposedRanges){let s=e.getComposedRanges(t.root)[0];if(s)return JE(t,s)}let n=null;function r(s){s.preventDefault(),s.stopImmediatePropagation(),n=s.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?JE(t,n):null}class kle{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let s=e.state.selection.main,{anchor:i,head:a}=s,l=this.toEditorPos(r.updateRangeStart),c=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:l,drifted:!1});let d=c-l>r.text.length;l==this.from&&ithis.to&&(c=i);let h=fq(e.state.sliceDoc(l,c),r.text,(d?s.from:s.to)-l,d?"end":null);if(!h){let g=Me.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));g.main.eq(s)||e.dispatch({selection:g,userEvent:"select"});return}let m={from:h.from+l,to:h.toA+l,insert:An.of(r.text.slice(h.from,h.toB).split(` -`))};if((et.mac||et.android)&&m.from==a-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(m={from:l,to:c,insert:An.of([r.text.replace("."," ")])}),this.pendingContextChange=m,!e.state.readOnly){let g=this.to-this.from+(m.to-m.from+m.insert.length);m6(e,m,Me.single(this.toEditorPos(r.selectionStart,g),this.toEditorPos(r.selectionEnd,g)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),m.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let s=[],i=null;for(let a=this.toEditorPos(r.rangeStart),l=this.toEditorPos(r.rangeEnd);a{let s=[];for(let i of r.getTextFormats()){let a=i.underlineStyle,l=i.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(l)){let c=this.toEditorPos(i.rangeStart),d=this.toEditorPos(i.rangeEnd);if(c{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let s=U0(r.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,s=this.pendingContextChange;return e.changes.iterChanges((i,a,l,c,d)=>{if(r)return;let h=d.length-(a-i);if(s&&a>=s.to)if(s.from==i&&s.to==a&&s.insert.eq(d)){s=this.pendingContextChange=null,n+=h,this.to+=h;return}else s=null,this.revertPending(e.state);if(i+=n,a+=n,a<=this.from)this.from+=h,this.to+=h;else if(ithis.to||this.to-this.from+d.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),d.toString()),this.to+=h}n+=h}),s&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(s=>!s.isUserEvent("input.type")&&s.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),s=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(r,s)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Ze{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(s=>s.forEach(i=>r(i,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=e.root||soe(e.parent)||document,this.viewState=new YE(e.state||Nn.create(e)),e.scrollTo&&e.scrollTo.is(o1)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Th).map(s=>new F4(s));for(let s of this.plugins)s.update(this);this.observer=new wle(this),this.inputState=new Qoe(this),this.inputState.ensureHandlers(this.plugins),this.docView=new AE(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let n=e.length==1&&e[0]instanceof ss?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,s,i=this.state;for(let g of e){if(g.startState!=i)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");i=g.state}if(this.destroyed){this.viewState.state=i;return}let a=this.hasFocus,l=0,c=null;e.some(g=>g.annotation(yq))?(this.inputState.notifiedFocused=a,l=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,c=bq(i,a),c||(l=1));let d=this.observer.delayedAndroidKey,h=null;if(d?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(h=null)):this.observer.clear(),i.facet(Nn.phrases)!=this.state.facet(Nn.phrases))return this.setState(i);s=Kv.create(this,i,e),s.flags|=l;let m=this.viewState.scrollTarget;try{this.updateState=2;for(let g of e){if(m&&(m=m.map(g.changes)),g.scrollIntoView){let{main:x}=g.state.selection;m=new Ih(x.empty?x:Me.cursor(x.head,x.head>x.anchor?-1:1))}for(let x of g.effects)x.is(o1)&&(m=x.value.clip(this.state))}this.viewState.update(s,m),this.bidiCache=Jv.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),n=this.docView.update(s),this.state.facet(l0)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(g=>g.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(f1)!=s.state.facet(f1)&&(this.viewState.mustMeasureContent=!0),(n||r||m||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!s.empty)for(let g of this.state.facet(Wk))try{g(s)}catch(x){bi(this.state,x,"update listener")}(c||h)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),h&&!hq(this,h)&&d.force&&zh(this.contentDOM,d.key,d.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new YE(e),this.plugins=e.facet(Th).map(r=>new F4(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new AE(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(Th),r=e.state.facet(Th);if(n!=r){let s=[];for(let i of r){let a=n.indexOf(i);if(a<0)s.push(new F4(i));else{let l=this.plugins[a];l.mustUpdate=e,s.push(l)}}for(let i of this.plugins)i.mustUpdate!=e&&i.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.scrollDOM,s=r.scrollTop*this.scaleY,{scrollAnchorPos:i,scrollAnchorHeight:a}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(a<0)if(RF(r))i=-1,a=this.viewState.heightMap.height;else{let x=this.viewState.scrollAnchorAt(s);i=x.from,a=x.top}this.updateState=1;let c=this.viewState.measure(this);if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let d=[];c&4||([this.measureRequests,d]=[d,this.measureRequests]);let h=d.map(x=>{try{return x.read(this)}catch(y){return bi(this.state,y),e_}}),m=Kv.create(this,this.state,[]),g=!1;m.flags|=c,n?n.flags|=c:n=m,this.updateState=2,m.empty||(this.updatePlugins(m),this.inputState.update(m),this.updateAttrs(),g=this.docView.update(m),g&&this.docViewUpdate());for(let x=0;x1||y<-1){s=s+y,r.scrollTop=s/this.scaleY,a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(Wk))l(n)}get themeClasses(){return Zk+" "+(this.state.facet(Kk)?Oq:kq)+" "+this.state.facet(f1)}updateAttrs(){let e=t_(this,sq,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Ml)?"true":"false",class:"cm-content",style:`${et.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),t_(this,h6,n);let r=this.observer.ignore(()=>{let s=$k(this.contentDOM,this.contentAttrs,n),i=$k(this.dom,this.editorAttrs,e);return s||i});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let s of r.effects)if(s.is(Ze.announce)){n&&(this.announceDOM.textContent=""),n=!1;let i=this.announceDOM.appendChild(document.createElement("div"));i.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(l0);let e=this.state.facet(Ze.cspNonce);Yc.mount(this.root,this.styleModules.concat(yle).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;nr.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return $4(this,e,zE(this,e,n,r))}moveByGroup(e,n){return $4(this,e,zE(this,e,n,r=>Poe(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),s=this.textDirectionAt(e.from),i=r[n?r.length-1:0];return Me.cursor(i.side(n,s)+e.from,i.forward(!n,s)?1:-1)}moveToLineBoundary(e,n,r=!0){return Doe(this,e,n,r)}moveVertically(e,n,r){return $4(this,e,zoe(this,e,n,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){return this.readMeasured(),cq(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let s=this.state.doc.lineAt(e),i=this.bidiSpans(s),a=i[Hc.find(i,e-s.from,-1,n)];return Up(r,a.dir==br.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(eq)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Ole)return UF(e.length);let n=this.textDirectionAt(e.from),r;for(let i of this.bidiCache)if(i.from==e.from&&i.dir==n&&(i.fresh||VF(i.isolates,r=_E(this,e))))return i.order;r||(r=_E(this,e));let s=voe(e.text,n,r);return this.bidiCache.push(new Jv(e.from,e.to,n,r,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||et.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{AF(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return o1.of(new Ih(typeof e=="number"?Me.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return o1.of(new Ih(Me.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Yr.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Yr.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=Yc.newName(),s=[f1.of(r),l0.of(Jk(`.${r}`,e))];return n&&n.dark&&s.push(Kk.of(!0)),s}static baseTheme(e){return uu.lowest(l0.of(Jk("."+Zk,e,jq)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),s=r&&sr.get(r)||sr.get(e);return((n=s?.rootView)===null||n===void 0?void 0:n.view)||null}}Ze.styleModule=l0;Ze.inputHandler=ZF;Ze.clipboardInputFilter=u6;Ze.clipboardOutputFilter=d6;Ze.scrollHandler=nq;Ze.focusChangeEffect=JF;Ze.perLineTextDirection=eq;Ze.exceptionSink=KF;Ze.updateListener=Wk;Ze.editable=Ml;Ze.mouseSelectionStyle=YF;Ze.dragMovesSelection=XF;Ze.clickAddsSelectionRange=GF;Ze.decorations=W0;Ze.outerDecorations=iq;Ze.atomicRanges=Xp;Ze.bidiIsolatedRanges=aq;Ze.scrollMargins=oq;Ze.darkTheme=Kk;Ze.cspNonce=st.define({combine:t=>t.length?t[0]:""});Ze.contentAttributes=h6;Ze.editorAttributes=sq;Ze.lineWrapping=Ze.contentAttributes.of({class:"cm-lineWrapping"});Ze.announce=Qt.define();const Ole=4096,e_={};class Jv{constructor(e,n,r,s,i,a){this.from=e,this.to=n,this.dir=r,this.isolates=s,this.fresh=i,this.order=a}static update(e,n){if(n.empty&&!e.some(i=>i.fresh))return e;let r=[],s=e.length?e[e.length-1].dir:br.LTR;for(let i=Math.max(0,e.length-10);i=0;s--){let i=r[s],a=typeof i=="function"?i(t):i;a&&qk(a,n)}return n}const jle=et.mac?"mac":et.windows?"win":et.linux?"linux":"key";function Nle(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let s,i,a,l;for(let c=0;cr.concat(s),[]))),n}function Tle(t,e,n){return Cq(Nq(t.state),e,t,n)}let Bc=null;const Ele=4e3;function _le(t,e=jle){let n=Object.create(null),r=Object.create(null),s=(a,l)=>{let c=r[a];if(c==null)r[a]=l;else if(c!=l)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},i=(a,l,c,d,h)=>{var m,g;let x=n[a]||(n[a]=Object.create(null)),y=l.split(/ (?!$)/).map(k=>Nle(k,e));for(let k=1;k{let T=Bc={view:N,prefix:j,scope:a};return setTimeout(()=>{Bc==T&&(Bc=null)},Ele),!0}]})}let w=y.join(" ");s(w,!1);let S=x[w]||(x[w]={preventDefault:!1,stopPropagation:!1,run:((g=(m=x._any)===null||m===void 0?void 0:m.run)===null||g===void 0?void 0:g.slice())||[]});c&&S.run.push(c),d&&(S.preventDefault=!0),h&&(S.stopPropagation=!0)};for(let a of t){let l=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let d of l){let h=n[d]||(n[d]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:m}=a;for(let g in h)h[g].run.push(x=>m(x,eO))}let c=a[e]||a.key;if(c)for(let d of l)i(d,c,a.run,a.preventDefault,a.stopPropagation),a.shift&&i(d,"Shift-"+c,a.shift,a.preventDefault,a.stopPropagation)}return n}let eO=null;function Cq(t,e,n,r){eO=e;let s=Zae(e),i=vi(s,0),a=ko(i)==s.length&&s!=" ",l="",c=!1,d=!1,h=!1;Bc&&Bc.view==n&&Bc.scope==r&&(l=Bc.prefix+" ",pq.indexOf(e.keyCode)<0&&(d=!0,Bc=null));let m=new Set,g=S=>{if(S){for(let k of S.run)if(!m.has(k)&&(m.add(k),k(n)))return S.stopPropagation&&(h=!0),!0;S.preventDefault&&(S.stopPropagation&&(h=!0),d=!0)}return!1},x=t[r],y,w;return x&&(g(x[l+m1(s,e,!a)])?c=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!(et.windows&&e.ctrlKey&&e.altKey)&&!(et.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(y=Kc[e.keyCode])&&y!=s?(g(x[l+m1(y,e,!0)])||e.shiftKey&&(w=V0[e.keyCode])!=s&&w!=y&&g(x[l+m1(w,e,!1)]))&&(c=!0):a&&e.shiftKey&&g(x[l+m1(s,e,!0)])&&(c=!0),!c&&g(x._any)&&(c=!0)),d&&(c=!0),c&&h&&e.stopPropagation(),eO=null,c}class Kp{constructor(e,n,r,s,i){this.className=e,this.left=n,this.top=r,this.width=s,this.height=i}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,r){if(r.empty){let s=e.coordsAtPos(r.head,r.assoc||1);if(!s)return[];let i=Tq(e);return[new Kp(n,s.left-i.left,s.top-i.top,null,s.bottom-s.top)]}else return Ale(e,n,r)}}function Tq(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==br.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function r_(t,e,n,r){let s=t.coordsAtPos(e,n*2);if(!s)return r;let i=t.dom.getBoundingClientRect(),a=(s.top+s.bottom)/2,l=t.posAtCoords({x:i.left+1,y:a}),c=t.posAtCoords({x:i.right-1,y:a});return l==null||c==null?r:{from:Math.max(r.from,Math.min(l,c)),to:Math.min(r.to,Math.max(l,c))}}function Ale(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),s=Math.min(n.to,t.viewport.to),i=t.textDirection==br.LTR,a=t.contentDOM,l=a.getBoundingClientRect(),c=Tq(t),d=a.querySelector(".cm-line"),h=d&&window.getComputedStyle(d),m=l.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),g=l.right-(h?parseInt(h.paddingRight):0),x=Xk(t,r,1),y=Xk(t,s,-1),w=x.type==ri.Text?x:null,S=y.type==ri.Text?y:null;if(w&&(t.lineWrapping||x.widgetLineBreaks)&&(w=r_(t,r,1,w)),S&&(t.lineWrapping||y.widgetLineBreaks)&&(S=r_(t,s,-1,S)),w&&S&&w.from==S.from&&w.to==S.to)return j(N(n.from,n.to,w));{let E=w?N(n.from,null,w):T(x,!1),_=S?N(null,n.to,S):T(y,!0),A=[];return(w||x).to<(S||y).from-(w&&S?1:0)||x.widgetLineBreaks>1&&E.bottom+t.defaultLineHeight/2<_.top?A.push(k(m,E.bottom,g,_.top)):E.bottom<_.top&&t.elementAtHeight((E.bottom+_.top)/2).type==ri.Text&&(E.bottom=_.top=(E.bottom+_.top)/2),j(E).concat(A).concat(j(_))}function k(E,_,A,D){return new Kp(e,E-c.left,_-c.top,A-E,D-_)}function j({top:E,bottom:_,horizontal:A}){let D=[];for(let q=0;qW&&I.from=L)break;R>V&&H(Math.max(Y,V),E==null&&Y<=W,Math.min(R,L),_==null&&R>=ee,K.dir)}if(V=$.to+1,V>=L)break}return B.length==0&&H(W,E==null,ee,_==null,t.textDirection),{top:D,bottom:q,horizontal:B}}function T(E,_){let A=l.top+(_?E.top:E.bottom);return{top:A,bottom:A,horizontal:[]}}}function Mle(t,e){return t.constructor==e.constructor&&t.eq(e)}class Rle{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(gv)!=e.state.facet(gv)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,r=e.facet(gv);for(;n!Mle(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let s of e)s.update&&n&&s.constructor&&this.drawn[r].constructor&&s.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(s.draw(),n);for(;n;){let s=n.nextSibling;n.remove(),n=s}this.drawn=e,et.safari&&et.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const gv=st.define();function Eq(t){return[Yr.define(e=>new Rle(e,t)),gv.of(t)]}const G0=st.define({combine(t){return Vo(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function Dle(t={}){return[G0.of(t),Ple,zle,Ile,tq.of(!0)]}function _q(t){return t.startState.facet(G0)!=t.state.facet(G0)}const Ple=Eq({above:!0,markers(t){let{state:e}=t,n=e.facet(G0),r=[];for(let s of e.selection.ranges){let i=s==e.selection.main;if(s.empty||n.drawRangeCursor){let a=i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:Me.cursor(s.head,s.head>s.anchor?-1:1);for(let c of Kp.forRange(t,a,l))r.push(c)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=_q(t);return n&&s_(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){s_(e.state,t)},class:"cm-cursorLayer"});function s_(t,e){e.style.animationDuration=t.facet(G0).cursorBlinkRate+"ms"}const zle=Eq({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:Kp.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||_q(t)},class:"cm-selectionLayer"}),Ile=uu.highest(Ze.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),Aq=Qt.define({map(t,e){return t==null?null:e.mapPos(t)}}),d0=Os.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(Aq)?r.value:n,t)}}),Lle=Yr.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let n=t.state.field(d0);n==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(d0)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(d0),n=e!=null&&t.coordsAtPos(e);if(!n)return null;let r=t.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+t.scrollDOM.scrollLeft*t.scaleX,top:n.top-r.top+t.scrollDOM.scrollTop*t.scaleY,height:n.bottom-n.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:n}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/n+"px",this.cursor.style.height=t.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(d0)!=t&&this.view.dispatch({effects:Aq.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Ble(){return[d0,Lle]}function i_(t,e,n,r,s){e.lastIndex=0;for(let i=t.iterRange(n,r),a=n,l;!i.next().done;a+=i.value.length)if(!i.lineBreak)for(;l=e.exec(i.value);)s(a+l.index,l)}function Fle(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:s,to:i}of n)s=Math.max(t.state.doc.lineAt(s).from,s-e),i=Math.min(t.state.doc.lineAt(i).to,i+e),r.length&&r[r.length-1].to>=s?r[r.length-1].to=i:r.push({from:s,to:i});return r}class qle{constructor(e){const{regexp:n,decoration:r,decorate:s,boundary:i,maxLength:a=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,s)this.addMatch=(l,c,d,h)=>s(h,d,d+l[0].length,l,c);else if(typeof r=="function")this.addMatch=(l,c,d,h)=>{let m=r(l,c,d);m&&h(d,d+l[0].length,m)};else if(r)this.addMatch=(l,c,d,h)=>h(d,d+l[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=i,this.maxLength=a}createDeco(e){let n=new Hl,r=n.add.bind(n);for(let{from:s,to:i}of Fle(e,this.maxLength))i_(e.state.doc,this.regexp,s,i,(a,l)=>this.addMatch(l,e,a,r));return n.finish()}updateDeco(e,n){let r=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((i,a,l,c)=>{c>=e.view.viewport.from&&l<=e.view.viewport.to&&(r=Math.min(l,r),s=Math.max(c,s))}),e.viewportMoved||s-r>1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,n.map(e.changes),r,s):n}updateRange(e,n,r,s){for(let i of e.visibleRanges){let a=Math.max(i.from,r),l=Math.min(i.to,s);if(l>=a){let c=e.state.doc.lineAt(a),d=c.toc.from;a--)if(this.boundary.test(c.text[a-1-c.from])){h=a;break}for(;lg.push(k.range(w,S));if(c==d)for(this.regexp.lastIndex=h-c.from;(x=this.regexp.exec(c.text))&&x.indexthis.addMatch(S,e,w,y));n=n.update({filterFrom:h,filterTo:m,filter:(w,S)=>wm,add:g})}}return n}}const tO=/x/.unicode!=null?"gu":"g",$le=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,tO),Hle={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let V4=null;function Qle(){var t;if(V4==null&&typeof document<"u"&&document.body){let e=document.body.style;V4=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return V4||!1}const xv=st.define({combine(t){let e=Vo(t,{render:null,specialChars:$le,addSpecialChars:null});return(e.replaceTabs=!Qle())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,tO)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,tO)),e}});function Vle(t={}){return[xv.of(t),Ule()]}let a_=null;function Ule(){return a_||(a_=Yr.fromClass(class{constructor(t){this.view=t,this.decorations=Ot.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(xv)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new qle({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:s}=n.state,i=vi(e[0],0);if(i==9){let a=s.lineAt(r),l=n.state.tabSize,c=Cf(a.text,l,r-a.from);return Ot.replace({widget:new Yle((l-c%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[i]||(this.decorationCache[i]=Ot.replace({widget:new Xle(t,i)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(xv);t.startState.facet(xv)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const Wle="•";function Gle(t){return t>=32?Wle:t==10?"␤":String.fromCharCode(9216+t)}class Xle extends Uo{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=Gle(this.code),r=e.state.phrase("Control character")+" "+(Hle[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,r,n);if(s)return s;let i=document.createElement("span");return i.textContent=n,i.title=r,i.setAttribute("aria-label",r),i.className="cm-specialChar",i}ignoreEvent(){return!1}}class Yle extends Uo{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function Kle(){return Jle}const Zle=Ot.line({class:"cm-activeLine"}),Jle=Yr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let s=t.lineBlockAt(r.head);s.from>e&&(n.push(Zle.range(s.from)),e=s.from)}return Ot.set(n)}},{decorations:t=>t.decorations});class ece extends Uo{constructor(e){super(),this.content=e}toDOM(e){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(e){let n=e.firstChild?Jh(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),s=Up(n[0],r.direction!="rtl"),i=parseInt(r.lineHeight);return s.bottom-s.top>i*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+i}:s}ignoreEvent(){return!1}}function tce(t){let e=Yr.fromClass(class{constructor(n){this.view=n,this.placeholder=t?Ot.set([Ot.widget({widget:new ece(t),side:1}).range(0)]):Ot.none}get decorations(){return this.view.state.doc.length?Ot.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,Ze.contentAttributes.of({"aria-placeholder":t})]:e}const nO=2e3;function nce(t,e,n){let r=Math.min(e.line,n.line),s=Math.max(e.line,n.line),i=[];if(e.off>nO||n.off>nO||e.col<0||n.col<0){let a=Math.min(e.off,n.off),l=Math.max(e.off,n.off);for(let c=r;c<=s;c++){let d=t.doc.line(c);d.length<=l&&i.push(Me.range(d.from+a,d.to+l))}}else{let a=Math.min(e.col,n.col),l=Math.max(e.col,n.col);for(let c=r;c<=s;c++){let d=t.doc.line(c),h=Rk(d.text,a,t.tabSize,!0);if(h<0)i.push(Me.cursor(d.to));else{let m=Rk(d.text,l,t.tabSize);i.push(Me.range(d.from+h,d.from+m))}}}return i}function rce(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function o_(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),s=n-r.from,i=s>nO?-1:s==r.length?rce(t,e.clientX):Cf(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:i,off:s}}function sce(t,e){let n=o_(t,e),r=t.state.selection;return n?{update(s){if(s.docChanged){let i=s.changes.mapPos(s.startState.doc.line(n.line).from),a=s.state.doc.lineAt(i);n={line:a.number,col:n.col,off:Math.min(n.off,a.length)},r=r.map(s.changes)}},get(s,i,a){let l=o_(t,s);if(!l)return r;let c=nce(t.state,n,l);return c.length?a?Me.create(c.concat(r.ranges)):Me.create(c):r}}:null}function ice(t){let e=(n=>n.altKey&&n.button==0);return Ze.mouseSelectionStyle.of((n,r)=>e(r)?sce(n,r):null)}const ace={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},oce={style:"cursor: crosshair"};function lce(t={}){let[e,n]=ace[t.key||"Alt"],r=Yr.fromClass(class{constructor(s){this.view=s,this.isDown=!1}set(s){this.isDown!=s&&(this.isDown=s,this.view.update([]))}},{eventObservers:{keydown(s){this.set(s.keyCode==e||n(s))},keyup(s){(s.keyCode==e||!n(s))&&this.set(!1)},mousemove(s){this.set(n(s))}}});return[r,Ze.contentAttributes.of(s=>{var i;return!((i=s.plugin(r))===null||i===void 0)&&i.isDown?oce:null})]}const p1="-10000px";class Mq{constructor(e,n,r,s){this.facet=n,this.createTooltipView=r,this.removeTooltipView=s,this.input=e.state.facet(n),this.tooltips=this.input.filter(a=>a);let i=null;this.tooltipViews=this.tooltips.map(a=>i=r(a,i))}update(e,n){var r;let s=e.state.facet(this.facet),i=s.filter(c=>c);if(s===this.input){for(let c of this.tooltipViews)c.update&&c.update(e);return!1}let a=[],l=n?[]:null;for(let c=0;cn[d]=c),n.length=l.length),this.input=s,this.tooltips=i,this.tooltipViews=a,!0}}function cce(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const U4=st.define({combine:t=>{var e,n,r;return{position:et.ios?"absolute":((e=t.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(s=>s.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(s=>s.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||cce}}}),l_=new WeakMap,x6=Yr.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(U4);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Mq(t,v6,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,r=t.state.facet(U4);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),r=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let s=document.createElement("div");s.className="cm-tooltip-arrow",n.dom.appendChild(s)}return n.dom.style.position=this.position,n.dom.style.top=p1,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(t=r.destroy)===null||t===void 0||t.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(et.safari){let a=i.getBoundingClientRect();n=Math.abs(a.top+1e4)>1||Math.abs(a.left)>1}else n=!!i.offsetParent&&i.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(t=i.width/this.parent.offsetWidth,e=i.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),s=f6(this.view);return{visible:{left:r.left+s.left,top:r.top+s.top,right:r.right-s.right,bottom:r.bottom-s.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((i,a)=>{let l=this.manager.tooltipViews[a];return l.getCoords?l.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(U4).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:n,space:r,scaleX:s,scaleY:i}=t,a=[];for(let l=0;l=Math.min(n.bottom,r.bottom)||m.rightMath.min(n.right,r.right)+.1)){h.style.top=p1;continue}let x=c.arrow?d.dom.querySelector(".cm-tooltip-arrow"):null,y=x?7:0,w=g.right-g.left,S=(e=l_.get(d))!==null&&e!==void 0?e:g.bottom-g.top,k=d.offset||dce,j=this.view.textDirection==br.LTR,N=g.width>r.right-r.left?j?r.left:r.right-g.width:j?Math.max(r.left,Math.min(m.left-(x?14:0)+k.x,r.right-w)):Math.min(Math.max(r.left,m.left-w+(x?14:0)-k.x),r.right-w),T=this.above[l];!c.strictSide&&(T?m.top-S-y-k.yr.bottom)&&T==r.bottom-m.bottom>m.top-r.top&&(T=this.above[l]=!T);let E=(T?m.top-r.top:r.bottom-m.bottom)-y;if(EN&&D.top<_+S&&D.bottom>_&&(_=T?D.top-S-2-y:D.bottom+y+2);if(this.position=="absolute"?(h.style.top=(_-t.parent.top)/i+"px",c_(h,(N-t.parent.left)/s)):(h.style.top=_/i+"px",c_(h,N/s)),x){let D=m.left+(j?k.x:-k.x)-(N+14-7);x.style.left=D/s+"px"}d.overlap!==!0&&a.push({left:N,top:_,right:A,bottom:_+S}),h.classList.toggle("cm-tooltip-above",T),h.classList.toggle("cm-tooltip-below",!T),d.positioned&&d.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=p1}},{eventObservers:{scroll(){this.maybeMeasure()}}});function c_(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}const uce=Ze.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),dce={x:0,y:0},v6=st.define({enables:[x6,uce]}),ey=st.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class pb{static create(e){return new pb(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Mq(e,ey,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(e,n){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let r of this.manager.tooltipViews){let s=r[e];if(s!==void 0){if(n===void 0)n=s;else if(n!==s)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const hce=v6.compute([ey],t=>{let e=t.facet(ey);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:pb.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class fce{constructor(e,n,r,s,i){this.view=e,this.source=n,this.field=r,this.setHover=s,this.hoverTime=i,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;el.bottom||n.xl.right+e.defaultCharacterWidth)return;let c=e.bidiSpans(e.state.doc.lineAt(s)).find(h=>h.from<=s&&h.to>=s),d=c&&c.dir==br.RTL?-1:1;i=n.x{this.pending==l&&(this.pending=null,c&&!(Array.isArray(c)&&!c.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(c)?c:[c])}))},c=>bi(e.state,c,"hover tooltip"))}else a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])})}get tooltip(){let e=this.view.plugin(x6),n=e?e.manager.tooltips.findIndex(r=>r.create==pb.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:s,tooltip:i}=this;if(s.length&&i&&!mce(i.dom,e)||this.pending){let{pos:a}=s[0]||this.pending,l=(r=(n=s[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:a;(a==l?this.view.posAtCoords(this.lastMove)!=a:!pce(this.view,a,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=r=>{e.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const g1=4;function mce(t,e){let{left:n,right:r,top:s,bottom:i}=t.getBoundingClientRect(),a;if(a=t.querySelector(".cm-tooltip-arrow")){let l=a.getBoundingClientRect();s=Math.min(l.top,s),i=Math.max(l.bottom,i)}return e.clientX>=n-g1&&e.clientX<=r+g1&&e.clientY>=s-g1&&e.clientY<=i+g1}function pce(t,e,n,r,s,i){let a=t.scrollDOM.getBoundingClientRect(),l=t.documentTop+t.documentPadding.top+t.contentHeight;if(a.left>r||a.rights||Math.min(a.bottom,l)=e&&c<=n}function gce(t,e={}){let n=Qt.define(),r=Os.define({create(){return[]},update(s,i){if(s.length&&(e.hideOnChange&&(i.docChanged||i.selection)?s=[]:e.hideOn&&(s=s.filter(a=>!e.hideOn(i,a))),i.docChanged)){let a=[];for(let l of s){let c=i.changes.mapPos(l.pos,-1,Ds.TrackDel);if(c!=null){let d=Object.assign(Object.create(null),l);d.pos=c,d.end!=null&&(d.end=i.changes.mapPos(d.end)),a.push(d)}}s=a}for(let a of i.effects)a.is(n)&&(s=a.value),a.is(xce)&&(s=[]);return s},provide:s=>ey.from(s)});return{active:r,extension:[r,Yr.define(s=>new fce(s,t,r,n,e.hoverTime||300)),hce]}}function Rq(t,e){let n=t.plugin(x6);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const xce=Qt.define(),u_=st.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function X0(t,e){let n=t.plugin(Dq),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const Dq=Yr.fromClass(class{constructor(t){this.input=t.state.facet(Y0),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(u_);this.top=new x1(t,!0,e.topContainer),this.bottom=new x1(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(u_);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new x1(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new x1(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(Y0);if(n!=this.input){let r=n.filter(c=>c),s=[],i=[],a=[],l=[];for(let c of r){let d=this.specs.indexOf(c),h;d<0?(h=c(t.view),l.push(h)):(h=this.panels[d],h.update&&h.update(t)),s.push(h),(h.top?i:a).push(h)}this.specs=r,this.panels=s,this.top.sync(i),this.bottom.sync(a);for(let c of l)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>Ze.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class x1{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=d_(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=d_(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function d_(t){let e=t.nextSibling;return t.remove(),e}const Y0=st.define({enables:Dq});class Vl extends od{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Vl.prototype.elementClass="";Vl.prototype.toDOM=void 0;Vl.prototype.mapMode=Ds.TrackBefore;Vl.prototype.startSide=Vl.prototype.endSide=-1;Vl.prototype.point=!0;const vv=st.define(),vce=st.define(),yce={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Bn.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},T0=st.define();function bce(t){return[Pq(),T0.of({...yce,...t})]}const h_=st.define({combine:t=>t.some(e=>e)});function Pq(t){return[wce]}const wce=Yr.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(T0).map(e=>new m_(t,e)),this.fixed=!t.state.facet(h_);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(h_)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Bn.iter(this.view.state.facet(vv),this.view.viewport.from),r=[],s=this.gutters.map(i=>new Sce(i,this.view.viewport,-this.view.documentPadding.top));for(let i of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(i.type)){let a=!0;for(let l of i.type)if(l.type==ri.Text&&a){rO(n,r,l.from);for(let c of s)c.line(this.view,l,r);a=!1}else if(l.widget)for(let c of s)c.widget(this.view,l)}else if(i.type==ri.Text){rO(n,r,i.from);for(let a of s)a.line(this.view,i,r)}else if(i.widget)for(let a of s)a.widget(this.view,i);for(let i of s)i.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(T0),n=t.state.facet(T0),r=t.docChanged||t.heightChanged||t.viewportChanged||!Bn.eq(t.startState.facet(vv),t.state.facet(vv),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let s of this.gutters)s.update(t)&&(r=!0);else{r=!0;let s=[];for(let i of n){let a=e.indexOf(i);a<0?s.push(new m_(this.view,i)):(this.gutters[a].update(t),s.push(this.gutters[a]))}for(let i of this.gutters)i.dom.remove(),s.indexOf(i)<0&&i.destroy();for(let i of s)i.config.side=="after"?this.getDOMAfter().appendChild(i.dom):this.dom.appendChild(i.dom);this.gutters=s}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>Ze.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,s=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==br.LTR?{left:r,right:s}:{right:r,left:s}})});function f_(t){return Array.isArray(t)?t:[t]}function rO(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class Sce{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Bn.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:s}=this,i=(n.top-this.height)/e.scaleY,a=n.height/e.scaleY;if(this.i==s.elements.length){let l=new zq(e,a,i,r);s.elements.push(l),s.dom.appendChild(l.dom)}else s.elements[this.i].update(e,a,i,r);this.height=n.bottom,this.i++}line(e,n,r){let s=[];rO(this.cursor,s,n.from),r.length&&(s=s.concat(r));let i=this.gutter.config.lineMarker(e,n,s);i&&s.unshift(i);let a=this.gutter;s.length==0&&!a.config.renderEmptyElements||this.addElement(e,n,s)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),s=r?[r]:null;for(let i of e.state.facet(vce)){let a=i(e,n.widget,n);a&&(s||(s=[])).push(a)}s&&this.addElement(e,n,s)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class m_{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,s=>{let i=s.target,a;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let c=i.getBoundingClientRect();a=(c.top+c.bottom)/2}else a=s.clientY;let l=e.lineBlockAtHeight(a-e.documentTop);n.domEventHandlers[r](e,l,s)&&s.preventDefault()});this.markers=f_(n.markers(e)),n.initialSpacer&&(this.spacer=new zq(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=f_(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let r=e.view.viewport;return!Bn.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class zq{constructor(e,n,r,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,s)}update(e,n,r,s){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),kce(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,n){let r="cm-gutterElement",s=this.dom.firstChild;for(let i=0,a=0;;){let l=a,c=ii(l,c,d)||a(l,c,d):a}return r}})}});class W4 extends Vl{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function G4(t,e){return t.state.facet(Eh).formatNumber(e,t.state)}const Nce=T0.compute([Eh],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(Oce)},lineMarker(e,n,r){return r.some(s=>s.toDOM)?null:new W4(G4(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let s of e.state.facet(jce)){let i=s(e,n,r);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(Eh)!=e.state.facet(Eh),initialSpacer(e){return new W4(G4(e,p_(e.state.doc.lines)))},updateSpacer(e,n){let r=G4(n.view,p_(n.view.state.doc.lines));return r==e.number?e:new W4(r)},domEventHandlers:t.facet(Eh).domEventHandlers,side:"before"}));function Cce(t={}){return[Eh.of(t),Pq(),Nce]}function p_(t){let e=9;for(;e{let e=[],n=-1;for(let r of t.selection.ranges){let s=t.doc.lineAt(r.head).from;s>n&&(n=s,e.push(Tce.range(s)))}return Bn.of(e)});function _ce(){return Ece}const Iq=1024;let Ace=0;class X4{constructor(e,n){this.from=e,this.to=n}}class an{constructor(e={}){this.id=Ace++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=ai.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}an.closedBy=new an({deserialize:t=>t.split(" ")});an.openedBy=new an({deserialize:t=>t.split(" ")});an.group=new an({deserialize:t=>t.split(" ")});an.isolate=new an({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});an.contextHash=new an({perNode:!0});an.lookAhead=new an({perNode:!0});an.mounted=new an({perNode:!0});class ty{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[an.mounted.id]}}const Mce=Object.create(null);class ai{constructor(e,n,r,s=0){this.name=e,this.props=n,this.id=r,this.flags=s}static define(e){let n=e.props&&e.props.length?Object.create(null):Mce,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new ai(e.name||"",n,e.id,r);if(e.props){for(let i of e.props)if(Array.isArray(i)||(i=i(s)),i){if(i[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[i[0].id]=i[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(an.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let s of r.split(" "))n[s]=e[r];return r=>{for(let s=r.prop(an.group),i=-1;i<(s?s.length:0);i++){let a=n[i<0?r.name:s[i]];if(a)return a}}}}ai.none=new ai("",Object.create(null),0,8);class gb{constructor(e){this.types=e;for(let n=0;n0;for(let c=this.cursor(a|hs.IncludeAnonymous);;){let d=!1;if(c.from<=i&&c.to>=s&&(!l&&c.type.isAnonymous||n(c)!==!1)){if(c.firstChild())continue;d=!0}for(;d&&r&&(l||!c.type.isAnonymous)&&r(c),!c.nextSibling();){if(!c.parent())return;d=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:w6(ai.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,s)=>new ur(this.type,n,r,s,this.propValues),e.makeTree||((n,r,s)=>new ur(ai.none,n,r,s)))}static build(e){return zce(e)}}ur.empty=new ur(ai.none,[],[],0);class y6{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new y6(this.buffer,this.index)}}class Jc{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return ai.none}toString(){let e=[];for(let n=0;n0));c=a[c+3]);return l}slice(e,n,r){let s=this.buffer,i=new Uint16Array(n-e),a=0;for(let l=e,c=0;l=e&&ne;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function K0(t,e,n,r){for(var s;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to0?l.length:-1;e!=d;e+=n){let h=l[e],m=c[e]+a.from;if(Lq(s,r,m,m+h.length)){if(h instanceof Jc){if(i&hs.ExcludeBuffers)continue;let g=h.findChild(0,h.buffer.length,n,r-m,s);if(g>-1)return new Co(new Rce(a,h,e,m),null,g)}else if(i&hs.IncludeAnonymous||!h.type.isAnonymous||b6(h)){let g;if(!(i&hs.IgnoreMounts)&&(g=ty.get(h))&&!g.overlay)return new Ni(g.tree,m,e,a);let x=new Ni(h,m,e,a);return i&hs.IncludeAnonymous||!x.type.isAnonymous?x:x.nextChild(n<0?h.children.length-1:0,n,r,s)}}}if(i&hs.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+n:e=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let s;if(!(r&hs.IgnoreOverlays)&&(s=ty.get(this._tree))&&s.overlay){let i=e-this.from;for(let{from:a,to:l}of s.overlay)if((n>0?a<=i:a=i:l>i))return new Ni(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function x_(t,e,n,r){let s=t.cursor(),i=[];if(!s.firstChild())return i;if(n!=null){for(let a=!1;!a;)if(a=s.type.is(n),!s.nextSibling())return i}for(;;){if(r!=null&&s.type.is(r))return i;if(s.type.is(e)&&i.push(s.node),!s.nextSibling())return r==null?i:[]}}function sO(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class Rce{constructor(e,n,r,s){this.parent=e,this.buffer=n,this.index=r,this.start=s}}class Co extends Bq{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:s}=this.context,i=s.findChild(this.index+4,s.buffer[this.index+3],e,n-this.context.start,r);return i<0?null:new Co(this.context,this,i)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&hs.ExcludeBuffers)return null;let{buffer:s}=this.context,i=s.findChild(this.index+4,s.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return i<0?null:new Co(this.context,this,i)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Co(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Co(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,s=this.index+4,i=r.buffer[this.index+3];if(i>s){let a=r.buffer[this.index+1];e.push(r.slice(s,i,a)),n.push(0)}return new ur(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Fq(t){if(!t.length)return null;let e=0,n=t[0];for(let i=1;in.from||a.to=e){let l=new Ni(a.tree,a.overlay[0].from+i.from,-1,i);(s||(s=[r])).push(K0(l,e,n,!1))}}return s?Fq(s):r}class iO{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Ni)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:s}=this.buffer;return this.type=n||s.set.types[s.buffer[e]],this.from=r+s.buffer[e+1],this.to=r+s.buffer[e+2],!0}yield(e){return e?e instanceof Ni?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:s}=this.buffer,i=s.findChild(this.index+4,s.buffer[this.index+3],e,n-this.buffer.start,r);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&hs.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&hs.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&hs.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let s=r<0?0:this.stack[r]+4;if(this.index!=s)return this.yieldBuf(n.findChild(s,this.index,-1,0,4))}else{let s=n.buffer[this.index+3];if(s<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(s)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:s}=this;if(s){if(e>0){if(this.index-1)for(let i=n+e,a=e<0?-1:r._tree.children.length;i!=a;i+=e){let l=r._tree.children[i];if(this.mode&hs.IncludeAnonymous||l instanceof Jc||!l.type.isAnonymous||b6(l))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to=0;){for(let a=e;a;a=a._parent)if(a.index==s){if(s==this.index)return a;n=a,r=i+1;break e}s=this.stack[--i]}for(let s=r;s=0;i--){if(i<0)return sO(this._tree,e,s);let a=r[n.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[s]&&e[s]!=a.name)return!1;s--}}return!0}}function b6(t){return t.children.some(e=>e instanceof Jc||!e.type.isAnonymous||b6(e))}function zce(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:s=Iq,reused:i=[],minRepeatType:a=r.types.length}=t,l=Array.isArray(n)?new y6(n,n.length):n,c=r.types,d=0,h=0;function m(E,_,A,D,q,B){let{id:H,start:W,end:ee,size:I}=l,V=h,L=d;if(I<0)if(l.next(),I==-1){let ie=i[H];A.push(ie),D.push(W-E);return}else if(I==-3){d=H;return}else if(I==-4){h=H;return}else throw new RangeError(`Unrecognized record size: ${I}`);let $=c[H],K,Y,R=W-E;if(ee-W<=s&&(Y=S(l.pos-_,q))){let ie=new Uint16Array(Y.size-Y.skip),X=l.pos-Y.size,z=ie.length;for(;l.pos>X;)z=k(Y.start,ie,z);K=new Jc(ie,ee-Y.start,r),R=Y.start-E}else{let ie=l.pos-I;l.next();let X=[],z=[],U=H>=a?H:-1,te=0,ne=ee;for(;l.pos>ie;)U>=0&&l.id==U&&l.size>=0?(l.end<=ne-s&&(y(X,z,W,te,l.end,ne,U,V,L),te=X.length,ne=l.end),l.next()):B>2500?g(W,ie,X,z):m(W,ie,X,z,U,B+1);if(U>=0&&te>0&&te-1&&te>0){let G=x($,L);K=w6($,X,z,0,X.length,0,ee-W,G,G)}else K=w($,X,z,ee-W,V-ee,L)}A.push(K),D.push(R)}function g(E,_,A,D){let q=[],B=0,H=-1;for(;l.pos>_;){let{id:W,start:ee,end:I,size:V}=l;if(V>4)l.next();else{if(H>-1&&ee=0;I-=3)W[V++]=q[I],W[V++]=q[I+1]-ee,W[V++]=q[I+2]-ee,W[V++]=V;A.push(new Jc(W,q[2]-ee,r)),D.push(ee-E)}}function x(E,_){return(A,D,q)=>{let B=0,H=A.length-1,W,ee;if(H>=0&&(W=A[H])instanceof ur){if(!H&&W.type==E&&W.length==q)return W;(ee=W.prop(an.lookAhead))&&(B=D[H]+W.length+ee)}return w(E,A,D,q,B,_)}}function y(E,_,A,D,q,B,H,W,ee){let I=[],V=[];for(;E.length>D;)I.push(E.pop()),V.push(_.pop()+A-q);E.push(w(r.types[H],I,V,B-q,W-B,ee)),_.push(q-A)}function w(E,_,A,D,q,B,H){if(B){let W=[an.contextHash,B];H=H?[W].concat(H):[W]}if(q>25){let W=[an.lookAhead,q];H=H?[W].concat(H):[W]}return new ur(E,_,A,D,H)}function S(E,_){let A=l.fork(),D=0,q=0,B=0,H=A.end-s,W={size:0,start:0,skip:0};e:for(let ee=A.pos-E;A.pos>ee;){let I=A.size;if(A.id==_&&I>=0){W.size=D,W.start=q,W.skip=B,B+=4,D+=4,A.next();continue}let V=A.pos-I;if(I<0||V=a?4:0,$=A.start;for(A.next();A.pos>V;){if(A.size<0)if(A.size==-3)L+=4;else break e;else A.id>=a&&(L+=4);A.next()}q=$,D+=I,B+=L}return(_<0||D==E)&&(W.size=D,W.start=q,W.skip=B),W.size>4?W:void 0}function k(E,_,A){let{id:D,start:q,end:B,size:H}=l;if(l.next(),H>=0&&D4){let ee=l.pos-(H-4);for(;l.pos>ee;)A=k(E,_,A)}_[--A]=W,_[--A]=B-E,_[--A]=q-E,_[--A]=D}else H==-3?d=D:H==-4&&(h=D);return A}let j=[],N=[];for(;l.pos>0;)m(t.start||0,t.bufferStart||0,j,N,-1,0);let T=(e=t.length)!==null&&e!==void 0?e:j.length?N[0]+j[0].length:0;return new ur(c[t.topID],j.reverse(),N.reverse(),T)}const v_=new WeakMap;function yv(t,e){if(!t.isAnonymous||e instanceof Jc||e.type!=t)return 1;let n=v_.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof ur)){n=1;break}n+=yv(t,r)}v_.set(e,n)}return n}function w6(t,e,n,r,s,i,a,l,c){let d=0;for(let y=r;y=h)break;_+=A}if(N==T+1){if(_>h){let A=y[T];x(A.children,A.positions,0,A.children.length,w[T]+j);continue}m.push(y[T])}else{let A=w[N-1]+y[N-1].length-E;m.push(w6(t,y,w,T,N,E,A,null,c))}g.push(E+j-i)}}return x(e,n,r,s,0),(l||c)(m,g,a)}class Ice{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof Co?this.setBuffer(e.context.buffer,e.index,n):e instanceof Ni&&this.map.set(e.tree,n)}get(e){return e instanceof Co?this.getBuffer(e.context.buffer,e.index):e instanceof Ni?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class rd{constructor(e,n,r,s,i=!1,a=!1){this.from=e,this.to=n,this.tree=r,this.offset=s,this.open=(i?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let s=[new rd(0,e.length,e,0,!1,r)];for(let i of n)i.to>e.length&&s.push(i);return s}static applyChanges(e,n,r=128){if(!n.length)return e;let s=[],i=1,a=e.length?e[0]:null;for(let l=0,c=0,d=0;;l++){let h=l=r)for(;a&&a.from=g.from||m<=g.to||d){let x=Math.max(g.from,c)-d,y=Math.min(g.to,m)-d;g=x>=y?null:new rd(x,y,g.tree,g.offset+d,l>0,!!h)}if(g&&s.push(g),a.to>m)break;a=inew X4(s.from,s.to)):[new X4(0,0)]:[new X4(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let s=this.startParse(e,n,r);for(;;){let i=s.advance();if(i)return i}}};class Lce{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new an({perNode:!0});let Bce=0;class ga{constructor(e,n,r,s){this.name=e,this.set=n,this.base=r,this.modified=s,this.id=Bce++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof ga&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let s=new ga(r,[],null,[]);if(s.set.push(s),n)for(let i of n.set)s.set.push(i);return s}static defineModifier(e){let n=new ny(e);return r=>r.modified.indexOf(n)>-1?r:ny.get(r.base||r,r.modified.concat(n).sort((s,i)=>s.id-i.id))}}let Fce=0;class ny{constructor(e){this.name=e,this.instances=[],this.id=Fce++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(l=>l.base==e&&qce(n,l.modified));if(r)return r;let s=[],i=new ga(e.name,s,e,n);for(let l of n)l.instances.push(i);let a=$ce(n);for(let l of e.set)if(!l.modified.length)for(let c of a)s.push(ny.get(l,c));return i}}function qce(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function $ce(t){let e=[[]];for(let n=0;nr.length-n.length)}function k6(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let s of n.split(" "))if(s){let i=[],a=2,l=s;for(let m=0;;){if(l=="..."&&m>0&&m+3==s.length){a=1;break}let g=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!g)throw new RangeError("Invalid path: "+s);if(i.push(g[0]=="*"?"":g[0][0]=='"'?JSON.parse(g[0]):g[0]),m+=g[0].length,m==s.length)break;let x=s[m++];if(m==s.length&&x=="!"){a=0;break}if(x!="/")throw new RangeError("Invalid path: "+s);l=s.slice(m)}let c=i.length-1,d=i[c];if(!d)throw new RangeError("Invalid path: "+s);let h=new Z0(r,a,c>0?i.slice(0,c):null);e[d]=h.sort(e[d])}}return qq.add(e)}const qq=new an({combine(t,e){let n,r,s;for(;t||e;){if(!t||e&&t.depth>=e.depth?(s=e,e=e.next):(s=t,t=t.next),n&&n.mode==s.mode&&!s.context&&!n.context)continue;let i=new Z0(s.tags,s.mode,s.context);n?n.next=i:r=i,n=i}return r}});class Z0{constructor(e,n,r,s){this.tags=e,this.mode=n,this.context=r,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let a=s;for(let l of i)for(let c of l.set){let d=n[c.id];if(d){a=a?a+" "+d:d;break}}return a},scope:r}}function Hce(t,e){let n=null;for(let r of t){let s=r.style(e);s&&(n=n?n+" "+s:s)}return n}function Qce(t,e,n,r=0,s=t.length){let i=new Vce(r,Array.isArray(e)?e:[e],n);i.highlightRange(t.cursor(),r,s,"",i.highlighters),i.flush(s)}class Vce{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,s,i){let{type:a,from:l,to:c}=e;if(l>=r||c<=n)return;a.isTop&&(i=this.highlighters.filter(x=>!x.scope||x.scope(a)));let d=s,h=Uce(e)||Z0.empty,m=Hce(i,h.tags);if(m&&(d&&(d+=" "),d+=m,h.mode==1&&(s+=(s?" ":"")+m)),this.startSpan(Math.max(n,l),d),h.opaque)return;let g=e.tree&&e.tree.prop(an.mounted);if(g&&g.overlay){let x=e.node.enter(g.overlay[0].from+l,1),y=this.highlighters.filter(S=>!S.scope||S.scope(g.tree.type)),w=e.firstChild();for(let S=0,k=l;;S++){let j=S=N||!e.nextSibling())););if(!j||N>r)break;k=j.to+l,k>n&&(this.highlightRange(x.cursor(),Math.max(n,j.from+l),Math.min(r,k),"",y),this.startSpan(Math.min(r,k),d))}w&&e.parent()}else if(e.firstChild()){g&&(s="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,s,i),this.startSpan(Math.min(r,e.to),d)}while(e.nextSibling());e.parent()}}}function Uce(t){let e=t.type.prop(qq);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Ke=ga.define,y1=Ke(),Pc=Ke(),y_=Ke(Pc),b_=Ke(Pc),zc=Ke(),b1=Ke(zc),Y4=Ke(zc),xo=Ke(),zu=Ke(xo),po=Ke(),go=Ke(),aO=Ke(),$m=Ke(aO),w1=Ke(),ye={comment:y1,lineComment:Ke(y1),blockComment:Ke(y1),docComment:Ke(y1),name:Pc,variableName:Ke(Pc),typeName:y_,tagName:Ke(y_),propertyName:b_,attributeName:Ke(b_),className:Ke(Pc),labelName:Ke(Pc),namespace:Ke(Pc),macroName:Ke(Pc),literal:zc,string:b1,docString:Ke(b1),character:Ke(b1),attributeValue:Ke(b1),number:Y4,integer:Ke(Y4),float:Ke(Y4),bool:Ke(zc),regexp:Ke(zc),escape:Ke(zc),color:Ke(zc),url:Ke(zc),keyword:po,self:Ke(po),null:Ke(po),atom:Ke(po),unit:Ke(po),modifier:Ke(po),operatorKeyword:Ke(po),controlKeyword:Ke(po),definitionKeyword:Ke(po),moduleKeyword:Ke(po),operator:go,derefOperator:Ke(go),arithmeticOperator:Ke(go),logicOperator:Ke(go),bitwiseOperator:Ke(go),compareOperator:Ke(go),updateOperator:Ke(go),definitionOperator:Ke(go),typeOperator:Ke(go),controlOperator:Ke(go),punctuation:aO,separator:Ke(aO),bracket:$m,angleBracket:Ke($m),squareBracket:Ke($m),paren:Ke($m),brace:Ke($m),content:xo,heading:zu,heading1:Ke(zu),heading2:Ke(zu),heading3:Ke(zu),heading4:Ke(zu),heading5:Ke(zu),heading6:Ke(zu),contentSeparator:Ke(xo),list:Ke(xo),quote:Ke(xo),emphasis:Ke(xo),strong:Ke(xo),link:Ke(xo),monospace:Ke(xo),strikethrough:Ke(xo),inserted:Ke(),deleted:Ke(),changed:Ke(),invalid:Ke(),meta:w1,documentMeta:Ke(w1),annotation:Ke(w1),processingInstruction:Ke(w1),definition:ga.defineModifier("definition"),constant:ga.defineModifier("constant"),function:ga.defineModifier("function"),standard:ga.defineModifier("standard"),local:ga.defineModifier("local"),special:ga.defineModifier("special")};for(let t in ye){let e=ye[t];e instanceof ga&&(e.name=t)}$q([{tag:ye.link,class:"tok-link"},{tag:ye.heading,class:"tok-heading"},{tag:ye.emphasis,class:"tok-emphasis"},{tag:ye.strong,class:"tok-strong"},{tag:ye.keyword,class:"tok-keyword"},{tag:ye.atom,class:"tok-atom"},{tag:ye.bool,class:"tok-bool"},{tag:ye.url,class:"tok-url"},{tag:ye.labelName,class:"tok-labelName"},{tag:ye.inserted,class:"tok-inserted"},{tag:ye.deleted,class:"tok-deleted"},{tag:ye.literal,class:"tok-literal"},{tag:ye.string,class:"tok-string"},{tag:ye.number,class:"tok-number"},{tag:[ye.regexp,ye.escape,ye.special(ye.string)],class:"tok-string2"},{tag:ye.variableName,class:"tok-variableName"},{tag:ye.local(ye.variableName),class:"tok-variableName tok-local"},{tag:ye.definition(ye.variableName),class:"tok-variableName tok-definition"},{tag:ye.special(ye.variableName),class:"tok-variableName2"},{tag:ye.definition(ye.propertyName),class:"tok-propertyName tok-definition"},{tag:ye.typeName,class:"tok-typeName"},{tag:ye.namespace,class:"tok-namespace"},{tag:ye.className,class:"tok-className"},{tag:ye.macroName,class:"tok-macroName"},{tag:ye.propertyName,class:"tok-propertyName"},{tag:ye.operator,class:"tok-operator"},{tag:ye.comment,class:"tok-comment"},{tag:ye.meta,class:"tok-meta"},{tag:ye.invalid,class:"tok-invalid"},{tag:ye.punctuation,class:"tok-punctuation"}]);var K4;const Wu=new an;function Hq(t){return st.define({combine:t?e=>e.concat(t):void 0})}const Wce=new an;class Sa{constructor(e,n,r=[],s=""){this.data=e,this.name=s,Nn.prototype.hasOwnProperty("tree")||Object.defineProperty(Nn.prototype,"tree",{get(){return Ss(this)}}),this.parser=n,this.extension=[eu.of(this),Nn.languageData.of((i,a,l)=>{let c=w_(i,a,l),d=c.type.prop(Wu);if(!d)return[];let h=i.facet(d),m=c.type.prop(Wce);if(m){let g=c.resolve(a-c.from,l);for(let x of m)if(x.test(g,i)){let y=i.facet(x.facet);return x.type=="replace"?y:y.concat(h)}}return h})].concat(r)}isActiveAt(e,n,r=-1){return w_(e,n,r).type.prop(Wu)==this.data}findRegions(e){let n=e.facet(eu);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],s=(i,a)=>{if(i.prop(Wu)==this.data){r.push({from:a,to:a+i.length});return}let l=i.prop(an.mounted);if(l){if(l.tree.prop(Wu)==this.data){if(l.overlay)for(let c of l.overlay)r.push({from:c.from+a,to:c.to+a});else r.push({from:a,to:a+i.length});return}else if(l.overlay){let c=r.length;if(s(l.tree,l.overlay[0].from+a),r.length>c)return}}for(let c=0;cr.isTop?n:void 0)]}),e.name)}configure(e,n){return new J0(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Ss(t){let e=t.field(Sa.state,!1);return e?e.tree:ur.empty}class Gce{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let Hm=null;class rf{constructor(e,n,r=[],s,i,a,l,c){this.parser=e,this.state=n,this.fragments=r,this.tree=s,this.treeLen=i,this.viewport=a,this.skipped=l,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new rf(e,n,[],ur.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Gce(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=ur.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(rd.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=Hm;Hm=this;try{return e()}finally{Hm=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=S_(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:s,treeLen:i,viewport:a,skipped:l}=this;if(this.takeTree(),!e.empty){let c=[];if(e.iterChangedRanges((d,h,m,g)=>c.push({fromA:d,toA:h,fromB:m,toB:g})),r=rd.applyChanges(r,c),s=ur.empty,i=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){l=[];for(let d of this.skipped){let h=e.mapPos(d.from,1),m=e.mapPos(d.to,-1);he.from&&(this.fragments=S_(this.fragments,s,i),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends S6{createParse(n,r,s){let i=s[0].from,a=s[s.length-1].to;return{parsedPos:i,advance(){let c=Hm;if(c){for(let d of s)c.tempSkipped.push(d);e&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,e]):e)}return this.parsedPos=a,new ur(ai.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return Hm}}function S_(t,e,n){return rd.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class sf{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new sf(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=rf.create(e.facet(eu).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new sf(r)}}Sa.state=Os.define({create:sf.init,update(t,e){for(let n of e.effects)if(n.is(Sa.setState))return n.value;return e.startState.facet(eu)!=e.state.facet(eu)?sf.init(e.state):t.apply(e)}});let Qq=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Qq=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const Z4=typeof navigator<"u"&&(!((K4=navigator.scheduling)===null||K4===void 0)&&K4.isInputPending)?()=>navigator.scheduling.isInputPending():null,Xce=Yr.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(Sa.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(Sa.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=Qq(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnds+1e3,c=i.context.work(()=>Z4&&Z4()||Date.now()>a,s+(l?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:Sa.setState.of(new sf(i.context))})),this.chunkBudget>0&&!(c&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>bi(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),eu=st.define({combine(t){return t.length?t[0]:null},enables:t=>[Sa.state,Xce,Ze.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class Vq{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const Yce=st.define(),Zp=st.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function dd(t){let e=t.facet(Zp);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function ep(t,e){let n="",r=t.tabSize,s=t.facet(Zp)[0];if(s==" "){for(;e>=r;)n+=" ",e-=r;s=" "}for(let i=0;i=e?Kce(t,n,e):null}class xb{constructor(e,n={}){this.state=e,this.options=n,this.unit=dd(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:i}=this.options;return s!=null&&s>=r.from&&s<=r.to?i&&s==e?{text:"",from:e}:(n<0?s-1&&(i+=a-this.countColumn(r,r.search(/\S|$/))),i}countColumn(e,n=e.length){return Cf(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:s}=this.lineAt(e,n),i=this.options.overrideIndentation;if(i){let a=i(s);if(a>-1)return a}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const vb=new an;function Kce(t,e,n){let r=e.resolveStack(n),s=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(s!=r.node){let i=[];for(let a=s;a&&!(a.fromr.node.to||a.from==r.node.from&&a.type==r.node.type);a=a.parent)i.push(a);for(let a=i.length-1;a>=0;a--)r={node:i[a],next:r}}return Uq(r,t,n)}function Uq(t,e,n){for(let r=t;r;r=r.next){let s=Jce(r.node);if(s)return s(j6.create(e,n,r))}return 0}function Zce(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function Jce(t){let e=t.type.prop(vb);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(an.closedBy))){let s=t.lastChild,i=s&&r.indexOf(s.name)>-1;return a=>Wq(a,!0,1,void 0,i&&!Zce(a)?s.from:void 0)}return t.parent==null?eue:null}function eue(){return 0}class j6 extends xb{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new j6(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(tue(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return Uq(this.context.next,this.base,this.pos)}}function tue(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function nue(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let s=t.options.simulateBreak,i=t.state.doc.lineAt(n.from),a=s==null||s<=i.from?i.to:Math.min(i.to,s);for(let l=n.to;;){let c=e.childAfter(l);if(!c||c==r)return null;if(!c.type.isSkipped){if(c.from>=a)return null;let d=/^ */.exec(i.text.slice(n.to-i.from))[0].length;return{from:n.from,to:n.to+d}}l=c.to}}function J4({closing:t,align:e=!0,units:n=1}){return r=>Wq(r,e,n,t)}function Wq(t,e,n,r,s){let i=t.textAfter,a=i.match(/^\s*/)[0].length,l=r&&i.slice(a,a+r.length)==r||s==t.pos+a,c=e?nue(t):null;return c?l?t.column(c.from):t.column(c.to):t.baseIndent+(l?0:t.unit*n)}function k_({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const rue=200;function sue(){return Nn.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,s=n.lineAt(r);if(r>s.from+rue)return t;let i=n.sliceString(s.from,r);if(!e.some(d=>d.test(i)))return t;let{state:a}=t,l=-1,c=[];for(let{head:d}of a.selection.ranges){let h=a.doc.lineAt(d);if(h.from==l)continue;l=h.from;let m=O6(a,h.from);if(m==null)continue;let g=/^\s*/.exec(h.text)[0],x=ep(a,m);g!=x&&c.push({from:h.from,to:h.from+g.length,insert:x})}return c.length?[t,{changes:c,sequential:!0}]:t})}const iue=st.define(),N6=new an;function Gq(t){let e=t.firstChild,n=t.lastChild;return e&&e.ton)continue;if(i&&l.from=e&&d.to>n&&(i=d)}}return i}function oue(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function ry(t,e,n){for(let r of t.facet(iue)){let s=r(t,e,n);if(s)return s}return aue(t,e,n)}function Xq(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const yb=Qt.define({map:Xq}),Jp=Qt.define({map:Xq});function Yq(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}const hd=Os.define({create(){return Ot.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,r)=>t=O_(t,n,r)),t=t.map(e.changes);for(let n of e.effects)if(n.is(yb)&&!lue(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(Jq),s=r?Ot.replace({widget:new pue(r(e.state,n.value))}):j_;t=t.update({add:[s.range(n.value.from,n.value.to)]})}else n.is(Jp)&&(t=t.update({filter:(r,s)=>n.value.from!=r||n.value.to!=s,filterFrom:n.value.from,filterTo:n.value.to}));return e.selection&&(t=O_(t,e.selection.main.head)),t},provide:t=>Ze.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,s)=>{n.push(r,s)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n{se&&(r=!0)}),r?t.update({filterFrom:e,filterTo:n,filter:(s,i)=>s>=n||i<=e}):t}function sy(t,e,n){var r;let s=null;return(r=t.field(hd,!1))===null||r===void 0||r.between(e,n,(i,a)=>{(!s||s.from>i)&&(s={from:i,to:a})}),s}function lue(t,e,n){let r=!1;return t.between(e,e,(s,i)=>{s==e&&i==n&&(r=!0)}),r}function Kq(t,e){return t.field(hd,!1)?e:e.concat(Qt.appendConfig.of(e$()))}const cue=t=>{for(let e of Yq(t)){let n=ry(t.state,e.from,e.to);if(n)return t.dispatch({effects:Kq(t.state,[yb.of(n),Zq(t,n)])}),!0}return!1},uue=t=>{if(!t.state.field(hd,!1))return!1;let e=[];for(let n of Yq(t)){let r=sy(t.state,n.from,n.to);r&&e.push(Jp.of(r),Zq(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function Zq(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,s=t.state.doc.lineAt(e.to).number;return Ze.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${s}.`)}const due=t=>{let{state:e}=t,n=[];for(let r=0;r{let e=t.state.field(hd,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,s)=>{n.push(Jp.of({from:r,to:s}))}),t.dispatch({effects:n}),!0},fue=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:cue},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:uue},{key:"Ctrl-Alt-[",run:due},{key:"Ctrl-Alt-]",run:hue}],mue={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Jq=st.define({combine(t){return Vo(t,mue)}});function e$(t){return[hd,vue]}function t$(t,e){let{state:n}=t,r=n.facet(Jq),s=a=>{let l=t.lineBlockAt(t.posAtDOM(a.target)),c=sy(t.state,l.from,l.to);c&&t.dispatch({effects:Jp.of(c)}),a.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,s,e);let i=document.createElement("span");return i.textContent=r.placeholderText,i.setAttribute("aria-label",n.phrase("folded code")),i.title=n.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=s,i}const j_=Ot.replace({widget:new class extends Uo{toDOM(t){return t$(t,null)}}});class pue extends Uo{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return t$(e,this.value)}}const gue={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class eS extends Vl{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function xue(t={}){let e={...gue,...t},n=new eS(e,!0),r=new eS(e,!1),s=Yr.fromClass(class{constructor(a){this.from=a.viewport.from,this.markers=this.buildMarkers(a)}update(a){(a.docChanged||a.viewportChanged||a.startState.facet(eu)!=a.state.facet(eu)||a.startState.field(hd,!1)!=a.state.field(hd,!1)||Ss(a.startState)!=Ss(a.state)||e.foldingChanged(a))&&(this.markers=this.buildMarkers(a.view))}buildMarkers(a){let l=new Hl;for(let c of a.viewportLineBlocks){let d=sy(a.state,c.from,c.to)?r:ry(a.state,c.from,c.to)?n:null;d&&l.add(c.from,c.from,d)}return l.finish()}}),{domEventHandlers:i}=e;return[s,bce({class:"cm-foldGutter",markers(a){var l;return((l=a.plugin(s))===null||l===void 0?void 0:l.markers)||Bn.empty},initialSpacer(){return new eS(e,!1)},domEventHandlers:{...i,click:(a,l,c)=>{if(i.click&&i.click(a,l,c))return!0;let d=sy(a.state,l.from,l.to);if(d)return a.dispatch({effects:Jp.of(d)}),!0;let h=ry(a.state,l.from,l.to);return h?(a.dispatch({effects:yb.of(h)}),!0):!1}}}),e$()]}const vue=Ze.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class eg{constructor(e,n){this.specs=e;let r;function s(l){let c=Yc.newName();return(r||(r=Object.create(null)))["."+c]=l,c}const i=typeof n.all=="string"?n.all:n.all?s(n.all):void 0,a=n.scope;this.scope=a instanceof Sa?l=>l.prop(Wu)==a.data:a?l=>l==a:void 0,this.style=$q(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:i}).style,this.module=r?new Yc(r):null,this.themeType=n.themeType}static define(e,n){return new eg(e,n||{})}}const oO=st.define(),n$=st.define({combine(t){return t.length?[t[0]]:null}});function tS(t){let e=t.facet(oO);return e.length?e:t.facet(n$)}function r$(t,e){let n=[bue],r;return t instanceof eg&&(t.module&&n.push(Ze.styleModule.of(t.module)),r=t.themeType),e?.fallback?n.push(n$.of(t)):r?n.push(oO.computeN([Ze.darkTheme],s=>s.facet(Ze.darkTheme)==(r=="dark")?[t]:[])):n.push(oO.of(t)),n}class yue{constructor(e){this.markCache=Object.create(null),this.tree=Ss(e.state),this.decorations=this.buildDeco(e,tS(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=Ss(e.state),r=tS(e.state),s=r!=tS(e.startState),{viewport:i}=e.view,a=e.changes.mapPos(this.decoratedTo,1);n.length=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(n!=this.tree||e.viewportChanged||s)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=i.to)}buildDeco(e,n){if(!n||!this.tree.length)return Ot.none;let r=new Hl;for(let{from:s,to:i}of e.visibleRanges)Qce(this.tree,n,(a,l,c)=>{r.add(a,l,this.markCache[c]||(this.markCache[c]=Ot.mark({class:c})))},s,i);return r.finish()}}const bue=uu.high(Yr.fromClass(yue,{decorations:t=>t.decorations})),wue=eg.define([{tag:ye.meta,color:"#404740"},{tag:ye.link,textDecoration:"underline"},{tag:ye.heading,textDecoration:"underline",fontWeight:"bold"},{tag:ye.emphasis,fontStyle:"italic"},{tag:ye.strong,fontWeight:"bold"},{tag:ye.strikethrough,textDecoration:"line-through"},{tag:ye.keyword,color:"#708"},{tag:[ye.atom,ye.bool,ye.url,ye.contentSeparator,ye.labelName],color:"#219"},{tag:[ye.literal,ye.inserted],color:"#164"},{tag:[ye.string,ye.deleted],color:"#a11"},{tag:[ye.regexp,ye.escape,ye.special(ye.string)],color:"#e40"},{tag:ye.definition(ye.variableName),color:"#00f"},{tag:ye.local(ye.variableName),color:"#30a"},{tag:[ye.typeName,ye.namespace],color:"#085"},{tag:ye.className,color:"#167"},{tag:[ye.special(ye.variableName),ye.macroName],color:"#256"},{tag:ye.definition(ye.propertyName),color:"#00c"},{tag:ye.comment,color:"#940"},{tag:ye.invalid,color:"#f00"}]),Sue=Ze.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),s$=1e4,i$="()[]{}",a$=st.define({combine(t){return Vo(t,{afterCursor:!0,brackets:i$,maxScanDistance:s$,renderMatch:jue})}}),kue=Ot.mark({class:"cm-matchingBracket"}),Oue=Ot.mark({class:"cm-nonmatchingBracket"});function jue(t){let e=[],n=t.matched?kue:Oue;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const Nue=Os.define({create(){return Ot.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(a$);for(let s of e.state.selection.ranges){if(!s.empty)continue;let i=To(e.state,s.head,-1,r)||s.head>0&&To(e.state,s.head-1,1,r)||r.afterCursor&&(To(e.state,s.head,1,r)||s.headZe.decorations.from(t)}),Cue=[Nue,Sue];function Tue(t={}){return[a$.of(t),Cue]}const Eue=new an;function lO(t,e,n){let r=t.prop(e<0?an.openedBy:an.closedBy);if(r)return r;if(t.name.length==1){let s=n.indexOf(t.name);if(s>-1&&s%2==(e<0?1:0))return[n[s+e]]}return null}function cO(t){let e=t.type.prop(Eue);return e?e(t.node):t}function To(t,e,n,r={}){let s=r.maxScanDistance||s$,i=r.brackets||i$,a=Ss(t),l=a.resolveInner(e,n);for(let c=l;c;c=c.parent){let d=lO(c.type,n,i);if(d&&c.from0?e>=h.from&&eh.from&&e<=h.to))return _ue(t,e,n,c,h,d,i)}}return Aue(t,e,n,a,l.type,s,i)}function _ue(t,e,n,r,s,i,a){let l=r.parent,c={from:s.from,to:s.to},d=0,h=l?.cursor();if(h&&(n<0?h.childBefore(r.from):h.childAfter(r.to)))do if(n<0?h.to<=r.from:h.from>=r.to){if(d==0&&i.indexOf(h.type.name)>-1&&h.from0)return null;let d={from:n<0?e-1:e,to:n>0?e+1:e},h=t.doc.iterRange(e,n>0?t.doc.length:0),m=0;for(let g=0;!h.next().done&&g<=i;){let x=h.value;n<0&&(g+=x.length);let y=e+g*n;for(let w=n>0?0:x.length-1,S=n>0?x.length:-1;w!=S;w+=n){let k=a.indexOf(x[w]);if(!(k<0||r.resolveInner(y+w,1).type!=s))if(k%2==0==n>0)m++;else{if(m==1)return{start:d,end:{from:y+w,to:y+w+1},matched:k>>1==c>>1};m--}}n>0&&(g+=x.length)}return h.done?{start:d,matched:!1}:null}function N_(t,e,n,r=0,s=0){e==null&&(e=t.search(/[^\s\u00a0]/),e==-1&&(e=t.length));let i=s;for(let a=r;a=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.posn}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosr?a.toLowerCase():a,i=this.string.substr(this.pos,e.length);return s(i)==s(e)?(n!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&n!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function Mue(t){return{name:t.name||"",token:t.token,blankLine:t.blankLine||(()=>{}),startState:t.startState||(()=>!0),copyState:t.copyState||Rue,indent:t.indent||(()=>null),languageData:t.languageData||{},tokenTable:t.tokenTable||E6,mergeTokens:t.mergeTokens!==!1}}function Rue(t){if(typeof t!="object")return t;let e={};for(let n in t){let r=t[n];e[n]=r instanceof Array?r.slice():r}return e}const C_=new WeakMap;class C6 extends Sa{constructor(e){let n=Hq(e.languageData),r=Mue(e),s,i=new class extends S6{createParse(a,l,c){return new Pue(s,a,l,c)}};super(n,i,[],e.name),this.topNode=Lue(n,this),s=this,this.streamParser=r,this.stateAfter=new an({perNode:!0}),this.tokenTable=e.tokenTable?new d$(r.tokenTable):Iue}static define(e){return new C6(e)}getIndent(e){let n,{overrideIndentation:r}=e.options;r&&(n=C_.get(e.state),n!=null&&n1e4)return null;for(;i=r&&n+e.length<=s&&e.prop(t.stateAfter);if(i)return{state:t.streamParser.copyState(i),pos:n+e.length};for(let a=e.children.length-1;a>=0;a--){let l=e.children[a],c=n+e.positions[a],d=l instanceof ur&&c=e.length)return e;!s&&n==0&&e.type==t.topNode&&(s=!0);for(let i=e.children.length-1;i>=0;i--){let a=e.positions[i],l=e.children[i],c;if(an&&T6(t,i.tree,0-i.offset,n,l),d;if(c&&c.pos<=r&&(d=l$(t,i.tree,n+i.offset,c.pos+i.offset,!1)))return{state:c.state,tree:d}}return{state:t.streamParser.startState(s?dd(s):4),tree:ur.empty}}let Pue=class{constructor(e,n,r,s){this.lang=e,this.input=n,this.fragments=r,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let i=rf.get(),a=s[0].from,{state:l,tree:c}=Due(e,r,a,this.to,i?.state);this.state=l,this.parsedPos=this.chunkStart=a+c.length;for(let d=0;dd.from<=i.viewport.from&&d.to>=i.viewport.from)&&(this.state=this.lang.streamParser.startState(dd(i.state)),i.skipUntilInView(this.parsedPos,i.viewport.from),this.parsedPos=i.viewport.from),this.moveRangeIndex()}advance(){let e=rf.get(),n=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),r=Math.min(n,this.chunkStart+512);for(e&&(r=Math.min(r,e.viewport.to));this.parsedPos=n?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,n),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let n=this.input.chunk(e);if(this.input.lineChunks)n==` -`&&(n="");else{let r=n.indexOf(` -`);r>-1&&(n=n.slice(0,r))}return e+n.length<=this.to?n:n.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,n=this.lineAfter(e),r=e+n.length;for(let s=this.rangeIndex;;){let i=this.ranges[s].to;if(i>=r||(n=n.slice(0,i-(r-n.length)),s++,s==this.ranges.length))break;let a=this.ranges[s].from,l=this.lineAfter(a);n+=l,r=a+l.length}return{line:n,end:r}}skipGapsTo(e,n,r){for(;;){let s=this.ranges[this.rangeIndex].to,i=e+n;if(r>0?s>i:s>=i)break;let a=this.ranges[++this.rangeIndex].from;n+=a-s}return n}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){s=this.skipGapsTo(n,s,1),n+=s;let l=this.chunk.length;s=this.skipGapsTo(r,s,-1),r+=s,i+=this.chunk.length-l}let a=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&i==4&&a>=0&&this.chunk[a]==e&&this.chunk[a+2]==n?this.chunk[a+2]=r:this.chunk.push(e,n,r,i),s}parseLine(e){let{line:n,end:r}=this.nextLine(),s=0,{streamParser:i}=this.lang,a=new o$(n,e?e.state.tabSize:4,e?dd(e.state):2);if(a.eol())i.blankLine(this.state,a.indentUnit);else for(;!a.eol();){let l=c$(i.token,a,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+a.start,this.parsedPos+a.pos,s)),a.start>1e4)break}this.parsedPos=r,this.moveRangeIndex(),this.parsedPose.start)return s}throw new Error("Stream parser failed to advance stream.")}const E6=Object.create(null),tp=[ai.none],zue=new gb(tp),T_=[],E_=Object.create(null),u$=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])u$[t]=h$(E6,e);class d${constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),u$)}resolve(e){return e?this.table[e]||(this.table[e]=h$(this.extra,e)):0}}const Iue=new d$(E6);function nS(t,e){T_.indexOf(t)>-1||(T_.push(t),console.warn(e))}function h$(t,e){let n=[];for(let l of e.split(" ")){let c=[];for(let d of l.split(".")){let h=t[d]||ye[d];h?typeof h=="function"?c.length?c=c.map(h):nS(d,`Modifier ${d} used at start of tag`):c.length?nS(d,`Tag ${d} used as modifier`):c=Array.isArray(h)?h:[h]:nS(d,`Unknown highlighting tag ${d}`)}for(let d of c)n.push(d)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),s=r+" "+n.map(l=>l.id),i=E_[s];if(i)return i.id;let a=E_[s]=ai.define({id:tp.length,name:r,props:[k6({[r]:n})]});return tp.push(a),a.id}function Lue(t,e){let n=ai.define({id:tp.length,name:"Document",props:[Wu.add(()=>t),vb.add(()=>r=>e.getIndent(r))],top:!0});return tp.push(n),n}br.RTL,br.LTR;const Bue=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=A6(t.state,n.from);return r.line?Fue(t):r.block?$ue(t):!1};function _6(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let s=t(e,n);return s?(r(n.update(s)),!0):!1}}const Fue=_6(Vue,0),que=_6(f$,0),$ue=_6((t,e)=>f$(t,e,Que(e)),0);function A6(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const Qm=50;function Hue(t,{open:e,close:n},r,s){let i=t.sliceDoc(r-Qm,r),a=t.sliceDoc(s,s+Qm),l=/\s*$/.exec(i)[0].length,c=/^\s*/.exec(a)[0].length,d=i.length-l;if(i.slice(d-e.length,d)==e&&a.slice(c,c+n.length)==n)return{open:{pos:r-l,margin:l&&1},close:{pos:s+c,margin:c&&1}};let h,m;s-r<=2*Qm?h=m=t.sliceDoc(r,s):(h=t.sliceDoc(r,r+Qm),m=t.sliceDoc(s-Qm,s));let g=/^\s*/.exec(h)[0].length,x=/\s*$/.exec(m)[0].length,y=m.length-x-n.length;return h.slice(g,g+e.length)==e&&m.slice(y,y+n.length)==n?{open:{pos:r+g+e.length,margin:/\s/.test(h.charAt(g+e.length))?1:0},close:{pos:s-x-n.length,margin:/\s/.test(m.charAt(y-1))?1:0}}:null}function Que(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),s=n.to<=r.to?r:t.doc.lineAt(n.to);s.from>r.from&&s.from==n.to&&(s=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let i=e.length-1;i>=0&&e[i].to>r.from?e[i].to=s.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:s.to})}return e}function f$(t,e,n=e.selection.ranges){let r=n.map(i=>A6(e,i.from).block);if(!r.every(i=>i))return null;let s=n.map((i,a)=>Hue(e,r[a],i.from,i.to));if(t!=2&&!s.every(i=>i))return{changes:e.changes(n.map((i,a)=>s[a]?[]:[{from:i.from,insert:r[a].open+" "},{from:i.to,insert:" "+r[a].close}]))};if(t!=1&&s.some(i=>i)){let i=[];for(let a=0,l;as&&(i==a||a>m.from)){s=m.from;let g=/^\s*/.exec(m.text)[0].length,x=g==m.length,y=m.text.slice(g,g+d.length)==d?g:-1;gi.comment<0&&(!i.empty||i.single))){let i=[];for(let{line:l,token:c,indent:d,empty:h,single:m}of r)(m||!h)&&i.push({from:l.from+d,insert:c+" "});let a=e.changes(i);return{changes:a,selection:e.selection.map(a,1)}}else if(t!=1&&r.some(i=>i.comment>=0)){let i=[];for(let{line:a,comment:l,token:c}of r)if(l>=0){let d=a.from+l,h=d+c.length;a.text[h-a.from]==" "&&h++,i.push({from:d,to:h})}return{changes:i}}return null}const uO=Qo.define(),Uue=Qo.define(),Wue=st.define(),m$=st.define({combine(t){return Vo(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,s)=>e(r,s)||n(r,s)})}}),p$=Os.define({create(){return Eo.empty},update(t,e){let n=e.state.facet(m$),r=e.annotation(uO);if(r){let c=wi.fromTransaction(e,r.selection),d=r.side,h=d==0?t.undone:t.done;return c?h=iy(h,h.length,n.minDepth,c):h=v$(h,e.startState.selection),new Eo(d==0?r.rest:h,d==0?h:r.rest)}let s=e.annotation(Uue);if((s=="full"||s=="before")&&(t=t.isolate()),e.annotation(ss.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let i=wi.fromTransaction(e),a=e.annotation(ss.time),l=e.annotation(ss.userEvent);return i?t=t.addChanges(i,a,l,n,e):e.selection&&(t=t.addSelection(e.startState.selection,a,l,n.newGroupDelay)),(s=="full"||s=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Eo(t.done.map(wi.fromJSON),t.undone.map(wi.fromJSON))}});function Gue(t={}){return[p$,m$.of(t),Ze.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?g$:e.inputType=="historyRedo"?dO:null;return r?(e.preventDefault(),r(n)):!1}})]}function bb(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let s=n.field(p$,!1);if(!s)return!1;let i=s.pop(t,n,e);return i?(r(i),!0):!1}}const g$=bb(0,!1),dO=bb(1,!1),Xue=bb(0,!0),Yue=bb(1,!0);class wi{constructor(e,n,r,s,i){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=s,this.selectionsAfter=i}setSelAfter(e){return new wi(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new wi(e.changes&&us.fromJSON(e.changes),[],e.mapped&&Io.fromJSON(e.mapped),e.startSelection&&Me.fromJSON(e.startSelection),e.selectionsAfter.map(Me.fromJSON))}static fromTransaction(e,n){let r=ka;for(let s of e.startState.facet(Wue)){let i=s(e);i.length&&(r=r.concat(i))}return!r.length&&e.changes.empty?null:new wi(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,ka)}static selection(e){return new wi(void 0,ka,void 0,void 0,e)}}function iy(t,e,n,r){let s=e+1>n+20?e-n-1:0,i=t.slice(s,e);return i.push(r),i}function Kue(t,e){let n=[],r=!1;return t.iterChangedRanges((s,i)=>n.push(s,i)),e.iterChangedRanges((s,i,a,l)=>{for(let c=0;c=d&&a<=h&&(r=!0)}}),r}function Zue(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function x$(t,e){return t.length?e.length?t.concat(e):t:e}const ka=[],Jue=200;function v$(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Jue));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),iy(t,t.length-1,1e9,n.setSelAfter(r)))}else return[wi.selection([e])]}function ede(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function rS(t,e){if(!t.length)return t;let n=t.length,r=ka;for(;n;){let s=tde(t[n-1],e,r);if(s.changes&&!s.changes.empty||s.effects.length){let i=t.slice(0,n);return i[n-1]=s,i}else e=s.mapped,n--,r=s.selectionsAfter}return r.length?[wi.selection(r)]:ka}function tde(t,e,n){let r=x$(t.selectionsAfter.length?t.selectionsAfter.map(l=>l.map(e)):ka,n);if(!t.changes)return wi.selection(r);let s=t.changes.map(e),i=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(i):i;return new wi(s,Qt.mapEffects(t.effects,e),a,t.startSelection.map(i),r)}const nde=/^(input\.type|delete)($|\.)/;class Eo{constructor(e,n,r=0,s=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=s}isolate(){return this.prevTime?new Eo(this.done,this.undone):this}addChanges(e,n,r,s,i){let a=this.done,l=a[a.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!r||nde.test(r))&&(!l.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?t.moveByChar(n,e):wb(n,e))}function Ws(t){return t.textDirectionAt(t.state.selection.main.head)==br.LTR}const b$=t=>y$(t,!Ws(t)),w$=t=>y$(t,Ws(t));function S$(t,e){return so(t,n=>n.empty?t.moveByGroup(n,e):wb(n,e))}const sde=t=>S$(t,!Ws(t)),ide=t=>S$(t,Ws(t));function ade(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function Sb(t,e,n){let r=Ss(t).resolveInner(e.head),s=n?an.closedBy:an.openedBy;for(let c=e.head;;){let d=n?r.childAfter(c):r.childBefore(c);if(!d)break;ade(t,d,s)?r=d:c=n?d.to:d.from}let i=r.type.prop(s),a,l;return i&&(a=n?To(t,r.from,1):To(t,r.to,-1))&&a.matched?l=n?a.end.to:a.end.from:l=n?r.to:r.from,Me.cursor(l,n?-1:1)}const ode=t=>so(t,e=>Sb(t.state,e,!Ws(t))),lde=t=>so(t,e=>Sb(t.state,e,Ws(t)));function k$(t,e){return so(t,n=>{if(!n.empty)return wb(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const O$=t=>k$(t,!1),j$=t=>k$(t,!0);function N$(t){let e=t.scrollDOM.clientHeighta.empty?t.moveVertically(a,e,n.height):wb(a,e));if(s.eq(r.selection))return!1;let i;if(n.selfScroll){let a=t.coordsAtPos(r.selection.main.head),l=t.scrollDOM.getBoundingClientRect(),c=l.top+n.marginTop,d=l.bottom-n.marginBottom;a&&a.top>c&&a.bottomC$(t,!1),hO=t=>C$(t,!0);function du(t,e,n){let r=t.lineBlockAt(e.head),s=t.moveToLineBoundary(e,n);if(s.head==e.head&&s.head!=(n?r.to:r.from)&&(s=t.moveToLineBoundary(e,n,!1)),!n&&s.head==r.from&&r.length){let i=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;i&&e.head!=r.from+i&&(s=Me.cursor(r.from+i))}return s}const cde=t=>so(t,e=>du(t,e,!0)),ude=t=>so(t,e=>du(t,e,!1)),dde=t=>so(t,e=>du(t,e,!Ws(t))),hde=t=>so(t,e=>du(t,e,Ws(t))),fde=t=>so(t,e=>Me.cursor(t.lineBlockAt(e.head).from,1)),mde=t=>so(t,e=>Me.cursor(t.lineBlockAt(e.head).to,-1));function pde(t,e,n){let r=!1,s=Tf(t.selection,i=>{let a=To(t,i.head,-1)||To(t,i.head,1)||i.head>0&&To(t,i.head-1,1)||i.headpde(t,e);function za(t,e){let n=Tf(t.state.selection,r=>{let s=e(r);return Me.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(ro(t.state,n)),!0)}function T$(t,e){return za(t,n=>t.moveByChar(n,e))}const E$=t=>T$(t,!Ws(t)),_$=t=>T$(t,Ws(t));function A$(t,e){return za(t,n=>t.moveByGroup(n,e))}const xde=t=>A$(t,!Ws(t)),vde=t=>A$(t,Ws(t)),yde=t=>za(t,e=>Sb(t.state,e,!Ws(t))),bde=t=>za(t,e=>Sb(t.state,e,Ws(t)));function M$(t,e){return za(t,n=>t.moveVertically(n,e))}const R$=t=>M$(t,!1),D$=t=>M$(t,!0);function P$(t,e){return za(t,n=>t.moveVertically(n,e,N$(t).height))}const A_=t=>P$(t,!1),M_=t=>P$(t,!0),wde=t=>za(t,e=>du(t,e,!0)),Sde=t=>za(t,e=>du(t,e,!1)),kde=t=>za(t,e=>du(t,e,!Ws(t))),Ode=t=>za(t,e=>du(t,e,Ws(t))),jde=t=>za(t,e=>Me.cursor(t.lineBlockAt(e.head).from)),Nde=t=>za(t,e=>Me.cursor(t.lineBlockAt(e.head).to)),R_=({state:t,dispatch:e})=>(e(ro(t,{anchor:0})),!0),D_=({state:t,dispatch:e})=>(e(ro(t,{anchor:t.doc.length})),!0),P_=({state:t,dispatch:e})=>(e(ro(t,{anchor:t.selection.main.anchor,head:0})),!0),z_=({state:t,dispatch:e})=>(e(ro(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),Cde=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),Tde=({state:t,dispatch:e})=>{let n=kb(t).map(({from:r,to:s})=>Me.range(r,Math.min(s+1,t.doc.length)));return e(t.update({selection:Me.create(n),userEvent:"select"})),!0},Ede=({state:t,dispatch:e})=>{let n=Tf(t.selection,r=>{let s=Ss(t),i=s.resolveStack(r.from,1);if(r.empty){let a=s.resolveStack(r.from,-1);a.node.from>=i.node.from&&a.node.to<=i.node.to&&(i=a)}for(let a=i;a;a=a.next){let{node:l}=a;if((l.from=r.to||l.to>r.to&&l.from<=r.from)&&a.next)return Me.range(l.to,l.from)}return r});return n.eq(t.selection)?!1:(e(ro(t,n)),!0)};function z$(t,e){let{state:n}=t,r=n.selection,s=n.selection.ranges.slice();for(let i of n.selection.ranges){let a=n.doc.lineAt(i.head);if(e?a.to0)for(let l=i;;){let c=t.moveVertically(l,e);if(c.heada.to){s.some(d=>d.head==c.head)||s.push(c);break}else{if(c.head==l.head)break;l=c}}}return s.length==r.ranges.length?!1:(t.dispatch(ro(n,Me.create(s,s.length-1))),!0)}const _de=t=>z$(t,!1),Ade=t=>z$(t,!0),Mde=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=Me.create([n.main]):n.main.empty||(r=Me.create([Me.cursor(n.main.head)])),r?(e(ro(t,r)),!0):!1};function tg(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,s=r.changeByRange(i=>{let{from:a,to:l}=i;if(a==l){let c=e(i);ca&&(n="delete.forward",c=S1(t,c,!0)),a=Math.min(a,c),l=Math.max(l,c)}else a=S1(t,a,!1),l=S1(t,l,!0);return a==l?{range:i}:{changes:{from:a,to:l},range:Me.cursor(a,as(t)))r.between(e,e,(s,i)=>{se&&(e=n?i:s)});return e}const I$=(t,e,n)=>tg(t,r=>{let s=r.from,{state:i}=t,a=i.doc.lineAt(s),l,c;if(n&&!e&&s>a.from&&sI$(t,!1,!0),L$=t=>I$(t,!0,!1),B$=(t,e)=>tg(t,n=>{let r=n.head,{state:s}=t,i=s.doc.lineAt(r),a=s.charCategorizer(r);for(let l=null;;){if(r==(e?i.to:i.from)){r==n.head&&i.number!=(e?s.doc.lines:1)&&(r+=e?1:-1);break}let c=Ps(i.text,r-i.from,e)+i.from,d=i.text.slice(Math.min(r,c)-i.from,Math.max(r,c)-i.from),h=a(d);if(l!=null&&h!=l)break;(d!=" "||r!=n.head)&&(l=h),r=c}return r}),F$=t=>B$(t,!1),Rde=t=>B$(t,!0),Dde=t=>tg(t,e=>{let n=t.lineBlockAt(e.head).to;return e.headtg(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),zde=t=>tg(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:An.of(["",""])},range:Me.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},Lde=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let s=r.from,i=t.doc.lineAt(s),a=s==i.from?s-1:Ps(i.text,s-i.from,!1)+i.from,l=s==i.to?s+1:Ps(i.text,s-i.from,!0)+i.from;return{changes:{from:a,to:l,insert:t.doc.slice(s,l).append(t.doc.slice(a,s))},range:Me.cursor(l)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function kb(t){let e=[],n=-1;for(let r of t.selection.ranges){let s=t.doc.lineAt(r.from),i=t.doc.lineAt(r.to);if(!r.empty&&r.to==i.from&&(i=t.doc.lineAt(r.to-1)),n>=s.number){let a=e[e.length-1];a.to=i.to,a.ranges.push(r)}else e.push({from:s.from,to:i.to,ranges:[r]});n=i.number+1}return e}function q$(t,e,n){if(t.readOnly)return!1;let r=[],s=[];for(let i of kb(t)){if(n?i.to==t.doc.length:i.from==0)continue;let a=t.doc.lineAt(n?i.to+1:i.from-1),l=a.length+1;if(n){r.push({from:i.to,to:a.to},{from:i.from,insert:a.text+t.lineBreak});for(let c of i.ranges)s.push(Me.range(Math.min(t.doc.length,c.anchor+l),Math.min(t.doc.length,c.head+l)))}else{r.push({from:a.from,to:i.from},{from:i.to,insert:t.lineBreak+a.text});for(let c of i.ranges)s.push(Me.range(c.anchor-l,c.head-l))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:Me.create(s,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Bde=({state:t,dispatch:e})=>q$(t,e,!1),Fde=({state:t,dispatch:e})=>q$(t,e,!0);function $$(t,e,n){if(t.readOnly)return!1;let r=[];for(let s of kb(t))n?r.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):r.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});return e(t.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const qde=({state:t,dispatch:e})=>$$(t,e,!1),$de=({state:t,dispatch:e})=>$$(t,e,!0),Hde=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(kb(e).map(({from:s,to:i})=>(s>0?s--:i{let i;if(t.lineWrapping){let a=t.lineBlockAt(s.head),l=t.coordsAtPos(s.head,s.assoc||1);l&&(i=a.bottom+t.documentTop-l.bottom+t.defaultLineHeight/2)}return t.moveVertically(s,!0,i)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Qde(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=Ss(t).resolveInner(e),r=n.childBefore(e),s=n.childAfter(e),i;return r&&s&&r.to<=e&&s.from>=e&&(i=r.type.prop(an.closedBy))&&i.indexOf(s.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(s.from).from&&!/\S/.test(t.sliceDoc(r.to,s.from))?{from:r.to,to:s.from}:null}const I_=H$(!1),Vde=H$(!0);function H$(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(s=>{let{from:i,to:a}=s,l=e.doc.lineAt(i),c=!t&&i==a&&Qde(e,i);t&&(i=a=(a<=l.to?l:e.doc.lineAt(a)).to);let d=new xb(e,{simulateBreak:i,simulateDoubleBreak:!!c}),h=O6(d,i);for(h==null&&(h=Cf(/^\s*/.exec(e.doc.lineAt(i).text)[0],e.tabSize));al.from&&i{let s=[];for(let a=r.from;a<=r.to;){let l=t.doc.lineAt(a);l.number>n&&(r.empty||r.to>l.from)&&(e(l,s,r),n=l.number),a=l.to+1}let i=t.changes(s);return{changes:s,range:Me.range(i.mapPos(r.anchor,1),i.mapPos(r.head,1))}})}const Ude=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new xb(t,{overrideIndentation:i=>{let a=n[i];return a??-1}}),s=M6(t,(i,a,l)=>{let c=O6(r,i.from);if(c==null)return;/\S/.test(i.text)||(c=0);let d=/^\s*/.exec(i.text)[0],h=ep(t,c);(d!=h||l.fromt.readOnly?!1:(e(t.update(M6(t,(n,r)=>{r.push({from:n.from,insert:t.facet(Zp)})}),{userEvent:"input.indent"})),!0),V$=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(M6(t,(n,r)=>{let s=/^\s*/.exec(n.text)[0];if(!s)return;let i=Cf(s,t.tabSize),a=0,l=ep(t,Math.max(0,i-dd(t)));for(;a(t.setTabFocusMode(),!0),Gde=[{key:"Ctrl-b",run:b$,shift:E$,preventDefault:!0},{key:"Ctrl-f",run:w$,shift:_$},{key:"Ctrl-p",run:O$,shift:R$},{key:"Ctrl-n",run:j$,shift:D$},{key:"Ctrl-a",run:fde,shift:jde},{key:"Ctrl-e",run:mde,shift:Nde},{key:"Ctrl-d",run:L$},{key:"Ctrl-h",run:fO},{key:"Ctrl-k",run:Dde},{key:"Ctrl-Alt-h",run:F$},{key:"Ctrl-o",run:Ide},{key:"Ctrl-t",run:Lde},{key:"Ctrl-v",run:hO}],Xde=[{key:"ArrowLeft",run:b$,shift:E$,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:sde,shift:xde,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:dde,shift:kde,preventDefault:!0},{key:"ArrowRight",run:w$,shift:_$,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:ide,shift:vde,preventDefault:!0},{mac:"Cmd-ArrowRight",run:hde,shift:Ode,preventDefault:!0},{key:"ArrowUp",run:O$,shift:R$,preventDefault:!0},{mac:"Cmd-ArrowUp",run:R_,shift:P_},{mac:"Ctrl-ArrowUp",run:__,shift:A_},{key:"ArrowDown",run:j$,shift:D$,preventDefault:!0},{mac:"Cmd-ArrowDown",run:D_,shift:z_},{mac:"Ctrl-ArrowDown",run:hO,shift:M_},{key:"PageUp",run:__,shift:A_},{key:"PageDown",run:hO,shift:M_},{key:"Home",run:ude,shift:Sde,preventDefault:!0},{key:"Mod-Home",run:R_,shift:P_},{key:"End",run:cde,shift:wde,preventDefault:!0},{key:"Mod-End",run:D_,shift:z_},{key:"Enter",run:I_,shift:I_},{key:"Mod-a",run:Cde},{key:"Backspace",run:fO,shift:fO,preventDefault:!0},{key:"Delete",run:L$,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:F$,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Rde,preventDefault:!0},{mac:"Mod-Backspace",run:Pde,preventDefault:!0},{mac:"Mod-Delete",run:zde,preventDefault:!0}].concat(Gde.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Yde=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:ode,shift:yde},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:lde,shift:bde},{key:"Alt-ArrowUp",run:Bde},{key:"Shift-Alt-ArrowUp",run:qde},{key:"Alt-ArrowDown",run:Fde},{key:"Shift-Alt-ArrowDown",run:$de},{key:"Mod-Alt-ArrowUp",run:_de},{key:"Mod-Alt-ArrowDown",run:Ade},{key:"Escape",run:Mde},{key:"Mod-Enter",run:Vde},{key:"Alt-l",mac:"Ctrl-l",run:Tde},{key:"Mod-i",run:Ede,preventDefault:!0},{key:"Mod-[",run:V$},{key:"Mod-]",run:Q$},{key:"Mod-Alt-\\",run:Ude},{key:"Shift-Mod-k",run:Hde},{key:"Shift-Mod-\\",run:gde},{key:"Mod-/",run:Bue},{key:"Alt-A",run:que},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Wde}].concat(Xde),Kde={key:"Tab",run:Q$,shift:V$},L_=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class af{constructor(e,n,r=0,s=e.length,i,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,s),this.bufferStart=r,this.normalize=i?l=>i(L_(l)):L_,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return vi(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=s6(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=ko(e);let s=this.normalize(n);if(s.length)for(let i=0,a=r;;i++){let l=s.charCodeAt(i),c=this.match(l,a,this.bufferPos+this.bufferStart);if(i==s.length-1){if(c)return this.value=c,this;break}a==r&&ithis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,s=r+n[0].length;if(this.matchPos=ay(this.text,s+(r==s?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(rthis.value.to)&&(!this.test||this.test(r,s,n)))return this.value={from:r,to:s,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=r||s.to<=n){let l=new Lh(n,e.sliceString(n,r));return sS.set(e,l),l}if(s.from==n&&s.to==r)return s;let{text:i,from:a}=s;return a>n&&(i=e.sliceString(n,a)+i,a=n),s.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,s=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,s,n)))return this.value={from:r,to:s,match:n},this.matchPos=ay(this.text,s+(r==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Lh.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(W$.prototype[Symbol.iterator]=G$.prototype[Symbol.iterator]=function(){return this});function Zde(t){try{return new RegExp(t,R6),!0}catch{return!1}}function ay(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e=56320&&r<57344;)e++;return e}function mO(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=lr("input",{class:"cm-textfield",name:"line",value:e}),r=lr("form",{class:"cm-gotoLine",onkeydown:i=>{i.keyCode==27?(i.preventDefault(),t.dispatch({effects:E0.of(!1)}),t.focus()):i.keyCode==13&&(i.preventDefault(),s())},onsubmit:i=>{i.preventDefault(),s()}},lr("label",t.state.phrase("Go to line"),": ",n)," ",lr("button",{class:"cm-button",type:"submit"},t.state.phrase("go")),lr("button",{name:"close",onclick:()=>{t.dispatch({effects:E0.of(!1)}),t.focus()},"aria-label":t.state.phrase("close"),type:"button"},["×"]));function s(){let i=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!i)return;let{state:a}=t,l=a.doc.lineAt(a.selection.main.head),[,c,d,h,m]=i,g=h?+h.slice(1):0,x=d?+d:l.number;if(d&&m){let S=x/100;c&&(S=S*(c=="-"?-1:1)+l.number/a.doc.lines),x=Math.round(a.doc.lines*S)}else d&&c&&(x=x*(c=="-"?-1:1)+l.number);let y=a.doc.line(Math.max(1,Math.min(a.doc.lines,x))),w=Me.cursor(y.from+Math.max(0,Math.min(g,y.length)));t.dispatch({effects:[E0.of(!1),Ze.scrollIntoView(w.from,{y:"center"})],selection:w}),t.focus()}return{dom:r}}const E0=Qt.define(),B_=Os.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(E0)&&(t=n.value);return t},provide:t=>Y0.from(t,e=>e?mO:null)}),Jde=t=>{let e=X0(t,mO);if(!e){let n=[E0.of(!0)];t.state.field(B_,!1)==null&&n.push(Qt.appendConfig.of([B_,ehe])),t.dispatch({effects:n}),e=X0(t,mO)}return e&&e.dom.querySelector("input").select(),!0},ehe=Ze.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),the={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},nhe=st.define({combine(t){return Vo(t,the,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function rhe(t){return[lhe,ohe]}const she=Ot.mark({class:"cm-selectionMatch"}),ihe=Ot.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function F_(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=Tr.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=Tr.Word)}function ahe(t,e,n,r){return t(e.sliceDoc(n,n+1))==Tr.Word&&t(e.sliceDoc(r-1,r))==Tr.Word}const ohe=Yr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(nhe),{state:n}=t,r=n.selection;if(r.ranges.length>1)return Ot.none;let s=r.main,i,a=null;if(s.empty){if(!e.highlightWordAroundCursor)return Ot.none;let c=n.wordAt(s.head);if(!c)return Ot.none;a=n.charCategorizer(s.head),i=n.sliceDoc(c.from,c.to)}else{let c=s.to-s.from;if(c200)return Ot.none;if(e.wholeWords){if(i=n.sliceDoc(s.from,s.to),a=n.charCategorizer(s.head),!(F_(a,n,s.from,s.to)&&ahe(a,n,s.from,s.to)))return Ot.none}else if(i=n.sliceDoc(s.from,s.to),!i)return Ot.none}let l=[];for(let c of t.visibleRanges){let d=new af(n.doc,i,c.from,c.to);for(;!d.next().done;){let{from:h,to:m}=d.value;if((!a||F_(a,n,h,m))&&(s.empty&&h<=s.from&&m>=s.to?l.push(ihe.range(h,m)):(h>=s.to||m<=s.from)&&l.push(she.range(h,m)),l.length>e.maxMatches))return Ot.none}}return Ot.set(l)}},{decorations:t=>t.decorations}),lhe=Ze.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),che=({state:t,dispatch:e})=>{let{selection:n}=t,r=Me.create(n.ranges.map(s=>t.wordAt(s.head)||Me.cursor(s.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function uhe(t,e){let{main:n,ranges:r}=t.selection,s=t.wordAt(n.head),i=s&&s.from==n.from&&s.to==n.to;for(let a=!1,l=new af(t.doc,e,r[r.length-1].to);;)if(l.next(),l.done){if(a)return null;l=new af(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),a=!0}else{if(a&&r.some(c=>c.from==l.value.from))continue;if(i){let c=t.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const dhe=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(i=>i.from===i.to))return che({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(i=>t.sliceDoc(i.from,i.to)!=r))return!1;let s=uhe(t,r);return s?(e(t.update({selection:t.selection.addRange(Me.range(s.from,s.to),!1),effects:Ze.scrollIntoView(s.to)})),!0):!1},Ef=st.define({combine(t){return Vo(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new khe(e),scrollToMatch:e=>Ze.scrollIntoView(e)})}});class X${constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||Zde(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?` -`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new phe(this):new fhe(this)}getCursor(e,n=0,r){let s=e.doc?e:Nn.create({doc:e});return r==null&&(r=s.doc.length),this.regexp?Sh(this,s,n,r):wh(this,s,n,r)}}class Y${constructor(e){this.spec=e}}function wh(t,e,n,r){return new af(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:s=>s.toLowerCase(),t.wholeWord?hhe(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function hhe(t,e){return(n,r,s,i)=>((i>n||i+s.length=n)return null;s.push(r.value)}return s}highlight(e,n,r,s){let i=wh(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)s(i.value.from,i.value.to)}}function Sh(t,e,n,r){return new W$(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?mhe(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function oy(t,e){return t.slice(Ps(t,e,!1),e)}function ly(t,e){return t.slice(e,Ps(t,e))}function mhe(t){return(e,n,r)=>!r[0].length||(t(oy(r.input,r.index))!=Tr.Word||t(ly(r.input,r.index))!=Tr.Word)&&(t(ly(r.input,r.index+r[0].length))!=Tr.Word||t(oy(r.input,r.index+r[0].length))!=Tr.Word)}class phe extends Y${nextMatch(e,n,r){let s=Sh(this.spec,e,r,e.doc.length).next();return s.done&&(s=Sh(this.spec,e,0,n).next()),s.done?null:s.value}prevMatchInRange(e,n,r){for(let s=1;;s++){let i=Math.max(n,r-s*1e4),a=Sh(this.spec,e,i,r),l=null;for(;!a.next().done;)l=a.value;if(l&&(i==n||l.from>i+10))return l;if(i==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let s=r.length;s>0;s--){let i=+r.slice(0,s);if(i>0&&i=n)return null;s.push(r.value)}return s}highlight(e,n,r,s){let i=Sh(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!i.next().done;)s(i.value.from,i.value.to)}}const np=Qt.define(),D6=Qt.define(),Uc=Os.define({create(t){return new iS(pO(t).create(),null)},update(t,e){for(let n of e.effects)n.is(np)?t=new iS(n.value.create(),t.panel):n.is(D6)&&(t=new iS(t.query,n.value?P6:null));return t},provide:t=>Y0.from(t,e=>e.panel)});class iS{constructor(e,n){this.query=e,this.panel=n}}const ghe=Ot.mark({class:"cm-searchMatch"}),xhe=Ot.mark({class:"cm-searchMatch cm-searchMatch-selected"}),vhe=Yr.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(Uc))}update(t){let e=t.state.field(Uc);(e!=t.startState.field(Uc)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return Ot.none;let{view:n}=this,r=new Hl;for(let s=0,i=n.visibleRanges,a=i.length;si[s+1].from-500;)c=i[++s].to;t.highlight(n.state,l,c,(d,h)=>{let m=n.state.selection.ranges.some(g=>g.from==d&&g.to==h);r.add(d,h,m?xhe:ghe)})}return r.finish()}},{decorations:t=>t.decorations});function ng(t){return e=>{let n=e.state.field(Uc,!1);return n&&n.query.spec.valid?t(e,n):J$(e)}}const cy=ng((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let s=Me.single(r.from,r.to),i=t.state.facet(Ef);return t.dispatch({selection:s,effects:[z6(t,r),i.scrollToMatch(s.main,t)],userEvent:"select.search"}),Z$(t),!0}),uy=ng((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,s=e.prevMatch(n,r,r);if(!s)return!1;let i=Me.single(s.from,s.to),a=t.state.facet(Ef);return t.dispatch({selection:i,effects:[z6(t,s),a.scrollToMatch(i.main,t)],userEvent:"select.search"}),Z$(t),!0}),yhe=ng((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:Me.create(n.map(r=>Me.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),bhe=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:s}=n.main,i=[],a=0;for(let l=new af(t.doc,t.sliceDoc(r,s));!l.next().done;){if(i.length>1e3)return!1;l.value.from==r&&(a=i.length),i.push(Me.range(l.value.from,l.value.to))}return e(t.update({selection:Me.create(i,a),userEvent:"select.search.matches"})),!0},q_=ng((t,{query:e})=>{let{state:n}=t,{from:r,to:s}=n.selection.main;if(n.readOnly)return!1;let i=e.nextMatch(n,r,r);if(!i)return!1;let a=i,l=[],c,d,h=[];a.from==r&&a.to==s&&(d=n.toText(e.getReplacement(a)),l.push({from:a.from,to:a.to,insert:d}),a=e.nextMatch(n,a.from,a.to),h.push(Ze.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let m=t.state.changes(l);return a&&(c=Me.single(a.from,a.to).map(m),h.push(z6(t,a)),h.push(n.facet(Ef).scrollToMatch(c.main,t))),t.dispatch({changes:m,selection:c,effects:h,userEvent:"input.replace"}),!0}),whe=ng((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(s=>{let{from:i,to:a}=s;return{from:i,to:a,insert:e.getReplacement(s)}});if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:Ze.announce.of(r),userEvent:"input.replace.all"}),!0});function P6(t){return t.state.facet(Ef).createPanel(t)}function pO(t,e){var n,r,s,i,a;let l=t.selection.main,c=l.empty||l.to>l.from+100?"":t.sliceDoc(l.from,l.to);if(e&&!c)return e;let d=t.facet(Ef);return new X$({search:((n=e?.literal)!==null&&n!==void 0?n:d.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(r=e?.caseSensitive)!==null&&r!==void 0?r:d.caseSensitive,literal:(s=e?.literal)!==null&&s!==void 0?s:d.literal,regexp:(i=e?.regexp)!==null&&i!==void 0?i:d.regexp,wholeWord:(a=e?.wholeWord)!==null&&a!==void 0?a:d.wholeWord})}function K$(t){let e=X0(t,P6);return e&&e.dom.querySelector("[main-field]")}function Z$(t){let e=K$(t);e&&e==t.root.activeElement&&e.select()}const J$=t=>{let e=t.state.field(Uc,!1);if(e&&e.panel){let n=K$(t);if(n&&n!=t.root.activeElement){let r=pO(t.state,e.query.spec);r.valid&&t.dispatch({effects:np.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[D6.of(!0),e?np.of(pO(t.state,e.query.spec)):Qt.appendConfig.of(jhe)]});return!0},eH=t=>{let e=t.state.field(Uc,!1);if(!e||!e.panel)return!1;let n=X0(t,P6);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:D6.of(!1)}),!0},She=[{key:"Mod-f",run:J$,scope:"editor search-panel"},{key:"F3",run:cy,shift:uy,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:cy,shift:uy,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:eH,scope:"editor search-panel"},{key:"Mod-Shift-l",run:bhe},{key:"Mod-Alt-g",run:Jde},{key:"Mod-d",run:dhe,preventDefault:!0}];class khe{constructor(e){this.view=e;let n=this.query=e.state.field(Uc).query.spec;this.commit=this.commit.bind(this),this.searchField=lr("input",{value:n.search,placeholder:Fi(e,"Find"),"aria-label":Fi(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=lr("input",{value:n.replace,placeholder:Fi(e,"Replace"),"aria-label":Fi(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=lr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=lr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=lr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(s,i,a){return lr("button",{class:"cm-button",name:s,onclick:i,type:"button"},a)}this.dom=lr("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,r("next",()=>cy(e),[Fi(e,"next")]),r("prev",()=>uy(e),[Fi(e,"previous")]),r("select",()=>yhe(e),[Fi(e,"all")]),lr("label",null,[this.caseField,Fi(e,"match case")]),lr("label",null,[this.reField,Fi(e,"regexp")]),lr("label",null,[this.wordField,Fi(e,"by word")]),...e.state.readOnly?[]:[lr("br"),this.replaceField,r("replace",()=>q_(e),[Fi(e,"replace")]),r("replaceAll",()=>whe(e),[Fi(e,"replace all")])],lr("button",{name:"close",onclick:()=>eH(e),"aria-label":Fi(e,"close"),type:"button"},["×"])])}commit(){let e=new X$({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:np.of(e)}))}keydown(e){Tle(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?uy:cy)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),q_(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(np)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Ef).top}}function Fi(t,e){return t.state.phrase(e)}const k1=30,O1=/[\s\.,:;?!]/;function z6(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),s=t.state.doc.lineAt(n).to,i=Math.max(r.from,e-k1),a=Math.min(s,n+k1),l=t.state.sliceDoc(i,a);if(i!=r.from){for(let c=0;cl.length-k1;c--)if(!O1.test(l[c-1])&&O1.test(l[c])){l=l.slice(0,c);break}}return Ze.announce.of(`${t.state.phrase("current match")}. ${l} ${t.state.phrase("on line")} ${r.number}.`)}const Ohe=Ze.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),jhe=[Uc,uu.low(vhe),Ohe];class tH{constructor(e,n,r,s){this.state=e,this.pos=n,this.explicit=r,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=Ss(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),s=n.text.slice(r-n.from,this.pos-n.from),i=s.search(rH(e,!1));return i<0?null:{from:r+i,to:this.pos,text:s.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function $_(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Nhe(t){let e=Object.create(null),n=Object.create(null);for(let{label:s}of t){e[s[0]]=!0;for(let i=1;itypeof s=="string"?{label:s}:s),[n,r]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:Nhe(e);return s=>{let i=s.matchBefore(r);return i||s.explicit?{from:i?i.from:s.pos,options:e,validFor:n}:null}}function Che(t,e){return n=>{for(let r=Ss(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}let H_=class{constructor(e,n,r,s){this.completion=e,this.source=n,this.match=r,this.score=s}};function sd(t){return t.selection.main.from}function rH(t,e){var n;let{source:r}=t,s=e&&r[0]!="^",i=r[r.length-1]!="$";return!s&&!i?t:new RegExp(`${s?"^":""}(?:${r})${i?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}const I6=Qo.define();function The(t,e,n,r){let{main:s}=t.selection,i=n-s.from,a=r-s.from;return{...t.changeByRange(l=>{if(l!=s&&n!=r&&t.sliceDoc(l.from+i,l.from+a)!=t.sliceDoc(n,r))return{range:l};let c=t.toText(e);return{changes:{from:l.from+i,to:r==s.from?l.to:l.from+a,insert:c},range:Me.cursor(l.from+i+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const Q_=new WeakMap;function Ehe(t){if(!Array.isArray(t))return t;let e=Q_.get(t);return e||Q_.set(t,e=nH(t)),e}const dy=Qt.define(),rp=Qt.define();class _he{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&E<=57||E>=97&&E<=122?2:E>=65&&E<=90?1:0:(_=s6(E))!=_.toLowerCase()?1:_!=_.toUpperCase()?2:0;(!j||A==1&&S||T==0&&A!=0)&&(n[m]==E||r[m]==E&&(g=!0)?a[m++]=j:a.length&&(k=!1)),T=A,j+=ko(E)}return m==c&&a[0]==0&&k?this.result(-100+(g?-200:0),a,e):x==c&&y==0?this.ret(-200-e.length+(w==e.length?0:-100),[0,w]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):x==c?this.ret(-900-e.length,[y,w]):m==c?this.result(-100+(g?-200:0)+-700+(k?0:-1100),a,e):n.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,n,r){let s=[],i=0;for(let a of n){let l=a+(this.astral?ko(vi(r,a)):1);i&&s[i-1]==a?s[i-1]=l:(s[i++]=a,s[i++]=l)}return this.ret(e-r.length,s)}}class Ahe{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Mhe,filterStrict:!1,compareCompletions:(e,n)=>e.label.localeCompare(n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>V_(e(r),n(r)),optionClass:(e,n)=>r=>V_(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function V_(t,e){return t?e?t+" "+e:t:e}function Mhe(t,e,n,r,s,i){let a=t.textDirection==br.RTL,l=a,c=!1,d="top",h,m,g=e.left-s.left,x=s.right-e.right,y=r.right-r.left,w=r.bottom-r.top;if(l&&g=w||j>e.top?h=n.bottom-e.top:(d="bottom",h=e.bottom-n.top)}let S=(e.bottom-e.top)/i.offsetHeight,k=(e.right-e.left)/i.offsetWidth;return{style:`${d}: ${h/S}px; max-width: ${m/k}px`,class:"cm-completionInfo-"+(c?a?"left-narrow":"right-narrow":l?"left":"right")}}function Rhe(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,s,i){let a=document.createElement("span");a.className="cm-completionLabel";let l=n.displayLabel||n.label,c=0;for(let d=0;dc&&a.appendChild(document.createTextNode(l.slice(c,h)));let g=a.appendChild(document.createElement("span"));g.appendChild(document.createTextNode(l.slice(h,m))),g.className="cm-completionMatchedText",c=m}return cn.position-r.position).map(n=>n.render)}function aS(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let s=Math.floor(e/n);return{from:s*n,to:(s+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}class Dhe{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let s=e.state.field(n),{options:i,selected:a}=s.open,l=e.state.facet(ws);this.optionContent=Rhe(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=aS(i.length,a,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",c=>{let{options:d}=e.state.field(n).open;for(let h=c.target,m;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(m=/-(\d+)$/.exec(h.id))&&+m[1]{let d=e.state.field(this.stateField,!1);d&&d.tooltip&&e.state.facet(ws).closeOnBlur&&c.relatedTarget!=e.contentDOM&&e.dispatch({effects:rp.of(null)})}),this.showOptions(i,s.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),s=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=s){let{options:i,selected:a,disabled:l}=r.open;(!s.open||s.open.options!=i)&&(this.range=aS(i.length,a,e.state.facet(ws).maxRenderedOptions),this.showOptions(i,r.id)),this.updateSel(),l!=((n=s.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;(n.selected>-1&&n.selected=this.range.to)&&(this.range=aS(n.options.length,n.selected,this.view.state.facet(ws).maxRenderedOptions),this.showOptions(n.options,e.id));let r=this.updateSelectedOption(n.selected);if(r){this.destroyInfo();let{completion:s}=n.options[n.selected],{info:i}=s;if(!i)return;let a=typeof i=="string"?document.createTextNode(i):i(s);if(!a)return;"then"in a?a.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,s)}).catch(l=>bi(this.view.state,l,"completion info")):(this.addInfoPane(a,s),r.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",r.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:i}=e;r.appendChild(s),this.infoDestroy=i||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let n=null;for(let r=this.list.firstChild,s=this.range.from;r;r=r.nextSibling,s++)r.nodeName!="LI"||!r.id?s--:s==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&(r.removeAttribute("aria-selected"),r.removeAttribute("aria-describedby"));return n&&zhe(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),i=this.space;if(!i){let a=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:a.clientWidth,bottom:a.clientHeight}}return s.top>Math.min(i.bottom,n.bottom)-10||s.bottom{a.target==s&&a.preventDefault()});let i=null;for(let a=r.from;ar.from||r.from==0))if(i=g,typeof d!="string"&&d.header)s.appendChild(d.header(d));else{let x=s.appendChild(document.createElement("completion-section"));x.textContent=g}}const h=s.appendChild(document.createElement("li"));h.id=n+"-"+a,h.setAttribute("role","option");let m=this.optionClass(l);m&&(h.className=m);for(let g of this.optionContent){let x=g(l,this.view.state,this.view,c);x&&h.appendChild(x)}}return r.from&&s.classList.add("cm-completionListIncompleteTop"),r.tonew Dhe(n,t,e)}function zhe(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),s=n.height/t.offsetHeight;r.topn.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/s)}function U_(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function Ihe(t,e){let n=[],r=null,s=null,i=h=>{n.push(h);let{section:m}=h.completion;if(m){r||(r=[]);let g=typeof m=="string"?m:m.name;r.some(x=>x.name==g)||r.push(typeof m=="string"?{name:g}:m)}},a=e.facet(ws);for(let h of t)if(h.hasResult()){let m=h.result.getMatch;if(h.result.filter===!1)for(let g of h.result.options)i(new H_(g,h.source,m?m(g):[],1e9-n.length));else{let g=e.sliceDoc(h.from,h.to),x,y=a.filterStrict?new Ahe(g):new _he(g);for(let w of h.result.options)if(x=y.match(w.label)){let S=w.displayLabel?m?m(w,x.matched):[]:x.matched,k=x.score+(w.boost||0);if(i(new H_(w,h.source,S,k)),typeof w.section=="object"&&w.section.rank==="dynamic"){let{name:j}=w.section;s||(s=Object.create(null)),s[j]=Math.max(k,s[j]||-1e9)}}}}if(r){let h=Object.create(null),m=0,g=(x,y)=>(x.rank==="dynamic"&&y.rank==="dynamic"?s[y.name]-s[x.name]:0)||(typeof x.rank=="number"?x.rank:1e9)-(typeof y.rank=="number"?y.rank:1e9)||(x.nameg.score-m.score||d(m.completion,g.completion))){let m=h.completion;!c||c.label!=m.label||c.detail!=m.detail||c.type!=null&&m.type!=null&&c.type!=m.type||c.apply!=m.apply||c.boost!=m.boost?l.push(h):U_(h.completion)>U_(c)&&(l[l.length-1]=h),c=h.completion}return l}class _h{constructor(e,n,r,s,i,a){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=s,this.selected=i,this.disabled=a}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new _h(this.options,W_(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,s,i,a){if(s&&!a&&e.some(d=>d.isPending))return s.setDisabled();let l=Ihe(e,n);if(!l.length)return s&&e.some(d=>d.isPending)?s.setDisabled():null;let c=n.facet(ws).selectOnOpen?0:-1;if(s&&s.selected!=c&&s.selected!=-1){let d=s.options[s.selected].completion;for(let h=0;hh.hasResult()?Math.min(d,h.from):d,1e8),create:Hhe,above:i.aboveCursor},s?s.timestamp:Date.now(),c,!1)}map(e){return new _h(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new _h(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class hy{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new hy(qhe,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(ws),i=(r.override||n.languageDataAt("autocomplete",sd(n)).map(Ehe)).map(c=>(this.active.find(h=>h.source==c)||new Oa(c,this.active.some(h=>h.state!=0)?1:0)).update(e,r));i.length==this.active.length&&i.every((c,d)=>c==this.active[d])&&(i=this.active);let a=this.open,l=e.effects.some(c=>c.is(L6));a&&e.docChanged&&(a=a.map(e.changes)),e.selection||i.some(c=>c.hasResult()&&e.changes.touchesRange(c.from,c.to))||!Lhe(i,this.active)||l?a=_h.build(i,n,this.id,a,r,l):a&&a.disabled&&!i.some(c=>c.isPending)&&(a=null),!a&&i.every(c=>!c.isPending)&&i.some(c=>c.hasResult())&&(i=i.map(c=>c.hasResult()?new Oa(c.source,0):c));for(let c of e.effects)c.is(iH)&&(a=a&&a.setSelected(c.value,this.id));return i==this.active&&a==this.open?this:new hy(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Bhe:Fhe}}function Lhe(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n-1&&(n["aria-activedescendant"]=t+"-"+e),n}const qhe=[];function sH(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(I6);if(r&&e.activateOnCompletion(r))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class Oa{constructor(e,n,r=!1){this.source=e,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,n){let r=sH(e,n),s=this;(r&8||r&16&&this.touches(e))&&(s=new Oa(s.source,0)),r&4&&s.state==0&&(s=new Oa(this.source,1)),s=s.updateFor(e,r);for(let i of e.effects)if(i.is(dy))s=new Oa(s.source,1,i.value);else if(i.is(rp))s=new Oa(s.source,0);else if(i.is(L6))for(let a of i.value)a.source==s.source&&(s=a);return s}updateFor(e,n){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(sd(e.state))}}class Bh extends Oa{constructor(e,n,r,s,i,a){super(e,3,n),this.limit=r,this.result=s,this.from=i,this.to=a}hasResult(){return!0}updateFor(e,n){var r;if(!(n&3))return this.map(e.changes);let s=this.result;s.map&&!e.changes.empty&&(s=s.map(s,e.changes));let i=e.changes.mapPos(this.from),a=e.changes.mapPos(this.to,1),l=sd(e.state);if(l>a||!s||n&2&&(sd(e.startState)==this.from||ln.map(e))}}),iH=Qt.define(),yi=Os.define({create(){return hy.start()},update(t,e){return t.update(e)},provide:t=>[v6.from(t,e=>e.tooltip),Ze.contentAttributes.from(t,e=>e.attrs)]});function B6(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(yi).active.find(s=>s.source==e.source);return r instanceof Bh?(typeof n=="string"?t.dispatch({...The(t.state,n,r.from,r.to),annotations:I6.of(e.completion)}):n(t,e.completion,r.from,r.to),!0):!1}const Hhe=Phe(yi,B6);function j1(t,e="option"){return n=>{let r=n.state.field(yi,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp-1?r.open.selected+s*(t?1:-1):t?0:a-1;return l<0?l=e=="page"?0:a-1:l>=a&&(l=e=="page"?a-1:0),n.dispatch({effects:iH.of(l)}),!0}}const Qhe=t=>{let e=t.state.field(yi,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field(yi,!1)?(t.dispatch({effects:dy.of(!0)}),!0):!1,Vhe=t=>{let e=t.state.field(yi,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:rp.of(null)}),!0)};class Uhe{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const Whe=50,Ghe=1e3,Xhe=Yr.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(yi).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(yi),n=t.state.facet(ws);if(!t.selectionSet&&!t.docChanged&&t.startState.field(yi)==e)return;let r=t.transactions.some(i=>{let a=sH(i,n);return a&8||(i.selection||i.docChanged)&&!(a&3)});for(let i=0;iWhe&&Date.now()-a.time>Ghe){for(let l of a.context.abortListeners)try{l()}catch(c){bi(this.view.state,c)}a.context.abortListeners=null,this.running.splice(i--,1)}else a.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(i=>i.effects.some(a=>a.is(dy)))&&(this.pendingStart=!0);let s=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(i=>i.isPending&&!this.running.some(a=>a.active.source==i.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let i of t.transactions)i.isUserEvent("input.type")?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(yi);for(let n of e.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ws).updateSyncTime))}startQuery(t){let{state:e}=this.view,n=sd(e),r=new tH(e,n,t.explicit,this.view),s=new Uhe(t,r);this.running.push(s),Promise.resolve(t.source(r)).then(i=>{s.context.aborted||(s.done=i||null,this.scheduleAccept())},i=>{this.view.dispatch({effects:rp.of(null)}),bi(this.view.state,i)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ws).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(ws),r=this.view.state.field(yi);for(let s=0;sl.source==i.active.source);if(a&&a.isPending)if(i.done==null){let l=new Oa(i.active.source,0);for(let c of i.updates)l=l.update(c,n);l.isPending||e.push(l)}else this.startQuery(a)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:L6.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(yi,!1);if(e&&e.tooltip&&this.view.state.facet(ws).closeOnBlur){let n=e.open&&Rq(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:rp.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:dy.of(!1)}),20),this.composing=0}}}),Yhe=typeof navigator=="object"&&/Win/.test(navigator.platform),Khe=uu.highest(Ze.domEventHandlers({keydown(t,e){let n=e.state.field(yi,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(Yhe&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],s=n.active.find(a=>a.source==r.source),i=r.completion.commitCharacters||s.result.commitCharacters;return i&&i.indexOf(t.key)>-1&&B6(e,r),!1}})),aH=Ze.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class Zhe{constructor(e,n,r,s){this.field=e,this.line=n,this.from=r,this.to=s}}class F6{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,Ds.TrackDel),r=e.mapPos(this.to,1,Ds.TrackDel);return n==null||r==null?null:new F6(this.field,n,r)}}class q6{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],s=[n],i=e.doc.lineAt(n),a=/^\s*/.exec(i.text)[0];for(let c of this.lines){if(r.length){let d=a,h=/^\t*/.exec(c)[0].length;for(let m=0;mnew F6(c.field,s[c.line]+c.from,s[c.line]+c.to));return{text:r,ranges:l}}static parse(e){let n=[],r=[],s=[],i;for(let a of e.split(/\r\n?|\n/)){for(;i=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(a);){let l=i[1]?+i[1]:null,c=i[2]||i[3]||"",d=-1,h=c.replace(/\\[{}]/g,m=>m[1]);for(let m=0;m=d&&g.field++}for(let m of s)if(m.line==r.length&&m.from>i.index){let g=i[2]?3+(i[1]||"").length:2;m.from-=g,m.to-=g}s.push(new Zhe(d,r.length,i.index,i.index+h.length)),a=a.slice(0,i.index)+c+a.slice(i.index+i[0].length)}a=a.replace(/\\([{}])/g,(l,c,d)=>{for(let h of s)h.line==r.length&&h.from>d&&(h.from--,h.to--);return c}),r.push(a)}return new q6(r,s)}}let Jhe=Ot.widget({widget:new class extends Uo{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),efe=Ot.mark({class:"cm-snippetField"});class _f{constructor(e,n){this.ranges=e,this.active=n,this.deco=Ot.set(e.map(r=>(r.from==r.to?Jhe:efe).range(r.from,r.to)),!0)}map(e){let n=[];for(let r of this.ranges){let s=r.map(e);if(!s)return null;n.push(s)}return new _f(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const rg=Qt.define({map(t,e){return t&&t.map(e)}}),tfe=Qt.define(),sp=Os.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(rg))return n.value;if(n.is(tfe)&&t)return new _f(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>Ze.decorations.from(t,e=>e?e.deco:Ot.none)});function $6(t,e){return Me.create(t.filter(n=>n.field==e).map(n=>Me.range(n.from,n.to)))}function nfe(t){let e=q6.parse(t);return(n,r,s,i)=>{let{text:a,ranges:l}=e.instantiate(n.state,s),{main:c}=n.state.selection,d={changes:{from:s,to:i==c.from?c.to:i,insert:An.of(a)},scrollIntoView:!0,annotations:r?[I6.of(r),ss.userEvent.of("input.complete")]:void 0};if(l.length&&(d.selection=$6(l,0)),l.some(h=>h.field>0)){let h=new _f(l,0),m=d.effects=[rg.of(h)];n.state.field(sp,!1)===void 0&&m.push(Qt.appendConfig.of([sp,ofe,lfe,aH]))}n.dispatch(n.state.update(d))}}function oH(t){return({state:e,dispatch:n})=>{let r=e.field(sp,!1);if(!r||t<0&&r.active==0)return!1;let s=r.active+t,i=t>0&&!r.ranges.some(a=>a.field==s+t);return n(e.update({selection:$6(r.ranges,s),effects:rg.of(i?null:new _f(r.ranges,s)),scrollIntoView:!0})),!0}}const rfe=({state:t,dispatch:e})=>t.field(sp,!1)?(e(t.update({effects:rg.of(null)})),!0):!1,sfe=oH(1),ife=oH(-1),afe=[{key:"Tab",run:sfe,shift:ife},{key:"Escape",run:rfe}],G_=st.define({combine(t){return t.length?t[0]:afe}}),ofe=uu.highest(Yp.compute([G_],t=>t.facet(G_)));function wl(t,e){return{...e,apply:nfe(t)}}const lfe=Ze.domEventHandlers({mousedown(t,e){let n=e.state.field(sp,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let s=n.ranges.find(i=>i.from<=r&&i.to>=r);return!s||s.field==n.active?!1:(e.dispatch({selection:$6(n.ranges,s.field),effects:rg.of(n.ranges.some(i=>i.field>s.field)?new _f(n.ranges,s.field):null),scrollIntoView:!0}),!0)}}),ip={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Gu=Qt.define({map(t,e){let n=e.mapPos(t,-1,Ds.TrackAfter);return n??void 0}}),H6=new class extends od{};H6.startSide=1;H6.endSide=-1;const lH=Os.define({create(){return Bn.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(Gu)&&(t=t.update({add:[H6.range(n.value,n.value+1)]}));return t}});function cfe(){return[dfe,lH]}const lS="()[]{}<>«»»«[]{}";function cH(t){for(let e=0;e{if((ufe?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let s=t.state.selection.main;if(r.length>2||r.length==2&&ko(vi(r,0))==1||e!=s.from||n!=s.to)return!1;let i=mfe(t.state,r);return i?(t.dispatch(i),!0):!1}),hfe=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=uH(t,t.selection.main.head).brackets||ip.brackets,s=null,i=t.changeByRange(a=>{if(a.empty){let l=pfe(t.doc,a.head);for(let c of r)if(c==l&&Ob(t.doc,a.head)==cH(vi(c,0)))return{changes:{from:a.head-c.length,to:a.head+c.length},range:Me.cursor(a.head-c.length)}}return{range:s=a}});return s||e(t.update(i,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},ffe=[{key:"Backspace",run:hfe}];function mfe(t,e){let n=uH(t,t.selection.main.head),r=n.brackets||ip.brackets;for(let s of r){let i=cH(vi(s,0));if(e==s)return i==s?vfe(t,s,r.indexOf(s+s+s)>-1,n):gfe(t,s,i,n.before||ip.before);if(e==i&&dH(t,t.selection.main.from))return xfe(t,s,i)}return null}function dH(t,e){let n=!1;return t.field(lH).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function Ob(t,e){let n=t.sliceString(e,e+2);return n.slice(0,ko(vi(n,0)))}function pfe(t,e){let n=t.sliceString(e-2,e);return ko(vi(n,0))==n.length?n:n.slice(1)}function gfe(t,e,n,r){let s=null,i=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:n,from:a.to}],effects:Gu.of(a.to+e.length),range:Me.range(a.anchor+e.length,a.head+e.length)};let l=Ob(t.doc,a.head);return!l||/\s/.test(l)||r.indexOf(l)>-1?{changes:{insert:e+n,from:a.head},effects:Gu.of(a.head+e.length),range:Me.cursor(a.head+e.length)}:{range:s=a}});return s?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function xfe(t,e,n){let r=null,s=t.changeByRange(i=>i.empty&&Ob(t.doc,i.head)==n?{changes:{from:i.head,to:i.head+n.length,insert:n},range:Me.cursor(i.head+n.length)}:r={range:i});return r?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function vfe(t,e,n,r){let s=r.stringPrefixes||ip.stringPrefixes,i=null,a=t.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:Gu.of(l.to+e.length),range:Me.range(l.anchor+e.length,l.head+e.length)};let c=l.head,d=Ob(t.doc,c),h;if(d==e){if(X_(t,c))return{changes:{insert:e+e,from:c},effects:Gu.of(c+e.length),range:Me.cursor(c+e.length)};if(dH(t,c)){let g=n&&t.sliceDoc(c,c+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:c,to:c+g.length,insert:g},range:Me.cursor(c+g.length)}}}else{if(n&&t.sliceDoc(c-2*e.length,c)==e+e&&(h=Y_(t,c-2*e.length,s))>-1&&X_(t,h))return{changes:{insert:e+e+e+e,from:c},effects:Gu.of(c+e.length),range:Me.cursor(c+e.length)};if(t.charCategorizer(c)(d)!=Tr.Word&&Y_(t,c,s)>-1&&!yfe(t,c,e,s))return{changes:{insert:e+e,from:c},effects:Gu.of(c+e.length),range:Me.cursor(c+e.length)}}return{range:i=l}});return i?null:t.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function X_(t,e){let n=Ss(t).resolveInner(e+1);return n.parent&&n.from==e}function yfe(t,e,n,r){let s=Ss(t).resolveInner(e,-1),i=r.reduce((a,l)=>Math.max(a,l.length),0);for(let a=0;a<5;a++){let l=t.sliceDoc(s.from,Math.min(s.to,s.from+n.length+i)),c=l.indexOf(n);if(!c||c>-1&&r.indexOf(l.slice(0,c))>-1){let h=s.firstChild;for(;h&&h.from==s.from&&h.to-h.from>n.length+c;){if(t.sliceDoc(h.to-n.length,h.to)==n)return!1;h=h.firstChild}return!0}let d=s.to==e&&s.parent;if(!d)break;s=d}return!1}function Y_(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=Tr.Word)return e;for(let s of n){let i=e-s.length;if(t.sliceDoc(i,e)==s&&r(t.sliceDoc(i-1,i))!=Tr.Word)return i}return-1}function bfe(t={}){return[Khe,yi,ws.of(t),Xhe,wfe,aH]}const hH=[{key:"Ctrl-Space",run:oS},{mac:"Alt-`",run:oS},{mac:"Alt-i",run:oS},{key:"Escape",run:Vhe},{key:"ArrowDown",run:j1(!0)},{key:"ArrowUp",run:j1(!1)},{key:"PageDown",run:j1(!0,"page")},{key:"PageUp",run:j1(!1,"page")},{key:"Enter",run:Qhe}],wfe=uu.highest(Yp.computeN([ws],t=>t.facet(ws).defaultKeymap?[hH]:[]));class K_{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class Qu{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let s=r.facet(ap).markerFilter;s&&(e=s(e,r));let i=e.slice().sort((x,y)=>x.from-y.from||x.to-y.to),a=new Hl,l=[],c=0,d=r.doc.iter(),h=0,m=r.doc.length;for(let x=0;;){let y=x==i.length?null:i[x];if(!y&&!l.length)break;let w,S;if(l.length)w=c,S=l.reduce((N,T)=>Math.min(N,T.to),y&&y.from>w?y.from:1e8);else{if(w=y.from,w>m)break;S=y.to,l.push(y),x++}for(;xN.from||N.to==w))l.push(N),x++,S=Math.min(N.to,S);else{S=Math.min(N.from,S);break}}S=Math.min(S,m);let k=!1;if(l.some(N=>N.from==w&&(N.to==S||S==m))&&(k=w==S,!k&&S-w<10)){let N=w-(h+d.value.length);N>0&&(d.next(N),h=w);for(let T=w;;){if(T>=S){k=!0;break}if(!d.lineBreak&&h+d.value.length>T)break;T=h+d.value.length,h+=d.value.length,d.next()}}let j=Dfe(l);if(k)a.add(w,w,Ot.widget({widget:new _fe(j),diagnostics:l.slice()}));else{let N=l.reduce((T,E)=>E.markClass?T+" "+E.markClass:T,"");a.add(w,S,Ot.mark({class:"cm-lintRange cm-lintRange-"+j+N,diagnostics:l.slice(),inclusiveEnd:l.some(T=>T.to>S)}))}if(c=S,c==m)break;for(let N=0;N{if(!(e&&a.diagnostics.indexOf(e)<0))if(!r)r=new K_(s,i,e||a.diagnostics[0]);else{if(a.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new K_(r.from,i,r.diagnostic)}}),r}function Sfe(t,e){let n=e.pos,r=e.end||n,s=t.state.facet(ap).hideOn(t,n,r);if(s!=null)return s;let i=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(a=>a.is(fH))||t.changes.touchesRange(i.from,Math.max(i.to,r)))}function kfe(t,e){return t.field(Wi,!1)?e:e.concat(Qt.appendConfig.of(Pfe))}const fH=Qt.define(),Q6=Qt.define(),mH=Qt.define(),Wi=Os.define({create(){return new Qu(Ot.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),r=null,s=t.panel;if(t.selected){let i=e.changes.mapPos(t.selected.from,1);r=of(n,t.selected.diagnostic,i)||of(n,null,i)}!n.size&&s&&e.state.facet(ap).autoPanel&&(s=null),t=new Qu(n,s,r)}for(let n of e.effects)if(n.is(fH)){let r=e.state.facet(ap).autoPanel?n.value.length?op.open:null:t.panel;t=Qu.init(n.value,r,e.state)}else n.is(Q6)?t=new Qu(t.diagnostics,n.value?op.open:null,t.selected):n.is(mH)&&(t=new Qu(t.diagnostics,t.panel,n.value));return t},provide:t=>[Y0.from(t,e=>e.panel),Ze.decorations.from(t,e=>e.diagnostics)]}),Ofe=Ot.mark({class:"cm-lintRange cm-lintRange-active"});function jfe(t,e,n){let{diagnostics:r}=t.state.field(Wi),s,i=-1,a=-1;r.between(e-(n<0?1:0),e+(n>0?1:0),(c,d,{spec:h})=>{if(e>=c&&e<=d&&(c==d||(e>c||n>0)&&(egH(t,n,!1)))}const Cfe=t=>{let e=t.state.field(Wi,!1);(!e||!e.panel)&&t.dispatch({effects:kfe(t.state,[Q6.of(!0)])});let n=X0(t,op.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},Z_=t=>{let e=t.state.field(Wi,!1);return!e||!e.panel?!1:(t.dispatch({effects:Q6.of(!1)}),!0)},Tfe=t=>{let e=t.state.field(Wi,!1);if(!e)return!1;let n=t.state.selection.main,r=e.diagnostics.iter(n.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(t.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},Efe=[{key:"Mod-Shift-m",run:Cfe,preventDefault:!0},{key:"F8",run:Tfe}],ap=st.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...Vo(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:J_,tooltipFilter:J_,needsRefresh:(e,n)=>e?n?r=>e(r)||n(r):e:n,hideOn:(e,n)=>e?n?(r,s,i)=>e(r,s,i)||n(r,s,i):e:n,autoPanel:(e,n)=>e||n})}}});function J_(t,e){return t?e?(n,r)=>e(t(n,r),r):t:e}function pH(t){let e=[];if(t)e:for(let{name:n}of t){for(let r=0;ri.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function gH(t,e,n){var r;let s=n?pH(e.actions):[];return lr("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},lr("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((i,a)=>{let l=!1,c=x=>{if(x.preventDefault(),l)return;l=!0;let y=of(t.state.field(Wi).diagnostics,e);y&&i.apply(t,y.from,y.to)},{name:d}=i,h=s[a]?d.indexOf(s[a]):-1,m=h<0?d:[d.slice(0,h),lr("u",d.slice(h,h+1)),d.slice(h+1)],g=i.markClass?" "+i.markClass:"";return lr("button",{type:"button",class:"cm-diagnosticAction"+g,onclick:c,onmousedown:c,"aria-label":` Action: ${d}${h<0?"":` (access key "${s[a]})"`}.`},m)}),e.source&&lr("div",{class:"cm-diagnosticSource"},e.source))}class _fe extends Uo{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return lr("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class eA{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=gH(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class op{constructor(e){this.view=e,this.items=[];let n=s=>{if(s.keyCode==27)Z_(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:i}=this.items[this.selectedIndex],a=pH(i.actions);for(let l=0;l{for(let i=0;iZ_(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Wi).selected;if(!e)return-1;for(let n=0;n{for(let h of d.diagnostics){if(a.has(h))continue;a.add(h);let m=-1,g;for(let x=r;xr&&(this.items.splice(r,m-r),s=!0)),n&&g.diagnostic==n.diagnostic?g.dom.hasAttribute("aria-selected")||(g.dom.setAttribute("aria-selected","true"),i=g):g.dom.hasAttribute("aria-selected")&&g.dom.removeAttribute("aria-selected"),r++}});r({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:c})=>{let d=c.height/this.list.offsetHeight;l.topc.bottom&&(this.list.scrollTop+=(l.bottom-c.bottom)/d)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let e=this.list.firstChild;function n(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)n();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(Wi),r=of(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:mH.of(r)})}static open(e){return new op(e)}}function Afe(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}function N1(t){return Afe(``,'width="6" height="3"')}const Mfe=Ze.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:N1("#d11")},".cm-lintRange-warning":{backgroundImage:N1("orange")},".cm-lintRange-info":{backgroundImage:N1("#999")},".cm-lintRange-hint":{backgroundImage:N1("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function Rfe(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function Dfe(t){let e="hint",n=1;for(let r of t){let s=Rfe(r.severity);s>n&&(n=s,e=r.severity)}return e}const Pfe=[Wi,Ze.decorations.compute([Wi],t=>{let{selected:e,panel:n}=t.field(Wi);return!e||!n||e.from==e.to?Ot.none:Ot.set([Ofe.range(e.from,e.to)])}),gce(jfe,{hideOn:Sfe}),Mfe];var tA=function(e){e===void 0&&(e={});var{crosshairCursor:n=!1}=e,r=[];e.closeBracketsKeymap!==!1&&(r=r.concat(ffe)),e.defaultKeymap!==!1&&(r=r.concat(Yde)),e.searchKeymap!==!1&&(r=r.concat(She)),e.historyKeymap!==!1&&(r=r.concat(rde)),e.foldKeymap!==!1&&(r=r.concat(fue)),e.completionKeymap!==!1&&(r=r.concat(hH)),e.lintKeymap!==!1&&(r=r.concat(Efe));var s=[];return e.lineNumbers!==!1&&s.push(Cce()),e.highlightActiveLineGutter!==!1&&s.push(_ce()),e.highlightSpecialChars!==!1&&s.push(Vle()),e.history!==!1&&s.push(Gue()),e.foldGutter!==!1&&s.push(xue()),e.drawSelection!==!1&&s.push(Dle()),e.dropCursor!==!1&&s.push(Ble()),e.allowMultipleSelections!==!1&&s.push(Nn.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&s.push(sue()),e.syntaxHighlighting!==!1&&s.push(r$(wue,{fallback:!0})),e.bracketMatching!==!1&&s.push(Tue()),e.closeBrackets!==!1&&s.push(cfe()),e.autocompletion!==!1&&s.push(bfe()),e.rectangularSelection!==!1&&s.push(ice()),n!==!1&&s.push(lce()),e.highlightActiveLine!==!1&&s.push(Kle()),e.highlightSelectionMatches!==!1&&s.push(rhe()),e.tabSize&&typeof e.tabSize=="number"&&s.push(Zp.of(" ".repeat(e.tabSize))),s.concat([Yp.of(r.flat())]).filter(Boolean)};const zfe="#e5c07b",nA="#e06c75",Ife="#56b6c2",Lfe="#ffffff",bv="#abb2bf",gO="#7d8799",Bfe="#61afef",Ffe="#98c379",rA="#d19a66",qfe="#c678dd",$fe="#21252b",sA="#2c313a",iA="#282c34",cS="#353a42",Hfe="#3E4451",aA="#528bff",Qfe=Ze.theme({"&":{color:bv,backgroundColor:iA},".cm-content":{caretColor:aA},".cm-cursor, .cm-dropCursor":{borderLeftColor:aA},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Hfe},".cm-panels":{backgroundColor:$fe,color:bv},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:iA,color:gO,border:"none"},".cm-activeLineGutter":{backgroundColor:sA},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:cS},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:cS,borderBottomColor:cS},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:sA,color:bv}}},{dark:!0}),Vfe=eg.define([{tag:ye.keyword,color:qfe},{tag:[ye.name,ye.deleted,ye.character,ye.propertyName,ye.macroName],color:nA},{tag:[ye.function(ye.variableName),ye.labelName],color:Bfe},{tag:[ye.color,ye.constant(ye.name),ye.standard(ye.name)],color:rA},{tag:[ye.definition(ye.name),ye.separator],color:bv},{tag:[ye.typeName,ye.className,ye.number,ye.changed,ye.annotation,ye.modifier,ye.self,ye.namespace],color:zfe},{tag:[ye.operator,ye.operatorKeyword,ye.url,ye.escape,ye.regexp,ye.link,ye.special(ye.string)],color:Ife},{tag:[ye.meta,ye.comment],color:gO},{tag:ye.strong,fontWeight:"bold"},{tag:ye.emphasis,fontStyle:"italic"},{tag:ye.strikethrough,textDecoration:"line-through"},{tag:ye.link,color:gO,textDecoration:"underline"},{tag:ye.heading,fontWeight:"bold",color:nA},{tag:[ye.atom,ye.bool,ye.special(ye.variableName)],color:rA},{tag:[ye.processingInstruction,ye.string,ye.inserted],color:Ffe},{tag:ye.invalid,color:Lfe}]),xH=[Qfe,r$(Vfe)];var Ufe=Ze.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),Wfe=function(e){e===void 0&&(e={});var{indentWithTab:n=!0,editable:r=!0,readOnly:s=!1,theme:i="light",placeholder:a="",basicSetup:l=!0}=e,c=[];switch(n&&c.unshift(Yp.of([Kde])),l&&(typeof l=="boolean"?c.unshift(tA()):c.unshift(tA(l))),a&&c.unshift(tce(a)),i){case"light":c.push(Ufe);break;case"dark":c.push(xH);break;case"none":break;default:c.push(i);break}return r===!1&&c.push(Ze.editable.of(!1)),s&&c.push(Nn.readOnly.of(!0)),[...c]},Gfe=t=>({line:t.state.doc.lineAt(t.state.selection.main.from),lineCount:t.state.doc.lines,lineBreak:t.state.lineBreak,length:t.state.doc.length,readOnly:t.state.readOnly,tabSize:t.state.tabSize,selection:t.state.selection,selectionAsSingle:t.state.selection.asSingle().main,ranges:t.state.selection.ranges,selectionCode:t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to),selections:t.state.selection.ranges.map(e=>t.state.sliceDoc(e.from,e.to)),selectedText:t.state.selection.ranges.some(e=>!e.empty)});class Xfe{constructor(e,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(n=>{try{n()}catch(r){console.error("TimeoutLatch callback error:",r)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class oA{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var uS=null,Yfe=()=>typeof window>"u"?new oA:(uS||(uS=new oA),uS),lA=Qo.define(),Kfe=200,Zfe=[];function Jfe(t){var{value:e,selection:n,onChange:r,onStatistics:s,onCreateEditor:i,onUpdate:a,extensions:l=Zfe,autoFocus:c,theme:d="light",height:h=null,minHeight:m=null,maxHeight:g=null,width:x=null,minWidth:y=null,maxWidth:w=null,placeholder:S="",editable:k=!0,readOnly:j=!1,indentWithTab:N=!0,basicSetup:T=!0,root:E,initialState:_}=t,[A,D]=b.useState(),[q,B]=b.useState(),[H,W]=b.useState(),ee=b.useState(()=>({current:null}))[0],I=b.useState(()=>({current:null}))[0],V=Ze.theme({"&":{height:h,minHeight:m,maxHeight:g,width:x,minWidth:y,maxWidth:w},"& .cm-scroller":{height:"100% !important"}}),L=Ze.updateListener.of(Y=>{if(Y.docChanged&&typeof r=="function"&&!Y.transactions.some(X=>X.annotation(lA))){ee.current?ee.current.reset():(ee.current=new Xfe(()=>{if(I.current){var X=I.current;I.current=null,X()}ee.current=null},Kfe),Yfe().add(ee.current));var R=Y.state.doc,ie=R.toString();r(ie,Y)}s&&s(Gfe(Y))}),$=Wfe({theme:d,editable:k,readOnly:j,placeholder:S,indentWithTab:N,basicSetup:T}),K=[L,V,...$];return a&&typeof a=="function"&&K.push(Ze.updateListener.of(a)),K=K.concat(l),b.useLayoutEffect(()=>{if(A&&!H){var Y={doc:e,selection:n,extensions:K},R=_?Nn.fromJSON(_.json,Y,_.fields):Nn.create(Y);if(W(R),!q){var ie=new Ze({state:R,parent:A,root:E});B(ie),i&&i(ie,R)}}return()=>{q&&(W(void 0),B(void 0))}},[A,H]),b.useEffect(()=>{t.container&&D(t.container)},[t.container]),b.useEffect(()=>()=>{q&&(q.destroy(),B(void 0)),ee.current&&(ee.current.cancel(),ee.current=null)},[q]),b.useEffect(()=>{c&&q&&q.focus()},[c,q]),b.useEffect(()=>{q&&q.dispatch({effects:Qt.reconfigure.of(K)})},[d,l,h,m,g,x,y,w,S,k,j,N,T,r,a]),b.useEffect(()=>{if(e!==void 0){var Y=q?q.state.doc.toString():"";if(q&&e!==Y){var R=ee.current&&!ee.current.isDone,ie=()=>{q&&e!==q.state.doc.toString()&&q.dispatch({changes:{from:0,to:q.state.doc.toString().length,insert:e||""},annotations:[lA.of(!0)]})};R?I.current=ie:ie()}}},[e,q]),{state:H,setState:W,view:q,setView:B,container:A,setContainer:D}}var eme=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],vH=b.forwardRef((t,e)=>{var{className:n,value:r="",selection:s,extensions:i=[],onChange:a,onStatistics:l,onCreateEditor:c,onUpdate:d,autoFocus:h,theme:m="light",height:g,minHeight:x,maxHeight:y,width:w,minWidth:S,maxWidth:k,basicSetup:j,placeholder:N,indentWithTab:T,editable:E,readOnly:_,root:A,initialState:D}=t,q=zJ(t,eme),B=b.useRef(null),{state:H,view:W,container:ee,setContainer:I}=Jfe({root:A,value:r,autoFocus:h,theme:m,height:g,minHeight:x,maxHeight:y,width:w,minWidth:S,maxWidth:k,basicSetup:j,placeholder:N,indentWithTab:T,editable:E,readOnly:_,selection:s,onChange:a,onStatistics:l,onCreateEditor:c,onUpdate:d,extensions:i,initialState:D});b.useImperativeHandle(e,()=>({editor:B.current,state:H,view:W}),[B,ee,H,W]);var V=b.useCallback($=>{B.current=$,I($)},[I]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var L=typeof m=="string"?"cm-theme-"+m:"cm-theme";return o.jsx("div",IJ({ref:V,className:""+L+(n?" "+n:"")},q))});vH.displayName="CodeMirror";var cA={};class fy{constructor(e,n,r,s,i,a,l,c,d,h=0,m){this.p=e,this.stack=n,this.state=r,this.reducePos=s,this.pos=i,this.score=a,this.buffer=l,this.bufferBase=c,this.curContext=d,this.lookAhead=h,this.parent=m}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let s=e.parser.context;return new fy(e,[],n,r,r,0,[],0,s?new uA(s,s.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,s=e&65535,{parser:i}=this.p,a=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[s])===null||n===void 0)&&n.isAnonymous)&&(d==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSizec;)this.stack.pop();this.reduceContext(s,d)}storeNode(e,n,r,s=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&a.buffer[l-4]==0&&a.buffer[l-1]>-1){if(n==r)return;if(a.buffer[l-2]>=n){a.buffer[l-2]=r;return}}}if(!i||this.pos==r)this.buffer.push(e,n,r,s);else{let a=this.buffer.length;if(a>0&&(this.buffer[a-4]!=0||this.buffer[a-1]<0)){let l=!1;for(let c=a;c>0&&this.buffer[c-2]>r;c-=4)if(this.buffer[c-1]>=0){l=!0;break}if(l)for(;a>0&&this.buffer[a-2]>r;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,s>4&&(s-=4)}this.buffer[a]=e,this.buffer[a+1]=n,this.buffer[a+2]=r,this.buffer[a+3]=s}}shift(e,n,r,s){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let i=e,{parser:a}=this.p;(s>this.pos||n<=a.maxNode)&&(this.pos=s,a.stateFlag(i,1)||(this.reducePos=s)),this.pushState(i,r),this.shiftContext(n,r),n<=a.maxNode&&this.buffer.push(n,r,s,4)}else this.pos=s,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,s,4)}apply(e,n,r,s){e&65536?this.reduce(e):this.shift(e,n,r,s)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let s=this.pos;this.reducePos=this.pos=s+e.length,this.pushState(n,s),this.buffer.push(r,s,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),s=e.bufferBase+n;for(;e&&s==e.bufferBase;)e=e.parent;return new fy(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,s,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new tme(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if((r&65536)==0)return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let s=[];for(let i=0,a;ic&1&&l==a)||s.push(n[i],a)}n=s}let r=[];for(let s=0;s>19,s=n&65535,i=this.stack.length-r*3;if(i<0||e.getGoto(this.stack[i],s,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;n=a}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(s,i)=>{if(!n.includes(s))return n.push(s),e.allActions(s,a=>{if(!(a&393216))if(a&65536){let l=(a>>19)-i;if(l>1){let c=a&65535,d=this.stack.length-l*3;if(d>=0&&e.getGoto(this.stack[d],c,!1)>=0)return l<<19|65536|c}}else{let l=r(a,i+1);if(l!=null)return l}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;nthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class uA{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class tme{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let s=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=s}}class my{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new my(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new my(this.stack,this.pos,this.index)}}function C1(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,s=0;r=92&&a--,a>=34&&a--;let c=a-32;if(c>=46&&(c-=46,l=!0),i+=c,l)break;i*=46}n?n[s++]=i:n=new e(i)}return n}class wv{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const dA=new wv;class nme{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=dA,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,s=this.rangeIndex,i=this.pos+e;for(;ir.to:i>=r.to;){if(s==this.ranges.length-1)return null;let a=this.ranges[++s];i+=a.from-r.to,r=a}return i}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,s;if(n>=0&&n=this.chunk2Pos&&rl.to&&(this.chunk2=this.chunk2.slice(0,l.to-r)),s=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),s}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=dA,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let s of this.ranges){if(s.from>=n)break;s.to>e&&(r+=this.input.read(Math.max(s.from,e),Math.min(s.to,n)))}return r}}class Fh{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;rme(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}Fh.prototype.contextual=Fh.prototype.fallback=Fh.prototype.extend=!1;Fh.prototype.fallback=Fh.prototype.extend=!1;class jb{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function rme(t,e,n,r,s,i){let a=0,l=1<0){let y=t[x];if(c.allows(y)&&(e.token.value==-1||e.token.value==y||sme(y,e.token.value,s,i))){e.acceptToken(y);break}}let h=e.next,m=0,g=t[a+2];if(e.next<0&&g>m&&t[d+g*3-3]==65535){a=t[d+g*3-1];continue e}for(;m>1,y=d+x+(x<<1),w=t[y],S=t[y+1]||65536;if(h=S)m=x+1;else{a=t[y+2],e.advance();continue e}}break}}function hA(t,e,n){for(let r=e,s;(s=t[r])!=65535;r++)if(s==n)return r-e;return-1}function sme(t,e,n,r){let s=hA(n,r,e);return s<0||hA(n,r,t)e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class ime{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?fA(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?fA(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=a,null;if(i instanceof ur){if(a==e){if(a=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[n]++,this.nextStart=a+i.length}}}class ame{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new wv)}getActions(e){let n=0,r=null,{parser:s}=e.p,{tokenizers:i}=s,a=s.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,c=0;for(let d=0;dm.end+25&&(c=Math.max(m.lookAhead,c)),m.value!=0)){let g=n;if(m.extended>-1&&(n=this.addActions(e,m.extended,m.end,n)),n=this.addActions(e,m.value,m.end,n),!h.extend&&(r=m,n>g))break}}for(;this.actions.length>n;)this.actions.pop();return c&&e.setLookAhead(c),!r&&e.pos==this.stream.end&&(r=new wv,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new wv,{pos:r,p:s}=e;return n.start=r,n.end=Math.min(r+1,s.stream.end),n.value=r==s.stream.end?s.parser.eofTerm:0,n}updateCachedToken(e,n,r){let s=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(s,e),r),e.value>-1){let{parser:i}=r.p;for(let a=0;a=0&&r.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(s+1)}putAction(e,n,r,s){for(let i=0;ie.bufferLength*4?new ime(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],s,i;if(this.bigReductionCount>300&&e.length==1){let[a]=e;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;an)r.push(l);else{if(this.advanceStack(l,r,e))continue;{s||(s=[],i=[]),s.push(l);let c=this.tokens.getMainToken(l);i.push(c.value,c.end)}}break}}if(!r.length){let a=s&&ume(s);if(a)return qi&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw qi&&s&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&s){let a=this.stoppedAt!=null&&s[0].pos>this.stoppedAt?s[0]:this.runRecovery(s,i,r);if(a)return qi&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(r.length>a)for(r.sort((l,c)=>c.score-l.score);r.length>a;)r.pop();r.some(l=>l.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let a=0;a500&&d.buffer.length>500)if((l.score-d.score||l.buffer.length-d.buffer.length)>0)r.splice(c--,1);else{r.splice(a--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let a=1;a ":"";if(this.stoppedAt!=null&&s>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let d=e.curContext&&e.curContext.tracker.strict,h=d?e.curContext.hash:0;for(let m=this.fragments.nodeAt(s);m;){let g=this.parser.nodeSet.types[m.type.id]==m.type?i.getGoto(e.state,m.type.id):-1;if(g>-1&&m.length&&(!d||(m.prop(an.contextHash)||0)==h))return e.useNode(m,g),qi&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(m.type.id)})`),!0;if(!(m instanceof ur)||m.children.length==0||m.positions[0]>0)break;let x=m.children[0];if(x instanceof ur&&m.positions[0]==0)m=x;else break}}let l=i.stateSlot(e.state,4);if(l>0)return e.reduce(l),qi&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let c=this.tokens.getActions(e);for(let d=0;ds?n.push(y):r.push(y)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return mA(e,n),!0}}runRecovery(e,n,r){let s=null,i=!1;for(let a=0;a ":"";if(l.deadEnd&&(i||(i=!0,l.restart(),qi&&console.log(h+this.stackID(l)+" (restarted)"),this.advanceFully(l,r))))continue;let m=l.split(),g=h;for(let x=0;x<10&&m.forceReduce()&&(qi&&console.log(g+this.stackID(m)+" (via force-reduce)"),!this.advanceFully(m,r));x++)qi&&(g=this.stackID(m)+" -> ");for(let x of l.recoverByInsert(c))qi&&console.log(h+this.stackID(x)+" (via recover-insert)"),this.advanceFully(x,r);this.stream.end>l.pos?(d==l.pos&&(d++,c=0),l.recoverByDelete(c,d),qi&&console.log(h+this.stackID(l)+` (via recover-delete ${this.parser.getName(c)})`),mA(l,r)):(!s||s.scoret;class cme{constructor(e){this.start=e.start,this.shift=e.shift||hS,this.reduce=e.reduce||hS,this.reuse=e.reuse||hS,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class lp extends S6{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let l=0;le.topRules[l][1]),s=[];for(let l=0;l=0)i(h,c,l[d++]);else{let m=l[d+-h];for(let g=-h;g>0;g--)i(l[d++],c,m);d++}}}this.nodeSet=new gb(n.map((l,c)=>ai.define({name:c>=this.minRepeatTerm?void 0:l,id:c,props:s[c],top:r.indexOf(c)>-1,error:c==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(c)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Iq;let a=C1(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new Fh(a,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let s=new ome(this,e,n,r);for(let i of this.wrappers)s=i(s,e,n,r);return s}getGoto(e,n,r=!1){let s=this.goto;if(n>=s[0])return-1;for(let i=s[n+1];;){let a=s[i++],l=a&1,c=s[i++];if(l&&r)return c;for(let d=i+(a>>1);i0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),s=r?n(r):void 0;for(let i=this.stateSlot(e,1);s==null;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=_l(this.data,i+2);else break;s=n(_l(this.data,i+1))}return s}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=_l(this.data,r+2);else break;if((this.data[r+2]&1)==0){let s=this.data[r+1];n.some((i,a)=>a&1&&i==s)||n.push(this.data[r],s)}}return n}configure(e){let n=Object.assign(Object.create(lp.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let s=e.tokenizers.find(i=>i.from==r);return s?s.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,s)=>{let i=e.specializers.find(l=>l.from==r.external);if(!i)return r;let a=Object.assign(Object.assign({},r),{external:i.to});return n.specializers[s]=pA(a),a})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let i of e.split(" ")){let a=n.indexOf(i);a>=0&&(r[a]=!0)}let s=null;for(let i=0;ir)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.scoret.external(n,r)<<1|e}return t.get}const dme=1,yH=194,bH=195,hme=196,gA=197,fme=198,mme=199,pme=200,gme=2,wH=3,xA=201,xme=24,vme=25,yme=49,bme=50,wme=55,Sme=56,kme=57,Ome=59,jme=60,Nme=61,Cme=62,Tme=63,Eme=65,_me=238,Ame=71,Mme=241,Rme=242,Dme=243,Pme=244,zme=245,Ime=246,Lme=247,Bme=248,SH=72,Fme=249,qme=250,$me=251,Hme=252,Qme=253,Vme=254,Ume=255,Wme=256,Gme=73,Xme=77,Yme=263,Kme=112,Zme=130,Jme=151,e0e=152,t0e=155,fd=10,cp=13,V6=32,Nb=9,U6=35,n0e=40,r0e=46,xO=123,vA=125,kH=39,OH=34,yA=92,s0e=111,i0e=120,a0e=78,o0e=117,l0e=85,c0e=new Set([vme,yme,bme,Yme,Eme,Zme,Sme,kme,_me,Cme,Tme,SH,Gme,Xme,jme,Nme,Jme,e0e,t0e,Kme]);function fS(t){return t==fd||t==cp}function mS(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const u0e=new jb((t,e)=>{let n;if(t.next<0)t.acceptToken(mme);else if(e.context.flags&Sv)fS(t.next)&&t.acceptToken(fme,1);else if(((n=t.peek(-1))<0||fS(n))&&e.canShift(gA)){let r=0;for(;t.next==V6||t.next==Nb;)t.advance(),r++;(t.next==fd||t.next==cp||t.next==U6)&&t.acceptToken(gA,-r)}else fS(t.next)&&t.acceptToken(hme,1)},{contextual:!0}),d0e=new jb((t,e)=>{let n=e.context;if(n.flags)return;let r=t.peek(-1);if(r==fd||r==cp){let s=0,i=0;for(;;){if(t.next==V6)s++;else if(t.next==Nb)s+=8-s%8;else break;t.advance(),i++}s!=n.indent&&t.next!=fd&&t.next!=cp&&t.next!=U6&&(s[t,e|jH])),m0e=new cme({start:h0e,reduce(t,e,n,r){return t.flags&Sv&&c0e.has(e)||(e==Ame||e==SH)&&t.flags&jH?t.parent:t},shift(t,e,n,r){return e==yH?new kv(t,f0e(r.read(r.pos,n.pos)),0):e==bH?t.parent:e==xme||e==wme||e==Ome||e==wH?new kv(t,0,Sv):bA.has(e)?new kv(t,0,bA.get(e)|t.flags&Sv):t},hash(t){return t.hash}}),p0e=new jb(t=>{for(let e=0;e<5;e++){if(t.next!="print".charCodeAt(e))return;t.advance()}if(!/\w/.test(String.fromCharCode(t.next)))for(let e=0;;e++){let n=t.peek(e);if(!(n==V6||n==Nb)){n!=n0e&&n!=r0e&&n!=fd&&n!=cp&&n!=U6&&t.acceptToken(dme);return}}}),g0e=new jb((t,e)=>{let{flags:n}=e.context,r=n&jl?OH:kH,s=(n&Nl)>0,i=!(n&Cl),a=(n&Tl)>0,l=t.pos;for(;!(t.next<0);)if(a&&t.next==xO)if(t.peek(1)==xO)t.advance(2);else{if(t.pos==l){t.acceptToken(wH,1);return}break}else if(i&&t.next==yA){if(t.pos==l){t.advance();let c=t.next;c>=0&&(t.advance(),x0e(t,c)),t.acceptToken(gme);return}break}else if(t.next==yA&&!i&&t.peek(1)>-1)t.advance(2);else if(t.next==r&&(!s||t.peek(1)==r&&t.peek(2)==r)){if(t.pos==l){t.acceptToken(xA,s?3:1);return}break}else if(t.next==fd){if(s)t.advance();else if(t.pos==l){t.acceptToken(xA);return}break}else t.advance();t.pos>l&&t.acceptToken(pme)});function x0e(t,e){if(e==s0e)for(let n=0;n<2&&t.next>=48&&t.next<=55;n++)t.advance();else if(e==i0e)for(let n=0;n<2&&mS(t.next);n++)t.advance();else if(e==o0e)for(let n=0;n<4&&mS(t.next);n++)t.advance();else if(e==l0e)for(let n=0;n<8&&mS(t.next);n++)t.advance();else if(e==a0e&&t.next==xO){for(t.advance();t.next>=0&&t.next!=vA&&t.next!=kH&&t.next!=OH&&t.next!=fd;)t.advance();t.next==vA&&t.advance()}}const v0e=k6({'async "*" "**" FormatConversion FormatSpec':ye.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":ye.controlKeyword,"in not and or is del":ye.operatorKeyword,"from def class global nonlocal lambda":ye.definitionKeyword,import:ye.moduleKeyword,"with as print":ye.keyword,Boolean:ye.bool,None:ye.null,VariableName:ye.variableName,"CallExpression/VariableName":ye.function(ye.variableName),"FunctionDefinition/VariableName":ye.function(ye.definition(ye.variableName)),"ClassDefinition/VariableName":ye.definition(ye.className),PropertyName:ye.propertyName,"CallExpression/MemberExpression/PropertyName":ye.function(ye.propertyName),Comment:ye.lineComment,Number:ye.number,String:ye.string,FormatString:ye.special(ye.string),Escape:ye.escape,UpdateOp:ye.updateOperator,"ArithOp!":ye.arithmeticOperator,BitOp:ye.bitwiseOperator,CompareOp:ye.compareOperator,AssignOp:ye.definitionOperator,Ellipsis:ye.punctuation,At:ye.meta,"( )":ye.paren,"[ ]":ye.squareBracket,"{ }":ye.brace,".":ye.derefOperator,", ;":ye.separator}),y0e={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},b0e=lp.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:lQdO,59aO'vQdO,59aO:zQdO,59aOOQS,59y,59yO;PQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;_QdO,5:QO;dQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;uQdO,5:UO;zQdO,5:WOOOW'#Fy'#FyOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/[QtO1G.|O!/cQtO1G.|O1lQdO1G.|O!0OQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!0VQdO1G/eO!0gQdO1G/eO!0oQdO1G/fO'vQdO'#H[O!0tQdO'#H[O!0yQtO1G.{O!1ZQdO,59iO!2aQdO,5=zO!2qQdO,5=zO!2yQdO1G/mO!3OQtO1G/mOOQS1G/l1G/lO!3`QdO,5=uO!4VQdO,5=uO0rQdO1G/qO!4tQdO1G/sO!4yQtO1G/sO!5ZQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5kQdO'#HxO0rQdO'#HxO!5|QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6[Q#xO1G2zO!6{QtO1G2zO'vQdO,5kOOQS1G1`1G1`O!8RQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!8WQdO'#FrO!8cQdO,59oO!8kQdO1G/XO!8uQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9fQdO'#GtOOQS,5jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!lO!lO!hO!=VQdO,5>hO!=hQdO'#EpO0rQdO1G0tO!=sQdO1G0tO!=xQgO1G0zO!AvQgO1G0}O!EqQdO,5>oO!E{QdO,5>oO!FTQtO,5>oO0rQdO1G1PO!F_QdO1G1PO4iQdO1G1UO!!vQdO1G1WOOQV,5;a,5;aO!FdQfO,5;aO!FiQgO1G1QO!JjQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JzQdO,5>pO!KXQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KaQdO'#FSO!KrQ!fO1G1WO!KzQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!LPQdO1G1]O!LXQdO'#F^OOQV1G1b1G1bO!#ZQtO1G1bPOOO1G2v1G2vP!L^OSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LfQdO,5=|O!LyQdO,5=|OOQS1G/u1G/uO!MRQdO,5>PO!McQdO,5>PO!MkQdO,5>PO!NOQdO,5>PO!N`QdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8kQdO7+$pO#!RQdO1G.|O#!YQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!aQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!qQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!vQdO7+%PO##OQdO7+%QO##TQdO1G3fOOQS7+%X7+%XO##eQdO1G3fO##mQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##rQdO1G3aOOQS-E9q-E9qO#$iQdO7+%]OOQS7+%_7+%_O#$wQdO1G3aO#%fQdO7+%_O#%kQdO1G3gO#%{QdO1G3gO#&TQdO7+%]O#&YQdO,5>dO#&sQdO,5>dO#&sQdO,5>dOOQS'#Dx'#DxO#'UO&jO'#DzO#'aO`O'#HyOOOW1G3}1G3}O#'fQdO1G3}O#'nQdO1G3}O#'yQ#xO7+(fO#(jQtO1G2UP#)TQdO'#GOOOQS,5nQdO,5sQdO1G4OOOQS-E9y-E9yO#?^QdO1G4OO<[QdO'#H{OOOO'#D{'#D{OOOO'#F|'#F|O#?oO&jO,5:fOOOW,5>e,5>eOOOW7+)i7+)iO#?zQdO7+)iO#@SQdO1G2zO#@mQdO1G2zP'vQdO'#FuO0rQdO<mO#BQQdO,5>mOOQS1G0v1G0vOOQS<rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ oQdO<cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<tO$4{QdO,5>tO1XQdO,5vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5wO$8zQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)nQdO'#GdO$9SQdO1G4bO$9^QdO1G4bO$9fQdO1G4bOOQS7+%T7+%TO$9tQdO1G1tO$:SQtO'#FaO$:ZQdO,5<}OOQS,5<},5<}O$:iQdO1G4cOOQS-E:a-E:aO$)nQdO,5<|O$:pQdO,5<|O$:uQdO7+)|OOQS-E:`-E:`O$;PQdO7+)|O$)nQdO,5S~O%cOS%^OSSOS%]PQ~OPdOVaOfoOhYOopOs!POvqO!PrO!Q{O!T!SO!U!RO!XZO!][O!h`O!r`O!s`O!t`O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#l!QO#o!TO#s!UO#u!VO#z!WO#}hO$P!XO%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~O%]!YO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%j![O%k!]O%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aO~Ok%xXl%xXm%xXn%xXo%xXp%xXs%xXz%xX{%xX!x%xX#g%xX%[%xX%_%xX%z%xXg%xX!T%xX!U%xX%{%xX!W%xX![%xX!Q%xX#[%xXt%xX!m%xX~P%SOfoOhYO!XZO!][O!h`O!r`O!s`O!t`O%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~Oz%wX{%wX#g%wX%[%wX%_%wX%z%wX~Ok!pOl!qOm!oOn!oOo!rOp!sOs!tO!x%wX~P)pOV!zOg!|Oo0cOv0qO!PrO~P'vOV#OOo0cOv0qO!W#PO~P'vOV#SOa#TOo0cOv0qO![#UO~P'vOQ#XO%`#XO%a#ZO~OQ#^OR#[O%`#^O%a#`O~OV%iX_%iXa%iXh%iXk%iXl%iXm%iXn%iXo%iXp%iXs%iXz%iX!X%iX!f%iX%j%iX%k%iX%l%iX%m%iX%n%iX%o%iX%p%iX%q%iX%r%iX%s%iXg%iX!T%iX!U%iX~O&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O{%iX!x%iX#g%iX%[%iX%_%iX%z%iX%{%iX!W%iX![%iX!Q%iX#[%iXt%iX!m%iX~P,eOz#dO{%hX!x%hX#g%hX%[%hX%_%hX%z%hX~Oo0cOv0qO~P'vO#g#gO%[#iO%_#iO~O%uWO~O!T#nO#u!VO#z!WO#}hO~OopO~P'vOV#sOa#tO%uWO{wP~OV#xOo0cOv0qO!Q#yO~P'vO{#{O!x$QO%z#|O#g!yX%[!yX%_!yX~OV#xOo0cOv0qO#g#SX%[#SX%_#SX~P'vOo0cOv0qO#g#WX%[#WX%_#WX~P'vOh$WO%uWO~O!f$YO!r$YO%uWO~OV$eO~P'vO!U$gO#s$hO#u$iO~O{$jO~OV$qO~P'vOS$sO%[$rO%_$rO%c$tO~OV$}Oa$}Og%POo0cOv0qO~P'vOo0cOv0qO{%SO~P'vO&Y%UO~Oa!bOh!iO!X!kO!f!mOVba_bakbalbambanbaobapbasbazba{ba!xba#gba%[ba%_ba%jba%kba%lba%mba%nba%oba%pba%qba%rba%sba%zbagba!Tba!Uba%{ba!Wba![ba!Qba#[batba!mba~On%ZO~Oo%ZO~P'vOo0cO~P'vOk0eOl0fOm0dOn0dOo0mOp0nOs0rOg%wX!T%wX!U%wX%{%wX!W%wX![%wX!Q%wX#[%wX!m%wX~P)pO%{%]Og%vXz%vX!T%vX!U%vX!W%vX{%vX~Og%_Oz%`O!T%dO!U%cO~Og%_O~Oz%gO!T%dO!U%cO!W&SX~O!W%kO~Oz%lO{%nO!T%dO!U%cO![%}X~O![%rO~O![%sO~OQ#XO%`#XO%a%uO~OV%wOo0cOv0qO!PrO~P'vOQ#^OR#[O%`#^O%a%zO~OV!qa_!qaa!qah!qak!qal!qam!qan!qao!qap!qas!qaz!qa{!qa!X!qa!f!qa!x!qa#g!qa%[!qa%_!qa%j!qa%k!qa%l!qa%m!qa%n!qa%o!qa%p!qa%q!qa%r!qa%s!qa%z!qag!qa!T!qa!U!qa%{!qa!W!qa![!qa!Q!qa#[!qat!qa!m!qa~P#yOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P%SOV&OOopOvqO{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P'vOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#g$zX%[$zX%_$zX~P'vO#g#gO%[&TO%_&TO~O!f&UOh&sX%[&sXz&sX#[&sX#g&sX%_&sX#Z&sXg&sX~Oh!iO%[&WO~Okealeameaneaoeapeaseazea{ea!xea#gea%[ea%_ea%zeagea!Tea!Uea%{ea!Wea![ea!Qea#[eatea!mea~P%SOsqazqa{qa#gqa%[qa%_qa%zqa~Ok!pOl!qOm!oOn!oOo!rOp!sO!xqa~PEcO%z&YOz%yX{%yX~O%uWOz%yX{%yX~Oz&]O{wX~O{&_O~Oz%lO#g%}X%[%}X%_%}Xg%}X{%}X![%}X!m%}X%z%}X~OV0lOo0cOv0qO!PrO~P'vO%z#|O#gUa%[Ua%_Ua~Oz&hO#g&PX%[&PX%_&PXn&PX~P%SOz&kO!Q&jO#g#Wa%[#Wa%_#Wa~Oz&lO#[&nO#g&rX%[&rX%_&rXg&rX~O!f$YO!r$YO#Z&qO%uWO~O#Z&qO~Oz&sO#g&tX%[&tX%_&tX~Oz&uO#g&pX%[&pX%_&pX{&pX~O!X&wO%z&xO~Oz&|On&wX~P%SOn'PO~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO%['UO~P'vOt'YO#p'WO#q'XOP#naV#naf#nah#nao#nas#nav#na!P#na!Q#na!T#na!U#na!X#na!]#na!h#na!r#na!s#na!t#na!{#na!}#na#P#na#R#na#T#na#X#na#Z#na#^#na#_#na#a#na#c#na#l#na#o#na#s#na#u#na#z#na#}#na$P#na%X#na%o#na%p#na%t#na%u#na&Z#na&[#na&]#na&^#na&_#na&`#na&a#na&b#na&c#na&d#na&e#na&f#na&g#na&h#na&i#na&j#na%Z#na%_#na~Oz'ZO#[']O{&xX~Oh'_O!X&wO~Oh!iO{$jO!X&wO~O{'eO~P%SO%['hO%_'hO~OS'iO%['hO%_'hO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%k!]O~P!#uO%kWi~P!#uOV!aO_!aOa!bOh!iO!X!kO!f!mO%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%m!_O%n!_O~P!&pO%mWi%nWi~P!&pOa!bOh!iO!X!kO!f!mOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%mWi%nWi%oWi%pWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~OV!aO_!aO%q!aO%r!aO%s!aO~P!)nOVWi_Wi%qWi%rWi%sWi~P!)nO!T%dO!U%cOg&VXz&VX~O%z'kO%{'kO~P,eOz'mOg&UX~Og'oO~Oz'pO{'rO!W&XX~Oo0cOv0qOz'pO{'sO!W&XX~P'vO!W'uO~Om!oOn!oOo!rOp!sOkjisjizji{ji!xji#gji%[ji%_ji%zji~Ol!qO~P!.aOlji~P!.aOk0eOl0fOm0dOn0dOo0mOp0nO~Ot'wO~P!/jOV'|Og'}Oo0cOv0qO~P'vOg'}Oz(OO~Og(QO~O!U(SO~Og(TOz(OO!T%dO!U%cO~P%SOk0eOl0fOm0dOn0dOo0mOp0nOgqa!Tqa!Uqa%{qa!Wqa![qa!Qqa#[qatqa!mqa~PEcOV'|Oo0cOv0qO!W&Sa~P'vOz(WO!W&Sa~O!W(XO~Oz(WO!T%dO!U%cO!W&Sa~P%SOV(]Oo0cOv0qO![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~P'vOz(^O![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~O![(aO~Oz(^O!T%dO!U%cO![%}a~P%SOz(dO!T%dO!U%cO![&Ta~P%SOz(gO{&lX![&lX!m&lX%z&lX~O{(kO![(mO!m(nO%z(jO~OV&OOopOvqO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~P'vOz(pO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~O!f&UOh&sa%[&saz&sa#[&sa#g&sa%_&sa#Z&sag&sa~O%[(uO~OV#sOa#tO%uWO~Oz&]O{wa~OopOvqO~P'vOz(^O#g%}a%[%}a%_%}ag%}a{%}a![%}a!m%}a%z%}a~P%SOz(zO#g%hX%[%hX%_%hX%z%hX~O%z#|O#gUi%[Ui%_Ui~O#g&Pa%[&Pa%_&Pan&Pa~P'vOz(}O#g&Pa%[&Pa%_&Pan&Pa~O%uWO#g&ra%[&ra%_&rag&ra~Oz)SO#g&ra%[&ra%_&rag&ra~Og)VO~OV)WOh$WO%uWO~O#Z)XO~O%uWO#g&ta%[&ta%_&ta~Oz)ZO#g&ta%[&ta%_&ta~Oo0cOv0qO#g&pa%[&pa%_&pa{&pa~P'vOz)^O#g&pa%[&pa%_&pa{&pa~OV)`Oa)`O%uWO~O%z)eO~Ot)hO#j)gOP#hiV#hif#hih#hio#his#hiv#hi!P#hi!Q#hi!T#hi!U#hi!X#hi!]#hi!h#hi!r#hi!s#hi!t#hi!{#hi!}#hi#P#hi#R#hi#T#hi#X#hi#Z#hi#^#hi#_#hi#a#hi#c#hi#l#hi#o#hi#s#hi#u#hi#z#hi#}#hi$P#hi%X#hi%o#hi%p#hi%t#hi%u#hi&Z#hi&[#hi&]#hi&^#hi&_#hi&`#hi&a#hi&b#hi&c#hi&d#hi&e#hi&f#hi&g#hi&h#hi&i#hi&j#hi%Z#hi%_#hi~Ot)iOP#kiV#kif#kih#kio#kis#kiv#ki!P#ki!Q#ki!T#ki!U#ki!X#ki!]#ki!h#ki!r#ki!s#ki!t#ki!{#ki!}#ki#P#ki#R#ki#T#ki#X#ki#Z#ki#^#ki#_#ki#a#ki#c#ki#l#ki#o#ki#s#ki#u#ki#z#ki#}#ki$P#ki%X#ki%o#ki%p#ki%t#ki%u#ki&Z#ki&[#ki&]#ki&^#ki&_#ki&`#ki&a#ki&b#ki&c#ki&d#ki&e#ki&f#ki&g#ki&h#ki&i#ki&j#ki%Z#ki%_#ki~OV)kOn&wa~P'vOz)lOn&wa~Oz)lOn&wa~P%SOn)pO~O%Y)tO~Ot)wO#p'WO#q)vOP#niV#nif#nih#nio#nis#niv#ni!P#ni!Q#ni!T#ni!U#ni!X#ni!]#ni!h#ni!r#ni!s#ni!t#ni!{#ni!}#ni#P#ni#R#ni#T#ni#X#ni#Z#ni#^#ni#_#ni#a#ni#c#ni#l#ni#o#ni#s#ni#u#ni#z#ni#}#ni$P#ni%X#ni%o#ni%p#ni%t#ni%u#ni&Z#ni&[#ni&]#ni&^#ni&_#ni&`#ni&a#ni&b#ni&c#ni&d#ni&e#ni&f#ni&g#ni&h#ni&i#ni&j#ni%Z#ni%_#ni~OV)zOo0cOv0qO{$jO~P'vOo0cOv0qO{&xa~P'vOz*OO{&xa~OV*SOa*TOg*WO%q*UO%uWO~O{$jO&{*YO~Oh'_O~Oh!iO{$jO~O%[*_O~O%[*aO%_*aO~OV$}Oa$}Oo0cOv0qOg&Ua~P'vOz*dOg&Ua~Oo0cOv0qO{*gO!W&Xa~P'vOz*hO!W&Xa~Oo0cOv0qOz*hO{*kO!W&Xa~P'vOo0cOv0qOz*hO!W&Xa~P'vOz*hO{*kO!W&Xa~Om0dOn0dOo0mOp0nOgjikjisjizji!Tji!Uji%{ji!Wji{ji![ji#gji%[ji%_ji!Qji#[jitji!mji%zji~Ol0fO~P!NkOlji~P!NkOV'|Og*pOo0cOv0qO~P'vOn*rO~Og*pOz*tO~Og*uO~OV'|Oo0cOv0qO!W&Si~P'vOz*vO!W&Si~O!W*wO~OV(]Oo0cOv0qO![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~P'vOz*zO!T%dO!U%cO![&Ti~Oz*}O![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~O![+OO~Oa+QOo0cOv0qO![&Ti~P'vOz*zO![&Ti~O![+SO~OV+UOo0cOv0qO{&la![&la!m&la%z&la~P'vOz+VO{&la![&la!m&la%z&la~O!]+YO&n+[O![!nX~O![+^O~O{(kO![+_O~O{(kO![+_O!m+`O~OV&OOopOvqO{%hq!x%hq#g%hq%[%hq%_%hq%z%hq~P'vOz$ri{$ri!x$ri#g$ri%[$ri%_$ri%z$ri~P%SOV&OOopOvqO~P'vOV&OOo0cOv0qO#g%ha%[%ha%_%ha%z%ha~P'vOz+aO#g%ha%[%ha%_%ha%z%ha~Oz$ia#g$ia%[$ia%_$ian$ia~P%SO#g&Pi%[&Pi%_&Pin&Pi~P'vOz+dO#g#Wq%[#Wq%_#Wq~O#[+eOz$va#g$va%[$va%_$vag$va~O%uWO#g&ri%[&ri%_&rig&ri~Oz+gO#g&ri%[&ri%_&rig&ri~OV+iOh$WO%uWO~O%uWO#g&ti%[&ti%_&ti~Oo0cOv0qO#g&pi%[&pi%_&pi{&pi~P'vO{#{Oz#eX!W#eX~Oz+mO!W&uX~O!W+oO~Ot+rO#j)gOP#hqV#hqf#hqh#hqo#hqs#hqv#hq!P#hq!Q#hq!T#hq!U#hq!X#hq!]#hq!h#hq!r#hq!s#hq!t#hq!{#hq!}#hq#P#hq#R#hq#T#hq#X#hq#Z#hq#^#hq#_#hq#a#hq#c#hq#l#hq#o#hq#s#hq#u#hq#z#hq#}#hq$P#hq%X#hq%o#hq%p#hq%t#hq%u#hq&Z#hq&[#hq&]#hq&^#hq&_#hq&`#hq&a#hq&b#hq&c#hq&d#hq&e#hq&f#hq&g#hq&h#hq&i#hq&j#hq%Z#hq%_#hq~On$|az$|a~P%SOV)kOn&wi~P'vOz+yOn&wi~Oz,TO{$jO#[,TO~O#q,VOP#nqV#nqf#nqh#nqo#nqs#nqv#nq!P#nq!Q#nq!T#nq!U#nq!X#nq!]#nq!h#nq!r#nq!s#nq!t#nq!{#nq!}#nq#P#nq#R#nq#T#nq#X#nq#Z#nq#^#nq#_#nq#a#nq#c#nq#l#nq#o#nq#s#nq#u#nq#z#nq#}#nq$P#nq%X#nq%o#nq%p#nq%t#nq%u#nq&Z#nq&[#nq&]#nq&^#nq&_#nq&`#nq&a#nq&b#nq&c#nq&d#nq&e#nq&f#nq&g#nq&h#nq&i#nq&j#nq%Z#nq%_#nq~O#[,WOz%Oa{%Oa~Oo0cOv0qO{&xi~P'vOz,YO{&xi~O{#{O%z,[Og&zXz&zX~O%uWOg&zXz&zX~Oz,`Og&yX~Og,bO~O%Y,eO~O!T%dO!U%cOg&Viz&Vi~OV$}Oa$}Oo0cOv0qOg&Ui~P'vO{,hOz$la!W$la~Oo0cOv0qO{,iOz$la!W$la~P'vOo0cOv0qO{*gO!W&Xi~P'vOz,lO!W&Xi~Oo0cOv0qOz,lO!W&Xi~P'vOz,lO{,oO!W&Xi~Og$hiz$hi!W$hi~P%SOV'|Oo0cOv0qO~P'vOn,qO~OV'|Og,rOo0cOv0qO~P'vOV'|Oo0cOv0qO!W&Sq~P'vOz$gi![$gi#g$gi%[$gi%_$gig$gi{$gi!m$gi%z$gi~P%SOV(]Oo0cOv0qO~P'vOa+QOo0cOv0qO![&Tq~P'vOz,sO![&Tq~O![,tO~OV(]Oo0cOv0qO![%}q#g%}q%[%}q%_%}qg%}q{%}q!m%}q%z%}q~P'vO{,uO~OV+UOo0cOv0qO{&li![&li!m&li%z&li~P'vOz,zO{&li![&li!m&li%z&li~O!]+YO&n+[O![!na~O{(kO![,}O~OV&OOo0cOv0qO#g%hi%[%hi%_%hi%z%hi~P'vOz-OO#g%hi%[%hi%_%hi%z%hi~O%uWO#g&rq%[&rq%_&rqg&rq~Oz-RO#g&rq%[&rq%_&rqg&rq~OV)`Oa)`O%uWO!W&ua~Oz-TO!W&ua~On$|iz$|i~P%SOV)kO~P'vOV)kOn&wq~P'vOt-XOP#myV#myf#myh#myo#mys#myv#my!P#my!Q#my!T#my!U#my!X#my!]#my!h#my!r#my!s#my!t#my!{#my!}#my#P#my#R#my#T#my#X#my#Z#my#^#my#_#my#a#my#c#my#l#my#o#my#s#my#u#my#z#my#}#my$P#my%X#my%o#my%p#my%t#my%u#my&Z#my&[#my&]#my&^#my&_#my&`#my&a#my&b#my&c#my&d#my&e#my&f#my&g#my&h#my&i#my&j#my%Z#my%_#my~O%Z-]O%_-]O~P`O#q-^OP#nyV#nyf#nyh#nyo#nys#nyv#ny!P#ny!Q#ny!T#ny!U#ny!X#ny!]#ny!h#ny!r#ny!s#ny!t#ny!{#ny!}#ny#P#ny#R#ny#T#ny#X#ny#Z#ny#^#ny#_#ny#a#ny#c#ny#l#ny#o#ny#s#ny#u#ny#z#ny#}#ny$P#ny%X#ny%o#ny%p#ny%t#ny%u#ny&Z#ny&[#ny&]#ny&^#ny&_#ny&`#ny&a#ny&b#ny&c#ny&d#ny&e#ny&f#ny&g#ny&h#ny&i#ny&j#ny%Z#ny%_#ny~Oz-aO{$jO#[-aO~Oo0cOv0qO{&xq~P'vOz-dO{&xq~O%z,[Og&zaz&za~O{#{Og&zaz&za~OV*SOa*TO%q*UO%uWOg&ya~Oz-hOg&ya~O$S-lO~OV$}Oa$}Oo0cOv0qO~P'vOo0cOv0qO{-mOz$li!W$li~P'vOo0cOv0qOz$li!W$li~P'vO{-mOz$li!W$li~Oo0cOv0qO{*gO~P'vOo0cOv0qO{*gO!W&Xq~P'vOz-pO!W&Xq~Oo0cOv0qOz-pO!W&Xq~P'vOs-sO!T%dO!U%cOg&Oq!W&Oq![&Oqz&Oq~P!/jOa+QOo0cOv0qO![&Ty~P'vOz$ji![$ji~P%SOa+QOo0cOv0qO~P'vOV+UOo0cOv0qO~P'vOV+UOo0cOv0qO{&lq![&lq!m&lq%z&lq~P'vO{(kO![-xO!m-yO%z-wO~OV&OOo0cOv0qO#g%hq%[%hq%_%hq%z%hq~P'vO%uWO#g&ry%[&ry%_&ryg&ry~OV)`Oa)`O%uWO!W&ui~Ot-}OP#m!RV#m!Rf#m!Rh#m!Ro#m!Rs#m!Rv#m!R!P#m!R!Q#m!R!T#m!R!U#m!R!X#m!R!]#m!R!h#m!R!r#m!R!s#m!R!t#m!R!{#m!R!}#m!R#P#m!R#R#m!R#T#m!R#X#m!R#Z#m!R#^#m!R#_#m!R#a#m!R#c#m!R#l#m!R#o#m!R#s#m!R#u#m!R#z#m!R#}#m!R$P#m!R%X#m!R%o#m!R%p#m!R%t#m!R%u#m!R&Z#m!R&[#m!R&]#m!R&^#m!R&_#m!R&`#m!R&a#m!R&b#m!R&c#m!R&d#m!R&e#m!R&f#m!R&g#m!R&h#m!R&i#m!R&j#m!R%Z#m!R%_#m!R~Oo0cOv0qO{&xy~P'vOV*SOa*TO%q*UO%uWOg&yi~O$S-lO%Z.VO%_.VO~OV.aOh._O!X.^O!].`O!h.YO!s.[O!t.[O%p.XO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O~Oo0cOv0qOz$lq!W$lq~P'vO{.fOz$lq!W$lq~Oo0cOv0qO{*gO!W&Xy~P'vOz.gO!W&Xy~Oo0cOv.kO~P'vOs-sO!T%dO!U%cOg&Oy!W&Oy![&Oyz&Oy~P!/jO{(kO![.nO~O{(kO![.nO!m.oO~OV*SOa*TO%q*UO%uWO~Oh.tO!f.rOz$TX#[$TX%j$TXg$TX~Os$TX{$TX!W$TX![$TX~P$-bO%o.vO%p.vOs$UXz$UX{$UX#[$UX%j$UX!W$UXg$UX![$UX~O!h.xO~Oz.|O#[/OO%j.yOs&|X{&|X!W&|Xg&|X~Oa/RO~P$)zOh.tOs&}Xz&}X{&}X#[&}X%j&}X!W&}Xg&}X![&}X~Os/VO{$jO~Oo0cOv0qOz$ly!W$ly~P'vOo0cOv0qO{*gO!W&X!R~P'vOz/ZO!W&X!R~Og&RXs&RX!T&RX!U&RX!W&RX![&RXz&RX~P!/jOs-sO!T%dO!U%cOg&Qa!W&Qa![&Qaz&Qa~O{(kO![/^O~O!f.rOh$[as$[az$[a{$[a#[$[a%j$[a!W$[ag$[a![$[a~O!h/eO~O%o.vO%p.vOs$Uaz$Ua{$Ua#[$Ua%j$Ua!W$Uag$Ua![$Ua~O%j.yOs$Yaz$Ya{$Ya#[$Ya!W$Yag$Ya![$Ya~Os&|a{&|a!W&|ag&|a~P$)nOz/jOs&|a{&|a!W&|ag&|a~O!W/mO~Og/mO~O{/oO~O![/pO~Oo0cOv0qO{*gO!W&X!Z~P'vO{/sO~O%z/tO~P$-bOz/uO#[/OO%j.yOg'PX~Oz/uOg'PX~Og/wO~O!h/xO~O#[/OOs%Saz%Sa{%Sa%j%Sa!W%Sag%Sa![%Sa~O#[/OO%j.yOs%Waz%Wa{%Wa!W%Wag%Wa~Os&|i{&|i!W&|ig&|i~P$)nOz/zO#[/OO%j.yO!['Oa~Og'Pa~P$)nOz0SOg'Pa~Oa0UO!['Oi~P$)zOz0WO!['Oi~Oz0WO#[/OO%j.yO!['Oi~O#[/OO%j.yOg$biz$bi~O%z0ZO~P$-bO#[/OO%j.yOg%Vaz%Va~Og'Pi~P$)nO{0^O~Oa0UO!['Oq~P$)zOz0`O!['Oq~O#[/OO%j.yOz%Ui![%Ui~Oa0UO~P$)zOa0UO!['Oy~P$)zO#[/OO%j.yOg$ciz$ci~O#[/OO%j.yOz%Uq![%Uq~Oz+aO#g%ha%[%ha%_%ha%z%ha~P%SOV&OOo0cOv0qO~P'vOn0hO~Oo0hO~P'vO{0iO~Ot0jO~P!/jO&]&Z&j&h&i&g&f&d&e&c&b&`&a&_&^&[%u~",goto:"!=j'QPPPPPP'RP'Z*s+[+t,_,y-fP.SP'Z.r.r'ZPPP'Z2[PPPPPP2[5PPP5PP7b7k=sPP=v>h>kPP'Z'ZPP>zPP'Z'ZPP'Z'Z'Z'Z'Z?O?w'ZP?zP@QDXGuGyPG|HWH['ZPPPH_Hk'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHqH}IVPI^IdPI^PI^I^PPPI^PKrPK{LVL]KrPI^LfPI^PLmLsPLwM]MzNeLwLwNkNxLwLwLwLw! ^! d! g! l! o! y!!P!!]!!o!!u!#P!#V!#s!#y!$P!$Z!$a!$g!$y!%T!%Z!%a!%k!%q!%w!%}!&T!&Z!&e!&k!&u!&{!'U!'[!'k!'s!'}!(UPPPPPPPPPPP!([!(_!(e!(n!(x!)TPPPPPPPPPPPP!-u!/Z!3^!6oPP!6w!7W!7a!8Y!8P!8c!8i!8l!8o!8r!8z!9jPPPPPPPPPPPPPPPPP!9m!9q!9wP!:]!:a!:m!:v!;S!;j!;m!;p!;v!;|!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[p0e,d0e,u0e,g0e,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>y0e[t]||-1}],tokenPrec:7668}),wA=new Ice,NH=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function T1(t){return(e,n,r)=>{if(r)return!1;let s=e.node.getChild("VariableName");return s&&n(s,t),!0}}const w0e={FunctionDefinition:T1("function"),ClassDefinition:T1("class"),ForStatement(t,e,n){if(n){for(let r=t.node.firstChild;r;r=r.nextSibling)if(r.name=="VariableName")e(r,"variable");else if(r.name=="in")break}},ImportStatement(t,e){var n,r;let{node:s}=t,i=((n=s.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let a=s.getChild("import");a;a=a.nextSibling)a.name=="VariableName"&&((r=a.nextSibling)===null||r===void 0?void 0:r.name)!="as"&&e(a,i?"variable":"namespace")},AssignStatement(t,e){for(let n=t.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")e(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(t,e){for(let n=null,r=t.node.firstChild;r;r=r.nextSibling)r.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&e(r,"variable"),n=r},CapturePattern:T1("variable"),AsPattern:T1("variable"),__proto__:null};function CH(t,e){let n=wA.get(e);if(n)return n;let r=[],s=!0;function i(a,l){let c=t.sliceString(a.from,a.to);r.push({label:c,type:l})}return e.cursor(hs.IncludeAnonymous).iterate(a=>{if(a.name){let l=w0e[a.name];if(l&&l(a,i,s)||!s&&NH.has(a.name))return!1;s=!1}else if(a.to-a.from>8192){for(let l of CH(t,a.node))r.push(l);return!1}}),wA.set(e,r),r}const SA=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,TH=["String","FormatString","Comment","PropertyName"];function S0e(t){let e=Ss(t.state).resolveInner(t.pos,-1);if(TH.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&SA.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let s=e;s;s=s.parent)NH.has(s.name)&&(r=r.concat(CH(t.state.doc,s)));return{options:r,from:n?e.from:t.pos,validFor:SA}}const k0e=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(t=>({label:t,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(t=>({label:t,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(t=>({label:t,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(t=>({label:t,type:"function"}))),O0e=[wl("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),wl("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),wl("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),wl("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),wl(`if \${}: - -`,{label:"if",detail:"block",type:"keyword"}),wl("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),wl("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),wl("import ${module}",{label:"import",detail:"statement",type:"keyword"}),wl("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],j0e=Che(TH,nH(k0e.concat(O0e)));function pS(t){let{node:e,pos:n}=t,r=t.lineIndent(n,-1),s=null;for(;;){let i=e.childBefore(n);if(i)if(i.name=="Comment")n=i.from;else if(i.name=="Body"||i.name=="MatchBody")t.baseIndentFor(i)+t.unit<=r&&(s=i),e=i;else if(i.name=="MatchClause")e=i;else if(i.type.is("Statement"))e=i;else break;else break}return s}function gS(t,e){let n=t.baseIndentFor(e),r=t.lineAt(t.pos,-1),s=r.from+r.text.length;return/^\s*($|#)/.test(r.text)&&t.node.ton?null:n+t.unit}const xS=J0.define({name:"python",parser:b0e.configure({props:[vb.add({Body:t=>{var e;let n=/^\s*(#|$)/.test(t.textAfter)&&pS(t)||t.node;return(e=gS(t,n))!==null&&e!==void 0?e:t.continue()},MatchBody:t=>{var e;let n=pS(t);return(e=gS(t,n||t.node))!==null&&e!==void 0?e:t.continue()},IfStatement:t=>/^\s*(else:|elif )/.test(t.textAfter)?t.baseIndent:t.continue(),"ForStatement WhileStatement":t=>/^\s*else:/.test(t.textAfter)?t.baseIndent:t.continue(),TryStatement:t=>/^\s*(except[ :]|finally:|else:)/.test(t.textAfter)?t.baseIndent:t.continue(),MatchStatement:t=>/^\s*case /.test(t.textAfter)?t.baseIndent+t.unit:t.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":J4({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":J4({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":J4({closing:"]"}),MemberExpression:t=>t.baseIndent+t.unit,"String FormatString":()=>null,Script:t=>{var e;let n=pS(t);return(e=n&&gS(t,n))!==null&&e!==void 0?e:t.continue()}}),N6.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":Gq,Body:(t,e)=>({from:t.from+1,to:t.to-(t.to==e.doc.length?0:1)}),"String FormatString":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function N0e(){return new Vq(xS,[xS.data.of({autocomplete:S0e}),xS.data.of({autocomplete:j0e})])}const C0e=k6({String:ye.string,Number:ye.number,"True False":ye.bool,PropertyName:ye.propertyName,Null:ye.null,", :":ye.separator,"[ ]":ye.squareBracket,"{ }":ye.brace}),T0e=lp.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[C0e],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),E0e=()=>t=>{try{JSON.parse(t.state.doc.toString())}catch(e){if(!(e instanceof SyntaxError))throw e;const n=_0e(e,t.state.doc);return[{from:n,message:e.message,severity:"error",to:n}]}return[]};function _0e(t,e){let n;return(n=t.message.match(/at position (\d+)/))?Math.min(+n[1],e.length):(n=t.message.match(/at line (\d+) column (\d+)/))?Math.min(e.line(+n[1]).from+ +n[2]-1,e.length):0}const A0e=J0.define({name:"json",parser:T0e.configure({props:[vb.add({Object:k_({except:/^\s*\}/}),Array:k_({except:/^\s*\]/})}),N6.add({"Object Array":Gq})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function M0e(){return new Vq(A0e)}const R0e={name:"toml",startState:function(){return{inString:!1,stringType:"",lhs:!0,inArray:0}},token:function(t,e){let n;if(!e.inString&&(n=t.match(/^('''|"""|'|")/))&&(e.stringType=n[0],e.inString=!0),t.sol()&&!e.inString&&e.inArray===0&&(e.lhs=!0),e.inString){for(;e.inString;)if(t.match(e.stringType))e.inString=!1;else if(t.peek()==="\\")t.next(),t.next();else{if(t.eol())break;t.match(/^.[^\\\"\']*/)}return e.lhs?"property":"string"}else{if(e.inArray&&t.peek()==="]")return t.next(),e.inArray--,"bracket";if(e.lhs&&t.peek()==="["&&t.skipTo("]"))return t.next(),t.peek()==="]"&&t.next(),"atom";if(t.peek()==="#")return t.skipToEnd(),"comment";if(t.eatSpace())return null;if(e.lhs&&t.eatWhile(function(r){return r!="="&&r!=" "}))return"property";if(e.lhs&&t.peek()==="=")return t.next(),e.lhs=!1,null;if(!e.lhs&&t.match(/^\d\d\d\d[\d\-\:\.T]*Z/))return"atom";if(!e.lhs&&(t.match("true")||t.match("false")))return"atom";if(!e.lhs&&t.peek()==="[")return e.inArray++,t.next(),"bracket";if(!e.lhs&&t.match(/^\-?\d+(?:\.\d+)?/))return"number";t.eatSpace()||t.next()}return null},languageData:{commentTokens:{line:"#"}}},D0e={python:[N0e()],json:[M0e(),E0e()],toml:[C6.define(R0e)],text:[]};function P0e({value:t,onChange:e,language:n="text",readOnly:r=!1,height:s="400px",minHeight:i,maxHeight:a,placeholder:l,theme:c="dark",className:d=""}){const[h,m]=b.useState(!1);if(b.useEffect(()=>{m(!0)},[]),!h)return o.jsx("div",{className:`rounded-md border bg-muted animate-pulse ${d}`,style:{height:s,minHeight:i,maxHeight:a}});const g=[...D0e[n]||[],Ze.lineWrapping];return r&&g.push(Ze.editable.of(!1)),o.jsx("div",{className:`rounded-md overflow-hidden border ${d}`,children:o.jsx(vH,{value:t,height:s,minHeight:i,maxHeight:a,theme:c==="dark"?xH:void 0,extensions:g,onChange:e,placeholder:l,basicSetup:{lineNumbers:!0,highlightActiveLineGutter:!0,highlightSpecialChars:!0,history:!0,foldGutter:!0,drawSelection:!0,dropCursor:!0,allowMultipleSelections:!0,indentOnInput:!0,syntaxHighlighting:!0,bracketMatching:!0,closeBrackets:!0,autocompletion:!0,rectangularSelection:!0,crosshairCursor:!0,highlightActiveLine:!0,highlightSelectionMatches:!0,closeBracketsKeymap:!0,defaultKeymap:!0,searchKeymap:!0,historyKeymap:!0,foldKeymap:!0,completionKeymap:!0,lintKeymap:!0}})})}function z0e(){const[t,e]=b.useState(!0),[n,r]=b.useState(!1),[s,i]=b.useState(!1),[a,l]=b.useState(!1),[c,d]=b.useState(!1),[h,m]=b.useState(!1),[g,x]=b.useState("visual"),[y,w]=b.useState(""),[S,k]=b.useState(!1),{toast:j}=Lr(),[N,T]=b.useState(null),[E,_]=b.useState(null),[A,D]=b.useState(null),[q,B]=b.useState(null),[H,W]=b.useState(null),[ee,I]=b.useState(null),[V,L]=b.useState(null),[$,K]=b.useState(null),[Y,R]=b.useState(null),[ie,X]=b.useState(null),[z,U]=b.useState(null),[te,ne]=b.useState(null),[G,se]=b.useState(null),[re,ae]=b.useState(null),[_e,Be]=b.useState(null),[Ye,Je]=b.useState(null),[Oe,Ve]=b.useState(null),[Ue,$e]=b.useState(null),jt=b.useRef(null),vt=b.useRef(!0),$n=b.useRef({}),qt=b.useCallback(async()=>{try{const We=await kae();w(We),k(!1)}catch(We){j({variant:"destructive",title:"加载失败",description:We instanceof Error?We.message:"加载源代码失败"})}},[j]),un=b.useCallback(async()=>{try{e(!0);const We=await dE();$n.current=We,T(We.bot),_(We.personality);const ot=We.chat;ot.talk_value_rules||(ot.talk_value_rules=[]),D(ot),B(We.expression),W(We.emoji),I(We.memory),L(We.tool),K(We.mood),R(We.voice),X(We.lpmm_knowledge),U(We.keyword_reaction),ne(We.response_post_process),se(We.chinese_typo),ae(We.response_splitter),Be(We.log),Je(We.debug),Ve(We.maim_message),$e(We.telemetry),l(!1),vt.current=!1,await qt()}catch(We){console.error("加载配置失败:",We),j({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}finally{e(!1)}},[j,qt]);b.useEffect(()=>{un()},[un]);const Mt=b.useCallback(async(We,ot)=>{if(!vt.current)try{i(!0),await jae(We,ot),l(!1)}catch(dn){console.error(`自动保存 ${We} 失败:`,dn),l(!0)}finally{i(!1)}},[]),ct=b.useCallback((We,ot)=>{vt.current||(l(!0),jt.current&&clearTimeout(jt.current),jt.current=setTimeout(()=>{Mt(We,ot)},2e3))},[Mt]);b.useEffect(()=>{N&&!vt.current&&ct("bot",N)},[N,ct]),b.useEffect(()=>{E&&!vt.current&&ct("personality",E)},[E,ct]),b.useEffect(()=>{A&&!vt.current&&ct("chat",A)},[A,ct]),b.useEffect(()=>{q&&!vt.current&&ct("expression",q)},[q,ct]),b.useEffect(()=>{H&&!vt.current&&ct("emoji",H)},[H,ct]),b.useEffect(()=>{ee&&!vt.current&&ct("memory",ee)},[ee,ct]),b.useEffect(()=>{V&&!vt.current&&ct("tool",V)},[V,ct]),b.useEffect(()=>{$&&!vt.current&&ct("mood",$)},[$,ct]),b.useEffect(()=>{Y&&!vt.current&&ct("voice",Y)},[Y,ct]),b.useEffect(()=>{ie&&!vt.current&&ct("lpmm_knowledge",ie)},[ie,ct]),b.useEffect(()=>{z&&!vt.current&&ct("keyword_reaction",z)},[z,ct]),b.useEffect(()=>{te&&!vt.current&&ct("response_post_process",te)},[te,ct]),b.useEffect(()=>{G&&!vt.current&&ct("chinese_typo",G)},[G,ct]),b.useEffect(()=>{re&&!vt.current&&ct("response_splitter",re)},[re,ct]),b.useEffect(()=>{_e&&!vt.current&&ct("log",_e)},[_e,ct]),b.useEffect(()=>{Ye&&!vt.current&&ct("debug",Ye)},[Ye,ct]),b.useEffect(()=>{Oe&&!vt.current&&ct("maim_message",Oe)},[Oe,ct]),b.useEffect(()=>{Ue&&!vt.current&&ct("telemetry",Ue)},[Ue,ct]);const Ne=async()=>{try{r(!0),await Oae(y),l(!1),k(!1),j({title:"保存成功",description:"配置已保存"}),await un()}catch(We){k(!0),j({variant:"destructive",title:"保存失败",description:We instanceof Error?We.message:"保存配置失败"})}finally{r(!1)}},ze=async We=>{if(a){j({variant:"destructive",title:"切换失败",description:"请先保存当前更改"});return}if(x(We),We==="source")await qt();else try{const ot=await dE();$n.current=ot,T(ot.bot),_(ot.personality);const dn=ot.chat;dn.talk_value_rules||(dn.talk_value_rules=[]),D(dn),B(ot.expression),W(ot.emoji),I(ot.memory),L(ot.tool),K(ot.mood),R(ot.voice),X(ot.lpmm_knowledge),U(ot.keyword_reaction),ne(ot.response_post_process),se(ot.chinese_typo),ae(ot.response_splitter),Be(ot.log),Je(ot.debug),Ve(ot.maim_message),$e(ot.telemetry),l(!1)}catch(ot){console.error("加载配置失败:",ot),j({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}},rt=async()=>{try{r(!0),jt.current&&clearTimeout(jt.current);const We={...$n.current,bot:N,personality:E,chat:A,expression:q,emoji:H,memory:ee,tool:V,mood:$,voice:Y,lpmm_knowledge:ie,keyword_reaction:z,response_post_process:te,chinese_typo:G,response_splitter:re,log:_e,debug:Ye,maim_message:Oe,telemetry:Ue};await hE(We),l(!1),j({title:"保存成功",description:"麦麦主程序配置已保存"})}catch(We){console.error("保存配置失败:",We),j({title:"保存失败",description:We.message,variant:"destructive"})}finally{r(!1)}},bt=async()=>{try{d(!0),cb().catch(()=>{}),m(!0)}catch(We){console.error("重启失败:",We),m(!1),j({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),d(!1)}},zt=async()=>{try{r(!0),jt.current&&clearTimeout(jt.current);const We={...$n.current,bot:N,personality:E,chat:A,expression:q,emoji:H,memory:ee,tool:V,mood:$,voice:Y,lpmm_knowledge:ie,keyword_reaction:z,response_post_process:te,chinese_typo:G,response_splitter:re,log:_e,debug:Ye,maim_message:Oe,telemetry:Ue};await hE(We),l(!1),j({title:"保存成功",description:"配置已保存,即将重启麦麦..."}),await new Promise(ot=>setTimeout(ot,500)),await bt()}catch(We){console.error("保存失败:",We),j({title:"保存失败",description:We.message,variant:"destructive"})}finally{r(!1)}},Rt=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},Hn=()=>{m(!1),d(!1),j({title:"重启失败",description:"服务器未能在预期时间内恢复,请手动检查",variant:"destructive"})};return t?o.jsx(pn,{className:"h-full",children:o.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):o.jsx(pn,{className:"h-full",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦主程序配置"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的核心功能和行为设置"})]}),o.jsxs("div",{className:"flex gap-2 w-full sm:w-auto items-center",children:[o.jsx(Yi,{value:g,onValueChange:We=>ze(We),className:"w-auto",children:o.jsxs(ji,{className:"h-9",children:[o.jsxs(Bt,{value:"visual",className:"text-xs sm:text-sm px-2 sm:px-3",children:[o.jsx(Xee,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1"}),"可视化"]}),o.jsxs(Bt,{value:"source",className:"text-xs sm:text-sm px-2 sm:px-3",children:[o.jsx(Yee,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1"}),"源代码"]})]})}),o.jsxs(ue,{onClick:g==="visual"?rt:Ne,disabled:n||s||!a||c,size:"sm",variant:"outline",className:"flex-1 sm:flex-none",children:[o.jsx(zp,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),n?"保存中...":s?"自动保存中...":a?"保存配置":"已保存"]}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsxs(ue,{disabled:n||s||c,size:"sm",className:"flex-1 sm:flex-none",children:[o.jsx(Dp,{className:"mr-2 h-4 w-4"}),c?"重启中...":a?"保存并重启":"重启麦麦"]})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认重启麦麦?"}),o.jsx(zn,{className:"space-y-3",asChild:!0,children:o.jsxs("div",{children:[o.jsx("p",{children:a?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"}),o.jsxs(ba,{className:"border-yellow-500/50 bg-yellow-500/10",children:[o.jsx(Xi,{className:"h-4 w-4 text-yellow-600"}),o.jsxs(wa,{className:"text-yellow-900 dark:text-yellow-100",children:[o.jsx("strong",{children:"重要提示:"}),"由于技术原因,使用重启功能后,将无法再使用 ",o.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。",o.jsxs(Er,{children:[o.jsx(Of,{asChild:!0,children:o.jsxs("button",{className:"ml-1 text-yellow-700 dark:text-yellow-300 underline hover:text-yellow-800 dark:hover:text-yellow-200 inline-flex items-center gap-1",children:[o.jsx(Zy,{className:"h-3 w-3"}),"如何结束程序?"]})}),o.jsxs(wr,{className:"max-w-2xl",children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"如何结束使用重启功能后的麦麦程序"}),o.jsx(Xr,{children:"由于重启功能会使程序脱离终端控制,需要通过系统命令来结束进程"})]}),o.jsxs(Yi,{defaultValue:"windows",className:"w-full",children:[o.jsxs(ji,{className:"grid w-full grid-cols-3",children:[o.jsx(Bt,{value:"windows",children:"Windows"}),o.jsx(Bt,{value:"macos",children:"macOS"}),o.jsx(Bt,{value:"linux",children:"Linux"})]}),o.jsxs(ln,{value:"windows",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法一:使用任务管理器"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Ctrl + Shift + Esc"})," 打开任务管理器"]}),o.jsxs("li",{children:['在"进程"或"详细信息"标签页中找到 ',o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"python.exe"})]}),o.jsx("li",{children:'右键点击并选择"结束任务"'})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法二:使用命令行"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开 PowerShell 或命令提示符,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:'Get-Process python | Where-Object {$_.MainWindowTitle -eq ""}'}),o.jsx("p",{className:"mt-2",children:"# 结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"Stop-Process -Name python -Force"})]})]})]}),o.jsxs(ln,{value:"macos",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法一:使用活动监视器"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Cmd + Space"}),' 打开 Spotlight,搜索"活动监视器"']}),o.jsxs("li",{children:["在进程列表中找到 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Python"})]}),o.jsx("li",{children:"选中后点击左上角的 X 按钮结束进程"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法二:使用终端"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:"ps aux | grep python | grep -v grep"}),o.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),o.jsx("p",{children:"kill -9 "}),o.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"pkill -9 python"})]})]})]}),o.jsxs(ln,{value:"linux",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"使用终端命令"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:"ps aux | grep python | grep -v grep"}),o.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),o.jsx("p",{children:"kill -9 "}),o.jsx("p",{className:"mt-2",children:"# 或使用 pkill 按名称结束"}),o.jsx("p",{children:'pkill -9 -f "bot.py"'}),o.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"pkill -9 python"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"使用 htop(如已安装)"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["在终端输入 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"htop"})]}),o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F3"})," 搜索 python"]}),o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F9"})," 发送信号,选择 SIGKILL"]})]})]})]})]}),o.jsx(fs,{children:o.jsx(e6,{asChild:!0,children:o.jsx(ue,{variant:"outline",children:"关闭"})})})]})]})]})]})]})})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:a?zt:bt,children:a?"保存并重启":"确认重启"})]})]})]})]})]}),o.jsxs(ba,{children:[o.jsx(Xi,{className:"h-4 w-4"}),o.jsxs(wa,{children:["配置更新后需要",o.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),g==="source"&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs(ba,{children:[o.jsx(Xi,{className:"h-4 w-4"}),o.jsxs(wa,{children:[o.jsx("strong",{children:"源代码模式(高级功能):"}),"直接编辑 TOML 配置文件。此功能仅适用于熟悉 TOML 语法的高级用户。保存时会在后端验证格式,只有格式完全正确才能保存。",S&&o.jsx("span",{className:"text-destructive font-semibold ml-2",children:"⚠️ 上次保存失败,请检查 TOML 格式"})]})]}),o.jsx(P0e,{value:y,onChange:We=>{w(We),l(!0),S&&k(!1)},language:"toml",theme:"dark",height:"calc(100vh - 280px)",minHeight:"500px",placeholder:"TOML 配置内容"})]}),g==="visual"&&o.jsx(o.Fragment,{children:o.jsxs(Yi,{defaultValue:"bot",className:"w-full",children:[o.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:o.jsxs(ji,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5 lg:grid-cols-10",children:[o.jsx(Bt,{value:"bot",className:"flex-shrink-0",children:"基本信息"}),o.jsx(Bt,{value:"personality",className:"flex-shrink-0",children:"人格"}),o.jsx(Bt,{value:"chat",className:"flex-shrink-0",children:"聊天"}),o.jsx(Bt,{value:"expression",className:"flex-shrink-0",children:"表达"}),o.jsx(Bt,{value:"features",className:"flex-shrink-0",children:"功能"}),o.jsx(Bt,{value:"processing",className:"flex-shrink-0",children:"处理"}),o.jsx(Bt,{value:"mood",className:"flex-shrink-0",children:"情绪"}),o.jsx(Bt,{value:"voice",className:"flex-shrink-0",children:"语音"}),o.jsx(Bt,{value:"lpmm",className:"flex-shrink-0",children:"知识库"}),o.jsx(Bt,{value:"other",className:"flex-shrink-0",children:"其他"})]})}),o.jsx(ln,{value:"bot",className:"space-y-4",children:N&&o.jsx(I0e,{config:N,onChange:T})}),o.jsx(ln,{value:"personality",className:"space-y-4",children:E&&o.jsx(L0e,{config:E,onChange:_})}),o.jsx(ln,{value:"chat",className:"space-y-4",children:A&&o.jsx(B0e,{config:A,onChange:D})}),o.jsx(ln,{value:"expression",className:"space-y-4",children:q&&o.jsx(q0e,{config:q,onChange:B})}),o.jsx(ln,{value:"features",className:"space-y-4",children:H&&ee&&V&&o.jsx($0e,{emojiConfig:H,memoryConfig:ee,toolConfig:V,onEmojiChange:W,onMemoryChange:I,onToolChange:L})}),o.jsx(ln,{value:"processing",className:"space-y-4",children:z&&te&&G&&re&&o.jsx(H0e,{keywordReactionConfig:z,responsePostProcessConfig:te,chineseTypoConfig:G,responseSplitterConfig:re,onKeywordReactionChange:U,onResponsePostProcessChange:ne,onChineseTypoChange:se,onResponseSplitterChange:ae})}),o.jsx(ln,{value:"mood",className:"space-y-4",children:$&&o.jsx(Q0e,{config:$,onChange:K})}),o.jsx(ln,{value:"voice",className:"space-y-4",children:Y&&o.jsx(V0e,{config:Y,onChange:R})}),o.jsx(ln,{value:"lpmm",className:"space-y-4",children:ie&&o.jsx(U0e,{config:ie,onChange:X})}),o.jsxs(ln,{value:"other",className:"space-y-4",children:[_e&&o.jsx(W0e,{config:_e,onChange:Be}),Ye&&o.jsx(G0e,{config:Ye,onChange:Je}),Oe&&o.jsx(X0e,{config:Oe,onChange:Ve}),Ue&&o.jsx(Y0e,{config:Ue,onChange:$e})]})]})}),h&&o.jsx(r6,{onRestartComplete:Rt,onRestartFailed:Hn})]})})}function I0e({config:t,onChange:e}){const n=()=>{e({...t,platforms:[...t.platforms,""]})},r=c=>{e({...t,platforms:t.platforms.filter((d,h)=>h!==c)})},s=(c,d)=>{const h=[...t.platforms];h[c]=d,e({...t,platforms:h})},i=()=>{e({...t,alias_names:[...t.alias_names,""]})},a=c=>{e({...t,alias_names:t.alias_names.filter((d,h)=>h!==c)})},l=(c,d)=>{const h=[...t.alias_names];h[c]=d,e({...t,alias_names:h})};return o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"基本信息"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"platform",children:"平台"}),o.jsx(Pe,{id:"platform",value:t.platform,onChange:c=>e({...t,platform:c.target.value}),placeholder:"qq"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"qq_account",children:"QQ账号"}),o.jsx(Pe,{id:"qq_account",value:t.qq_account,onChange:c=>e({...t,qq_account:c.target.value}),placeholder:"123456789"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"nickname",children:"昵称"}),o.jsx(Pe,{id:"nickname",value:t.nickname,onChange:c=>e({...t,nickname:c.target.value}),placeholder:"麦麦"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{children:"其他平台账号"}),o.jsxs(ue,{onClick:n,size:"sm",variant:"outline",children:[o.jsx(Is,{className:"h-4 w-4 mr-1"}),"添加"]})]}),o.jsxs("div",{className:"space-y-2",children:[t.platforms.map((c,d)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Pe,{value:c,onChange:h=>s(d,h.target.value),placeholder:"wx:114514"}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsx(ue,{size:"icon",variant:"outline",children:o.jsx(Cn,{className:"h-4 w-4"})})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:['确定要删除平台账号 "',c||"(空)",'" 吗?此操作无法撤销。']})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>r(d),children:"删除"})]})]})]})]},d)),t.platforms.length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无其他平台账号"})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{children:"别名"}),o.jsxs(ue,{onClick:i,size:"sm",variant:"outline",children:[o.jsx(Is,{className:"h-4 w-4 mr-1"}),"添加"]})]}),o.jsxs("div",{className:"space-y-2",children:[t.alias_names.map((c,d)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Pe,{value:c,onChange:h=>l(d,h.target.value),placeholder:"小麦"}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsx(ue,{size:"icon",variant:"outline",children:o.jsx(Cn,{className:"h-4 w-4"})})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:['确定要删除别名 "',c||"(空)",'" 吗?此操作无法撤销。']})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>a(d),children:"删除"})]})]})]})]},d)),t.alias_names.length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无别名"})]})]})]})]})})}function L0e({config:t,onChange:e}){const n=()=>{e({...t,states:[...t.states,""]})},r=i=>{e({...t,states:t.states.filter((a,l)=>l!==i)})},s=(i,a)=>{const l=[...t.states];l[i]=a,e({...t,states:l})};return o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"人格设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"personality",children:"人格特质"}),o.jsx(Nr,{id:"personality",value:t.personality,onChange:i=>e({...t,personality:i.target.value}),placeholder:"描述人格特质和身份特征(建议120字以内)",rows:3}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"建议120字以内,描述人格特质和身份特征"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"reply_style",children:"表达风格"}),o.jsx(Nr,{id:"reply_style",value:t.reply_style,onChange:i=>e({...t,reply_style:i.target.value}),placeholder:"描述说话的表达风格和习惯",rows:3})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"interest",children:"兴趣"}),o.jsx(Nr,{id:"interest",value:t.interest,onChange:i=>e({...t,interest:i.target.value}),placeholder:"会影响麦麦对什么话题进行回复",rows:2})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"plan_style",children:"说话规则与行为风格"}),o.jsx(Nr,{id:"plan_style",value:t.plan_style,onChange:i=>e({...t,plan_style:i.target.value}),placeholder:"麦麦的说话规则和行为风格",rows:5})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"visual_style",children:"识图规则"}),o.jsx(Nr,{id:"visual_style",value:t.visual_style,onChange:i=>e({...t,visual_style:i.target.value}),placeholder:"识图时的处理规则",rows:3})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"private_plan_style",children:"私聊规则"}),o.jsx(Nr,{id:"private_plan_style",value:t.private_plan_style,onChange:i=>e({...t,private_plan_style:i.target.value}),placeholder:"私聊的说话规则和行为风格",rows:4})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{children:"状态列表(人格多样性)"}),o.jsxs(ue,{onClick:n,size:"sm",variant:"outline",children:[o.jsx(Is,{className:"h-4 w-4 mr-1"}),"添加状态"]})]}),o.jsx("div",{className:"space-y-2",children:t.states.map((i,a)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Nr,{value:i,onChange:l=>s(a,l.target.value),placeholder:"描述一个人格状态",rows:2}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsx(ue,{size:"icon",variant:"outline",children:o.jsx(Cn,{className:"h-4 w-4"})})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsx(zn,{children:"确定要删除这个人格状态吗?此操作无法撤销。"})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>r(a),children:"删除"})]})]})]})]},a))})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"state_probability",children:"状态替换概率"}),o.jsx(Pe,{id:"state_probability",type:"number",step:"0.1",min:"0",max:"1",value:t.state_probability,onChange:i=>e({...t,state_probability:parseFloat(i.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"每次构建人格时替换 personality 的概率(0.0-1.0)"})]})]})]})})}function B0e({config:t,onChange:e}){const n=()=>{e({...t,talk_value_rules:[...t.talk_value_rules,{target:"",time:"00:00-23:59",value:1}]})},r=l=>{e({...t,talk_value_rules:t.talk_value_rules.filter((c,d)=>d!==l)})},s=(l,c,d)=>{const h=[...t.talk_value_rules];h[l]={...h[l],[c]:d},e({...t,talk_value_rules:h})},i=({value:l,onChange:c})=>{const[d,h]=b.useState("00"),[m,g]=b.useState("00"),[x,y]=b.useState("23"),[w,S]=b.useState("59");b.useEffect(()=>{const j=l.split("-");if(j.length===2){const[N,T]=j,[E,_]=N.split(":"),[A,D]=T.split(":");E&&h(E.padStart(2,"0")),_&&g(_.padStart(2,"0")),A&&y(A.padStart(2,"0")),D&&S(D.padStart(2,"0"))}},[l]);const k=(j,N,T,E)=>{const _=`${j}:${N}-${T}:${E}`;c(_)};return o.jsxs(Bo,{children:[o.jsx(Fo,{asChild:!0,children:o.jsxs(ue,{variant:"outline",className:"w-full justify-start font-mono text-sm",children:[o.jsx(Mh,{className:"h-4 w-4 mr-2"}),l||"选择时间段"]})}),o.jsx(Ka,{className:"w-80",children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium text-sm mb-3",children:"开始时间"}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-xs",children:"小时"}),o.jsxs(Vt,{value:d,onValueChange:j=>{h(j),k(j,m,x,w)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:Array.from({length:24},(j,N)=>N).map(j=>o.jsx(De,{value:j.toString().padStart(2,"0"),children:j.toString().padStart(2,"0")},j))})]})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-xs",children:"分钟"}),o.jsxs(Vt,{value:m,onValueChange:j=>{g(j),k(d,j,x,w)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:Array.from({length:60},(j,N)=>N).map(j=>o.jsx(De,{value:j.toString().padStart(2,"0"),children:j.toString().padStart(2,"0")},j))})]})]})]})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium text-sm mb-3",children:"结束时间"}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-xs",children:"小时"}),o.jsxs(Vt,{value:x,onValueChange:j=>{y(j),k(d,m,j,w)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:Array.from({length:24},(j,N)=>N).map(j=>o.jsx(De,{value:j.toString().padStart(2,"0"),children:j.toString().padStart(2,"0")},j))})]})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-xs",children:"分钟"}),o.jsxs(Vt,{value:w,onValueChange:j=>{S(j),k(d,m,x,j)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:Array.from({length:60},(j,N)=>N).map(j=>o.jsx(De,{value:j.toString().padStart(2,"0"),children:j.toString().padStart(2,"0")},j))})]})]})]})]})]})})]})},a=({rule:l})=>{const c=`{ target = "${l.target}", time = "${l.time}", value = ${l.value.toFixed(1)} }`;return o.jsxs(Bo,{children:[o.jsx(Fo,{asChild:!0,children:o.jsxs(ue,{variant:"outline",size:"sm",children:[o.jsx(Ji,{className:"h-4 w-4 mr-1"}),"预览"]})}),o.jsx(Ka,{className:"w-96",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),o.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:c}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"聊天设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"talk_value",children:"聊天频率(基础值)"}),o.jsx(Pe,{id:"talk_value",type:"number",step:"0.1",min:"0",max:"1",value:t.talk_value,onChange:l=>e({...t,talk_value:parseFloat(l.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"越小越沉默,范围 0-1"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"mentioned_bot_reply",checked:t.mentioned_bot_reply,onCheckedChange:l=>e({...t,mentioned_bot_reply:l})}),o.jsx(he,{htmlFor:"mentioned_bot_reply",className:"cursor-pointer",children:"启用提及必回复"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"max_context_size",children:"上下文长度"}),o.jsx(Pe,{id:"max_context_size",type:"number",min:"1",value:t.max_context_size,onChange:l=>e({...t,max_context_size:parseInt(l.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"planner_smooth",children:"规划器平滑"}),o.jsx(Pe,{id:"planner_smooth",type:"number",step:"1",min:"0",value:t.planner_smooth,onChange:l=>e({...t,planner_smooth:parseFloat(l.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"增大数值会减小 planner 负荷,推荐 1-5,0 为关闭"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"enable_talk_value_rules",checked:t.enable_talk_value_rules,onCheckedChange:l=>e({...t,enable_talk_value_rules:l})}),o.jsx(he,{htmlFor:"enable_talk_value_rules",className:"cursor-pointer",children:"启用动态发言频率规则"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"include_planner_reasoning",checked:t.include_planner_reasoning,onCheckedChange:l=>e({...t,include_planner_reasoning:l})}),o.jsx(he,{htmlFor:"include_planner_reasoning",className:"cursor-pointer",children:"将 planner 推理加入 replyer"})]})]})]}),t.enable_talk_value_rules&&o.jsxs("div",{className:"border-t pt-6",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-base font-semibold",children:"动态发言频率规则"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"按时段或聊天流ID调整发言频率,优先匹配具体聊天,再匹配全局规则"})]}),o.jsxs(ue,{onClick:n,size:"sm",children:[o.jsx(Is,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),t.talk_value_rules&&t.talk_value_rules.length>0?o.jsx("div",{className:"space-y-4",children:t.talk_value_rules.map((l,c)=>o.jsxs("div",{className:"rounded-lg border p-4 bg-muted/50 space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["规则 #",c+1]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(a,{rule:l}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsx(ue,{variant:"ghost",size:"sm",children:o.jsx(Cn,{className:"h-4 w-4 text-destructive"})})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:["确定要删除规则 #",c+1," 吗?此操作无法撤销。"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>r(c),children:"删除"})]})]})]})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"配置类型"}),o.jsxs(Vt,{value:l.target===""?"global":"specific",onValueChange:d=>{d==="global"?s(c,"target",""):s(c,"target","qq::group")},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"global",children:"全局配置"}),o.jsx(De,{value:"specific",children:"详细配置"})]})]})]}),l.target!==""&&(()=>{const d=l.target.split(":"),h=d[0]||"qq",m=d[1]||"",g=d[2]||"group";return o.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[o.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"平台"}),o.jsxs(Vt,{value:h,onValueChange:x=>{s(c,"target",`${x}:${m}:${g}`)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"qq",children:"QQ"}),o.jsx(De,{value:"wx",children:"微信"})]})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"群 ID"}),o.jsx(Pe,{value:m,onChange:x=>{s(c,"target",`${h}:${x.target.value}:${g}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"类型"}),o.jsxs(Vt,{value:g,onValueChange:x=>{s(c,"target",`${h}:${m}:${x}`)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"group",children:"群组(group)"}),o.jsx(De,{value:"private",children:"私聊(private)"})]})]})]})]}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",l.target||"(未设置)"]})]})})(),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"时间段 (Time)"}),o.jsx(i,{value:l.time,onChange:d=>s(c,"time",d)}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"支持跨夜区间,例如 23:00-02:00"})]}),o.jsxs("div",{className:"grid gap-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{htmlFor:`rule-value-${c}`,className:"text-xs font-medium",children:"发言频率值 (Value)"}),o.jsx(Pe,{id:`rule-value-${c}`,type:"number",step:"0.01",min:"0.01",max:"1",value:l.value,onChange:d=>{const h=parseFloat(d.target.value);isNaN(h)||s(c,"value",Math.max(.01,Math.min(1,h)))},className:"w-20 h-8 text-xs"})]}),o.jsx(Nf,{value:[l.value],onValueChange:d=>s(c,"value",d[0]),min:.01,max:1,step:.01,className:"w-full"}),o.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[o.jsx("span",{children:"0.01 (极少发言)"}),o.jsx("span",{children:"0.5"}),o.jsx("span",{children:"1.0 (正常)"})]})]})]})]},c))}):o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:o.jsx("p",{className:"text-sm",children:'暂无规则,点击"添加规则"按钮创建'})}),o.jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg",children:[o.jsx("h5",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"📝 规则说明"}),o.jsxs("ul",{className:"text-xs text-blue-800 dark:text-blue-200 space-y-1",children:[o.jsxs("li",{children:["• ",o.jsx("strong",{children:"Target 为空"}),":全局规则,对所有聊天生效"]}),o.jsxs("li",{children:["• ",o.jsx("strong",{children:"Target 指定"}),":仅对特定聊天流生效(格式:platform:id:type)"]}),o.jsxs("li",{children:["• ",o.jsx("strong",{children:"优先级"}),":先匹配具体聊天流规则,再匹配全局规则"]}),o.jsxs("li",{children:["• ",o.jsx("strong",{children:"时间支持跨夜"}),":例如 23:00-02:00 表示晚上11点到次日凌晨2点"]}),o.jsxs("li",{children:["• ",o.jsx("strong",{children:"数值范围"}),":建议 0-1,0 表示完全沉默,1 表示正常发言"]})]})]})]})]})}function F0e({member:t,groupIndex:e,memberIndex:n,availableChatIds:r,onUpdate:s,onRemove:i}){const a=r.includes(t)||t==="*",[l,c]=b.useState(!a);return o.jsxs("div",{className:"flex gap-2",children:[o.jsx("div",{className:"flex-1 flex gap-2",children:l?o.jsxs(o.Fragment,{children:[o.jsx(Pe,{value:t,onChange:d=>s(e,n,d.target.value),placeholder:'输入 "*" 或 "qq:123456:group"',className:"flex-1"}),r.length>0&&o.jsx(ue,{size:"sm",variant:"outline",onClick:()=>c(!1),title:"切换到下拉选择",children:"下拉"})]}):o.jsxs(o.Fragment,{children:[o.jsxs(Vt,{value:t,onValueChange:d=>s(e,n,d),children:[o.jsx($t,{className:"flex-1",children:o.jsx(Ut,{placeholder:"选择聊天流"})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"*",children:"* (全局共享)"}),r.map((d,h)=>o.jsx(De,{value:d,children:d},h))]})]}),o.jsx(ue,{size:"sm",variant:"outline",onClick:()=>c(!0),title:"切换到手动输入",children:"输入"})]})}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsx(ue,{size:"icon",variant:"outline",children:o.jsx(Cn,{className:"h-4 w-4"})})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:['确定要删除组成员 "',t||"(空)",'" 吗?此操作无法撤销。']})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>i(e,n),children:"删除"})]})]})]})]})}function q0e({config:t,onChange:e}){const n=()=>{e({...t,learning_list:[...t.learning_list,["","enable","enable","1.0"]]})},r=m=>{e({...t,learning_list:t.learning_list.filter((g,x)=>x!==m)})},s=(m,g,x)=>{const y=[...t.learning_list];y[m][g]=x,e({...t,learning_list:y})},i=({rule:m})=>{const g=`["${m[0]}", "${m[1]}", "${m[2]}", "${m[3]}"]`;return o.jsxs(Bo,{children:[o.jsx(Fo,{asChild:!0,children:o.jsxs(ue,{variant:"outline",size:"sm",children:[o.jsx(Ji,{className:"h-4 w-4 mr-1"}),"预览"]})}),o.jsx(Ka,{className:"w-96",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),o.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:g}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},a=()=>{e({...t,expression_groups:[...t.expression_groups,[]]})},l=m=>{e({...t,expression_groups:t.expression_groups.filter((g,x)=>x!==m)})},c=m=>{const g=[...t.expression_groups];g[m]=[...g[m],""],e({...t,expression_groups:g})},d=(m,g)=>{const x=[...t.expression_groups];x[m]=x[m].filter((y,w)=>w!==g),e({...t,expression_groups:x})},h=(m,g,x)=>{const y=[...t.expression_groups];y[m][g]=x,e({...t,expression_groups:y})};return o.jsxs("div",{className:"space-y-6",children:[o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold",children:"表达学习配置"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置麦麦如何学习和使用表达方式"})]}),o.jsxs(ue,{onClick:n,size:"sm",variant:"outline",children:[o.jsx(Is,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),o.jsxs("div",{className:"space-y-4",children:[t.learning_list.map((m,g)=>{const x=t.learning_list.some((N,T)=>T!==g&&N[0]===""),y=m[0]==="",w=m[0].split(":"),S=w[0]||"qq",k=w[1]||"",j=w[2]||"group";return o.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium",children:["规则 ",g+1," ",y&&"(全局配置)"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(i,{rule:m}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsx(ue,{size:"sm",variant:"ghost",children:o.jsx(Cn,{className:"h-4 w-4"})})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:["确定要删除学习规则 ",g+1," 吗?此操作无法撤销。"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>r(g),children:"删除"})]})]})]})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"配置类型"}),o.jsxs(Vt,{value:y?"global":"specific",onValueChange:N=>{N==="global"?s(g,0,""):s(g,0,"qq::group")},disabled:x&&!y,children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"global",children:"全局配置"}),o.jsx(De,{value:"specific",disabled:x&&!y,children:"详细配置"})]})]}),x&&!y&&o.jsx("p",{className:"text-xs text-amber-600",children:"已存在全局配置,无法创建新的全局配置"})]}),!y&&o.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[o.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"平台"}),o.jsxs(Vt,{value:S,onValueChange:N=>{s(g,0,`${N}:${k}:${j}`)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"qq",children:"QQ"}),o.jsx(De,{value:"wx",children:"微信"})]})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"群 ID"}),o.jsx(Pe,{value:k,onChange:N=>{s(g,0,`${S}:${N.target.value}:${j}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"类型"}),o.jsxs(Vt,{value:j,onValueChange:N=>{s(g,0,`${S}:${k}:${N}`)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"group",children:"群组(group)"}),o.jsx(De,{value:"private",children:"私聊(private)"})]})]})]})]}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",m[0]||"(未设置)"]})]}),o.jsx("div",{className:"grid gap-2",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-xs font-medium",children:"使用学到的表达"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦使用从聊天中学到的表达方式"})]}),o.jsx(Ft,{checked:m[1]==="enable",onCheckedChange:N=>s(g,1,N?"enable":"disable")})]})}),o.jsx("div",{className:"grid gap-2",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-xs font-medium",children:"学习表达"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦从聊天中学习新的表达方式"})]}),o.jsx(Ft,{checked:m[2]==="enable",onCheckedChange:N=>s(g,2,N?"enable":"disable")})]})}),o.jsxs("div",{className:"grid gap-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{className:"text-xs font-medium",children:"学习强度"}),o.jsx(Pe,{type:"number",step:"0.1",min:"0",max:"5",value:m[3],onChange:N=>{const T=parseFloat(N.target.value);isNaN(T)||s(g,3,Math.max(0,Math.min(5,T)).toFixed(1))},className:"w-20 h-8 text-xs"})]}),o.jsx(Nf,{value:[parseFloat(m[3])||1],onValueChange:N=>s(g,3,N[0].toFixed(1)),min:0,max:5,step:.1,className:"w-full"}),o.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[o.jsx("span",{children:"0 (不学习)"}),o.jsx("span",{children:"2.5"}),o.jsx("span",{children:"5.0 (快速学习)"})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"影响学习频率,最短学习间隔 = 300/学习强度(秒)"})]})]})]},g)}),t.learning_list.length===0&&o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无学习规则,点击"添加规则"开始配置'})]})]})}),o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold",children:"表达共享组配置"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置不同聊天流之间如何共享学到的表达方式"})]}),o.jsxs(ue,{onClick:a,size:"sm",variant:"outline",children:[o.jsx(Is,{className:"h-4 w-4 mr-1"}),"添加共享组"]})]}),o.jsxs("div",{className:"space-y-4",children:[t.expression_groups.map((m,g)=>{const x=t.learning_list.map(y=>y[0]).filter(y=>y!=="");return o.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium",children:["共享组 ",g+1,m.length===1&&m[0]==="*"&&"(全局共享)"]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ue,{onClick:()=>c(g),size:"sm",variant:"outline",children:o.jsx(Is,{className:"h-4 w-4"})}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsx(ue,{size:"sm",variant:"ghost",children:o.jsx(Cn,{className:"h-4 w-4"})})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:["确定要删除共享组 ",g+1," 吗?此操作无法撤销。"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>l(g),children:"删除"})]})]})]})]})]}),o.jsx("div",{className:"space-y-2",children:m.map((y,w)=>o.jsx(F0e,{member:y,groupIndex:g,memberIndex:w,availableChatIds:x,onUpdate:h,onRemove:d},`${g}-${w}`))}),o.jsx("p",{className:"text-xs text-muted-foreground",children:'提示:可以从下拉框选择已配置的聊天流,或手动输入。输入 "*" 启用全局共享'})]},g)}),t.expression_groups.length===0&&o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无共享组,点击"添加共享组"开始配置'})]})]})})]})}function $0e({emojiConfig:t,memoryConfig:e,toolConfig:n,onEmojiChange:r,onMemoryChange:s,onToolChange:i}){return o.jsxs("div",{className:"space-y-6",children:[o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"工具设置"}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"enable_tool",checked:n.enable_tool,onCheckedChange:a=>i({...n,enable_tool:a})}),o.jsx(he,{htmlFor:"enable_tool",className:"cursor-pointer",children:"启用工具系统"})]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"允许麦麦使用各种工具来增强功能"})]})}),o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"记忆设置"}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"max_agent_iterations",children:"记忆思考深度"}),o.jsx(Pe,{id:"max_agent_iterations",type:"number",min:"1",value:e.max_agent_iterations,onChange:a=>s({...e,max_agent_iterations:parseInt(a.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"最低为 1(不深入思考)"})]})]})}),o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"表情包设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"emoji_chance",children:"表情包激活概率"}),o.jsx(Pe,{id:"emoji_chance",type:"number",step:"0.1",min:"0",max:"1",value:t.emoji_chance,onChange:a=>r({...t,emoji_chance:parseFloat(a.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"范围 0-1,越大越容易发送表情包"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"max_reg_num",children:"最大注册数量"}),o.jsx(Pe,{id:"max_reg_num",type:"number",min:"1",value:t.max_reg_num,onChange:a=>r({...t,max_reg_num:parseInt(a.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦最多可以注册的表情包数量"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),o.jsx(Pe,{id:"check_interval",type:"number",min:"1",value:t.check_interval,onChange:a=>r({...t,check_interval:parseInt(a.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包(注册、破损、删除)的时间间隔"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"do_replace",checked:t.do_replace,onCheckedChange:a=>r({...t,do_replace:a})}),o.jsx(he,{htmlFor:"do_replace",className:"cursor-pointer",children:"达到最大数量时替换表情包"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"steal_emoji",checked:t.steal_emoji,onCheckedChange:a=>r({...t,steal_emoji:a})}),o.jsx(he,{htmlFor:"steal_emoji",className:"cursor-pointer",children:"偷取表情包"})]}),o.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"允许麦麦将看到的表情包据为己有"}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"content_filtration",checked:t.content_filtration,onCheckedChange:a=>r({...t,content_filtration:a})}),o.jsx(he,{htmlFor:"content_filtration",className:"cursor-pointer",children:"启用表情包过滤"})]}),t.content_filtration&&o.jsxs("div",{className:"grid gap-2 pl-6 border-l-2 border-primary/20",children:[o.jsx(he,{htmlFor:"filtration_prompt",children:"过滤要求"}),o.jsx(Pe,{id:"filtration_prompt",value:t.filtration_prompt,onChange:a=>r({...t,filtration_prompt:a.target.value}),placeholder:"符合公序良俗"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"只有符合此要求的表情包才会被保存"})]})]})]})})]})}function H0e({keywordReactionConfig:t,responsePostProcessConfig:e,chineseTypoConfig:n,responseSplitterConfig:r,onKeywordReactionChange:s,onResponsePostProcessChange:i,onChineseTypoChange:a,onResponseSplitterChange:l}){const c=()=>{s({...t,regex_rules:[...t.regex_rules,{regex:[""],reaction:""}]})},d=T=>{s({...t,regex_rules:t.regex_rules.filter((E,_)=>_!==T)})},h=(T,E,_)=>{const A=[...t.regex_rules];E==="regex"&&typeof _=="string"?A[T]={...A[T],regex:[_]}:E==="reaction"&&typeof _=="string"&&(A[T]={...A[T],reaction:_}),s({...t,regex_rules:A})},m=({regex:T,reaction:E,onRegexChange:_,onReactionChange:A})=>{const[D,q]=b.useState(!1),[B,H]=b.useState(""),[W,ee]=b.useState(null),[I,V]=b.useState(""),[L,$]=b.useState({}),[K,Y]=b.useState(""),R=b.useRef(null),[ie,X]=b.useState("build"),z=G=>G.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),U=(G,se=0)=>{const re=R.current;if(!re)return;const ae=re.selectionStart||0,_e=re.selectionEnd||0,Be=T.substring(0,ae)+G+T.substring(_e);_(Be),setTimeout(()=>{const Ye=ae+G.length+se;re.setSelectionRange(Ye,Ye),re.focus()},0)};b.useEffect(()=>{if(!T||!B){ee(null),$({}),Y(E),V("");return}try{const G=z(T),se=new RegExp(G,"g"),re=B.match(se);ee(re),V("");const _e=new RegExp(G).exec(B);if(_e&&_e.groups){$(_e.groups);let Be=E;Object.entries(_e.groups).forEach(([Ye,Je])=>{Be=Be.replace(new RegExp(`\\[${Ye}\\]`,"g"),Je||"")}),Y(Be)}else $({}),Y(E)}catch(G){V(G.message),ee(null),$({}),Y(E)}},[T,B,E]);const te=()=>{if(!B||!W||W.length===0)return o.jsx("span",{className:"text-muted-foreground",children:B||"请输入测试文本"});try{const G=z(T),se=new RegExp(G,"g");let re=0;const ae=[];let _e;for(;(_e=se.exec(B))!==null;)_e.index>re&&ae.push(o.jsx("span",{children:B.substring(re,_e.index)},`text-${re}`)),ae.push(o.jsx("span",{className:"bg-yellow-200 dark:bg-yellow-900 font-semibold",children:_e[0]},`match-${_e.index}`)),re=_e.index+_e[0].length;return re)",desc:"Python风格命名捕获组",moveCursor:-1},{label:"非捕获组",pattern:"(?:)",desc:"分组但不保存匹配结果",moveCursor:-1}]},{category:"字符类",items:[{label:"字符集",pattern:"[]",desc:"匹配括号内的任意字符",moveCursor:-1},{label:"排除字符",pattern:"[^]",desc:"匹配不在括号内的字符",moveCursor:-1},{label:"范围",pattern:"[a-z]",desc:"匹配a到z的字符"},{label:"中文字符",pattern:"[\\u4e00-\\u9fa5]",desc:"匹配中文汉字"}]},{category:"常用模板",items:[{label:"捕获词语",pattern:"(?P\\S+)",desc:"捕获一个词语"},{label:"捕获句子",pattern:"(?P.+)",desc:"捕获整个句子"},{label:"捕获数字",pattern:"(?P\\d+)",desc:"捕获一个或多个数字"},{label:"可选词语",pattern:"(?:词语1|词语2)",desc:"匹配多个可选项之一"}]}];return o.jsxs(Er,{open:D,onOpenChange:q,children:[o.jsx(Of,{asChild:!0,children:o.jsxs(ue,{variant:"outline",size:"sm",children:[o.jsx(Fv,{className:"h-4 w-4 mr-1"}),"正则编辑器"]})}),o.jsxs(wr,{className:"max-w-[95vw] sm:max-w-[900px] max-h-[90vh]",children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"正则表达式编辑器"}),o.jsx(Xr,{className:"text-sm",children:"使用可视化工具构建正则表达式,并实时测试效果"})]}),o.jsx(pn,{className:"max-h-[calc(90vh-120px)]",children:o.jsxs(Yi,{value:ie,onValueChange:G=>X(G),className:"w-full",children:[o.jsxs(ji,{className:"grid w-full grid-cols-2",children:[o.jsx(Bt,{value:"build",children:"🔧 构建器"}),o.jsx(Bt,{value:"test",children:"🧪 测试器"})]}),o.jsxs(ln,{value:"build",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{className:"text-sm font-medium",children:"正则表达式"}),o.jsx(Pe,{ref:R,value:T,onChange:G=>_(G.target.value),className:"font-mono text-sm",placeholder:"点击下方按钮构建正则表达式..."})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{className:"text-sm font-medium",children:"Reaction 内容"}),o.jsx(Nr,{value:E,onChange:G=>A(G.target.value),placeholder:"使用 [捕获组名] 引用捕获的内容...",rows:3,className:"text-sm"})]}),o.jsxs("div",{className:"space-y-4 border-t pt-4",children:[ne.map(G=>o.jsxs("div",{className:"space-y-2",children:[o.jsx("h5",{className:"text-xs font-semibold text-primary",children:G.category}),o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:G.items.map(se=>o.jsx(ue,{variant:"outline",size:"sm",className:"justify-start h-auto py-2 px-3",onClick:()=>U(se.pattern,se.moveCursor||0),children:o.jsxs("div",{className:"flex flex-col items-start w-full",children:[o.jsxs("div",{className:"flex items-center gap-2 w-full",children:[o.jsx("span",{className:"text-xs font-medium",children:se.label}),o.jsx("code",{className:"ml-auto text-xs bg-muted px-1.5 py-0.5 rounded font-mono",children:se.pattern})]}),o.jsx("span",{className:"text-xs text-muted-foreground mt-0.5",children:se.desc})]})},se.label))})]},G.category)),o.jsxs("div",{className:"space-y-2 border-t pt-4",children:[o.jsx("h5",{className:"text-xs font-semibold text-primary",children:"完整示例模板"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ue,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>_("^(?P\\S{1,20})是这样的$"),children:o.jsxs("div",{className:"flex flex-col items-start w-full",children:[o.jsxs("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:["^(?P\\S","{1,20}",")是这样的$"]}),o.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「某事物是这样的」并捕获事物名称"})]})}),o.jsx(ue,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>_("(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"),children:o.jsxs("div",{className:"flex flex-col items-start w-full",children:[o.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"}),o.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「我没要求你做某事」并捕获具体行为"})]})}),o.jsx(ue,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>_("(?P.+?)(?:是|为什么|怎么)"),children:o.jsxs("div",{className:"flex flex-col items-start w-full",children:[o.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?P.+?)(?:是|为什么|怎么)"}),o.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"捕获问题主题词"})]})})]})]})]}),o.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3 space-y-1",children:[o.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 使用提示"}),o.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[o.jsx("li",{children:"点击输入框设置光标位置,然后点击按钮插入模式"}),o.jsxs("li",{children:["命名捕获组格式:",o.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"(?P<名称>模式)"})]}),o.jsxs("li",{children:["在 reaction 中使用 ",o.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"[名称]"})," 引用捕获的内容"]}),o.jsx("li",{children:"切换到测试器标签页验证正则表达式效果"})]})]})]}),o.jsxs(ln,{value:"test",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{className:"text-sm font-medium",children:"当前正则表达式"}),o.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:T||"(未设置)"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"test-text",className:"text-sm font-medium",children:"测试文本"}),o.jsx(Nr,{id:"test-text",value:B,onChange:G=>H(G.target.value),placeholder:`在此输入要测试的文本... -例如:打游戏是这样的`,className:"min-h-[100px] text-sm"})]}),I&&o.jsxs("div",{className:"rounded-md bg-destructive/10 border border-destructive/20 p-3",children:[o.jsx("p",{className:"text-sm text-destructive font-medium",children:"正则表达式错误"}),o.jsx("p",{className:"text-xs text-destructive/80 mt-1",children:I})]}),!I&&B&&o.jsxs("div",{className:"space-y-3",children:[o.jsx("div",{className:"flex items-center gap-2",children:W&&W.length>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),o.jsxs("span",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:["匹配成功 (",W.length," 处)"]})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-gray-400"}),o.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"无匹配"})]})}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{className:"text-sm font-medium",children:"匹配高亮"}),o.jsx(pn,{className:"h-40 rounded-md bg-muted p-3",children:o.jsx("div",{className:"text-sm break-words",children:te()})})]}),Object.keys(L).length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{className:"text-sm font-medium",children:"命名捕获组"}),o.jsx(pn,{className:"h-32 rounded-md border p-3",children:o.jsx("div",{className:"space-y-2",children:Object.entries(L).map(([G,se])=>o.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[o.jsxs("span",{className:"font-mono font-semibold text-primary min-w-[80px]",children:["[",G,"]"]}),o.jsx("span",{className:"text-muted-foreground",children:"="}),o.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded",children:se})]},G))})})]}),Object.keys(L).length>0&&E&&o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{className:"text-sm font-medium",children:"Reaction 替换预览"}),o.jsx(pn,{className:"h-48 rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3",children:o.jsx("div",{className:"text-sm break-words",children:K})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"reaction 中的 [name] 已被替换为对应的捕获组值"})]})]}),o.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3 space-y-1",children:[o.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 测试说明"}),o.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[o.jsx("li",{children:"匹配的文本会以黄色背景高亮显示"}),o.jsx("li",{children:"命名捕获组的值会显示在下方列表中"}),o.jsx("li",{children:"Reaction 替换预览显示最终生成的反应内容"}),o.jsx("li",{children:"如需修改正则,切换回构建器标签页"})]})]})]})]})})]})]})},g=()=>{s({...t,keyword_rules:[...t.keyword_rules,{keywords:[],reaction:""}]})},x=T=>{s({...t,keyword_rules:t.keyword_rules.filter((E,_)=>_!==T)})},y=(T,E,_)=>{const A=[...t.keyword_rules];typeof _=="string"&&(A[T]={...A[T],reaction:_}),s({...t,keyword_rules:A})},w=T=>{const E=[...t.keyword_rules];E[T]={...E[T],keywords:[...E[T].keywords||[],""]},s({...t,keyword_rules:E})},S=(T,E)=>{const _=[...t.keyword_rules];_[T]={..._[T],keywords:(_[T].keywords||[]).filter((A,D)=>D!==E)},s({...t,keyword_rules:_})},k=(T,E,_)=>{const A=[...t.keyword_rules],D=[...A[T].keywords||[]];D[E]=_,A[T]={...A[T],keywords:D},s({...t,keyword_rules:A})},j=({rule:T})=>{const E=`{ regex = [${(T.regex||[]).map(_=>`"${_}"`).join(", ")}], reaction = "${T.reaction}" }`;return o.jsxs(Bo,{children:[o.jsx(Fo,{asChild:!0,children:o.jsxs(ue,{variant:"outline",size:"sm",children:[o.jsx(Ji,{className:"h-4 w-4 mr-1"}),"预览"]})}),o.jsx(Ka,{className:"w-[95vw] sm:w-[500px]",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),o.jsx(pn,{className:"h-60 rounded-md bg-muted p-3",children:o.jsx("pre",{className:"font-mono text-xs break-all",children:E})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},N=({rule:T})=>{const E=`[[keyword_reaction.keyword_rules]] -keywords = [${(T.keywords||[]).map(_=>`"${_}"`).join(", ")}] -reaction = "${T.reaction}"`;return o.jsxs(Bo,{children:[o.jsx(Fo,{asChild:!0,children:o.jsxs(ue,{variant:"outline",size:"sm",children:[o.jsx(Ji,{className:"h-4 w-4 mr-1"}),"预览"]})}),o.jsx(Ka,{className:"w-[95vw] sm:w-[500px]",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),o.jsx(pn,{className:"h-60 rounded-md bg-muted p-3",children:o.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-all",children:E})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"关键词反应配置"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"配置触发特定反应的关键词和正则表达式规则"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-base font-semibold",children:"正则表达式规则"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用正则表达式匹配消息内容"})]}),o.jsxs(ue,{onClick:c,size:"sm",variant:"outline",children:[o.jsx(Is,{className:"h-4 w-4 mr-1"}),"添加正则规则"]})]}),o.jsxs("div",{className:"space-y-3",children:[t.regex_rules.map((T,E)=>o.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium",children:["正则规则 ",E+1]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(m,{regex:T.regex&&T.regex[0]||"",reaction:T.reaction,onRegexChange:_=>h(E,"regex",_),onReactionChange:_=>h(E,"reaction",_)}),o.jsx(j,{rule:T}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsx(ue,{size:"sm",variant:"ghost",children:o.jsx(Cn,{className:"h-4 w-4"})})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:["确定要删除正则规则 ",E+1," 吗?此操作无法撤销。"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>d(E),children:"删除"})]})]})]})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"正则表达式(Python 语法)"}),o.jsx(Pe,{value:T.regex&&T.regex[0]||"",onChange:_=>h(E,"regex",_.target.value),placeholder:"例如:^(?P\\\\S{1,20})是这样的$ (点击正则编辑器按钮可视化构建)",className:"font-mono text-sm"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:'支持命名捕获组 (?Ppattern),可在 reaction 中使用 [name] 引用。点击"正则编辑器"可视化构建和测试!'})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"反应内容"}),o.jsx(Nr,{value:T.reaction,onChange:_=>h(E,"reaction",_.target.value),placeholder:`触发后麦麦的反应... -可以使用 [捕获组名] 来引用正则表达式中的内容`,rows:3,className:"text-sm"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"使用 [捕获组名] 引用正则表达式中的命名捕获组,例如 [n] 会被替换为捕获的内容"})]})]})]},E)),t.regex_rules.length===0&&o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无正则规则,点击"添加正则规则"开始配置'})]})]}),o.jsxs("div",{className:"space-y-4 border-t pt-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-base font-semibold",children:"关键词规则"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用关键词列表匹配消息内容"})]}),o.jsxs(ue,{onClick:g,size:"sm",variant:"outline",children:[o.jsx(Is,{className:"h-4 w-4 mr-1"}),"添加关键词规则"]})]}),o.jsxs("div",{className:"space-y-3",children:[t.keyword_rules.map((T,E)=>o.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium",children:["关键词规则 ",E+1]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(N,{rule:T}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsx(ue,{size:"sm",variant:"ghost",children:o.jsx(Cn,{className:"h-4 w-4"})})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:["确定要删除关键词规则 ",E+1," 吗?此操作无法撤销。"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>x(E),children:"删除"})]})]})]})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{className:"text-xs font-medium",children:"关键词列表"}),o.jsxs(ue,{onClick:()=>w(E),size:"sm",variant:"ghost",children:[o.jsx(Is,{className:"h-3 w-3 mr-1"}),"添加关键词"]})]}),o.jsxs("div",{className:"space-y-2",children:[(T.keywords||[]).map((_,A)=>o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Pe,{value:_,onChange:D=>k(E,A,D.target.value),placeholder:"关键词",className:"flex-1"}),o.jsx(ue,{onClick:()=>S(E,A),size:"sm",variant:"ghost",children:o.jsx(Cn,{className:"h-4 w-4"})})]},A)),(!T.keywords||T.keywords.length===0)&&o.jsx("p",{className:"text-xs text-muted-foreground text-center py-2",children:'暂无关键词,点击"添加关键词"开始配置'})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"反应内容"}),o.jsx(Nr,{value:T.reaction,onChange:_=>y(E,"reaction",_.target.value),placeholder:"触发后麦麦的反应...",rows:3,className:"text-sm"})]})]})]},E)),t.keyword_rules.length===0&&o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无关键词规则,点击"添加关键词规则"开始配置'})]})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"回复后处理配置"}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"enable_response_post_process",checked:e.enable_response_post_process,onCheckedChange:T=>i({...e,enable_response_post_process:T})}),o.jsx(he,{htmlFor:"enable_response_post_process",className:"cursor-pointer",children:"启用回复后处理"})]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"包括错别字生成器和回复分割器"})]}),e.enable_response_post_process&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"border-t pt-6 space-y-4",children:o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[o.jsx(Ft,{id:"enable_chinese_typo",checked:n.enable,onCheckedChange:T=>a({...n,enable:T})}),o.jsx(he,{htmlFor:"enable_chinese_typo",className:"cursor-pointer font-semibold",children:"中文错别字生成器"})]}),o.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"为回复添加随机错别字,让麦麦的回复更自然"}),n.enable&&o.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"error_rate",className:"text-xs font-medium",children:"单字替换概率"}),o.jsx(Pe,{id:"error_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.error_rate,onChange:T=>a({...n,error_rate:parseFloat(T.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"min_freq",className:"text-xs font-medium",children:"最小字频阈值"}),o.jsx(Pe,{id:"min_freq",type:"number",min:"0",value:n.min_freq,onChange:T=>a({...n,min_freq:parseInt(T.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"tone_error_rate",className:"text-xs font-medium",children:"声调错误概率"}),o.jsx(Pe,{id:"tone_error_rate",type:"number",step:"0.01",min:"0",max:"1",value:n.tone_error_rate,onChange:T=>a({...n,tone_error_rate:parseFloat(T.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"word_replace_rate",className:"text-xs font-medium",children:"整词替换概率"}),o.jsx(Pe,{id:"word_replace_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.word_replace_rate,onChange:T=>a({...n,word_replace_rate:parseFloat(T.target.value)})})]})]})]})}),o.jsx("div",{className:"border-t pt-6 space-y-4",children:o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[o.jsx(Ft,{id:"enable_response_splitter",checked:r.enable,onCheckedChange:T=>l({...r,enable:T})}),o.jsx(he,{htmlFor:"enable_response_splitter",className:"cursor-pointer font-semibold",children:"回复分割器"})]}),o.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"控制回复的长度和句子数量"}),r.enable&&o.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"max_length",className:"text-xs font-medium",children:"最大长度"}),o.jsx(Pe,{id:"max_length",type:"number",min:"1",value:r.max_length,onChange:T=>l({...r,max_length:parseInt(T.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大字符数"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"max_sentence_num",className:"text-xs font-medium",children:"最大句子数"}),o.jsx(Pe,{id:"max_sentence_num",type:"number",min:"1",value:r.max_sentence_num,onChange:T=>l({...r,max_sentence_num:parseInt(T.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大句子数量"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"enable_kaomoji_protection",checked:r.enable_kaomoji_protection,onCheckedChange:T=>l({...r,enable_kaomoji_protection:T})}),o.jsx(he,{htmlFor:"enable_kaomoji_protection",className:"cursor-pointer",children:"启用颜文字保护"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"enable_overflow_return_all",checked:r.enable_overflow_return_all,onCheckedChange:T=>l({...r,enable_overflow_return_all:T})}),o.jsx(he,{htmlFor:"enable_overflow_return_all",className:"cursor-pointer",children:"超出时一次性返回全部"})]}),o.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"当句子数量超出限制时,合并后一次性返回所有内容"})]})]})})]})]})]})}function Q0e({config:t,onChange:e}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"情绪设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{checked:t.enable_mood,onCheckedChange:n=>e({...t,enable_mood:n})}),o.jsx(he,{className:"cursor-pointer",children:"启用情绪系统"})]}),t.enable_mood&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"情绪更新阈值"}),o.jsx(Pe,{type:"number",min:"1",value:t.mood_update_threshold,onChange:n=>e({...t,mood_update_threshold:parseInt(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"越高,更新越慢"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"情感特征"}),o.jsx(Nr,{value:t.emotion_style,onChange:n=>e({...t,emotion_style:n.target.value}),placeholder:"影响情绪的变化情况",rows:2})]})]})]})]})}function V0e({config:t,onChange:e}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"语音设置"}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{checked:t.enable_asr,onCheckedChange:n=>e({...t,enable_asr:n})}),o.jsx(he,{className:"cursor-pointer",children:"启用语音识别"})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"启用后麦麦可以识别语音消息,需要配置语音识别模型"})]})}function U0e({config:t,onChange:e}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{checked:t.enable,onCheckedChange:n=>e({...t,enable:n})}),o.jsx(he,{className:"cursor-pointer",children:"启用 LPMM 知识库"})]}),t.enable&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"LPMM 模式"}),o.jsxs(Vt,{value:t.lpmm_mode,onValueChange:n=>e({...t,lpmm_mode:n}),children:[o.jsx($t,{children:o.jsx(Ut,{placeholder:"选择 LPMM 模式"})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"classic",children:"经典模式"}),o.jsx(De,{value:"agent",children:"Agent 模式"})]})]})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"同义词搜索 TopK"}),o.jsx(Pe,{type:"number",min:"1",value:t.rag_synonym_search_top_k,onChange:n=>e({...t,rag_synonym_search_top_k:parseInt(n.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"同义词阈值"}),o.jsx(Pe,{type:"number",step:"0.1",min:"0",max:"1",value:t.rag_synonym_threshold,onChange:n=>e({...t,rag_synonym_threshold:parseFloat(n.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"实体提取线程数"}),o.jsx(Pe,{type:"number",min:"1",value:t.info_extraction_workers,onChange:n=>e({...t,info_extraction_workers:parseInt(n.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"嵌入向量维度"}),o.jsx(Pe,{type:"number",min:"1",value:t.embedding_dimension,onChange:n=>e({...t,embedding_dimension:parseInt(n.target.value)})})]})]})]})]})]})}function W0e({config:t,onChange:e}){const[n,r]=b.useState(""),[s,i]=b.useState("WARNING"),a=()=>{n&&!t.suppress_libraries.includes(n)&&(e({...t,suppress_libraries:[...t.suppress_libraries,n]}),r(""))},l=x=>{e({...t,suppress_libraries:t.suppress_libraries.filter(y=>y!==x)})},c=()=>{n&&!t.library_log_levels[n]&&(e({...t,library_log_levels:{...t.library_log_levels,[n]:s}}),r(""),i("WARNING"))},d=x=>{const y={...t.library_log_levels};delete y[x],e({...t,library_log_levels:y})},h=["DEBUG","INFO","WARNING","ERROR","CRITICAL"],m=["FULL","compact","lite"],g=["none","title","full"];return o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"日志配置"}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"日期格式"}),o.jsx(Pe,{value:t.date_style,onChange:x=>e({...t,date_style:x.target.value}),placeholder:"例如: m-d H:i:s"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"m=月, d=日, H=时, i=分, s=秒"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"日志级别样式"}),o.jsxs(Vt,{value:t.log_level_style,onValueChange:x=>e({...t,log_level_style:x}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:m.map(x=>o.jsx(De,{value:x,children:x},x))})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"日志文本颜色"}),o.jsxs(Vt,{value:t.color_text,onValueChange:x=>e({...t,color_text:x}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:g.map(x=>o.jsx(De,{value:x,children:x},x))})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"全局日志级别"}),o.jsxs(Vt,{value:t.log_level,onValueChange:x=>e({...t,log_level:x}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:h.map(x=>o.jsx(De,{value:x,children:x},x))})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"控制台日志级别"}),o.jsxs(Vt,{value:t.console_log_level,onValueChange:x=>e({...t,console_log_level:x}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:h.map(x=>o.jsx(De,{value:x,children:x},x))})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"文件日志级别"}),o.jsxs(Vt,{value:t.file_log_level,onValueChange:x=>e({...t,file_log_level:x}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:h.map(x=>o.jsx(De,{value:x,children:x},x))})]})]})]})]}),o.jsxs("div",{children:[o.jsx(he,{className:"mb-2 block",children:"完全屏蔽的库"}),o.jsxs("div",{className:"flex gap-2 mb-2",children:[o.jsx(Pe,{value:n,onChange:x=>r(x.target.value),placeholder:"输入库名",className:"flex-1",onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),a())}}),o.jsx(ue,{onClick:a,size:"sm",className:"flex-shrink-0",children:o.jsx(Is,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),o.jsx("div",{className:"flex flex-wrap gap-2",children:t.suppress_libraries.map(x=>o.jsxs("div",{className:"flex items-center gap-1 bg-secondary px-3 py-1 rounded-md",children:[o.jsx("span",{className:"text-sm",children:x}),o.jsx(ue,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>l(x),children:o.jsx(Cn,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},x))})]}),o.jsxs("div",{children:[o.jsx(he,{className:"mb-2 block",children:"特定库的日志级别"}),o.jsxs("div",{className:"flex gap-2 mb-2",children:[o.jsx(Pe,{value:n,onChange:x=>r(x.target.value),placeholder:"输入库名",className:"flex-1"}),o.jsxs(Vt,{value:s,onValueChange:i,children:[o.jsx($t,{className:"w-32",children:o.jsx(Ut,{})}),o.jsx(Ht,{children:h.map(x=>o.jsx(De,{value:x,children:x},x))})]}),o.jsx(ue,{onClick:c,size:"sm",children:o.jsx(Is,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),o.jsx("div",{className:"space-y-2",children:Object.entries(t.library_log_levels).map(([x,y])=>o.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[o.jsx("span",{className:"text-sm font-medium",children:x}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-sm text-muted-foreground",children:y}),o.jsx(ue,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>d(x),children:o.jsx(Cn,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]})]},x))})]})]})}function G0e({config:t,onChange:e}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"调试配置"}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"显示 Prompt"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否在日志中显示提示词"})]}),o.jsx(Ft,{checked:t.show_prompt,onCheckedChange:n=>e({...t,show_prompt:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"显示回复器 Prompt"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的提示词"})]}),o.jsx(Ft,{checked:t.show_replyer_prompt,onCheckedChange:n=>e({...t,show_replyer_prompt:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"显示回复器推理"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的推理过程"})]}),o.jsx(Ft,{checked:t.show_replyer_reasoning,onCheckedChange:n=>e({...t,show_replyer_reasoning:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"显示 Jargon Prompt"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示术语相关的提示词"})]}),o.jsx(Ft,{checked:t.show_jargon_prompt,onCheckedChange:n=>e({...t,show_jargon_prompt:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"显示记忆检索 Prompt"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示记忆检索相关的提示词"})]}),o.jsx(Ft,{checked:t.show_memory_prompt,onCheckedChange:n=>e({...t,show_memory_prompt:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"显示 Planner Prompt"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示 Planner 的提示词和原始返回结果"})]}),o.jsx(Ft,{checked:t.show_planner_prompt,onCheckedChange:n=>e({...t,show_planner_prompt:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"显示 LPMM 相关文段"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示 LPMM 知识库找到的相关文段日志"})]}),o.jsx(Ft,{checked:t.show_lpmm_paragraph,onCheckedChange:n=>e({...t,show_lpmm_paragraph:n})})]})]})]})}function X0e({config:t,onChange:e}){const[n,r]=b.useState(""),s=()=>{n&&!t.auth_token.includes(n)&&(e({...t,auth_token:[...t.auth_token,n]}),r(""))},i=a=>{e({...t,auth_token:t.auth_token.filter((l,c)=>c!==a)})};return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"MaimMessage 服务配置"}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"启用自定义服务器"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否使用自定义的 MaimMessage 服务器"})]}),o.jsx(Ft,{checked:t.use_custom,onCheckedChange:a=>e({...t,use_custom:a})})]}),t.use_custom&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"主机地址"}),o.jsx(Pe,{value:t.host,onChange:a=>e({...t,host:a.target.value}),placeholder:"127.0.0.1"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"端口号"}),o.jsx(Pe,{type:"number",value:t.port,onChange:a=>e({...t,port:parseInt(a.target.value)}),placeholder:"8090"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"连接模式"}),o.jsxs(Vt,{value:t.mode,onValueChange:a=>e({...t,mode:a}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"ws",children:"WebSocket (ws)"}),o.jsx(De,{value:"tcp",children:"TCP"})]})]})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{checked:t.use_wss,onCheckedChange:a=>e({...t,use_wss:a}),disabled:t.mode!=="ws"}),o.jsx(he,{children:"使用 WSS 安全连接"})]})]}),t.use_wss&&t.mode==="ws"&&o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"SSL 证书文件路径"}),o.jsx(Pe,{value:t.cert_file,onChange:a=>e({...t,cert_file:a.target.value}),placeholder:"cert.pem"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"SSL 密钥文件路径"}),o.jsx(Pe,{value:t.key_file,onChange:a=>e({...t,key_file:a.target.value}),placeholder:"key.pem"})]})]})]})]})]}),o.jsxs("div",{children:[o.jsx(he,{className:"mb-2 block",children:"认证令牌"}),o.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"用于 API 验证,为空则不启用验证"}),o.jsxs("div",{className:"flex gap-2 mb-2",children:[o.jsx(Pe,{value:n,onChange:a=>r(a.target.value),placeholder:"输入认证令牌",onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),s())}}),o.jsx(ue,{onClick:s,size:"sm",children:o.jsx(Is,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),o.jsx("div",{className:"space-y-2",children:t.auth_token.map((a,l)=>o.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[o.jsx("span",{className:"text-sm font-mono",children:a}),o.jsx(ue,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>i(l),children:o.jsx(Cn,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},l))})]})]})}function Y0e({config:t,onChange:e}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"统计信息"}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"启用统计信息发送"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"发送匿名统计信息,帮助我们了解全球有多少只麦麦在运行"})]}),o.jsx(Ft,{checked:t.enable,onCheckedChange:n=>e({...t,enable:n})})]})]})}const Af=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{className:"relative w-full overflow-auto",children:o.jsx("table",{ref:n,className:xe("w-full caption-bottom text-sm",t),...e})}));Af.displayName="Table";const Mf=b.forwardRef(({className:t,...e},n)=>o.jsx("thead",{ref:n,className:xe("[&_tr]:border-b",t),...e}));Mf.displayName="TableHeader";const Rf=b.forwardRef(({className:t,...e},n)=>o.jsx("tbody",{ref:n,className:xe("[&_tr:last-child]:border-0",t),...e}));Rf.displayName="TableBody";const K0e=b.forwardRef(({className:t,...e},n)=>o.jsx("tfoot",{ref:n,className:xe("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));K0e.displayName="TableFooter";const zs=b.forwardRef(({className:t,...e},n)=>o.jsx("tr",{ref:n,className:xe("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...e}));zs.displayName="TableRow";const mn=b.forwardRef(({className:t,...e},n)=>o.jsx("th",{ref:n,className:xe("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e}));mn.displayName="TableHead";const Yt=b.forwardRef(({className:t,...e},n)=>o.jsx("td",{ref:n,className:xe("px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e}));Yt.displayName="TableCell";const Z0e=b.forwardRef(({className:t,...e},n)=>o.jsx("caption",{ref:n,className:xe("mt-4 text-sm text-muted-foreground",t),...e}));Z0e.displayName="TableCaption";var kA=1,J0e=.9,epe=.8,tpe=.17,vS=.1,yS=.999,npe=.9999,rpe=.99,spe=/[\\\/_+.#"@\[\(\{&]/,ipe=/[\\\/_+.#"@\[\(\{&]/g,ape=/[\s-]/,EH=/[\s-]/g;function vO(t,e,n,r,s,i,a){if(i===e.length)return s===t.length?kA:rpe;var l=`${s},${i}`;if(a[l]!==void 0)return a[l];for(var c=r.charAt(i),d=n.indexOf(c,s),h=0,m,g,x,y;d>=0;)m=vO(t,e,n,r,d+1,i+1,a),m>h&&(d===s?m*=kA:spe.test(t.charAt(d-1))?(m*=epe,x=t.slice(s,d-1).match(ipe),x&&s>0&&(m*=Math.pow(yS,x.length))):ape.test(t.charAt(d-1))?(m*=J0e,y=t.slice(s,d-1).match(EH),y&&s>0&&(m*=Math.pow(yS,y.length))):(m*=tpe,s>0&&(m*=Math.pow(yS,d-s))),t.charAt(d)!==e.charAt(i)&&(m*=npe)),(mm&&(m=g*vS)),m>h&&(h=m),d=n.indexOf(c,d+1);return a[l]=h,h}function OA(t){return t.toLowerCase().replace(EH," ")}function ope(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,vO(t,e,OA(t),OA(e),0,0,{})}var lpe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],hu=lpe.reduce((t,e)=>{const n=Vy(`Primitive.${e}`),r=b.forwardRef((s,i)=>{const{asChild:a,...l}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),Vm='[cmdk-group=""]',bS='[cmdk-group-items=""]',cpe='[cmdk-group-heading=""]',_H='[cmdk-item=""]',jA=`${_H}:not([aria-disabled="true"])`,yO="cmdk-item-select",kh="data-value",upe=(t,e,n)=>ope(t,e,n),AH=b.createContext(void 0),sg=()=>b.useContext(AH),MH=b.createContext(void 0),W6=()=>b.useContext(MH),RH=b.createContext(void 0),DH=b.forwardRef((t,e)=>{let n=Oh(()=>{var X,z;return{search:"",value:(z=(X=t.value)!=null?X:t.defaultValue)!=null?z:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Oh(()=>new Set),s=Oh(()=>new Map),i=Oh(()=>new Map),a=Oh(()=>new Set),l=PH(t),{label:c,children:d,value:h,onValueChange:m,filter:g,shouldFilter:x,loop:y,disablePointerSelection:w=!1,vimBindings:S=!0,...k}=t,j=Gi(),N=Gi(),T=Gi(),E=b.useRef(null),_=wpe();md(()=>{if(h!==void 0){let X=h.trim();n.current.value=X,A.emit()}},[h]),md(()=>{_(6,ee)},[]);let A=b.useMemo(()=>({subscribe:X=>(a.current.add(X),()=>a.current.delete(X)),snapshot:()=>n.current,setState:(X,z,U)=>{var te,ne,G,se;if(!Object.is(n.current[X],z)){if(n.current[X]=z,X==="search")W(),B(),_(1,H);else if(X==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let re=document.getElementById(T);re?re.focus():(te=document.getElementById(j))==null||te.focus()}if(_(7,()=>{var re;n.current.selectedItemId=(re=I())==null?void 0:re.id,A.emit()}),U||_(5,ee),((ne=l.current)==null?void 0:ne.value)!==void 0){let re=z??"";(se=(G=l.current).onValueChange)==null||se.call(G,re);return}}A.emit()}},emit:()=>{a.current.forEach(X=>X())}}),[]),D=b.useMemo(()=>({value:(X,z,U)=>{var te;z!==((te=i.current.get(X))==null?void 0:te.value)&&(i.current.set(X,{value:z,keywords:U}),n.current.filtered.items.set(X,q(z,U)),_(2,()=>{B(),A.emit()}))},item:(X,z)=>(r.current.add(X),z&&(s.current.has(z)?s.current.get(z).add(X):s.current.set(z,new Set([X]))),_(3,()=>{W(),B(),n.current.value||H(),A.emit()}),()=>{i.current.delete(X),r.current.delete(X),n.current.filtered.items.delete(X);let U=I();_(4,()=>{W(),U?.getAttribute("id")===X&&H(),A.emit()})}),group:X=>(s.current.has(X)||s.current.set(X,new Set),()=>{i.current.delete(X),s.current.delete(X)}),filter:()=>l.current.shouldFilter,label:c||t["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:j,inputId:T,labelId:N,listInnerRef:E}),[]);function q(X,z){var U,te;let ne=(te=(U=l.current)==null?void 0:U.filter)!=null?te:upe;return X?ne(X,n.current.search,z):0}function B(){if(!n.current.search||l.current.shouldFilter===!1)return;let X=n.current.filtered.items,z=[];n.current.filtered.groups.forEach(te=>{let ne=s.current.get(te),G=0;ne.forEach(se=>{let re=X.get(se);G=Math.max(re,G)}),z.push([te,G])});let U=E.current;V().sort((te,ne)=>{var G,se;let re=te.getAttribute("id"),ae=ne.getAttribute("id");return((G=X.get(ae))!=null?G:0)-((se=X.get(re))!=null?se:0)}).forEach(te=>{let ne=te.closest(bS);ne?ne.appendChild(te.parentElement===ne?te:te.closest(`${bS} > *`)):U.appendChild(te.parentElement===U?te:te.closest(`${bS} > *`))}),z.sort((te,ne)=>ne[1]-te[1]).forEach(te=>{var ne;let G=(ne=E.current)==null?void 0:ne.querySelector(`${Vm}[${kh}="${encodeURIComponent(te[0])}"]`);G?.parentElement.appendChild(G)})}function H(){let X=V().find(U=>U.getAttribute("aria-disabled")!=="true"),z=X?.getAttribute(kh);A.setState("value",z||void 0)}function W(){var X,z,U,te;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ne=0;for(let G of r.current){let se=(z=(X=i.current.get(G))==null?void 0:X.value)!=null?z:"",re=(te=(U=i.current.get(G))==null?void 0:U.keywords)!=null?te:[],ae=q(se,re);n.current.filtered.items.set(G,ae),ae>0&&ne++}for(let[G,se]of s.current)for(let re of se)if(n.current.filtered.items.get(re)>0){n.current.filtered.groups.add(G);break}n.current.filtered.count=ne}function ee(){var X,z,U;let te=I();te&&(((X=te.parentElement)==null?void 0:X.firstChild)===te&&((U=(z=te.closest(Vm))==null?void 0:z.querySelector(cpe))==null||U.scrollIntoView({block:"nearest"})),te.scrollIntoView({block:"nearest"}))}function I(){var X;return(X=E.current)==null?void 0:X.querySelector(`${_H}[aria-selected="true"]`)}function V(){var X;return Array.from(((X=E.current)==null?void 0:X.querySelectorAll(jA))||[])}function L(X){let z=V()[X];z&&A.setState("value",z.getAttribute(kh))}function $(X){var z;let U=I(),te=V(),ne=te.findIndex(se=>se===U),G=te[ne+X];(z=l.current)!=null&&z.loop&&(G=ne+X<0?te[te.length-1]:ne+X===te.length?te[0]:te[ne+X]),G&&A.setState("value",G.getAttribute(kh))}function K(X){let z=I(),U=z?.closest(Vm),te;for(;U&&!te;)U=X>0?ype(U,Vm):bpe(U,Vm),te=U?.querySelector(jA);te?A.setState("value",te.getAttribute(kh)):$(X)}let Y=()=>L(V().length-1),R=X=>{X.preventDefault(),X.metaKey?Y():X.altKey?K(1):$(1)},ie=X=>{X.preventDefault(),X.metaKey?L(0):X.altKey?K(-1):$(-1)};return b.createElement(hu.div,{ref:e,tabIndex:-1,...k,"cmdk-root":"",onKeyDown:X=>{var z;(z=k.onKeyDown)==null||z.call(k,X);let U=X.nativeEvent.isComposing||X.keyCode===229;if(!(X.defaultPrevented||U))switch(X.key){case"n":case"j":{S&&X.ctrlKey&&R(X);break}case"ArrowDown":{R(X);break}case"p":case"k":{S&&X.ctrlKey&&ie(X);break}case"ArrowUp":{ie(X);break}case"Home":{X.preventDefault(),L(0);break}case"End":{X.preventDefault(),Y();break}case"Enter":{X.preventDefault();let te=I();if(te){let ne=new Event(yO);te.dispatchEvent(ne)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:D.inputId,id:D.labelId,style:kpe},c),Cb(t,X=>b.createElement(MH.Provider,{value:A},b.createElement(AH.Provider,{value:D},X))))}),dpe=b.forwardRef((t,e)=>{var n,r;let s=Gi(),i=b.useRef(null),a=b.useContext(RH),l=sg(),c=PH(t),d=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:a?.forceMount;md(()=>{if(!d)return l.item(s,a?.id)},[d]);let h=zH(s,i,[t.value,t.children,i],t.keywords),m=W6(),g=tu(_=>_.value&&_.value===h.current),x=tu(_=>d||l.filter()===!1?!0:_.search?_.filtered.items.get(s)>0:!0);b.useEffect(()=>{let _=i.current;if(!(!_||t.disabled))return _.addEventListener(yO,y),()=>_.removeEventListener(yO,y)},[x,t.onSelect,t.disabled]);function y(){var _,A;w(),(A=(_=c.current).onSelect)==null||A.call(_,h.current)}function w(){m.setState("value",h.current,!0)}if(!x)return null;let{disabled:S,value:k,onSelect:j,forceMount:N,keywords:T,...E}=t;return b.createElement(hu.div,{ref:Gc(i,e),...E,id:s,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!g,"data-disabled":!!S,"data-selected":!!g,onPointerMove:S||l.getDisablePointerSelection()?void 0:w,onClick:S?void 0:y},t.children)}),hpe=b.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:s,...i}=t,a=Gi(),l=b.useRef(null),c=b.useRef(null),d=Gi(),h=sg(),m=tu(x=>s||h.filter()===!1?!0:x.search?x.filtered.groups.has(a):!0);md(()=>h.group(a),[]),zH(a,l,[t.value,t.heading,c]);let g=b.useMemo(()=>({id:a,forceMount:s}),[s]);return b.createElement(hu.div,{ref:Gc(l,e),...i,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&b.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),Cb(t,x=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},b.createElement(RH.Provider,{value:g},x))))}),fpe=b.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,s=b.useRef(null),i=tu(a=>!a.search);return!n&&!i?null:b.createElement(hu.div,{ref:Gc(s,e),...r,"cmdk-separator":"",role:"separator"})}),mpe=b.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,s=t.value!=null,i=W6(),a=tu(d=>d.search),l=tu(d=>d.selectedItemId),c=sg();return b.useEffect(()=>{t.value!=null&&i.setState("search",t.value)},[t.value]),b.createElement(hu.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:s?t.value:a,onChange:d=>{s||i.setState("search",d.target.value),n?.(d.target.value)}})}),ppe=b.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...s}=t,i=b.useRef(null),a=b.useRef(null),l=tu(d=>d.selectedItemId),c=sg();return b.useEffect(()=>{if(a.current&&i.current){let d=a.current,h=i.current,m,g=new ResizeObserver(()=>{m=requestAnimationFrame(()=>{let x=d.offsetHeight;h.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return g.observe(d),()=>{cancelAnimationFrame(m),g.unobserve(d)}}},[]),b.createElement(hu.div,{ref:Gc(i,e),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},Cb(t,d=>b.createElement("div",{ref:Gc(a,c.listInnerRef),"cmdk-list-sizer":""},d)))}),gpe=b.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:a,...l}=t;return b.createElement(Mj,{open:n,onOpenChange:r},b.createElement(Ej,{container:a},b.createElement(Uy,{"cmdk-overlay":"",className:s}),b.createElement(Wy,{"aria-label":t.label,"cmdk-dialog":"",className:i},b.createElement(DH,{ref:e,...l}))))}),xpe=b.forwardRef((t,e)=>tu(n=>n.filtered.count===0)?b.createElement(hu.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),vpe=b.forwardRef((t,e)=>{let{progress:n,children:r,label:s="Loading...",...i}=t;return b.createElement(hu.div,{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Cb(t,a=>b.createElement("div",{"aria-hidden":!0},a)))}),Ei=Object.assign(DH,{List:ppe,Item:dpe,Input:mpe,Group:hpe,Separator:fpe,Dialog:gpe,Empty:xpe,Loading:vpe});function ype(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function bpe(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function PH(t){let e=b.useRef(t);return md(()=>{e.current=t}),e}var md=typeof window>"u"?b.useEffect:b.useLayoutEffect;function Oh(t){let e=b.useRef();return e.current===void 0&&(e.current=t()),e}function tu(t){let e=W6(),n=()=>t(e.snapshot());return b.useSyncExternalStore(e.subscribe,n,n)}function zH(t,e,n,r=[]){let s=b.useRef(),i=sg();return md(()=>{var a;let l=(()=>{var d;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(d=h.current.textContent)==null?void 0:d.trim():s.current}})(),c=r.map(d=>d.trim());i.value(t,l,c),(a=e.current)==null||a.setAttribute(kh,l),s.current=l}),s}var wpe=()=>{let[t,e]=b.useState(),n=Oh(()=>new Map);return md(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,s)=>{n.current.set(r,s),e({})}};function Spe(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function Cb({asChild:t,children:e},n){return t&&b.isValidElement(e)?b.cloneElement(Spe(e),{ref:e.ref},n(e.props.children)):n(e)}var kpe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Tb=b.forwardRef(({className:t,...e},n)=>o.jsx(Ei,{ref:n,className:xe("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));Tb.displayName=Ei.displayName;const Eb=b.forwardRef(({className:t,...e},n)=>o.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[o.jsx(ii,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),o.jsx(Ei.Input,{ref:n,className:xe("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...e})]}));Eb.displayName=Ei.Input.displayName;const _b=b.forwardRef(({className:t,...e},n)=>o.jsx(Ei.List,{ref:n,className:xe("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));_b.displayName=Ei.List.displayName;const Ab=b.forwardRef((t,e)=>o.jsx(Ei.Empty,{ref:e,className:"py-6 text-center text-sm",...t}));Ab.displayName=Ei.Empty.displayName;const up=b.forwardRef(({className:t,...e},n)=>o.jsx(Ei.Group,{ref:n,className:xe("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...e}));up.displayName=Ei.Group.displayName;const Ope=b.forwardRef(({className:t,...e},n)=>o.jsx(Ei.Separator,{ref:n,className:xe("-mx-1 h-px bg-border",t),...e}));Ope.displayName=Ei.Separator.displayName;const dp=b.forwardRef(({className:t,...e},n)=>o.jsx(Ei.Item,{ref:n,className:xe("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t),...e}));dp.displayName=Ei.Item.displayName;const Ci=b.forwardRef(({className:t,...e},n)=>o.jsx(bI,{ref:n,className:xe("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...e,children:o.jsx(zee,{className:xe("grid place-content-center text-current"),children:o.jsx(zo,{className:"h-4 w-4"})})}));Ci.displayName=bI.displayName;const IH=b.createContext(null),LH="maibot-completed-tours";function jpe(){try{const t=localStorage.getItem(LH);return t?new Set(JSON.parse(t)):new Set}catch{return new Set}}function NA(t){localStorage.setItem(LH,JSON.stringify([...t]))}function Npe({children:t}){const[e,n]=b.useState({activeTourId:null,stepIndex:0,isRunning:!1}),r=b.useRef(new Map),[,s]=b.useState(0),[i,a]=b.useState(jpe),l=b.useCallback((N,T)=>{r.current.set(N,T),s(E=>E+1)},[]),c=b.useCallback(N=>{r.current.delete(N),n(T=>T.activeTourId===N?{...T,activeTourId:null,isRunning:!1,stepIndex:0}:T)},[]),d=b.useCallback((N,T=0)=>{r.current.has(N)&&n({activeTourId:N,stepIndex:T,isRunning:!0})},[]),h=b.useCallback(()=>{n(N=>({...N,isRunning:!1}))},[]),m=b.useCallback(N=>{n(T=>({...T,stepIndex:N}))},[]),g=b.useCallback(()=>{n(N=>({...N,stepIndex:N.stepIndex+1}))},[]),x=b.useCallback(()=>{n(N=>({...N,stepIndex:Math.max(0,N.stepIndex-1)}))},[]),y=b.useCallback(()=>e.activeTourId?r.current.get(e.activeTourId)||[]:[],[e.activeTourId]),w=b.useCallback(N=>{a(T=>{const E=new Set(T);return E.add(N),NA(E),E})},[]),S=b.useCallback(N=>{const{action:T,index:E,status:_,type:A}=N,D=["finished","skipped"];if(T==="close"){n(q=>({...q,isRunning:!1,stepIndex:0}));return}D.includes(_)?n(q=>(_==="finished"&&q.activeTourId&&setTimeout(()=>w(q.activeTourId),0),{...q,isRunning:!1,stepIndex:0})):A==="step:after"&&(T==="next"?n(q=>({...q,stepIndex:E+1})):T==="prev"&&n(q=>({...q,stepIndex:E-1})))},[w]),k=b.useCallback(N=>i.has(N),[i]),j=b.useCallback(N=>{a(T=>{const E=new Set(T);return E.delete(N),NA(E),E})},[]);return o.jsx(IH.Provider,{value:{state:e,tours:r.current,registerTour:l,unregisterTour:c,startTour:d,stopTour:h,goToStep:m,nextStep:g,prevStep:x,getCurrentSteps:y,handleJoyrideCallback:S,isTourCompleted:k,markTourCompleted:w,resetTourCompleted:j},children:t})}function BH(t){return e=>typeof e===t}var Cpe=BH("function"),Tpe=t=>t===null,CA=t=>Object.prototype.toString.call(t).slice(8,-1)==="RegExp",TA=t=>!Epe(t)&&!Tpe(t)&&(Cpe(t)||typeof t=="object"),Epe=BH("undefined");function _pe(t,e){const{length:n}=t;if(n!==e.length)return!1;for(let r=n;r--!==0;)if(!ti(t[r],e[r]))return!1;return!0}function Ape(t,e){if(t.byteLength!==e.byteLength)return!1;const n=new DataView(t.buffer),r=new DataView(e.buffer);let s=t.byteLength;for(;s--;)if(n.getUint8(s)!==r.getUint8(s))return!1;return!0}function Mpe(t,e){if(t.size!==e.size)return!1;for(const n of t.entries())if(!e.has(n[0]))return!1;for(const n of t.entries())if(!ti(n[1],e.get(n[0])))return!1;return!0}function Rpe(t,e){if(t.size!==e.size)return!1;for(const n of t.entries())if(!e.has(n[0]))return!1;return!0}function ti(t,e){if(t===e)return!0;if(t&&TA(t)&&e&&TA(e)){if(t.constructor!==e.constructor)return!1;if(Array.isArray(t)&&Array.isArray(e))return _pe(t,e);if(t instanceof Map&&e instanceof Map)return Mpe(t,e);if(t instanceof Set&&e instanceof Set)return Rpe(t,e);if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return Ape(t,e);if(CA(t)&&CA(e))return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(let s=n.length;s--!==0;)if(!Object.prototype.hasOwnProperty.call(e,n[s]))return!1;for(let s=n.length;s--!==0;){const i=n[s];if(!(i==="_owner"&&t.$$typeof)&&!ti(t[i],e[i]))return!1}return!0}return Number.isNaN(t)&&Number.isNaN(e)?!0:t===e}var Dpe=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","WeakMap","WeakSet"],Ppe=["bigint","boolean","null","number","string","symbol","undefined"];function Mb(t){const e=Object.prototype.toString.call(t).slice(8,-1);if(/HTML\w+Element/.test(e))return"HTMLElement";if(zpe(e))return e}function io(t){return e=>Mb(e)===t}function zpe(t){return Dpe.includes(t)}function Df(t){return e=>typeof e===t}function Ipe(t){return Ppe.includes(t)}var Lpe=["innerHTML","ownerDocument","style","attributes","nodeValue"];function at(t){if(t===null)return"null";switch(typeof t){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(at.array(t))return"Array";if(at.plainFunction(t))return"Function";const e=Mb(t);return e||"Object"}at.array=Array.isArray;at.arrayOf=(t,e)=>!at.array(t)&&!at.function(e)?!1:t.every(n=>e(n));at.asyncGeneratorFunction=t=>Mb(t)==="AsyncGeneratorFunction";at.asyncFunction=io("AsyncFunction");at.bigint=Df("bigint");at.boolean=t=>t===!0||t===!1;at.date=io("Date");at.defined=t=>!at.undefined(t);at.domElement=t=>at.object(t)&&!at.plainObject(t)&&t.nodeType===1&&at.string(t.nodeName)&&Lpe.every(e=>e in t);at.empty=t=>at.string(t)&&t.length===0||at.array(t)&&t.length===0||at.object(t)&&!at.map(t)&&!at.set(t)&&Object.keys(t).length===0||at.set(t)&&t.size===0||at.map(t)&&t.size===0;at.error=io("Error");at.function=Df("function");at.generator=t=>at.iterable(t)&&at.function(t.next)&&at.function(t.throw);at.generatorFunction=io("GeneratorFunction");at.instanceOf=(t,e)=>!t||!e?!1:Object.getPrototypeOf(t)===e.prototype;at.iterable=t=>!at.nullOrUndefined(t)&&at.function(t[Symbol.iterator]);at.map=io("Map");at.nan=t=>Number.isNaN(t);at.null=t=>t===null;at.nullOrUndefined=t=>at.null(t)||at.undefined(t);at.number=t=>Df("number")(t)&&!at.nan(t);at.numericString=t=>at.string(t)&&t.length>0&&!Number.isNaN(Number(t));at.object=t=>!at.nullOrUndefined(t)&&(at.function(t)||typeof t=="object");at.oneOf=(t,e)=>at.array(t)?t.indexOf(e)>-1:!1;at.plainFunction=io("Function");at.plainObject=t=>{if(Mb(t)!=="Object")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.getPrototypeOf({})};at.primitive=t=>at.null(t)||Ipe(typeof t);at.promise=io("Promise");at.propertyOf=(t,e,n)=>{if(!at.object(t)||!e)return!1;const r=t[e];return at.function(n)?n(r):at.defined(r)};at.regexp=io("RegExp");at.set=io("Set");at.string=Df("string");at.symbol=Df("symbol");at.undefined=Df("undefined");at.weakMap=io("WeakMap");at.weakSet=io("WeakSet");var pt=at;function Bpe(...t){return t.every(e=>pt.string(e)||pt.array(e)||pt.plainObject(e))}function Fpe(t,e,n){return FH(t,e)?[t,e].every(pt.array)?!t.some(RA(n))&&e.some(RA(n)):[t,e].every(pt.plainObject)?!Object.entries(t).some(MA(n))&&Object.entries(e).some(MA(n)):e===n:!1}function EA(t,e,n){const{actual:r,key:s,previous:i,type:a}=n,l=_o(t,s),c=_o(e,s);let d=[l,c].every(pt.number)&&(a==="increased"?lc);return pt.undefined(r)||(d=d&&c===r),pt.undefined(i)||(d=d&&l===i),d}function _A(t,e,n){const{key:r,type:s,value:i}=n,a=_o(t,r),l=_o(e,r),c=s==="added"?a:l,d=s==="added"?l:a;if(!pt.nullOrUndefined(i)){if(pt.defined(c)){if(pt.array(c)||pt.plainObject(c))return Fpe(c,d,i)}else return ti(d,i);return!1}return[a,l].every(pt.array)?!d.every(G6(c)):[a,l].every(pt.plainObject)?qpe(Object.keys(c),Object.keys(d)):![a,l].every(h=>pt.primitive(h)&&pt.defined(h))&&(s==="added"?!pt.defined(a)&&pt.defined(l):pt.defined(a)&&!pt.defined(l))}function AA(t,e,{key:n}={}){let r=_o(t,n),s=_o(e,n);if(!FH(r,s))throw new TypeError("Inputs have different types");if(!Bpe(r,s))throw new TypeError("Inputs don't have length");return[r,s].every(pt.plainObject)&&(r=Object.keys(r),s=Object.keys(s)),[r,s]}function MA(t){return([e,n])=>pt.array(t)?ti(t,n)||t.some(r=>ti(r,n)||pt.array(n)&&G6(n)(r)):pt.plainObject(t)&&t[e]?!!t[e]&&ti(t[e],n):ti(t,n)}function qpe(t,e){return e.some(n=>!t.includes(n))}function RA(t){return e=>pt.array(t)?t.some(n=>ti(n,e)||pt.array(e)&&G6(e)(n)):ti(t,e)}function Um(t,e){return pt.array(t)?t.some(n=>ti(n,e)):ti(t,e)}function G6(t){return e=>t.some(n=>ti(n,e))}function FH(...t){return t.every(pt.array)||t.every(pt.number)||t.every(pt.plainObject)||t.every(pt.string)}function _o(t,e){return pt.plainObject(t)||pt.array(t)?pt.string(e)?e.split(".").reduce((r,s)=>r&&r[s],t):pt.number(e)?t[e]:t:t}function py(t,e){if([t,e].some(pt.nullOrUndefined))throw new Error("Missing required parameters");if(![t,e].every(h=>pt.plainObject(h)||pt.array(h)))throw new Error("Expected plain objects or array");return{added:(h,m)=>{try{return _A(t,e,{key:h,type:"added",value:m})}catch{return!1}},changed:(h,m,g)=>{try{const x=_o(t,h),y=_o(e,h),w=pt.defined(m),S=pt.defined(g);if(w||S){const k=S?Um(g,x):!Um(m,x),j=Um(m,y);return k&&j}return[x,y].every(pt.array)||[x,y].every(pt.plainObject)?!ti(x,y):x!==y}catch{return!1}},changedFrom:(h,m,g)=>{if(!pt.defined(h))return!1;try{const x=_o(t,h),y=_o(e,h),w=pt.defined(g);return Um(m,x)&&(w?Um(g,y):!w)}catch{return!1}},decreased:(h,m,g)=>{if(!pt.defined(h))return!1;try{return EA(t,e,{key:h,actual:m,previous:g,type:"decreased"})}catch{return!1}},emptied:h=>{try{const[m,g]=AA(t,e,{key:h});return!!m.length&&!g.length}catch{return!1}},filled:h=>{try{const[m,g]=AA(t,e,{key:h});return!m.length&&!!g.length}catch{return!1}},increased:(h,m,g)=>{if(!pt.defined(h))return!1;try{return EA(t,e,{key:h,actual:m,previous:g,type:"increased"})}catch{return!1}},removed:(h,m)=>{try{return _A(t,e,{key:h,type:"removed",value:m})}catch{return!1}}}}var wS,DA;function $pe(){if(DA)return wS;DA=1;var t=new Error("Element already at target scroll position"),e=new Error("Scroll cancelled"),n=Math.min,r=Date.now;wS={left:s("scrollLeft"),top:s("scrollTop")};function s(l){return function(d,h,m,g){m=m||{},typeof m=="function"&&(g=m,m={}),typeof g!="function"&&(g=a);var x=r(),y=d[l],w=m.ease||i,S=isNaN(m.duration)?350:+m.duration,k=!1;return y===h?g(t,d[l]):requestAnimationFrame(N),j;function j(){k=!0}function N(T){if(k)return g(e,d[l]);var E=r(),_=n(1,(E-x)/S),A=w(_);d[l]=A*(h-y)+y,_<1?requestAnimationFrame(N):requestAnimationFrame(function(){g(null,d[l])})}}}function i(l){return .5*(1-Math.cos(Math.PI*l))}function a(){}return wS}var Hpe=$pe();const Qpe=yd(Hpe);var Ov={exports:{}},Vpe=Ov.exports,PA;function Upe(){return PA||(PA=1,(function(t){(function(e,n){t.exports?t.exports=n():e.Scrollparent=n()})(Vpe,function(){function e(r){var s=getComputedStyle(r,null).getPropertyValue("overflow");return s.indexOf("scroll")>-1||s.indexOf("auto")>-1}function n(r){if(r instanceof HTMLElement||r instanceof SVGElement){for(var s=r.parentNode;s.parentNode;){if(e(s))return s;s=s.parentNode}return document.scrollingElement||document.documentElement}}return n})})(Ov)),Ov.exports}var Wpe=Upe();const qH=yd(Wpe);var SS,zA;function Gpe(){if(zA)return SS;zA=1;var t=function(r){return Object.prototype.hasOwnProperty.call(r,"props")},e=function(r,s){return r+n(s)},n=function(r){return r===null||typeof r=="boolean"||typeof r>"u"?"":typeof r=="number"?r.toString():typeof r=="string"?r:Array.isArray(r)?r.reduce(e,""):t(r)&&Object.prototype.hasOwnProperty.call(r.props,"children")?n(r.props.children):""};return n.default=n,SS=n,SS}var Xpe=Gpe();const IA=yd(Xpe);var kS,LA;function Ype(){if(LA)return kS;LA=1;var t=function(j){return e(j)&&!n(j)};function e(k){return!!k&&typeof k=="object"}function n(k){var j=Object.prototype.toString.call(k);return j==="[object RegExp]"||j==="[object Date]"||i(k)}var r=typeof Symbol=="function"&&Symbol.for,s=r?Symbol.for("react.element"):60103;function i(k){return k.$$typeof===s}function a(k){return Array.isArray(k)?[]:{}}function l(k,j){return j.clone!==!1&&j.isMergeableObject(k)?w(a(k),k,j):k}function c(k,j,N){return k.concat(j).map(function(T){return l(T,N)})}function d(k,j){if(!j.customMerge)return w;var N=j.customMerge(k);return typeof N=="function"?N:w}function h(k){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(k).filter(function(j){return Object.propertyIsEnumerable.call(k,j)}):[]}function m(k){return Object.keys(k).concat(h(k))}function g(k,j){try{return j in k}catch{return!1}}function x(k,j){return g(k,j)&&!(Object.hasOwnProperty.call(k,j)&&Object.propertyIsEnumerable.call(k,j))}function y(k,j,N){var T={};return N.isMergeableObject(k)&&m(k).forEach(function(E){T[E]=l(k[E],N)}),m(j).forEach(function(E){x(k,E)||(g(k,E)&&N.isMergeableObject(j[E])?T[E]=d(E,N)(k[E],j[E],N):T[E]=l(j[E],N))}),T}function w(k,j,N){N=N||{},N.arrayMerge=N.arrayMerge||c,N.isMergeableObject=N.isMergeableObject||t,N.cloneUnlessOtherwiseSpecified=l;var T=Array.isArray(j),E=Array.isArray(k),_=T===E;return _?T?N.arrayMerge(k,j,N):y(k,j,N):l(j,N)}w.all=function(j,N){if(!Array.isArray(j))throw new Error("first argument should be an array");return j.reduce(function(T,E){return w(T,E,N)},{})};var S=w;return kS=S,kS}var Kpe=Ype();const Ua=yd(Kpe);var ig=typeof window<"u"&&typeof document<"u"&&typeof navigator<"u",Zpe=(function(){for(var t=["Edge","Trident","Firefox"],e=0;e=0)return 1;return 0})();function Jpe(t){var e=!1;return function(){e||(e=!0,window.Promise.resolve().then(function(){e=!1,t()}))}}function ege(t){var e=!1;return function(){e||(e=!0,setTimeout(function(){e=!1,t()},Zpe))}}var tge=ig&&window.Promise,nge=tge?Jpe:ege;function $H(t){var e={};return t&&e.toString.call(t)==="[object Function]"}function Sd(t,e){if(t.nodeType!==1)return[];var n=t.ownerDocument.defaultView,r=n.getComputedStyle(t,null);return e?r[e]:r}function X6(t){return t.nodeName==="HTML"?t:t.parentNode||t.host}function ag(t){if(!t)return document.body;switch(t.nodeName){case"HTML":case"BODY":return t.ownerDocument.body;case"#document":return t.body}var e=Sd(t),n=e.overflow,r=e.overflowX,s=e.overflowY;return/(auto|scroll|overlay)/.test(n+s+r)?t:ag(X6(t))}function HH(t){return t&&t.referenceNode?t.referenceNode:t}var BA=ig&&!!(window.MSInputMethodContext&&document.documentMode),FA=ig&&/MSIE 10/.test(navigator.userAgent);function Pf(t){return t===11?BA:t===10?FA:BA||FA}function lf(t){if(!t)return document.documentElement;for(var e=Pf(10)?document.body:null,n=t.offsetParent||null;n===e&&t.nextElementSibling;)n=(t=t.nextElementSibling).offsetParent;var r=n&&n.nodeName;return!r||r==="BODY"||r==="HTML"?t?t.ownerDocument.documentElement:document.documentElement:["TH","TD","TABLE"].indexOf(n.nodeName)!==-1&&Sd(n,"position")==="static"?lf(n):n}function rge(t){var e=t.nodeName;return e==="BODY"?!1:e==="HTML"||lf(t.firstElementChild)===t}function bO(t){return t.parentNode!==null?bO(t.parentNode):t}function gy(t,e){if(!t||!t.nodeType||!e||!e.nodeType)return document.documentElement;var n=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?t:e,s=n?e:t,i=document.createRange();i.setStart(r,0),i.setEnd(s,0);var a=i.commonAncestorContainer;if(t!==a&&e!==a||r.contains(s))return rge(a)?a:lf(a);var l=bO(t);return l.host?gy(l.host,e):gy(t,bO(e).host)}function cf(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"top",n=e==="top"?"scrollTop":"scrollLeft",r=t.nodeName;if(r==="BODY"||r==="HTML"){var s=t.ownerDocument.documentElement,i=t.ownerDocument.scrollingElement||s;return i[n]}return t[n]}function sge(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=cf(e,"top"),s=cf(e,"left"),i=n?-1:1;return t.top+=r*i,t.bottom+=r*i,t.left+=s*i,t.right+=s*i,t}function qA(t,e){var n=e==="x"?"Left":"Top",r=n==="Left"?"Right":"Bottom";return parseFloat(t["border"+n+"Width"])+parseFloat(t["border"+r+"Width"])}function $A(t,e,n,r){return Math.max(e["offset"+t],e["scroll"+t],n["client"+t],n["offset"+t],n["scroll"+t],Pf(10)?parseInt(n["offset"+t])+parseInt(r["margin"+(t==="Height"?"Top":"Left")])+parseInt(r["margin"+(t==="Height"?"Bottom":"Right")]):0)}function QH(t){var e=t.body,n=t.documentElement,r=Pf(10)&&getComputedStyle(n);return{height:$A("Height",e,n,r),width:$A("Width",e,n,r)}}var ige=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},age=(function(){function t(e,n){for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!1,r=Pf(10),s=e.nodeName==="HTML",i=wO(t),a=wO(e),l=ag(t),c=Sd(e),d=parseFloat(c.borderTopWidth),h=parseFloat(c.borderLeftWidth);n&&s&&(a.top=Math.max(a.top,0),a.left=Math.max(a.left,0));var m=nu({top:i.top-a.top-d,left:i.left-a.left-h,width:i.width,height:i.height});if(m.marginTop=0,m.marginLeft=0,!r&&s){var g=parseFloat(c.marginTop),x=parseFloat(c.marginLeft);m.top-=d-g,m.bottom-=d-g,m.left-=h-x,m.right-=h-x,m.marginTop=g,m.marginLeft=x}return(r&&!n?e.contains(l):e===l&&l.nodeName!=="BODY")&&(m=sge(m,e)),m}function oge(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=t.ownerDocument.documentElement,r=Y6(t,n),s=Math.max(n.clientWidth,window.innerWidth||0),i=Math.max(n.clientHeight,window.innerHeight||0),a=e?0:cf(n),l=e?0:cf(n,"left"),c={top:a-r.top+r.marginTop,left:l-r.left+r.marginLeft,width:s,height:i};return nu(c)}function VH(t){var e=t.nodeName;if(e==="BODY"||e==="HTML")return!1;if(Sd(t,"position")==="fixed")return!0;var n=X6(t);return n?VH(n):!1}function UH(t){if(!t||!t.parentElement||Pf())return document.documentElement;for(var e=t.parentElement;e&&Sd(e,"transform")==="none";)e=e.parentElement;return e||document.documentElement}function K6(t,e,n,r){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,i={top:0,left:0},a=s?UH(t):gy(t,HH(e));if(r==="viewport")i=oge(a,s);else{var l=void 0;r==="scrollParent"?(l=ag(X6(e)),l.nodeName==="BODY"&&(l=t.ownerDocument.documentElement)):r==="window"?l=t.ownerDocument.documentElement:l=r;var c=Y6(l,a,s);if(l.nodeName==="HTML"&&!VH(a)){var d=QH(t.ownerDocument),h=d.height,m=d.width;i.top+=c.top-c.marginTop,i.bottom=h+c.top,i.left+=c.left-c.marginLeft,i.right=m+c.left}else i=c}n=n||0;var g=typeof n=="number";return i.left+=g?n:n.left||0,i.top+=g?n:n.top||0,i.right-=g?n:n.right||0,i.bottom-=g?n:n.bottom||0,i}function lge(t){var e=t.width,n=t.height;return e*n}function WH(t,e,n,r,s){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0;if(t.indexOf("auto")===-1)return t;var a=K6(n,r,i,s),l={top:{width:a.width,height:e.top-a.top},right:{width:a.right-e.right,height:a.height},bottom:{width:a.width,height:a.bottom-e.bottom},left:{width:e.left-a.left,height:a.height}},c=Object.keys(l).map(function(g){return ja({key:g},l[g],{area:lge(l[g])})}).sort(function(g,x){return x.area-g.area}),d=c.filter(function(g){var x=g.width,y=g.height;return x>=n.clientWidth&&y>=n.clientHeight}),h=d.length>0?d[0].key:c[0].key,m=t.split("-")[1];return h+(m?"-"+m:"")}function GH(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,s=r?UH(e):gy(e,HH(n));return Y6(n,s,r)}function XH(t){var e=t.ownerDocument.defaultView,n=e.getComputedStyle(t),r=parseFloat(n.marginTop||0)+parseFloat(n.marginBottom||0),s=parseFloat(n.marginLeft||0)+parseFloat(n.marginRight||0),i={width:t.offsetWidth+s,height:t.offsetHeight+r};return i}function xy(t){var e={left:"right",right:"left",bottom:"top",top:"bottom"};return t.replace(/left|right|bottom|top/g,function(n){return e[n]})}function YH(t,e,n){n=n.split("-")[0];var r=XH(t),s={width:r.width,height:r.height},i=["right","left"].indexOf(n)!==-1,a=i?"top":"left",l=i?"left":"top",c=i?"height":"width",d=i?"width":"height";return s[a]=e[a]+e[c]/2-r[c]/2,n===l?s[l]=e[l]-r[d]:s[l]=e[xy(l)],s}function og(t,e){return Array.prototype.find?t.find(e):t.filter(e)[0]}function cge(t,e,n){if(Array.prototype.findIndex)return t.findIndex(function(s){return s[e]===n});var r=og(t,function(s){return s[e]===n});return t.indexOf(r)}function KH(t,e,n){var r=n===void 0?t:t.slice(0,cge(t,"name",n));return r.forEach(function(s){s.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var i=s.function||s.fn;s.enabled&&$H(i)&&(e.offsets.popper=nu(e.offsets.popper),e.offsets.reference=nu(e.offsets.reference),e=i(e,s))}),e}function uge(){if(!this.state.isDestroyed){var t={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};t.offsets.reference=GH(this.state,this.popper,this.reference,this.options.positionFixed),t.placement=WH(this.options.placement,t.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),t.originalPlacement=t.placement,t.positionFixed=this.options.positionFixed,t.offsets.popper=YH(this.popper,t.offsets.reference,t.placement),t.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",t=KH(this.modifiers,t),this.state.isCreated?this.options.onUpdate(t):(this.state.isCreated=!0,this.options.onCreate(t))}}function ZH(t,e){return t.some(function(n){var r=n.name,s=n.enabled;return s&&r===e})}function Z6(t){for(var e=[!1,"ms","Webkit","Moz","O"],n=t.charAt(0).toUpperCase()+t.slice(1),r=0;ra[x]&&(t.offsets.popper[m]+=l[m]+y-a[x]),t.offsets.popper=nu(t.offsets.popper);var w=l[m]+l[d]/2-y/2,S=Sd(t.instance.popper),k=parseFloat(S["margin"+h]),j=parseFloat(S["border"+h+"Width"]),N=w-t.offsets.popper[m]-k-j;return N=Math.max(Math.min(a[d]-y,N),0),t.arrowElement=r,t.offsets.arrow=(n={},uf(n,m,Math.round(N)),uf(n,g,""),n),t}function kge(t){return t==="end"?"start":t==="start"?"end":t}var nQ=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],OS=nQ.slice(3);function HA(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=OS.indexOf(t),r=OS.slice(n+1).concat(OS.slice(0,n));return e?r.reverse():r}var jS={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function Oge(t,e){if(ZH(t.instance.modifiers,"inner")||t.flipped&&t.placement===t.originalPlacement)return t;var n=K6(t.instance.popper,t.instance.reference,e.padding,e.boundariesElement,t.positionFixed),r=t.placement.split("-")[0],s=xy(r),i=t.placement.split("-")[1]||"",a=[];switch(e.behavior){case jS.FLIP:a=[r,s];break;case jS.CLOCKWISE:a=HA(r);break;case jS.COUNTERCLOCKWISE:a=HA(r,!0);break;default:a=e.behavior}return a.forEach(function(l,c){if(r!==l||a.length===c+1)return t;r=t.placement.split("-")[0],s=xy(r);var d=t.offsets.popper,h=t.offsets.reference,m=Math.floor,g=r==="left"&&m(d.right)>m(h.left)||r==="right"&&m(d.left)m(h.top)||r==="bottom"&&m(d.top)m(n.right),w=m(d.top)m(n.bottom),k=r==="left"&&x||r==="right"&&y||r==="top"&&w||r==="bottom"&&S,j=["top","bottom"].indexOf(r)!==-1,N=!!e.flipVariations&&(j&&i==="start"&&x||j&&i==="end"&&y||!j&&i==="start"&&w||!j&&i==="end"&&S),T=!!e.flipVariationsByContent&&(j&&i==="start"&&y||j&&i==="end"&&x||!j&&i==="start"&&S||!j&&i==="end"&&w),E=N||T;(g||k||E)&&(t.flipped=!0,(g||k)&&(r=a[c+1]),E&&(i=kge(i)),t.placement=r+(i?"-"+i:""),t.offsets.popper=ja({},t.offsets.popper,YH(t.instance.popper,t.offsets.reference,t.placement)),t=KH(t.instance.modifiers,t,"flip"))}),t}function jge(t){var e=t.offsets,n=e.popper,r=e.reference,s=t.placement.split("-")[0],i=Math.floor,a=["top","bottom"].indexOf(s)!==-1,l=a?"right":"bottom",c=a?"left":"top",d=a?"width":"height";return n[l]i(r[l])&&(t.offsets.popper[c]=i(r[l])),t}function Nge(t,e,n,r){var s=t.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),i=+s[1],a=s[2];if(!i)return t;if(a.indexOf("%")===0){var l=void 0;switch(a){case"%p":l=n;break;case"%":case"%r":default:l=r}var c=nu(l);return c[e]/100*i}else if(a==="vh"||a==="vw"){var d=void 0;return a==="vh"?d=Math.max(document.documentElement.clientHeight,window.innerHeight||0):d=Math.max(document.documentElement.clientWidth,window.innerWidth||0),d/100*i}else return i}function Cge(t,e,n,r){var s=[0,0],i=["right","left"].indexOf(r)!==-1,a=t.split(/(\+|\-)/).map(function(h){return h.trim()}),l=a.indexOf(og(a,function(h){return h.search(/,|\s/)!==-1}));a[l]&&a[l].indexOf(",")===-1&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var c=/\s*,\s*|\s+/,d=l!==-1?[a.slice(0,l).concat([a[l].split(c)[0]]),[a[l].split(c)[1]].concat(a.slice(l+1))]:[a];return d=d.map(function(h,m){var g=(m===1?!i:i)?"height":"width",x=!1;return h.reduce(function(y,w){return y[y.length-1]===""&&["+","-"].indexOf(w)!==-1?(y[y.length-1]=w,x=!0,y):x?(y[y.length-1]+=w,x=!1,y):y.concat(w)},[]).map(function(y){return Nge(y,g,e,n)})}),d.forEach(function(h,m){h.forEach(function(g,x){J6(g)&&(s[m]+=g*(h[x-1]==="-"?-1:1))})}),s}function Tge(t,e){var n=e.offset,r=t.placement,s=t.offsets,i=s.popper,a=s.reference,l=r.split("-")[0],c=void 0;return J6(+n)?c=[+n,0]:c=Cge(n,i,a,l),l==="left"?(i.top+=c[0],i.left-=c[1]):l==="right"?(i.top+=c[0],i.left+=c[1]):l==="top"?(i.left+=c[0],i.top-=c[1]):l==="bottom"&&(i.left+=c[0],i.top+=c[1]),t.popper=i,t}function Ege(t,e){var n=e.boundariesElement||lf(t.instance.popper);t.instance.reference===n&&(n=lf(n));var r=Z6("transform"),s=t.instance.popper.style,i=s.top,a=s.left,l=s[r];s.top="",s.left="",s[r]="";var c=K6(t.instance.popper,t.instance.reference,e.padding,n,t.positionFixed);s.top=i,s.left=a,s[r]=l,e.boundaries=c;var d=e.priority,h=t.offsets.popper,m={primary:function(x){var y=h[x];return h[x]c[x]&&!e.escapeWithReference&&(w=Math.min(h[y],c[x]-(x==="right"?h.width:h.height))),uf({},y,w)}};return d.forEach(function(g){var x=["left","top"].indexOf(g)!==-1?"primary":"secondary";h=ja({},h,m[x](g))}),t.offsets.popper=h,t}function _ge(t){var e=t.placement,n=e.split("-")[0],r=e.split("-")[1];if(r){var s=t.offsets,i=s.reference,a=s.popper,l=["bottom","top"].indexOf(n)!==-1,c=l?"left":"top",d=l?"width":"height",h={start:uf({},c,i[c]),end:uf({},c,i[c]+i[d]-a[d])};t.offsets.popper=ja({},a,h[r])}return t}function Age(t){if(!tQ(t.instance.modifiers,"hide","preventOverflow"))return t;var e=t.offsets.reference,n=og(t.instance.modifiers,function(r){return r.name==="preventOverflow"}).boundaries;if(e.bottomn.right||e.top>n.bottom||e.right2&&arguments[2]!==void 0?arguments[2]:{};ige(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=nge(this.update.bind(this)),this.options=ja({},t.Defaults,s),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(ja({},t.Defaults.modifiers,s.modifiers)).forEach(function(a){r.options.modifiers[a]=ja({},t.Defaults.modifiers[a]||{},s.modifiers?s.modifiers[a]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(a){return ja({name:a},r.options.modifiers[a])}).sort(function(a,l){return a.order-l.order}),this.modifiers.forEach(function(a){a.enabled&&$H(a.onLoad)&&a.onLoad(r.reference,r.popper,r.options,a,r.state)}),this.update();var i=this.options.eventsEnabled;i&&this.enableEventListeners(),this.state.eventsEnabled=i}return age(t,[{key:"update",value:function(){return uge.call(this)}},{key:"destroy",value:function(){return dge.call(this)}},{key:"enableEventListeners",value:function(){return fge.call(this)}},{key:"disableEventListeners",value:function(){return pge.call(this)}}]),t})();hp.Utils=(typeof window<"u"?window:global).PopperUtils;hp.placements=nQ;hp.Defaults=Dge;var Pge=["innerHTML","ownerDocument","style","attributes","nodeValue"],zge=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","WeakMap","WeakSet"],Ige=["bigint","boolean","null","number","string","symbol","undefined"];function Rb(t){var e=Object.prototype.toString.call(t).slice(8,-1);if(/HTML\w+Element/.test(e))return"HTMLElement";if(Lge(e))return e}function ao(t){return function(e){return Rb(e)===t}}function Lge(t){return zge.includes(t)}function zf(t){return function(e){return typeof e===t}}function Bge(t){return Ige.includes(t)}function Ee(t){if(t===null)return"null";switch(typeof t){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(Ee.array(t))return"Array";if(Ee.plainFunction(t))return"Function";var e=Rb(t);return e||"Object"}Ee.array=Array.isArray;Ee.arrayOf=function(t,e){return!Ee.array(t)&&!Ee.function(e)?!1:t.every(function(n){return e(n)})};Ee.asyncGeneratorFunction=function(t){return Rb(t)==="AsyncGeneratorFunction"};Ee.asyncFunction=ao("AsyncFunction");Ee.bigint=zf("bigint");Ee.boolean=function(t){return t===!0||t===!1};Ee.date=ao("Date");Ee.defined=function(t){return!Ee.undefined(t)};Ee.domElement=function(t){return Ee.object(t)&&!Ee.plainObject(t)&&t.nodeType===1&&Ee.string(t.nodeName)&&Pge.every(function(e){return e in t})};Ee.empty=function(t){return Ee.string(t)&&t.length===0||Ee.array(t)&&t.length===0||Ee.object(t)&&!Ee.map(t)&&!Ee.set(t)&&Object.keys(t).length===0||Ee.set(t)&&t.size===0||Ee.map(t)&&t.size===0};Ee.error=ao("Error");Ee.function=zf("function");Ee.generator=function(t){return Ee.iterable(t)&&Ee.function(t.next)&&Ee.function(t.throw)};Ee.generatorFunction=ao("GeneratorFunction");Ee.instanceOf=function(t,e){return!t||!e?!1:Object.getPrototypeOf(t)===e.prototype};Ee.iterable=function(t){return!Ee.nullOrUndefined(t)&&Ee.function(t[Symbol.iterator])};Ee.map=ao("Map");Ee.nan=function(t){return Number.isNaN(t)};Ee.null=function(t){return t===null};Ee.nullOrUndefined=function(t){return Ee.null(t)||Ee.undefined(t)};Ee.number=function(t){return zf("number")(t)&&!Ee.nan(t)};Ee.numericString=function(t){return Ee.string(t)&&t.length>0&&!Number.isNaN(Number(t))};Ee.object=function(t){return!Ee.nullOrUndefined(t)&&(Ee.function(t)||typeof t=="object")};Ee.oneOf=function(t,e){return Ee.array(t)?t.indexOf(e)>-1:!1};Ee.plainFunction=ao("Function");Ee.plainObject=function(t){if(Rb(t)!=="Object")return!1;var e=Object.getPrototypeOf(t);return e===null||e===Object.getPrototypeOf({})};Ee.primitive=function(t){return Ee.null(t)||Bge(typeof t)};Ee.promise=ao("Promise");Ee.propertyOf=function(t,e,n){if(!Ee.object(t)||!e)return!1;var r=t[e];return Ee.function(n)?n(r):Ee.defined(r)};Ee.regexp=ao("RegExp");Ee.set=ao("Set");Ee.string=zf("string");Ee.symbol=zf("symbol");Ee.undefined=zf("undefined");Ee.weakMap=ao("WeakMap");Ee.weakSet=ao("WeakSet");function rQ(t){return function(e){return typeof e===t}}var Fge=rQ("function"),qge=function(t){return t===null},QA=function(t){return Object.prototype.toString.call(t).slice(8,-1)==="RegExp"},VA=function(t){return!$ge(t)&&!qge(t)&&(Fge(t)||typeof t=="object")},$ge=rQ("undefined"),kO=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function Hge(t,e){var n=t.length;if(n!==e.length)return!1;for(var r=n;r--!==0;)if(!Si(t[r],e[r]))return!1;return!0}function Qge(t,e){if(t.byteLength!==e.byteLength)return!1;for(var n=new DataView(t.buffer),r=new DataView(e.buffer),s=t.byteLength;s--;)if(n.getUint8(s)!==r.getUint8(s))return!1;return!0}function Vge(t,e){var n,r,s,i;if(t.size!==e.size)return!1;try{for(var a=kO(t.entries()),l=a.next();!l.done;l=a.next()){var c=l.value;if(!e.has(c[0]))return!1}}catch(m){n={error:m}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}try{for(var d=kO(t.entries()),h=d.next();!h.done;h=d.next()){var c=h.value;if(!Si(c[1],e.get(c[0])))return!1}}catch(m){s={error:m}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(s)throw s.error}}return!0}function Uge(t,e){var n,r;if(t.size!==e.size)return!1;try{for(var s=kO(t.entries()),i=s.next();!i.done;i=s.next()){var a=i.value;if(!e.has(a[0]))return!1}}catch(l){n={error:l}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return!0}function Si(t,e){if(t===e)return!0;if(t&&VA(t)&&e&&VA(e)){if(t.constructor!==e.constructor)return!1;if(Array.isArray(t)&&Array.isArray(e))return Hge(t,e);if(t instanceof Map&&e instanceof Map)return Vge(t,e);if(t instanceof Set&&e instanceof Set)return Uge(t,e);if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return Qge(t,e);if(QA(t)&&QA(e))return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var s=n.length;s--!==0;)if(!Object.prototype.hasOwnProperty.call(e,n[s]))return!1;for(var s=n.length;s--!==0;){var i=n[s];if(!(i==="_owner"&&t.$$typeof)&&!Si(t[i],e[i]))return!1}return!0}return Number.isNaN(t)&&Number.isNaN(e)?!0:t===e}function Wge(){for(var t=[],e=0;ec);return Ee.undefined(r)||(d=d&&c===r),Ee.undefined(i)||(d=d&&l===i),d}function WA(t,e,n){var r=n.key,s=n.type,i=n.value,a=Ao(t,r),l=Ao(e,r),c=s==="added"?a:l,d=s==="added"?l:a;if(!Ee.nullOrUndefined(i)){if(Ee.defined(c)){if(Ee.array(c)||Ee.plainObject(c))return Gge(c,d,i)}else return Si(d,i);return!1}return[a,l].every(Ee.array)?!d.every(eN(c)):[a,l].every(Ee.plainObject)?Xge(Object.keys(c),Object.keys(d)):![a,l].every(function(h){return Ee.primitive(h)&&Ee.defined(h)})&&(s==="added"?!Ee.defined(a)&&Ee.defined(l):Ee.defined(a)&&!Ee.defined(l))}function GA(t,e,n){var r=n===void 0?{}:n,s=r.key,i=Ao(t,s),a=Ao(e,s);if(!sQ(i,a))throw new TypeError("Inputs have different types");if(!Wge(i,a))throw new TypeError("Inputs don't have length");return[i,a].every(Ee.plainObject)&&(i=Object.keys(i),a=Object.keys(a)),[i,a]}function XA(t){return function(e){var n=e[0],r=e[1];return Ee.array(t)?Si(t,r)||t.some(function(s){return Si(s,r)||Ee.array(r)&&eN(r)(s)}):Ee.plainObject(t)&&t[n]?!!t[n]&&Si(t[n],r):Si(t,r)}}function Xge(t,e){return e.some(function(n){return!t.includes(n)})}function YA(t){return function(e){return Ee.array(t)?t.some(function(n){return Si(n,e)||Ee.array(e)&&eN(e)(n)}):Si(t,e)}}function Wm(t,e){return Ee.array(t)?t.some(function(n){return Si(n,e)}):Si(t,e)}function eN(t){return function(e){return t.some(function(n){return Si(n,e)})}}function sQ(){for(var t=[],e=0;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Jge(t,e){if(t==null)return{};var n={},r=Object.keys(t),s,i;for(i=0;i=0)&&(n[s]=t[s]);return n}function iQ(t,e){if(t==null)return{};var n=Jge(t,e),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function El(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function exe(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return El(t)}function dg(t){var e=Zge();return function(){var r=vy(t),s;if(e){var i=vy(this).constructor;s=Reflect.construct(r,arguments,i)}else s=r.apply(this,arguments);return exe(this,s)}}function txe(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function aQ(t){var e=txe(t,"string");return typeof e=="symbol"?e:String(e)}var nxe={flip:{padding:20},preventOverflow:{padding:10}},rxe="The typeValidator argument must be a function with the signature function(props, propName, componentName).",sxe="The error message is optional, but must be a string if provided.";function ixe(t,e,n,r){return typeof t=="boolean"?t:typeof t=="function"?t(e,n,r):t?!!t:!1}function axe(t,e){return Object.hasOwnProperty.call(t,e)}function oxe(t,e,n,r){return new Error("Required ".concat(t[e]," `").concat(e,"` was not specified in `").concat(n,"`."))}function lxe(t,e){if(typeof t!="function")throw new TypeError(rxe);if(e&&typeof e!="string")throw new TypeError(sxe)}function ZA(t,e,n){return lxe(t,n),function(r,s,i){for(var a=arguments.length,l=new Array(a>3?a-3:0),c=3;c3&&arguments[3]!==void 0?arguments[3]:!1;t.addEventListener(e,n,r)}function uxe(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;t.removeEventListener(e,n,r)}function dxe(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s;s=function(a){n(a),uxe(t,e,s)},cxe(t,e,s,r)}function JA(){}var oQ=(function(t){ug(n,t);var e=dg(n);function n(){return lg(this,n),e.apply(this,arguments)}return cg(n,[{key:"componentDidMount",value:function(){bo()&&(this.node||this.appendNode(),Gm||this.renderPortal())}},{key:"componentDidUpdate",value:function(){bo()&&(Gm||this.renderPortal())}},{key:"componentWillUnmount",value:function(){!bo()||!this.node||(Gm||sv.unmountComponentAtNode(this.node),this.node&&this.node.parentNode===document.body&&(document.body.removeChild(this.node),this.node=void 0))}},{key:"appendNode",value:function(){var s=this.props,i=s.id,a=s.zIndex;this.node||(this.node=document.createElement("div"),i&&(this.node.id=i),a&&(this.node.style.zIndex=a),document.body.appendChild(this.node))}},{key:"renderPortal",value:function(){if(!bo())return null;var s=this.props,i=s.children,a=s.setRef;if(this.node||this.appendNode(),Gm)return sv.createPortal(i,this.node);var l=sv.unstable_renderSubtreeIntoContainer(this,i.length>1?oe.createElement("div",null,i):i[0],this.node);return a(l),null}},{key:"renderReact16",value:function(){var s=this.props,i=s.hasChildren,a=s.placement,l=s.target;return i?this.renderPortal():l||a==="center"?this.renderPortal():null}},{key:"render",value:function(){return Gm?this.renderReact16():null}}]),n})(oe.Component);Fs(oQ,"propTypes",{children:Ge.oneOfType([Ge.element,Ge.array]),hasChildren:Ge.bool,id:Ge.oneOfType([Ge.string,Ge.number]),placement:Ge.string,setRef:Ge.func.isRequired,target:Ge.oneOfType([Ge.object,Ge.string]),zIndex:Ge.number});var lQ=(function(t){ug(n,t);var e=dg(n);function n(){return lg(this,n),e.apply(this,arguments)}return cg(n,[{key:"parentStyle",get:function(){var s=this.props,i=s.placement,a=s.styles,l=a.arrow.length,c={pointerEvents:"none",position:"absolute",width:"100%"};return i.startsWith("top")?(c.bottom=0,c.left=0,c.right=0,c.height=l):i.startsWith("bottom")?(c.left=0,c.right=0,c.top=0,c.height=l):i.startsWith("left")?(c.right=0,c.top=0,c.bottom=0):i.startsWith("right")&&(c.left=0,c.top=0),c}},{key:"render",value:function(){var s=this.props,i=s.placement,a=s.setArrowRef,l=s.styles,c=l.arrow,d=c.color,h=c.display,m=c.length,g=c.margin,x=c.position,y=c.spread,w={display:h,position:x},S,k=y,j=m;return i.startsWith("top")?(S="0,0 ".concat(k/2,",").concat(j," ").concat(k,",0"),w.bottom=0,w.marginLeft=g,w.marginRight=g):i.startsWith("bottom")?(S="".concat(k,",").concat(j," ").concat(k/2,",0 0,").concat(j),w.top=0,w.marginLeft=g,w.marginRight=g):i.startsWith("left")?(j=y,k=m,S="0,0 ".concat(k,",").concat(j/2," 0,").concat(j),w.right=0,w.marginTop=g,w.marginBottom=g):i.startsWith("right")&&(j=y,k=m,S="".concat(k,",").concat(j," ").concat(k,",0 0,").concat(j/2),w.left=0,w.marginTop=g,w.marginBottom=g),oe.createElement("div",{className:"__floater__arrow",style:this.parentStyle},oe.createElement("span",{ref:a,style:w},oe.createElement("svg",{width:k,height:j,version:"1.1",xmlns:"http://www.w3.org/2000/svg"},oe.createElement("polygon",{points:S,fill:d}))))}}]),n})(oe.Component);Fs(lQ,"propTypes",{placement:Ge.string.isRequired,setArrowRef:Ge.func.isRequired,styles:Ge.object.isRequired});var hxe=["color","height","width"];function cQ(t){var e=t.handleClick,n=t.styles,r=n.color,s=n.height,i=n.width,a=iQ(n,hxe);return oe.createElement("button",{"aria-label":"close",onClick:e,style:a,type:"button"},oe.createElement("svg",{width:"".concat(i,"px"),height:"".concat(s,"px"),viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid"},oe.createElement("g",null,oe.createElement("path",{d:"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z",fill:r}))))}cQ.propTypes={handleClick:Ge.func.isRequired,styles:Ge.object.isRequired};function uQ(t){var e=t.content,n=t.footer,r=t.handleClick,s=t.open,i=t.positionWrapper,a=t.showCloseButton,l=t.title,c=t.styles,d={content:oe.isValidElement(e)?e:oe.createElement("div",{className:"__floater__content",style:c.content},e)};return l&&(d.title=oe.isValidElement(l)?l:oe.createElement("div",{className:"__floater__title",style:c.title},l)),n&&(d.footer=oe.isValidElement(n)?n:oe.createElement("div",{className:"__floater__footer",style:c.footer},n)),(a||i)&&!Ee.boolean(s)&&(d.close=oe.createElement(cQ,{styles:c.close,handleClick:r})),oe.createElement("div",{className:"__floater__container",style:c.container},d.close,d.title,d.content,d.footer)}uQ.propTypes={content:Ge.node.isRequired,footer:Ge.node,handleClick:Ge.func.isRequired,open:Ge.bool,positionWrapper:Ge.bool.isRequired,showCloseButton:Ge.bool.isRequired,styles:Ge.object.isRequired,title:Ge.node};var dQ=(function(t){ug(n,t);var e=dg(n);function n(){return lg(this,n),e.apply(this,arguments)}return cg(n,[{key:"style",get:function(){var s=this.props,i=s.disableAnimation,a=s.component,l=s.placement,c=s.hideArrow,d=s.status,h=s.styles,m=h.arrow.length,g=h.floater,x=h.floaterCentered,y=h.floaterClosing,w=h.floaterOpening,S=h.floaterWithAnimation,k=h.floaterWithComponent,j={};return c||(l.startsWith("top")?j.padding="0 0 ".concat(m,"px"):l.startsWith("bottom")?j.padding="".concat(m,"px 0 0"):l.startsWith("left")?j.padding="0 ".concat(m,"px 0 0"):l.startsWith("right")&&(j.padding="0 0 0 ".concat(m,"px"))),[Tn.OPENING,Tn.OPEN].indexOf(d)!==-1&&(j=jr(jr({},j),w)),d===Tn.CLOSING&&(j=jr(jr({},j),y)),d===Tn.OPEN&&!i&&(j=jr(jr({},j),S)),l==="center"&&(j=jr(jr({},j),x)),a&&(j=jr(jr({},j),k)),jr(jr({},g),j)}},{key:"render",value:function(){var s=this.props,i=s.component,a=s.handleClick,l=s.hideArrow,c=s.setFloaterRef,d=s.status,h={},m=["__floater"];return i?oe.isValidElement(i)?h.content=oe.cloneElement(i,{closeFn:a}):h.content=i({closeFn:a}):h.content=oe.createElement(uQ,this.props),d===Tn.OPEN&&m.push("__floater__open"),l||(h.arrow=oe.createElement(lQ,this.props)),oe.createElement("div",{ref:c,className:m.join(" "),style:this.style},oe.createElement("div",{className:"__floater__body"},h.content,h.arrow))}}]),n})(oe.Component);Fs(dQ,"propTypes",{component:Ge.oneOfType([Ge.func,Ge.element]),content:Ge.node,disableAnimation:Ge.bool.isRequired,footer:Ge.node,handleClick:Ge.func.isRequired,hideArrow:Ge.bool.isRequired,open:Ge.bool,placement:Ge.string.isRequired,positionWrapper:Ge.bool.isRequired,setArrowRef:Ge.func.isRequired,setFloaterRef:Ge.func.isRequired,showCloseButton:Ge.bool,status:Ge.string.isRequired,styles:Ge.object.isRequired,title:Ge.node});var hQ=(function(t){ug(n,t);var e=dg(n);function n(){return lg(this,n),e.apply(this,arguments)}return cg(n,[{key:"render",value:function(){var s=this.props,i=s.children,a=s.handleClick,l=s.handleMouseEnter,c=s.handleMouseLeave,d=s.setChildRef,h=s.setWrapperRef,m=s.style,g=s.styles,x;if(i)if(oe.Children.count(i)===1)if(!oe.isValidElement(i))x=oe.createElement("span",null,i);else{var y=Ee.function(i.type)?"innerRef":"ref";x=oe.cloneElement(oe.Children.only(i),Fs({},y,d))}else x=i;return x?oe.createElement("span",{ref:h,style:jr(jr({},g),m),onClick:a,onMouseEnter:l,onMouseLeave:c},x):null}}]),n})(oe.Component);Fs(hQ,"propTypes",{children:Ge.node,handleClick:Ge.func.isRequired,handleMouseEnter:Ge.func.isRequired,handleMouseLeave:Ge.func.isRequired,setChildRef:Ge.func.isRequired,setWrapperRef:Ge.func.isRequired,style:Ge.object,styles:Ge.object.isRequired});var fxe={zIndex:100};function mxe(t){var e=Ua(fxe,t.options||{});return{wrapper:{cursor:"help",display:"inline-flex",flexDirection:"column",zIndex:e.zIndex},wrapperPosition:{left:-1e3,position:"absolute",top:-1e3,visibility:"hidden"},floater:{display:"inline-block",filter:"drop-shadow(0 0 3px rgba(0, 0, 0, 0.3))",maxWidth:300,opacity:0,position:"relative",transition:"opacity 0.3s",visibility:"hidden",zIndex:e.zIndex},floaterOpening:{opacity:1,visibility:"visible"},floaterWithAnimation:{opacity:1,transition:"opacity 0.3s, transform 0.2s",visibility:"visible"},floaterWithComponent:{maxWidth:"100%"},floaterClosing:{opacity:0,visibility:"visible"},floaterCentered:{left:"50%",position:"fixed",top:"50%",transform:"translate(-50%, -50%)"},container:{backgroundColor:"#fff",color:"#666",minHeight:60,minWidth:200,padding:20,position:"relative",zIndex:10},title:{borderBottom:"1px solid #555",color:"#555",fontSize:18,marginBottom:5,paddingBottom:6,paddingRight:18},content:{fontSize:15},close:{backgroundColor:"transparent",border:0,borderRadius:0,color:"#555",fontSize:0,height:15,outline:"none",padding:10,position:"absolute",right:0,top:0,width:15,WebkitAppearance:"none"},footer:{borderTop:"1px solid #ccc",fontSize:13,marginTop:10,paddingTop:5},arrow:{color:"#fff",display:"inline-flex",length:16,margin:8,position:"absolute",spread:32},options:e}}var pxe=["arrow","flip","offset"],gxe=["position","top","right","bottom","left"],tN=(function(t){ug(n,t);var e=dg(n);function n(r){var s;return lg(this,n),s=e.call(this,r),Fs(El(s),"setArrowRef",function(i){s.arrowRef=i}),Fs(El(s),"setChildRef",function(i){s.childRef=i}),Fs(El(s),"setFloaterRef",function(i){s.floaterRef=i}),Fs(El(s),"setWrapperRef",function(i){s.wrapperRef=i}),Fs(El(s),"handleTransitionEnd",function(){var i=s.state.status,a=s.props.callback;s.wrapperPopper&&s.wrapperPopper.instance.update(),s.setState({status:i===Tn.OPENING?Tn.OPEN:Tn.IDLE},function(){var l=s.state.status;a(l===Tn.OPEN?"open":"close",s.props)})}),Fs(El(s),"handleClick",function(){var i=s.props,a=i.event,l=i.open;if(!Ee.boolean(l)){var c=s.state,d=c.positionWrapper,h=c.status;(s.event==="click"||s.event==="hover"&&d)&&(E1({title:"click",data:[{event:a,status:h===Tn.OPEN?"closing":"opening"}],debug:s.debug}),s.toggle())}}),Fs(El(s),"handleMouseEnter",function(){var i=s.props,a=i.event,l=i.open;if(!(Ee.boolean(l)||NS())){var c=s.state.status;s.event==="hover"&&c===Tn.IDLE&&(E1({title:"mouseEnter",data:[{key:"originalEvent",value:a}],debug:s.debug}),clearTimeout(s.eventDelayTimeout),s.toggle())}}),Fs(El(s),"handleMouseLeave",function(){var i=s.props,a=i.event,l=i.eventDelay,c=i.open;if(!(Ee.boolean(c)||NS())){var d=s.state,h=d.status,m=d.positionWrapper;s.event==="hover"&&(E1({title:"mouseLeave",data:[{key:"originalEvent",value:a}],debug:s.debug}),l?[Tn.OPENING,Tn.OPEN].indexOf(h)!==-1&&!m&&!s.eventDelayTimeout&&(s.eventDelayTimeout=setTimeout(function(){delete s.eventDelayTimeout,s.toggle()},l*1e3)):s.toggle(Tn.IDLE))}}),s.state={currentPlacement:r.placement,needsUpdate:!1,positionWrapper:r.wrapperOptions.position&&!!r.target,status:Tn.INIT,statusWrapper:Tn.INIT},s._isMounted=!1,s.hasMounted=!1,bo()&&window.addEventListener("load",function(){s.popper&&s.popper.instance.update(),s.wrapperPopper&&s.wrapperPopper.instance.update()}),s}return cg(n,[{key:"componentDidMount",value:function(){if(bo()){var s=this.state.positionWrapper,i=this.props,a=i.children,l=i.open,c=i.target;this._isMounted=!0,E1({title:"init",data:{hasChildren:!!a,hasTarget:!!c,isControlled:Ee.boolean(l),positionWrapper:s,target:this.target,floater:this.floaterRef},debug:this.debug}),this.hasMounted||(this.initPopper(),this.hasMounted=!0),!a&&c&&Ee.boolean(l)}}},{key:"componentDidUpdate",value:function(s,i){if(bo()){var a=this.props,l=a.autoOpen,c=a.open,d=a.target,h=a.wrapperOptions,m=Yge(i,this.state),g=m.changedFrom,x=m.changed;if(s.open!==c){var y;Ee.boolean(c)&&(y=c?Tn.OPENING:Tn.CLOSING),this.toggle(y)}(s.wrapperOptions.position!==h.position||s.target!==d)&&this.changeWrapperPosition(this.props),x("status",Tn.IDLE)&&c?this.toggle(Tn.OPEN):g("status",Tn.INIT,Tn.IDLE)&&l&&this.toggle(Tn.OPEN),this.popper&&x("status",Tn.OPENING)&&this.popper.instance.update(),this.floaterRef&&(x("status",Tn.OPENING)||x("status",Tn.CLOSING))&&dxe(this.floaterRef,"transitionend",this.handleTransitionEnd),x("needsUpdate",!0)&&this.rebuildPopper()}}},{key:"componentWillUnmount",value:function(){bo()&&(this._isMounted=!1,this.popper&&this.popper.instance.destroy(),this.wrapperPopper&&this.wrapperPopper.instance.destroy())}},{key:"initPopper",value:function(){var s=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.target,a=this.state.positionWrapper,l=this.props,c=l.disableFlip,d=l.getPopper,h=l.hideArrow,m=l.offset,g=l.placement,x=l.wrapperOptions,y=g==="top"||g==="bottom"?"flip":["right","bottom-end","top-end","left","top-start","bottom-start"];if(g==="center")this.setState({status:Tn.IDLE});else if(i&&this.floaterRef){var w=this.options,S=w.arrow,k=w.flip,j=w.offset,N=iQ(w,pxe);new hp(i,this.floaterRef,{placement:g,modifiers:jr({arrow:jr({enabled:!h,element:this.arrowRef},S),flip:jr({enabled:!c,behavior:y},k),offset:jr({offset:"0, ".concat(m,"px")},j)},N),onCreate:function(_){var A;if(s.popper=_,!((A=s.floaterRef)!==null&&A!==void 0&&A.isConnected)){s.setState({needsUpdate:!0});return}d(_,"floater"),s._isMounted&&s.setState({currentPlacement:_.placement,status:Tn.IDLE}),g!==_.placement&&setTimeout(function(){_.instance.update()},1)},onUpdate:function(_){s.popper=_;var A=s.state.currentPlacement;s._isMounted&&_.placement!==A&&s.setState({currentPlacement:_.placement})}})}if(a){var T=Ee.undefined(x.offset)?0:x.offset;new hp(this.target,this.wrapperRef,{placement:x.placement||g,modifiers:{arrow:{enabled:!1},offset:{offset:"0, ".concat(T,"px")},flip:{enabled:!1}},onCreate:function(_){s.wrapperPopper=_,s._isMounted&&s.setState({statusWrapper:Tn.IDLE}),d(_,"wrapper"),g!==_.placement&&setTimeout(function(){_.instance.update()},1)}})}}},{key:"rebuildPopper",value:function(){var s=this;this.floaterRefInterval=setInterval(function(){var i;(i=s.floaterRef)!==null&&i!==void 0&&i.isConnected&&(clearInterval(s.floaterRefInterval),s.setState({needsUpdate:!1}),s.initPopper())},50)}},{key:"changeWrapperPosition",value:function(s){var i=s.target,a=s.wrapperOptions;this.setState({positionWrapper:a.position&&!!i})}},{key:"toggle",value:function(s){var i=this.state.status,a=i===Tn.OPEN?Tn.CLOSING:Tn.OPENING;Ee.undefined(s)||(a=s),this.setState({status:a})}},{key:"debug",get:function(){var s=this.props.debug;return s||bo()&&"ReactFloaterDebug"in window&&!!window.ReactFloaterDebug}},{key:"event",get:function(){var s=this.props,i=s.disableHoverToClick,a=s.event;return a==="hover"&&NS()&&!i?"click":a}},{key:"options",get:function(){var s=this.props.options;return Ua(nxe,s||{})}},{key:"styles",get:function(){var s=this,i=this.state,a=i.status,l=i.positionWrapper,c=i.statusWrapper,d=this.props.styles,h=Ua(mxe(d),d);if(l){var m;[Tn.IDLE].indexOf(a)===-1||[Tn.IDLE].indexOf(c)===-1?m=h.wrapperPosition:m=this.wrapperPopper.styles,h.wrapper=jr(jr({},h.wrapper),m)}if(this.target){var g=window.getComputedStyle(this.target);this.wrapperStyles?h.wrapper=jr(jr({},h.wrapper),this.wrapperStyles):["relative","static"].indexOf(g.position)===-1&&(this.wrapperStyles={},l||(gxe.forEach(function(x){s.wrapperStyles[x]=g[x]}),h.wrapper=jr(jr({},h.wrapper),this.wrapperStyles),this.target.style.position="relative",this.target.style.top="auto",this.target.style.right="auto",this.target.style.bottom="auto",this.target.style.left="auto"))}return h}},{key:"target",get:function(){if(!bo())return null;var s=this.props.target;return s?Ee.domElement(s)?s:document.querySelector(s):this.childRef||this.wrapperRef}},{key:"render",value:function(){var s=this.state,i=s.currentPlacement,a=s.positionWrapper,l=s.status,c=this.props,d=c.children,h=c.component,m=c.content,g=c.disableAnimation,x=c.footer,y=c.hideArrow,w=c.id,S=c.open,k=c.showCloseButton,j=c.style,N=c.target,T=c.title,E=oe.createElement(hQ,{handleClick:this.handleClick,handleMouseEnter:this.handleMouseEnter,handleMouseLeave:this.handleMouseLeave,setChildRef:this.setChildRef,setWrapperRef:this.setWrapperRef,style:j,styles:this.styles.wrapper},d),_={};return a?_.wrapperInPortal=E:_.wrapperAsChildren=E,oe.createElement("span",null,oe.createElement(oQ,{hasChildren:!!d,id:w,placement:i,setRef:this.setFloaterRef,target:N,zIndex:this.styles.options.zIndex},oe.createElement(dQ,{component:h,content:m,disableAnimation:g,footer:x,handleClick:this.handleClick,hideArrow:y||i==="center",open:S,placement:i,positionWrapper:a,setArrowRef:this.setArrowRef,setFloaterRef:this.setFloaterRef,showCloseButton:k,status:l,styles:this.styles,title:T}),_.wrapperInPortal),_.wrapperAsChildren)}}]),n})(oe.Component);Fs(tN,"propTypes",{autoOpen:Ge.bool,callback:Ge.func,children:Ge.node,component:ZA(Ge.oneOfType([Ge.func,Ge.element]),function(t){return!t.content}),content:ZA(Ge.node,function(t){return!t.component}),debug:Ge.bool,disableAnimation:Ge.bool,disableFlip:Ge.bool,disableHoverToClick:Ge.bool,event:Ge.oneOf(["hover","click"]),eventDelay:Ge.number,footer:Ge.node,getPopper:Ge.func,hideArrow:Ge.bool,id:Ge.oneOfType([Ge.string,Ge.number]),offset:Ge.number,open:Ge.bool,options:Ge.object,placement:Ge.oneOf(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end","auto","center"]),showCloseButton:Ge.bool,style:Ge.object,styles:Ge.object,target:Ge.oneOfType([Ge.object,Ge.string]),title:Ge.node,wrapperOptions:Ge.shape({offset:Ge.number,placement:Ge.oneOf(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end","auto"]),position:Ge.bool})});Fs(tN,"defaultProps",{autoOpen:!1,callback:JA,debug:!1,disableAnimation:!1,disableFlip:!1,disableHoverToClick:!1,event:"click",eventDelay:.4,getPopper:JA,hideArrow:!1,offset:15,placement:"bottom",showCloseButton:!1,styles:{},target:null,wrapperOptions:{position:!1}});var xxe=Object.defineProperty,vxe=(t,e,n)=>e in t?xxe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,xt=(t,e,n)=>vxe(t,typeof e!="symbol"?e+"":e,n),Yn={INIT:"init",START:"start",STOP:"stop",RESET:"reset",PREV:"prev",NEXT:"next",GO:"go",CLOSE:"close",SKIP:"skip",UPDATE:"update"},Va={TOUR_START:"tour:start",STEP_BEFORE:"step:before",BEACON:"beacon",TOOLTIP:"tooltip",STEP_AFTER:"step:after",TOUR_END:"tour:end",TOUR_STATUS:"tour:status",TARGET_NOT_FOUND:"error:target_not_found"},Xt={INIT:"init",READY:"ready",BEACON:"beacon",TOOLTIP:"tooltip",COMPLETE:"complete",ERROR:"error"},wn={IDLE:"idle",READY:"ready",WAITING:"waiting",RUNNING:"running",PAUSED:"paused",SKIPPED:"skipped",FINISHED:"finished"};function Fc(){var t;return!!(typeof window<"u"&&((t=window.document)!=null&&t.createElement))}function fQ(t){return t?t.getBoundingClientRect():null}function yxe(t=!1){const{body:e,documentElement:n}=document;if(!e||!n)return 0;if(t){const r=[e.scrollHeight,e.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight].sort((i,a)=>i-a),s=Math.floor(r.length/2);return r.length%2===0?(r[s-1]+r[s])/2:r[s]}return Math.max(e.scrollHeight,e.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight)}function Pl(t){if(typeof t=="string")try{return document.querySelector(t)}catch{return null}return t}function bxe(t){return!t||t.nodeType!==1?null:getComputedStyle(t)}function fp(t,e,n){if(!t)return Xu();const r=qH(t);if(r){if(r.isSameNode(Xu()))return n?document:Xu();if(!(r.scrollHeight>r.offsetHeight)&&!e)return r.style.overflow="initial",Xu()}return r}function Db(t,e){if(!t)return!1;const n=fp(t,e);return n?!n.isSameNode(Xu()):!1}function wxe(t){return t.offsetParent!==document.body}function df(t,e="fixed"){if(!t||!(t instanceof HTMLElement))return!1;const{nodeName:n}=t,r=bxe(t);return n==="BODY"||n==="HTML"?!1:r&&r.position===e?!0:t.parentNode?df(t.parentNode,e):!1}function Sxe(t){var e;if(!t)return!1;let n=t;for(;n&&n!==document.body;){if(n instanceof HTMLElement){const{display:r,visibility:s}=getComputedStyle(n);if(r==="none"||s==="hidden")return!1}n=(e=n.parentElement)!=null?e:null}return!0}function kxe(t,e,n){var r,s,i;const a=fQ(t),l=fp(t,n),c=Db(t,n),d=df(t);let h=0,m=(r=a?.top)!=null?r:0;if(c&&d){const g=(s=t?.offsetTop)!=null?s:0,x=(i=l?.scrollTop)!=null?i:0;m=g-x}else l instanceof HTMLElement&&(h=l.scrollTop,!c&&!df(t)&&(m+=h),l.isSameNode(Xu())||(m+=Xu().scrollTop));return Math.floor(m-e)}function Oxe(t,e,n){var r;if(!t)return 0;const{offsetTop:s=0,scrollTop:i=0}=(r=qH(t))!=null?r:{};let a=t.getBoundingClientRect().top+i;s&&(Db(t,n)||wxe(t))&&(a-=s);const l=Math.floor(a-e);return l<0?0:l}function Xu(){var t;return(t=document.scrollingElement)!=null?t:document.documentElement}function jxe(t,e){const{duration:n,element:r}=e;return new Promise((s,i)=>{const{scrollTop:a}=r,l=t>a?t-a:a-t;Qpe.top(r,t,{duration:l<100?50:n},c=>c&&c.message!=="Element already at target scroll position"?i(c):s())})}var Xm=ya.createPortal!==void 0;function mQ(t=navigator.userAgent){let e=t;return typeof window>"u"?e="node":document.documentMode?e="ie":/Edge/.test(t)?e="edge":window.opera||t.includes(" OPR/")?e="opera":typeof window.InstallTrigger<"u"?e="firefox":window.chrome?e="chrome":/(Version\/([\d._]+).*Safari|CriOS|FxiOS| Mobile\/)/.test(t)&&(e="safari"),e}function jv(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function wo(t,e={}){const{defaultValue:n,step:r,steps:s}=e;let i=IA(t);if(i)(i.includes("{step}")||i.includes("{steps}"))&&r&&s&&(i=i.replace("{step}",r.toString()).replace("{steps}",s.toString()));else if(b.isValidElement(t)&&!Object.values(t.props).length&&jv(t.type)==="function"){const a=t.type({});i=wo(a,e)}else i=IA(n);return i}function Nxe(t,e){return!pt.plainObject(t)||!pt.array(e)?!1:Object.keys(t).every(n=>e.includes(n))}function Cxe(t){const e=/^#?([\da-f])([\da-f])([\da-f])$/i,n=t.replace(e,(s,i,a,l)=>i+i+a+a+l+l),r=/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(n);return r?[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)]:[]}function eM(t){return t.disableBeacon||t.placement==="center"}function tM(){return!["chrome","safari","firefox","opera"].includes(mQ())}function pd({data:t,debug:e=!1,title:n,warn:r=!1}){const s=r?console.warn||console.error:console.log;e&&(n&&t?(console.groupCollapsed(`%creact-joyride: ${n}`,"color: #ff0044; font-weight: bold; font-size: 12px;"),Array.isArray(t)?t.forEach(i=>{pt.plainObject(i)&&i.key?s.apply(console,[i.key,i.value]):s.apply(console,[i])}):s.apply(console,[t]),console.groupEnd()):console.error("Missing title or data props"))}function Txe(t){return Object.keys(t)}function pQ(t,...e){if(!pt.plainObject(t))throw new TypeError("Expected an object");const n={};for(const r in t)({}).hasOwnProperty.call(t,r)&&(e.includes(r)||(n[r]=t[r]));return n}function Exe(t,...e){if(!pt.plainObject(t))throw new TypeError("Expected an object");if(!e.length)return t;const n={};for(const r in t)({}).hasOwnProperty.call(t,r)&&e.includes(r)&&(n[r]=t[r]);return n}function jO(t,e,n){const r=i=>i.replace("{step}",String(e)).replace("{steps}",String(n));if(jv(t)==="string")return r(t);if(!b.isValidElement(t))return t;const{children:s}=t.props;if(jv(s)==="string"&&s.includes("{step}"))return b.cloneElement(t,{children:r(s)});if(Array.isArray(s))return b.cloneElement(t,{children:s.map(i=>typeof i=="string"?r(i):jO(i,e,n))});if(jv(t.type)==="function"&&!Object.values(t.props).length){const i=t.type({});return jO(i,e,n)}return t}function _xe(t){const{isFirstStep:e,lifecycle:n,previousLifecycle:r,scrollToFirstStep:s,step:i,target:a}=t;return!i.disableScrolling&&(!e||s||n===Xt.TOOLTIP)&&i.placement!=="center"&&(!i.isFixed||!df(a))&&r!==n&&[Xt.BEACON,Xt.TOOLTIP].includes(n)}var Axe={options:{preventOverflow:{boundariesElement:"scrollParent"}},wrapperOptions:{offset:-18,position:!0}},gQ={back:"Back",close:"Close",last:"Last",next:"Next",nextLabelWithProgress:"Next (Step {step} of {steps})",open:"Open the dialog",skip:"Skip"},Mxe={event:"click",placement:"bottom",offset:10,disableBeacon:!1,disableCloseOnEsc:!1,disableOverlay:!1,disableOverlayClose:!1,disableScrollParentFix:!1,disableScrolling:!1,hideBackButton:!1,hideCloseButton:!1,hideFooter:!1,isFixed:!1,locale:gQ,showProgress:!1,showSkipButton:!1,spotlightClicks:!1,spotlightPadding:10},Rxe={continuous:!1,debug:!1,disableCloseOnEsc:!1,disableOverlay:!1,disableOverlayClose:!1,disableScrolling:!1,disableScrollParentFix:!1,getHelpers:void 0,hideBackButton:!1,run:!0,scrollOffset:20,scrollDuration:300,scrollToFirstStep:!1,showSkipButton:!1,showProgress:!1,spotlightClicks:!1,spotlightPadding:10,steps:[]},Dxe={arrowColor:"#fff",backgroundColor:"#fff",beaconSize:36,overlayColor:"rgba(0, 0, 0, 0.5)",primaryColor:"#f04",spotlightShadow:"0 0 15px rgba(0, 0, 0, 0.5)",textColor:"#333",width:380,zIndex:100},Ym={backgroundColor:"transparent",border:0,borderRadius:0,color:"#555",cursor:"pointer",fontSize:16,lineHeight:1,padding:8,WebkitAppearance:"none"},nM={borderRadius:4,position:"absolute"};function Pxe(t,e){var n,r,s,i,a;const{floaterProps:l,styles:c}=t,d=Ua((n=e.floaterProps)!=null?n:{},l??{}),h=Ua(c??{},(r=e.styles)!=null?r:{}),m=Ua(Dxe,h.options||{}),g=e.placement==="center"||e.disableBeacon;let{width:x}=m;window.innerWidth>480&&(x=380),"width"in m&&(x=typeof m.width=="number"&&window.innerWidthxQ(n,e)):(pd({title:"validateSteps",data:"steps must be an array",warn:!0,debug:e}),!1)}var vQ={action:"init",controlled:!1,index:0,lifecycle:Xt.INIT,origin:null,size:0,status:wn.IDLE},sM=Txe(pQ(vQ,"controlled","size")),Ixe=class{constructor(t){xt(this,"beaconPopper"),xt(this,"tooltipPopper"),xt(this,"data",new Map),xt(this,"listener"),xt(this,"store",new Map),xt(this,"addListener",s=>{this.listener=s}),xt(this,"setSteps",s=>{const{size:i,status:a}=this.getState(),l={size:s.length,status:a};this.data.set("steps",s),a===wn.WAITING&&!i&&s.length&&(l.status=wn.RUNNING),this.setState(l)}),xt(this,"getPopper",s=>s==="beacon"?this.beaconPopper:this.tooltipPopper),xt(this,"setPopper",(s,i)=>{s==="beacon"?this.beaconPopper=i:this.tooltipPopper=i}),xt(this,"cleanupPoppers",()=>{this.beaconPopper=null,this.tooltipPopper=null}),xt(this,"close",(s=null)=>{const{index:i,status:a}=this.getState();a===wn.RUNNING&&this.setState({...this.getNextState({action:Yn.CLOSE,index:i+1,origin:s})})}),xt(this,"go",s=>{const{controlled:i,status:a}=this.getState();if(i||a!==wn.RUNNING)return;const l=this.getSteps()[s];this.setState({...this.getNextState({action:Yn.GO,index:s}),status:l?a:wn.FINISHED})}),xt(this,"info",()=>this.getState()),xt(this,"next",()=>{const{index:s,status:i}=this.getState();i===wn.RUNNING&&this.setState(this.getNextState({action:Yn.NEXT,index:s+1}))}),xt(this,"open",()=>{const{status:s}=this.getState();s===wn.RUNNING&&this.setState({...this.getNextState({action:Yn.UPDATE,lifecycle:Xt.TOOLTIP})})}),xt(this,"prev",()=>{const{index:s,status:i}=this.getState();i===wn.RUNNING&&this.setState({...this.getNextState({action:Yn.PREV,index:s-1})})}),xt(this,"reset",(s=!1)=>{const{controlled:i}=this.getState();i||this.setState({...this.getNextState({action:Yn.RESET,index:0}),status:s?wn.RUNNING:wn.READY})}),xt(this,"skip",()=>{const{status:s}=this.getState();s===wn.RUNNING&&this.setState({action:Yn.SKIP,lifecycle:Xt.INIT,status:wn.SKIPPED})}),xt(this,"start",s=>{const{index:i,size:a}=this.getState();this.setState({...this.getNextState({action:Yn.START,index:pt.number(s)?s:i},!0),status:a?wn.RUNNING:wn.WAITING})}),xt(this,"stop",(s=!1)=>{const{index:i,status:a}=this.getState();[wn.FINISHED,wn.SKIPPED].includes(a)||this.setState({...this.getNextState({action:Yn.STOP,index:i+(s?1:0)}),status:wn.PAUSED})}),xt(this,"update",s=>{var i,a;if(!Nxe(s,sM))throw new Error(`State is not valid. Valid keys: ${sM.join(", ")}`);this.setState({...this.getNextState({...this.getState(),...s,action:(i=s.action)!=null?i:Yn.UPDATE,origin:(a=s.origin)!=null?a:null},!0)})});const{continuous:e=!1,stepIndex:n,steps:r=[]}=t??{};this.setState({action:Yn.INIT,controlled:pt.number(n),continuous:e,index:pt.number(n)?n:0,lifecycle:Xt.INIT,origin:null,status:r.length?wn.READY:wn.IDLE},!0),this.beaconPopper=null,this.tooltipPopper=null,this.listener=null,this.setSteps(r)}getState(){return this.store.size?{action:this.store.get("action")||"",controlled:this.store.get("controlled")||!1,index:parseInt(this.store.get("index"),10),lifecycle:this.store.get("lifecycle")||"",origin:this.store.get("origin")||null,size:this.store.get("size")||0,status:this.store.get("status")||""}:{...vQ}}getNextState(t,e=!1){var n,r,s,i,a;const{action:l,controlled:c,index:d,size:h,status:m}=this.getState(),g=pt.number(t.index)?t.index:d,x=c&&!e?d:Math.min(Math.max(g,0),h);return{action:(n=t.action)!=null?n:l,controlled:c,index:x,lifecycle:(r=t.lifecycle)!=null?r:Xt.INIT,origin:(s=t.origin)!=null?s:null,size:(i=t.size)!=null?i:h,status:x===h?wn.FINISHED:(a=t.status)!=null?a:m}}getSteps(){const t=this.data.get("steps");return Array.isArray(t)?t:[]}hasUpdatedState(t){const e=JSON.stringify(t),n=JSON.stringify(this.getState());return e!==n}setState(t,e=!1){const n=this.getState(),{action:r,index:s,lifecycle:i,origin:a=null,size:l,status:c}={...n,...t};this.store.set("action",r),this.store.set("index",s),this.store.set("lifecycle",i),this.store.set("origin",a),this.store.set("size",l),this.store.set("status",c),e&&(this.store.set("controlled",t.controlled),this.store.set("continuous",t.continuous)),this.listener&&this.hasUpdatedState(n)&&this.listener(this.getState())}getHelpers(){return{close:this.close,go:this.go,info:this.info,next:this.next,open:this.open,prev:this.prev,reset:this.reset,skip:this.skip}}};function Lxe(t){return new Ixe(t)}function Bxe({styles:t}){return b.createElement("div",{key:"JoyrideSpotlight",className:"react-joyride__spotlight","data-test-id":"spotlight",style:t})}var Fxe=Bxe,qxe=class extends b.Component{constructor(){super(...arguments),xt(this,"isActive",!1),xt(this,"resizeTimeout"),xt(this,"scrollTimeout"),xt(this,"scrollParent"),xt(this,"state",{isScrolling:!1,mouseOverSpotlight:!1,showSpotlight:!0}),xt(this,"hideSpotlight",()=>{const{continuous:t,disableOverlay:e,lifecycle:n}=this.props,r=[Xt.INIT,Xt.BEACON,Xt.COMPLETE,Xt.ERROR];return e||(t?r.includes(n):n!==Xt.TOOLTIP)}),xt(this,"handleMouseMove",t=>{const{mouseOverSpotlight:e}=this.state,{height:n,left:r,position:s,top:i,width:a}=this.spotlightStyles,l=s==="fixed"?t.clientY:t.pageY,c=s==="fixed"?t.clientX:t.pageX,d=l>=i&&l<=i+n,m=c>=r&&c<=r+a&&d;m!==e&&this.updateState({mouseOverSpotlight:m})}),xt(this,"handleScroll",()=>{const{target:t}=this.props,e=Pl(t);if(this.scrollParent!==document){const{isScrolling:n}=this.state;n||this.updateState({isScrolling:!0,showSpotlight:!1}),clearTimeout(this.scrollTimeout),this.scrollTimeout=window.setTimeout(()=>{this.updateState({isScrolling:!1,showSpotlight:!0})},50)}else df(e,"sticky")&&this.updateState({})}),xt(this,"handleResize",()=>{clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(()=>{this.isActive&&this.forceUpdate()},100)})}componentDidMount(){const{debug:t,disableScrolling:e,disableScrollParentFix:n=!1,target:r}=this.props,s=Pl(r);this.scrollParent=fp(s??document.body,n,!0),this.isActive=!0,window.addEventListener("resize",this.handleResize)}componentDidUpdate(t){var e;const{disableScrollParentFix:n,lifecycle:r,spotlightClicks:s,target:i}=this.props,{changed:a}=py(t,this.props);if(a("target")||a("disableScrollParentFix")){const l=Pl(i);this.scrollParent=fp(l??document.body,n,!0)}a("lifecycle",Xt.TOOLTIP)&&((e=this.scrollParent)==null||e.addEventListener("scroll",this.handleScroll,{passive:!0}),setTimeout(()=>{const{isScrolling:l}=this.state;l||this.updateState({showSpotlight:!0})},100)),(a("spotlightClicks")||a("disableOverlay")||a("lifecycle"))&&(s&&r===Xt.TOOLTIP?window.addEventListener("mousemove",this.handleMouseMove,!1):r!==Xt.TOOLTIP&&window.removeEventListener("mousemove",this.handleMouseMove))}componentWillUnmount(){var t;this.isActive=!1,window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("resize",this.handleResize),clearTimeout(this.resizeTimeout),clearTimeout(this.scrollTimeout),(t=this.scrollParent)==null||t.removeEventListener("scroll",this.handleScroll)}get overlayStyles(){const{mouseOverSpotlight:t}=this.state,{disableOverlayClose:e,placement:n,styles:r}=this.props;let s=r.overlay;return tM()&&(s=n==="center"?r.overlayLegacyCenter:r.overlayLegacy),{cursor:e?"default":"pointer",height:yxe(),pointerEvents:t?"none":"auto",...s}}get spotlightStyles(){var t,e,n;const{showSpotlight:r}=this.state,{disableScrollParentFix:s=!1,spotlightClicks:i,spotlightPadding:a=0,styles:l,target:c}=this.props,d=Pl(c),h=fQ(d),m=df(d),g=kxe(d,a,s);return{...tM()?l.spotlightLegacy:l.spotlight,height:Math.round(((t=h?.height)!=null?t:0)+a*2),left:Math.round(((e=h?.left)!=null?e:0)-a),opacity:r?1:0,pointerEvents:i?"none":"auto",position:m?"fixed":"absolute",top:g,transition:"opacity 0.2s",width:Math.round(((n=h?.width)!=null?n:0)+a*2)}}updateState(t){this.isActive&&this.setState(e=>({...e,...t}))}render(){const{showSpotlight:t}=this.state,{onClickOverlay:e,placement:n}=this.props,{hideSpotlight:r,overlayStyles:s,spotlightStyles:i}=this;if(r())return null;let a=n!=="center"&&t&&b.createElement(Fxe,{styles:i});if(mQ()==="safari"){const{mixBlendMode:l,zIndex:c,...d}=s;a=b.createElement("div",{style:{...d}},a),delete s.backgroundColor}return b.createElement("div",{className:"react-joyride__overlay","data-test-id":"overlay",onClick:e,role:"presentation",style:s},a)}},$xe=class extends b.Component{constructor(){super(...arguments),xt(this,"node",null)}componentDidMount(){const{id:t}=this.props;Fc()&&(this.node=document.createElement("div"),this.node.id=t,document.body.appendChild(this.node),Xm||this.renderReact15())}componentDidUpdate(){Fc()&&(Xm||this.renderReact15())}componentWillUnmount(){!Fc()||!this.node||(Xm||ya.unmountComponentAtNode(this.node),this.node.parentNode===document.body&&(document.body.removeChild(this.node),this.node=null))}renderReact15(){if(!Fc())return;const{children:t}=this.props;this.node&&ya.unstable_renderSubtreeIntoContainer(this,t,this.node)}renderReact16(){if(!Fc()||!Xm)return null;const{children:t}=this.props;return this.node?ya.createPortal(t,this.node):null}render(){return Xm?this.renderReact16():null}},Hxe=class{constructor(t,e){if(xt(this,"element"),xt(this,"options"),xt(this,"canBeTabbed",n=>{const{tabIndex:r}=n;return r===null||r<0?!1:this.canHaveFocus(n)}),xt(this,"canHaveFocus",n=>{const r=/input|select|textarea|button|object/,s=n.nodeName.toLowerCase();return(r.test(s)&&!n.getAttribute("disabled")||s==="a"&&!!n.getAttribute("href"))&&this.isVisible(n)}),xt(this,"findValidTabElements",()=>[].slice.call(this.element.querySelectorAll("*"),0).filter(this.canBeTabbed)),xt(this,"handleKeyDown",n=>{const{code:r="Tab"}=this.options;n.code===r&&this.interceptTab(n)}),xt(this,"interceptTab",n=>{n.preventDefault();const r=this.findValidTabElements(),{shiftKey:s}=n;if(!r.length)return;let i=document.activeElement?r.indexOf(document.activeElement):0;i===-1||!s&&i+1===r.length?i=0:s&&i===0?i=r.length-1:i+=s?-1:1,r[i].focus()}),xt(this,"isHidden",n=>{const r=n.offsetWidth<=0&&n.offsetHeight<=0,s=window.getComputedStyle(n);return r&&!n.innerHTML?!0:r&&s.getPropertyValue("overflow")!=="visible"||s.getPropertyValue("display")==="none"}),xt(this,"isVisible",n=>{let r=n;for(;r;)if(r instanceof HTMLElement){if(r===document.body)break;if(this.isHidden(r))return!1;r=r.parentNode}return!0}),xt(this,"removeScope",()=>{window.removeEventListener("keydown",this.handleKeyDown)}),xt(this,"checkFocus",n=>{document.activeElement!==n&&(n.focus(),window.requestAnimationFrame(()=>this.checkFocus(n)))}),xt(this,"setFocus",()=>{const{selector:n}=this.options;if(!n)return;const r=this.element.querySelector(n);r&&window.requestAnimationFrame(()=>this.checkFocus(r))}),!(t instanceof HTMLElement))throw new TypeError("Invalid parameter: element must be an HTMLElement");this.element=t,this.options=e,window.addEventListener("keydown",this.handleKeyDown,!1),this.setFocus()}},Qxe=class extends b.Component{constructor(t){if(super(t),xt(this,"beacon",null),xt(this,"setBeaconRef",s=>{this.beacon=s}),t.beaconComponent)return;const e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.id="joyride-beacon-animation",t.nonce&&n.setAttribute("nonce",t.nonce),n.appendChild(document.createTextNode(` - @keyframes joyride-beacon-inner { - 20% { - opacity: 0.9; - } - - 90% { - opacity: 0.7; - } - } - - @keyframes joyride-beacon-outer { - 0% { - transform: scale(1); - } - - 45% { - opacity: 0.7; - transform: scale(0.75); - } - - 100% { - opacity: 0.9; - transform: scale(1); - } - } - `)),e.appendChild(n)}componentDidMount(){const{shouldFocus:t}=this.props;setTimeout(()=>{pt.domElement(this.beacon)&&t&&this.beacon.focus()},0)}componentWillUnmount(){const t=document.getElementById("joyride-beacon-animation");t?.parentNode&&t.parentNode.removeChild(t)}render(){const{beaconComponent:t,continuous:e,index:n,isLastStep:r,locale:s,onClickOrHover:i,size:a,step:l,styles:c}=this.props,d=wo(s.open),h={"aria-label":d,onClick:i,onMouseEnter:i,ref:this.setBeaconRef,title:d};let m;if(t){const g=t;m=b.createElement(g,{continuous:e,index:n,isLastStep:r,size:a,step:l,...h})}else m=b.createElement("button",{key:"JoyrideBeacon",className:"react-joyride__beacon","data-test-id":"button-beacon",style:c.beacon,type:"button",...h},b.createElement("span",{style:c.beaconInner}),b.createElement("span",{style:c.beaconOuter}));return m}};function Vxe({styles:t,...e}){const{color:n,height:r,width:s,...i}=t;return oe.createElement("button",{style:i,type:"button",...e},oe.createElement("svg",{height:typeof r=="number"?`${r}px`:r,preserveAspectRatio:"xMidYMid",version:"1.1",viewBox:"0 0 18 18",width:typeof s=="number"?`${s}px`:s,xmlns:"http://www.w3.org/2000/svg"},oe.createElement("g",null,oe.createElement("path",{d:"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z",fill:n}))))}var Uxe=Vxe;function Wxe(t){const{backProps:e,closeProps:n,index:r,isLastStep:s,primaryProps:i,skipProps:a,step:l,tooltipProps:c}=t,{content:d,hideBackButton:h,hideCloseButton:m,hideFooter:g,showSkipButton:x,styles:y,title:w}=l,S={};return S.primary=b.createElement("button",{"data-test-id":"button-primary",style:y.buttonNext,type:"button",...i}),x&&!s&&(S.skip=b.createElement("button",{"aria-live":"off","data-test-id":"button-skip",style:y.buttonSkip,type:"button",...a})),!h&&r>0&&(S.back=b.createElement("button",{"data-test-id":"button-back",style:y.buttonBack,type:"button",...e})),S.close=!m&&b.createElement(Uxe,{"data-test-id":"button-close",styles:y.buttonClose,...n}),b.createElement("div",{key:"JoyrideTooltip","aria-label":wo(w??d),className:"react-joyride__tooltip",style:y.tooltip,...c},b.createElement("div",{style:y.tooltipContainer},w&&b.createElement("h1",{"aria-label":wo(w),style:y.tooltipTitle},w),b.createElement("div",{style:y.tooltipContent},d)),!g&&b.createElement("div",{style:y.tooltipFooter},b.createElement("div",{style:y.tooltipFooterSpacer},S.skip),S.back,S.primary),S.close)}var Gxe=Wxe,Xxe=class extends b.Component{constructor(){super(...arguments),xt(this,"handleClickBack",t=>{t.preventDefault();const{helpers:e}=this.props;e.prev()}),xt(this,"handleClickClose",t=>{t.preventDefault();const{helpers:e}=this.props;e.close("button_close")}),xt(this,"handleClickPrimary",t=>{t.preventDefault();const{continuous:e,helpers:n}=this.props;if(!e){n.close("button_primary");return}n.next()}),xt(this,"handleClickSkip",t=>{t.preventDefault();const{helpers:e}=this.props;e.skip()}),xt(this,"getElementsProps",()=>{const{continuous:t,index:e,isLastStep:n,setTooltipRef:r,size:s,step:i}=this.props,{back:a,close:l,last:c,next:d,nextLabelWithProgress:h,skip:m}=i.locale,g=wo(a),x=wo(l),y=wo(c),w=wo(d),S=wo(m);let k=l,j=x;if(t){if(k=d,j=w,i.showProgress&&!n){const N=wo(h,{step:e+1,steps:s});k=jO(h,e+1,s),j=N}n&&(k=c,j=y)}return{backProps:{"aria-label":g,children:a,"data-action":"back",onClick:this.handleClickBack,role:"button",title:g},closeProps:{"aria-label":x,children:l,"data-action":"close",onClick:this.handleClickClose,role:"button",title:x},primaryProps:{"aria-label":j,children:k,"data-action":"primary",onClick:this.handleClickPrimary,role:"button",title:j},skipProps:{"aria-label":S,children:m,"data-action":"skip",onClick:this.handleClickSkip,role:"button",title:S},tooltipProps:{"aria-modal":!0,ref:r,role:"alertdialog"}}})}render(){const{continuous:t,index:e,isLastStep:n,setTooltipRef:r,size:s,step:i}=this.props,{beaconComponent:a,tooltipComponent:l,...c}=i;let d;if(l){const h={...this.getElementsProps(),continuous:t,index:e,isLastStep:n,size:s,step:c,setTooltipRef:r},m=l;d=b.createElement(m,{...h})}else d=b.createElement(Gxe,{...this.getElementsProps(),continuous:t,index:e,isLastStep:n,size:s,step:i});return d}},Yxe=class extends b.Component{constructor(){super(...arguments),xt(this,"scope",null),xt(this,"tooltip",null),xt(this,"handleClickHoverBeacon",t=>{const{step:e,store:n}=this.props;t.type==="mouseenter"&&e.event!=="hover"||n.update({lifecycle:Xt.TOOLTIP})}),xt(this,"setTooltipRef",t=>{this.tooltip=t}),xt(this,"setPopper",(t,e)=>{var n;const{action:r,lifecycle:s,step:i,store:a}=this.props;e==="wrapper"?a.setPopper("beacon",t):a.setPopper("tooltip",t),a.getPopper("beacon")&&(a.getPopper("tooltip")||i.placement==="center")&&s===Xt.INIT&&a.update({action:r,lifecycle:Xt.READY}),(n=i.floaterProps)!=null&&n.getPopper&&i.floaterProps.getPopper(t,e)}),xt(this,"renderTooltip",t=>{const{continuous:e,helpers:n,index:r,size:s,step:i}=this.props;return b.createElement(Xxe,{continuous:e,helpers:n,index:r,isLastStep:r+1===s,setTooltipRef:this.setTooltipRef,size:s,step:i,...t})})}componentDidMount(){const{debug:t,index:e}=this.props;pd({title:`step:${e}`,data:[{key:"props",value:this.props}],debug:t})}componentDidUpdate(t){var e;const{action:n,callback:r,continuous:s,controlled:i,debug:a,helpers:l,index:c,lifecycle:d,shouldScroll:h,status:m,step:g,store:x}=this.props,{changed:y,changedFrom:w}=py(t,this.props),S=l.info(),k=s&&n!==Yn.CLOSE&&(c>0||n===Yn.PREV),j=y("action")||y("index")||y("lifecycle")||y("status"),N=w("lifecycle",[Xt.TOOLTIP,Xt.INIT],Xt.INIT),T=y("action",[Yn.NEXT,Yn.PREV,Yn.SKIP,Yn.CLOSE]),E=i&&c===t.index;if(T&&(N||E)&&r({...S,index:t.index,lifecycle:Xt.COMPLETE,step:t.step,type:Va.STEP_AFTER}),g.placement==="center"&&m===wn.RUNNING&&y("index")&&n!==Yn.START&&d===Xt.INIT&&x.update({lifecycle:Xt.READY}),j){const _=Pl(g.target),A=!!_;A&&Sxe(_)?(w("status",wn.READY,wn.RUNNING)||w("lifecycle",Xt.INIT,Xt.READY))&&r({...S,step:g,type:Va.STEP_BEFORE}):(console.warn(A?"Target not visible":"Target not mounted",g),r({...S,type:Va.TARGET_NOT_FOUND,step:g}),i||x.update({index:c+(n===Yn.PREV?-1:1)}))}w("lifecycle",Xt.INIT,Xt.READY)&&x.update({lifecycle:eM(g)||k?Xt.TOOLTIP:Xt.BEACON}),y("index")&&pd({title:`step:${d}`,data:[{key:"props",value:this.props}],debug:a}),y("lifecycle",Xt.BEACON)&&r({...S,step:g,type:Va.BEACON}),y("lifecycle",Xt.TOOLTIP)&&(r({...S,step:g,type:Va.TOOLTIP}),h&&this.tooltip&&(this.scope=new Hxe(this.tooltip,{selector:"[data-action=primary]"}),this.scope.setFocus())),w("lifecycle",[Xt.TOOLTIP,Xt.INIT],Xt.INIT)&&((e=this.scope)==null||e.removeScope(),x.cleanupPoppers())}componentWillUnmount(){var t;(t=this.scope)==null||t.removeScope()}get open(){const{lifecycle:t,step:e}=this.props;return eM(e)||t===Xt.TOOLTIP}render(){const{continuous:t,debug:e,index:n,nonce:r,shouldScroll:s,size:i,step:a}=this.props,l=Pl(a.target);return!xQ(a)||!pt.domElement(l)?null:b.createElement("div",{key:`JoyrideStep-${n}`,className:"react-joyride__step"},b.createElement(tN,{...a.floaterProps,component:this.renderTooltip,debug:e,getPopper:this.setPopper,id:`react-joyride-step-${n}`,open:this.open,placement:a.placement,target:a.target},b.createElement(Qxe,{beaconComponent:a.beaconComponent,continuous:t,index:n,isLastStep:n+1===i,locale:a.locale,nonce:r,onClickOrHover:this.handleClickHoverBeacon,shouldFocus:s,size:i,step:a,styles:a.styles})))}},yQ=class extends b.Component{constructor(t){super(t),xt(this,"helpers"),xt(this,"store"),xt(this,"callback",a=>{const{callback:l}=this.props;pt.function(l)&&l(a)}),xt(this,"handleKeyboard",a=>{const{index:l,lifecycle:c}=this.state,{steps:d}=this.props,h=d[l];c===Xt.TOOLTIP&&a.code==="Escape"&&h&&!h.disableCloseOnEsc&&this.store.close("keyboard")}),xt(this,"handleClickOverlay",()=>{const{index:a}=this.state,{steps:l}=this.props;lh(this.props,l[a]).disableOverlayClose||this.helpers.close("overlay")}),xt(this,"syncState",a=>{this.setState(a)});const{debug:e,getHelpers:n,run:r=!0,stepIndex:s}=t;this.store=Lxe({...t,controlled:r&&pt.number(s)}),this.helpers=this.store.getHelpers();const{addListener:i}=this.store;pd({title:"init",data:[{key:"props",value:this.props},{key:"state",value:this.state}],debug:e}),i(this.syncState),n&&n(this.helpers),this.state=this.store.getState()}componentDidMount(){if(!Fc())return;const{debug:t,disableCloseOnEsc:e,run:n,steps:r}=this.props,{start:s}=this.store;rM(r,t)&&n&&s(),e||document.body.addEventListener("keydown",this.handleKeyboard,{passive:!0})}componentDidUpdate(t,e){if(!Fc())return;const{action:n,controlled:r,index:s,status:i}=this.state,{debug:a,run:l,stepIndex:c,steps:d}=this.props,{stepIndex:h,steps:m}=t,{reset:g,setSteps:x,start:y,stop:w,update:S}=this.store,{changed:k}=py(t,this.props),{changed:j,changedFrom:N}=py(e,this.state),T=lh(this.props,d[s]),E=!ti(m,d),_=pt.number(c)&&k("stepIndex"),A=Pl(T.target);if(E&&(rM(d,a)?x(d):console.warn("Steps are not valid",d)),k("run")&&(l?y(c):w()),_){let B=pt.number(h)&&h=0?w:0,r===wn.RUNNING&&jxe(w,{element:y,duration:a}).then(()=>{setTimeout(()=>{var j;(j=this.store.getPopper("tooltip"))==null||j.instance.update()},10)})}}render(){if(!Fc())return null;const{index:t,lifecycle:e,status:n}=this.state,{continuous:r=!1,debug:s=!1,nonce:i,scrollToFirstStep:a=!1,steps:l}=this.props,c=n===wn.RUNNING,d={};if(c&&l[t]){const h=lh(this.props,l[t]);d.step=b.createElement(Yxe,{...this.state,callback:this.callback,continuous:r,debug:s,helpers:this.helpers,nonce:i,shouldScroll:!h.disableScrolling&&(t!==0||a),step:h,store:this.store}),d.overlay=b.createElement($xe,{id:"react-joyride-portal"},b.createElement(qxe,{...h,continuous:r,debug:s,lifecycle:e,onClickOverlay:this.handleClickOverlay}))}return b.createElement("div",{className:"react-joyride"},d.step,d.overlay)}};xt(yQ,"defaultProps",Rxe);var Kxe=yQ;function nN(){const t=b.useContext(IH);if(!t)throw new Error("useTour must be used within a TourProvider");return t}const Zxe={options:{zIndex:1e4,primaryColor:"hsl(var(--primary))",textColor:"hsl(var(--foreground))",backgroundColor:"hsl(var(--background))",arrowColor:"hsl(var(--background))",overlayColor:"rgba(0, 0, 0, 0.5)"},tooltip:{borderRadius:"var(--radius)",padding:"1rem"},tooltipContainer:{textAlign:"left"},tooltipTitle:{fontSize:"1rem",fontWeight:600,marginBottom:"0.5rem"},tooltipContent:{fontSize:"0.875rem",padding:"0.5rem 0"},buttonNext:{backgroundColor:"hsl(var(--primary))",color:"hsl(var(--primary-foreground))",borderRadius:"calc(var(--radius) - 2px)",fontSize:"0.875rem",padding:"0.5rem 1rem"},buttonBack:{color:"hsl(var(--muted-foreground))",fontSize:"0.875rem",marginRight:"0.5rem"},buttonSkip:{color:"hsl(var(--muted-foreground))",fontSize:"0.875rem"},buttonClose:{color:"hsl(var(--muted-foreground))"},spotlight:{borderRadius:"var(--radius)"}},Jxe={back:"上一步",close:"关闭",last:"完成",next:"下一步",nextLabelWithProgress:"下一步 ({step}/{steps})",open:"打开对话框",skip:"跳过"};function e1e(){const{state:t,getCurrentSteps:e,handleJoyrideCallback:n}=nN(),r=e(),[s,i]=b.useState(!1),a=b.useRef(t.stepIndex),l=b.useRef(null);b.useEffect(()=>{a.current!==t.stepIndex&&(i(!1),a.current=t.stepIndex)},[t.stepIndex]),b.useEffect(()=>{if(!t.isRunning||r.length===0){i(!1);return}const h=r[t.stepIndex];if(!h){i(!1);return}const m=h.target;if(m==="body"){i(!0);return}i(!1);const g=setTimeout(()=>{const x=()=>{const k=document.querySelector(m);if(k){const j=k.getBoundingClientRect();if(j.width>0&&j.height>0)return!0}return!1};if(x()){setTimeout(()=>i(!0),100);return}const y=setInterval(()=>{x()&&(clearInterval(y),setTimeout(()=>i(!0),100))},100),w=setTimeout(()=>{clearInterval(y),i(!0)},5e3),S=()=>{clearInterval(y),clearTimeout(w)};l.current=S},150);return()=>{clearTimeout(g),l.current&&(l.current(),l.current=null)}},[t.isRunning,t.stepIndex,r]);const c=b.useRef(null);if(b.useEffect(()=>{let h=document.getElementById("tour-portal-container");return h||(h=document.createElement("div"),h.id="tour-portal-container",h.style.cssText="position: fixed; top: 0; left: 0; z-index: 99999; pointer-events: none;",document.body.appendChild(h)),c.current=h,()=>{}},[]),!t.isRunning||r.length===0||!s)return null;const d=o.jsx(Kxe,{steps:r,stepIndex:t.stepIndex,run:t.isRunning,continuous:!0,showSkipButton:!0,showProgress:!0,disableOverlayClose:!0,disableScrolling:!1,disableScrollParentFix:!1,callback:n,styles:Zxe,locale:Jxe,scrollOffset:80,scrollToFirstStep:!0,floaterProps:{styles:{floater:{zIndex:99999}},disableAnimation:!0}},`tour-step-${t.stepIndex}`);return c.current?ya.createPortal(d,c.current):d}const Rl="model-assignment-tour",bQ=[{target:"body",content:"本引导旨在帮助你配置模型提供商和对应的模型,并为麦麦的各个组件分配合适的模型。",placement:"center",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="sidebar-model-provider"]',content:'第一步,你需要配置模型提供商。模型提供商决定了你要使用谁家的模型,无论是单一厂商(如 DeepSeek),还是模型平台(如 Siliconflow),都可以在这里进行配置。点击"下一步"进入配置页面。',placement:"right",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="add-provider-button"]',content:'点击"添加提供商"按钮,开始配置你的模型提供商。',placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="provider-dialog"]',content:"在这里,你可以选择你想要配置的模型提供商,填写相关信息后保存即可。",placement:"left",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-name-input"]',content:"这里的名称是你为这个模型提供商起的一个名字,方便你在后续使用时识别它。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-apikey-input"]',content:"这里需要填写你从模型提供商那里获取的 API 密钥,用于验证和调用模型服务。对于不同的提供商,获取 API 密钥的方式可能有所不同,请参考对应提供商的文档。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-url-input"]',content:"这里需要填写模型提供商的 API 访问地址,确保填写正确以便系统能够连接到模型服务。对于不同的提供商,API 地址可能有所不同,请参考对应提供商的文档。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-template-select"]',content:"当然,如果你不知道如何填写这些信息,很多模型提供商在这里都提供了预设的模板供你选择,选择对应的模板后,相关信息会自动填充。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-save-button"]',content:"填写完所有信息后,点击保存按钮,模型提供商就配置完成了。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-cancel-button"]',content:"因为这次咱们什么都没有填写,所以点击取消按钮退出吧。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="sidebar-model-management"]',content:'配置好模型提供商后,接下来我们需要为麦麦添加模型并分配功能。点击"下一步"进入模型管理页面。',placement:"right",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="add-model-button"]',content:'在为麦麦的组件分配模型之前,首先需要添加你想要分配的模型,点击"添加模型"按钮开始添加。',placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="model-dialog"]',content:"在这里,你可以选择你之前配置好的模型提供商,然后选择对应的模型来添加。",placement:"left",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-name-input"]',content:"这里的模型名称是你为这个模型起的一个名字,方便你在后续使用时识别它。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-provider-select"]',content:"在这里选择你之前配置好的模型提供商,这样系统才能知道你要添加哪个提供商的模型。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-identifier-input"]',content:"这里需要填写你想要添加的模型的标识符,不同的模型提供商可能有不同的标识符格式,请参考对应提供商的文档。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-save-button"]',content:"填写完所有信息后,点击保存按钮,模型就添加完成了。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-cancel-button"]',content:"当然,因为这次咱们什么都没有填写,所以直接点击取消按钮退出吧,等你准备好了再来添加模型。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="tasks-tab-trigger"]',content:'最后一步,添加好模型后,切换到"为模型分配功能"标签页,为麦麦的各个组件分配合适的模型。',placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="task-model-select"]',content:"在这里,你可以为每个组件选择一个或多个合适的模型,选择完成后配置会自动保存。恭喜你完成了模型配置的学习!",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1}],wQ={0:"/config/model",1:"/config/model",2:"/config/modelProvider",3:"/config/modelProvider",4:"/config/modelProvider",5:"/config/modelProvider",6:"/config/modelProvider",7:"/config/modelProvider",8:"/config/modelProvider",9:"/config/modelProvider",10:"/config/modelProvider",11:"/config/model",12:"/config/model",13:"/config/model",14:"/config/model",15:"/config/model",16:"/config/model",17:"/config/model",18:"/config/model",19:"/config/model"},h0=[{id:"siliconflow",name:"SiliconFlow",base_url:"https://api.siliconflow.cn/v1",client_type:"openai",display_name:"硅基流动 (SiliconFlow)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"deepseek",name:"DeepSeek",base_url:"https://api.deepseek.com",client_type:"openai",display_name:"DeepSeek",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"rinkoai",name:"RinkoAI",base_url:"https://rinkoai.com/v1",client_type:"openai",display_name:"RinkoAI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"zhipu",name:"ZhipuAI",base_url:"https://open.bigmodel.cn/api/paas/v4",client_type:"openai",display_name:"智谱 AI (ZhipuAI / GLM)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"moonshot",name:"Moonshot",base_url:"https://api.moonshot.cn/v1",client_type:"openai",display_name:"月之暗面 (Moonshot / Kimi)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"doubao",name:"Doubao",base_url:"https://ark.cn-beijing.volces.com/api/v3",client_type:"openai",display_name:"字节豆包 (Doubao)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"alibaba",name:"Alibaba",base_url:"https://dashscope.aliyuncs.com/compatible-mode/v1",client_type:"openai",display_name:"阿里云百炼 (Alibaba Qwen)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"baichuan",name:"Baichuan",base_url:"https://api.baichuan-ai.com/v1",client_type:"openai",display_name:"百川智能 (Baichuan)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"minimax",name:"MiniMax",base_url:"https://api.minimax.chat/v1",client_type:"openai",display_name:"MiniMax (海螺 AI)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"stepfun",name:"StepFun",base_url:"https://api.stepfun.com/v1",client_type:"openai",display_name:"阶跃星辰 (StepFun)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"lingyi",name:"Lingyi",base_url:"https://api.lingyiwanwu.com/v1",client_type:"openai",display_name:"零一万物 (Lingyi / Yi)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"openai",name:"OpenAI",base_url:"https://api.openai.com/v1",client_type:"openai",display_name:"OpenAI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"xai",name:"xAI",base_url:"https://api.x.ai/v1",client_type:"openai",display_name:"xAI (Grok)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"anthropic",name:"Anthropic",base_url:"https://api.anthropic.com/v1",client_type:"openai",display_name:"Anthropic (Claude)"},{id:"gemini",name:"Gemini",base_url:"https://generativelanguage.googleapis.com/v1beta",client_type:"gemini",display_name:"Google Gemini",modelFetcher:{endpoint:"/models",parser:"gemini"}},{id:"cohere",name:"Cohere",base_url:"https://api.cohere.ai/v1",client_type:"openai",display_name:"Cohere"},{id:"groq",name:"Groq",base_url:"https://api.groq.com/openai/v1",client_type:"openai",display_name:"Groq",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"together",name:"Together AI",base_url:"https://api.together.xyz/v1",client_type:"openai",display_name:"Together AI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"fireworks",name:"Fireworks",base_url:"https://api.fireworks.ai/inference/v1",client_type:"openai",display_name:"Fireworks AI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"mistral",name:"Mistral",base_url:"https://api.mistral.ai/v1",client_type:"openai",display_name:"Mistral AI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"perplexity",name:"Perplexity",base_url:"https://api.perplexity.ai",client_type:"openai",display_name:"Perplexity AI"},{id:"custom",name:"",base_url:"",client_type:"openai",display_name:"自定义"}];function iM(t){return t?t.replace(/\/+$/,"").toLowerCase():""}function t1e(t){if(!t)return null;const e=iM(t);return h0.find(n=>n.id!=="custom"&&iM(n.base_url)===e)||null}function n1e(){const[t,e]=b.useState([]),[n,r]=b.useState(!0),[s,i]=b.useState(!1),[a,l]=b.useState(!1),[c,d]=b.useState(!1),[h,m]=b.useState(!1),[g,x]=b.useState(!1),[y,w]=b.useState(!1),[S,k]=b.useState(null),[j,N]=b.useState(null),[T,E]=b.useState("custom"),[_,A]=b.useState(!1),[D,q]=b.useState(!1),[B,H]=b.useState(null),[W,ee]=b.useState(!1),[I,V]=b.useState(""),[L,$]=b.useState(new Set),[K,Y]=b.useState(!1),[R,ie]=b.useState(1),[X,z]=b.useState(20),[U,te]=b.useState(""),[ne,G]=b.useState(new Set),[se,re]=b.useState(new Map),{toast:ae}=Lr(),_e=na(),{state:Be,goToStep:Ye,registerTour:Je}=nN(),Oe=b.useRef(null),Ve=b.useRef(!0);b.useEffect(()=>{Je(Rl,bQ)},[Je]),b.useEffect(()=>{if(Be.activeTourId===Rl&&Be.isRunning){const ve=wQ[Be.stepIndex];ve&&!window.location.pathname.endsWith(ve.replace("/config/",""))&&_e({to:ve})}},[Be.stepIndex,Be.activeTourId,Be.isRunning,_e]);const Ue=b.useRef(Be.stepIndex);b.useEffect(()=>{if(Be.activeTourId===Rl&&Be.isRunning){const ve=Ue.current,He=Be.stepIndex;ve>=3&&ve<=9&&He<3&&w(!1),Ue.current=He}},[Be.stepIndex,Be.activeTourId,Be.isRunning]),b.useEffect(()=>{if(Be.activeTourId!==Rl||!Be.isRunning)return;const ve=He=>{const ht=He.target,vn=Be.stepIndex;vn===2&&ht.closest('[data-tour="add-provider-button"]')?setTimeout(()=>Ye(3),300):vn===9&&ht.closest('[data-tour="provider-cancel-button"]')&&setTimeout(()=>Ye(10),300)};return document.addEventListener("click",ve,!0),()=>document.removeEventListener("click",ve,!0)},[Be,Ye]),b.useEffect(()=>{$e()},[]);const $e=async()=>{try{r(!0);const ve=await Dh();e(ve.api_providers||[]),d(!1),Ve.current=!1}catch(ve){console.error("加载配置失败:",ve)}finally{r(!1)}},jt=async()=>{try{m(!0),cb().catch(()=>{}),x(!0)}catch(ve){console.error("重启失败:",ve),x(!1),ae({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),m(!1)}},vt=async()=>{try{i(!0),Oe.current&&clearTimeout(Oe.current);const ve=await Dh();ve.api_providers=t,await Uv(ve),d(!1),ae({title:"保存成功",description:"正在重启麦麦..."}),await jt()}catch(ve){console.error("保存配置失败:",ve),ae({title:"保存失败",description:ve.message,variant:"destructive"}),i(!1)}},$n=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},qt=()=>{x(!1),m(!1),ae({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},un=b.useCallback(async ve=>{if(!Ve.current)try{l(!0),await bk("api_providers",ve),d(!1)}catch(He){console.error("自动保存失败:",He),d(!0)}finally{l(!1)}},[]);b.useEffect(()=>{if(!Ve.current)return d(!0),Oe.current&&clearTimeout(Oe.current),Oe.current=setTimeout(()=>{un(t)},2e3),()=>{Oe.current&&clearTimeout(Oe.current)}},[t,un]);const Mt=async()=>{try{i(!0),Oe.current&&clearTimeout(Oe.current);const ve=await Dh();ve.api_providers=t,await Uv(ve),d(!1),ae({title:"保存成功",description:"模型提供商配置已保存"})}catch(ve){console.error("保存配置失败:",ve),ae({title:"保存失败",description:ve.message,variant:"destructive"})}finally{i(!1)}},ct=(ve,He)=>{if(ve){const ht=h0.find(vn=>vn.base_url===ve.base_url&&vn.client_type===ve.client_type);E(ht?.id||"custom"),k(ve)}else E("custom"),k({name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10});N(He),ee(!1),w(!0)},Ne=ve=>{E(ve),A(!1);const He=h0.find(ht=>ht.id===ve);He&&He.id!=="custom"?k(ht=>({...ht,name:He.name,base_url:He.base_url,client_type:He.client_type})):He?.id==="custom"&&k(ht=>({...ht,name:"",base_url:"",client_type:"openai"}))},ze=b.useMemo(()=>T!=="custom",[T]),rt=async()=>{if(S?.api_key)try{await navigator.clipboard.writeText(S.api_key),ae({title:"复制成功",description:"API Key 已复制到剪贴板"})}catch{ae({title:"复制失败",description:"无法访问剪贴板",variant:"destructive"})}},bt=()=>{if(!S)return;const ve={...S,max_retry:S.max_retry??2,timeout:S.timeout??30,retry_interval:S.retry_interval??10};if(j!==null){const He=[...t];He[j]=ve,e(He)}else e([...t,ve]);w(!1),k(null),N(null)},zt=ve=>{if(!ve&&S){const He={...S,max_retry:S.max_retry??2,timeout:S.timeout??30,retry_interval:S.retry_interval??10};k(He)}w(ve)},Rt=ve=>{H(ve),q(!0)},Hn=()=>{if(B!==null){const ve=t.filter((He,ht)=>ht!==B);e(ve),ae({title:"删除成功",description:"提供商已从列表中移除"})}q(!1),H(null)},We=ve=>{const He=new Set(L);He.has(ve)?He.delete(ve):He.add(ve),$(He)},ot=()=>{if(L.size===xn.length)$(new Set);else{const ve=xn.map((He,ht)=>t.findIndex(vn=>vn===xn[ht]));$(new Set(ve))}},dn=()=>{if(L.size===0){ae({title:"提示",description:"请先选择要删除的提供商",variant:"default"});return}Y(!0)},Pt=()=>{const ve=t.filter((He,ht)=>!L.has(ht));e(ve),$(new Set),Y(!1),ae({title:"批量删除成功",description:`已删除 ${L.size} 个提供商`})},xn=t.filter(ve=>{if(!I)return!0;const He=I.toLowerCase();return ve.name.toLowerCase().includes(He)||ve.base_url.toLowerCase().includes(He)||ve.client_type.toLowerCase().includes(He)}),dt=Math.ceil(xn.length/X),rn=xn.slice((R-1)*X,R*X),wt=()=>{const ve=parseInt(U);ve>=1&&ve<=dt&&(ie(ve),te(""))},Wt=async ve=>{G(He=>new Set(He).add(ve));try{const He=await Cae(ve);re(ht=>new Map(ht).set(ve,He)),He.network_ok?He.api_key_valid===!0?ae({title:"连接正常",description:`${ve} 网络连接正常,API Key 有效 (${He.latency_ms}ms)`}):He.api_key_valid===!1?ae({title:"连接正常但 Key 无效",description:`${ve} 网络连接正常,但 API Key 无效或已过期`,variant:"destructive"}):ae({title:"网络连接正常",description:`${ve} 可以访问 (${He.latency_ms}ms)`}):ae({title:"连接失败",description:He.error||"无法连接到提供商",variant:"destructive"})}catch(He){ae({title:"测试失败",description:He.message,variant:"destructive"})}finally{G(He=>{const ht=new Set(He);return ht.delete(ve),ht})}},Gt=async()=>{for(const ve of t)await Wt(ve.name)},lt=ve=>{const He=ne.has(ve),ht=se.get(ve);return He?o.jsxs(tn,{variant:"secondary",className:"gap-1",children:[o.jsx(Us,{className:"h-3 w-3 animate-spin"}),"测试中"]}):ht?ht.network_ok?ht.api_key_valid===!0?o.jsxs(tn,{className:"gap-1 bg-green-600 hover:bg-green-700",children:[o.jsx(Ya,{className:"h-3 w-3"}),"正常"]}):ht.api_key_valid===!1?o.jsxs(tn,{variant:"destructive",className:"gap-1",children:[o.jsx(Lo,{className:"h-3 w-3"}),"Key无效"]}):o.jsxs(tn,{className:"gap-1 bg-blue-600 hover:bg-blue-700",children:[o.jsx(Ya,{className:"h-3 w-3"}),"可访问"]}):o.jsxs(tn,{variant:"destructive",className:"gap-1",children:[o.jsx(OI,{className:"h-3 w-3"}),"离线"]}):null};return n?o.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})}):o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"AI模型厂商配置"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理 AI 模型厂商的 API 配置"})]}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[L.size>0&&o.jsxs(ue,{onClick:dn,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[o.jsx(Cn,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",L.size,")"]}),o.jsxs(ue,{onClick:Gt,size:"sm",variant:"outline",className:"w-full sm:w-auto",disabled:t.length===0||ne.size>0,children:[o.jsx(Zu,{className:"mr-2 h-4 w-4"}),ne.size>0?`测试中 (${ne.size})`:"测试全部"]}),o.jsxs(ue,{onClick:()=>ct(null,null),size:"sm",className:"w-full sm:w-auto","data-tour":"add-provider-button",children:[o.jsx(Is,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加提供商"]}),o.jsxs(ue,{onClick:Mt,disabled:s||a||!c||h,size:"sm",variant:"outline",className:"w-full sm:w-auto sm:min-w-[120px]",children:[o.jsx(zp,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),s?"保存中...":a?"自动保存中...":c?"保存配置":"已保存"]}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsxs(ue,{disabled:s||a||h,size:"sm",className:"w-full sm:w-auto sm:min-w-[120px]",children:[o.jsx(Dp,{className:"mr-2 h-4 w-4"}),h?"重启中...":c?"保存并重启":"重启麦麦"]})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认重启麦麦?"}),o.jsx(zn,{className:"space-y-3",asChild:!0,children:o.jsxs("div",{children:[o.jsx("p",{children:c?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"}),o.jsxs(ba,{className:"border-yellow-500/50 bg-yellow-500/10",children:[o.jsx(Xi,{className:"h-4 w-4 text-yellow-600"}),o.jsxs(wa,{className:"text-yellow-900 dark:text-yellow-100",children:[o.jsx("strong",{children:"重要提示:"}),"由于技术原因,使用重启功能后,将无法再使用 ",o.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。",o.jsxs(Er,{children:[o.jsx(Of,{asChild:!0,children:o.jsxs("button",{className:"ml-1 text-yellow-700 dark:text-yellow-300 underline hover:text-yellow-800 dark:hover:text-yellow-200 inline-flex items-center gap-1",children:[o.jsx(Zy,{className:"h-3 w-3"}),"如何结束程序?"]})}),o.jsxs(wr,{className:"max-w-2xl",children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"如何结束使用重启功能后的麦麦程序"}),o.jsx(Xr,{children:"由于重启功能会使程序脱离终端控制,需要通过系统命令来结束进程"})]}),o.jsxs(Yi,{defaultValue:"windows",className:"w-full",children:[o.jsxs(ji,{className:"grid w-full grid-cols-3",children:[o.jsx(Bt,{value:"windows",children:"Windows"}),o.jsx(Bt,{value:"macos",children:"macOS"}),o.jsx(Bt,{value:"linux",children:"Linux"})]}),o.jsxs(ln,{value:"windows",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法一:使用任务管理器"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Ctrl + Shift + Esc"})," 打开任务管理器"]}),o.jsxs("li",{children:["在“进程”或“详细信息”标签页中找到 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"python.exe"})]}),o.jsx("li",{children:"右键点击并选择“结束任务”"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法二:使用命令行"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开 PowerShell 或命令提示符,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:'Get-Process python | Where-Object {$_.MainWindowTitle -eq ""}'}),o.jsx("p",{className:"mt-2",children:"# 结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"Stop-Process -Name python -Force"})]})]})]}),o.jsxs(ln,{value:"macos",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法一:使用活动监视器"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Cmd + Space"})," 打开 Spotlight,搜索“活动监视器”"]}),o.jsxs("li",{children:["在进程列表中找到 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Python"})]}),o.jsx("li",{children:"选中后点击左上角的 X 按钮结束进程"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法二:使用终端"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:"ps aux | grep python | grep -v grep"}),o.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),o.jsx("p",{children:"kill -9 "}),o.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"pkill -9 python"})]})]})]}),o.jsxs(ln,{value:"linux",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"使用终端命令"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:"ps aux | grep python | grep -v grep"}),o.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),o.jsx("p",{children:"kill -9 "}),o.jsx("p",{className:"mt-2",children:"# 或使用 pkill 按名称结束"}),o.jsx("p",{children:'pkill -9 -f "bot.py"'}),o.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"pkill -9 python"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"使用 htop(如已安装)"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["在终端输入 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"htop"})]}),o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F3"})," 搜索 python"]}),o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F9"})," 发送信号,选择 SIGKILL"]})]})]})]})]}),o.jsx(fs,{children:o.jsx(e6,{asChild:!0,children:o.jsx(ue,{variant:"outline",children:"关闭"})})})]})]})]})]})]})})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:c?vt:jt,children:c?"保存并重启":"确认重启"})]})]})]})]})]}),o.jsxs(ba,{children:[o.jsx(Xi,{className:"h-4 w-4"}),o.jsxs(wa,{children:["配置更新后需要",o.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),o.jsxs(pn,{className:"h-[calc(100vh-260px)]",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 mb-4",children:[o.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[o.jsx(ii,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(Pe,{placeholder:"搜索提供商名称、URL 或类型...",value:I,onChange:ve=>V(ve.target.value),className:"pl-9"})]}),I&&o.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",xn.length," 个结果"]})]}),o.jsx("div",{className:"md:hidden space-y-3",children:xn.length===0?o.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:I?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'}):rn.map((ve,He)=>{const ht=t.findIndex(vn=>vn===ve);return o.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[o.jsx("h3",{className:"font-semibold text-base truncate",children:ve.name}),lt(ve.name)]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:ve.base_url})]}),o.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>Wt(ve.name),disabled:ne.has(ve.name),title:"测试连接",children:ne.has(ve.name)?o.jsx(Us,{className:"h-4 w-4 animate-spin"}):o.jsx(Zu,{className:"h-4 w-4"})}),o.jsx(ue,{variant:"default",size:"sm",onClick:()=>ct(ve,ht),children:o.jsx(Ju,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),o.jsx(ue,{size:"sm",onClick:()=>Rt(ht),className:"bg-red-600 hover:bg-red-700 text-white",children:o.jsx(Cn,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"客户端类型"}),o.jsx("p",{className:"font-medium",children:ve.client_type})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"最大重试"}),o.jsx("p",{className:"font-medium",children:ve.max_retry})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"超时(秒)"}),o.jsx("p",{className:"font-medium",children:ve.timeout})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"重试间隔(秒)"}),o.jsx("p",{className:"font-medium",children:ve.retry_interval})]})]})]},He)})}),o.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs(Af,{children:[o.jsx(Mf,{children:o.jsxs(zs,{children:[o.jsx(mn,{className:"w-12",children:o.jsx(Ci,{checked:L.size===xn.length&&xn.length>0,onCheckedChange:ot})}),o.jsx(mn,{children:"状态"}),o.jsx(mn,{children:"名称"}),o.jsx(mn,{children:"基础URL"}),o.jsx(mn,{children:"客户端类型"}),o.jsx(mn,{className:"text-right",children:"最大重试"}),o.jsx(mn,{className:"text-right",children:"超时(秒)"}),o.jsx(mn,{className:"text-right",children:"重试间隔(秒)"}),o.jsx(mn,{className:"text-right",children:"操作"})]})}),o.jsx(Rf,{children:rn.length===0?o.jsx(zs,{children:o.jsx(Yt,{colSpan:9,className:"text-center text-muted-foreground py-8",children:I?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'})}):rn.map((ve,He)=>{const ht=t.findIndex(vn=>vn===ve);return o.jsxs(zs,{children:[o.jsx(Yt,{children:o.jsx(Ci,{checked:L.has(ht),onCheckedChange:()=>We(ht)})}),o.jsx(Yt,{children:lt(ve.name)||o.jsx(tn,{variant:"outline",className:"text-muted-foreground",children:"未测试"})}),o.jsx(Yt,{className:"font-medium",children:ve.name}),o.jsx(Yt,{className:"max-w-xs truncate",title:ve.base_url,children:ve.base_url}),o.jsx(Yt,{children:ve.client_type}),o.jsx(Yt,{className:"text-right",children:ve.max_retry}),o.jsx(Yt,{className:"text-right",children:ve.timeout}),o.jsx(Yt,{className:"text-right",children:ve.retry_interval}),o.jsx(Yt,{className:"text-right",children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>Wt(ve.name),disabled:ne.has(ve.name),title:"测试连接",children:ne.has(ve.name)?o.jsx(Us,{className:"h-4 w-4 animate-spin"}):o.jsx(Zu,{className:"h-4 w-4"})}),o.jsxs(ue,{variant:"default",size:"sm",onClick:()=>ct(ve,ht),children:[o.jsx(Ju,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),o.jsxs(ue,{size:"sm",onClick:()=>Rt(ht),className:"bg-red-600 hover:bg-red-700 text-white",children:[o.jsx(Cn,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},He)})})]})})}),xn.length>0&&o.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{htmlFor:"page-size-provider",className:"text-sm whitespace-nowrap",children:"每页显示"}),o.jsxs(Vt,{value:X.toString(),onValueChange:ve=>{z(parseInt(ve)),ie(1),$(new Set)},children:[o.jsx($t,{id:"page-size-provider",className:"w-20",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"10",children:"10"}),o.jsx(De,{value:"20",children:"20"}),o.jsx(De,{value:"50",children:"50"}),o.jsx(De,{value:"100",children:"100"})]})]}),o.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(R-1)*X+1," 到"," ",Math.min(R*X,xn.length)," 条,共 ",xn.length," 条"]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>ie(1),disabled:R===1,className:"hidden sm:flex",children:o.jsx(Ip,{className:"h-4 w-4"})}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>ie(ve=>Math.max(1,ve-1)),disabled:R===1,children:[o.jsx(wd,{className:"h-4 w-4 sm:mr-1"}),o.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Pe,{type:"number",value:U,onChange:ve=>te(ve.target.value),onKeyDown:ve=>ve.key==="Enter"&&wt(),placeholder:R.toString(),className:"w-16 h-8 text-center",min:1,max:dt}),o.jsx(ue,{variant:"outline",size:"sm",onClick:wt,disabled:!U,className:"h-8",children:"跳转"})]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>ie(ve=>ve+1),disabled:R>=dt,children:[o.jsx("span",{className:"hidden sm:inline",children:"下一页"}),o.jsx(Zl,{className:"h-4 w-4 sm:ml-1"})]}),o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>ie(dt),disabled:R>=dt,className:"hidden sm:flex",children:o.jsx(Lp,{className:"h-4 w-4"})})]})]})]}),o.jsx(Er,{open:y,onOpenChange:zt,children:o.jsxs(wr,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto","data-tour":"provider-dialog",preventOutsideClose:Be.isRunning,children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:j!==null?"编辑提供商":"添加提供商"}),o.jsx(Xr,{children:"配置 API 提供商的连接信息和参数"})]}),o.jsxs("form",{onSubmit:ve=>{ve.preventDefault(),bt()},autoComplete:"off",children:[o.jsxs("div",{className:"grid gap-4 py-4",children:[o.jsxs("div",{className:"grid gap-2","data-tour":"provider-template-select",children:[o.jsx(he,{htmlFor:"template",children:"提供商模板"}),o.jsxs(Bo,{open:_,onOpenChange:A,children:[o.jsx(Fo,{asChild:!0,children:o.jsxs(ue,{variant:"outline",role:"combobox","aria-expanded":_,className:"w-full justify-between",children:[T?h0.find(ve=>ve.id===T)?.display_name:"选择提供商模板...",o.jsx(Lj,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o.jsx(Ka,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:o.jsxs(Tb,{children:[o.jsx(Eb,{placeholder:"搜索提供商模板..."}),o.jsx(pn,{className:"h-[300px]",children:o.jsxs(_b,{className:"max-h-none overflow-visible",children:[o.jsx(Ab,{children:"未找到匹配的模板"}),o.jsx(up,{children:h0.map(ve=>o.jsxs(dp,{value:ve.display_name,onSelect:()=>Ne(ve.id),children:[o.jsx(zo,{className:`mr-2 h-4 w-4 ${T===ve.id?"opacity-100":"opacity-0"}`}),ve.display_name]},ve.id))})]})})]})})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"选择预设模板可自动填充 URL 和客户端类型,支持搜索"})]}),o.jsxs("div",{className:"grid gap-2","data-tour":"provider-name-input",children:[o.jsx(he,{htmlFor:"name",children:"名称 *"}),o.jsx(Pe,{id:"name",value:S?.name||"",onChange:ve=>k(He=>He?{...He,name:ve.target.value}:null),placeholder:"例如: DeepSeek, SiliconFlow"})]}),o.jsxs("div",{className:"grid gap-2","data-tour":"provider-url-input",children:[o.jsx(he,{htmlFor:"base_url",children:"基础 URL *"}),o.jsx(Pe,{id:"base_url",value:S?.base_url||"",onChange:ve=>k(He=>He?{...He,base_url:ve.target.value}:null),placeholder:"https://api.example.com/v1",disabled:ze,className:ze?"bg-muted cursor-not-allowed":""}),ze&&o.jsx("p",{className:"text-xs text-muted-foreground",children:'使用模板时 URL 不可编辑,切换到"自定义"以手动配置'})]}),o.jsxs("div",{className:"grid gap-2","data-tour":"provider-apikey-input",children:[o.jsx(he,{htmlFor:"api_key",children:"API Key *"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Pe,{id:"api_key",type:W?"text":"password",value:S?.api_key||"",onChange:ve=>k(He=>He?{...He,api_key:ve.target.value}:null),placeholder:"sk-...",className:"flex-1"}),o.jsx(ue,{type:"button",variant:"outline",size:"icon",onClick:()=>ee(!W),title:W?"隐藏密钥":"显示密钥",children:W?o.jsx(I0,{className:"h-4 w-4"}):o.jsx(Ji,{className:"h-4 w-4"})}),o.jsx(ue,{type:"button",variant:"outline",size:"icon",onClick:rt,title:"复制密钥",children:o.jsx(Iv,{className:"h-4 w-4"})})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"client_type",children:"客户端类型"}),o.jsxs(Vt,{value:S?.client_type||"openai",onValueChange:ve=>k(He=>He?{...He,client_type:ve}:null),disabled:ze,children:[o.jsx($t,{id:"client_type",className:ze?"bg-muted cursor-not-allowed":"",children:o.jsx(Ut,{placeholder:"选择客户端类型"})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"openai",children:"OpenAI"}),o.jsx(De,{value:"gemini",children:"Gemini"})]})]}),ze&&o.jsx("p",{className:"text-xs text-muted-foreground",children:'使用模板时客户端类型不可编辑,切换到"自定义"以手动配置'})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"max_retry",children:"最大重试"}),o.jsx(Pe,{id:"max_retry",type:"number",min:"0",value:S?.max_retry??"",onChange:ve=>{const He=ve.target.value===""?null:parseInt(ve.target.value);k(ht=>ht?{...ht,max_retry:He}:null)},placeholder:"默认: 2"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"timeout",children:"超时(秒)"}),o.jsx(Pe,{id:"timeout",type:"number",min:"1",value:S?.timeout??"",onChange:ve=>{const He=ve.target.value===""?null:parseInt(ve.target.value);k(ht=>ht?{...ht,timeout:He}:null)},placeholder:"默认: 30"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"retry_interval",children:"重试间隔(秒)"}),o.jsx(Pe,{id:"retry_interval",type:"number",min:"1",value:S?.retry_interval??"",onChange:ve=>{const He=ve.target.value===""?null:parseInt(ve.target.value);k(ht=>ht?{...ht,retry_interval:He}:null)},placeholder:"默认: 10"})]})]})]}),o.jsxs(fs,{children:[o.jsx(ue,{type:"button",variant:"outline",onClick:()=>w(!1),"data-tour":"provider-cancel-button",children:"取消"}),o.jsx(ue,{type:"submit","data-tour":"provider-save-button",children:"保存"})]})]})]})}),o.jsx(Fn,{open:D,onOpenChange:q,children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:['确定要删除提供商 "',B!==null?t[B]?.name:"",'" 吗? 此操作无法撤销。']})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:Hn,children:"删除"})]})]})}),o.jsx(Fn,{open:K,onOpenChange:Y,children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认批量删除"}),o.jsxs(zn,{children:["确定要删除选中的 ",L.size," 个提供商吗? 此操作无法撤销。"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:Pt,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),g&&o.jsx(r6,{onRestartComplete:$n,onRestartFailed:qt})]})}function r1e(){for(var t=arguments.length,e=new Array(t),n=0;nr=>{e.forEach(s=>s(r))},e)}const Pb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function If(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function rN(t){return"nodeType"in t}function _i(t){var e,n;return t?If(t)?t:rN(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function sN(t){const{Document:e}=_i(t);return t instanceof e}function hg(t){return If(t)?!1:t instanceof _i(t).HTMLElement}function SQ(t){return t instanceof _i(t).SVGElement}function Lf(t){return t?If(t)?t.document:rN(t)?sN(t)?t:hg(t)||SQ(t)?t.ownerDocument:document:document:document}const $o=Pb?b.useLayoutEffect:b.useEffect;function iN(t){const e=b.useRef(t);return $o(()=>{e.current=t}),b.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s{t.current=setInterval(r,s)},[]),n=b.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function mp(t,e){e===void 0&&(e=[t]);const n=b.useRef(t);return $o(()=>{n.current!==t&&(n.current=t)},e),n}function fg(t,e){const n=b.useRef();return b.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function yy(t){const e=iN(t),n=b.useRef(null),r=b.useCallback(s=>{s!==n.current&&e?.(s,n.current),n.current=s},[]);return[n,r]}function NO(t){const e=b.useRef();return b.useEffect(()=>{e.current=t},[t]),e.current}let CS={};function mg(t,e){return b.useMemo(()=>{if(e)return e;const n=CS[t]==null?0:CS[t]+1;return CS[t]=n,t+"-"+n},[t,e])}function kQ(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s{const l=Object.entries(a);for(const[c,d]of l){const h=i[c];h!=null&&(i[c]=h+t*d)}return i},{...e})}}const qh=kQ(1),pp=kQ(-1);function i1e(t){return"clientX"in t&&"clientY"in t}function aN(t){if(!t)return!1;const{KeyboardEvent:e}=_i(t.target);return e&&t instanceof e}function a1e(t){if(!t)return!1;const{TouchEvent:e}=_i(t.target);return e&&t instanceof e}function CO(t){if(a1e(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return i1e(t)?{x:t.clientX,y:t.clientY}:null}const gp=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[gp.Translate.toString(t),gp.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),aM="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function o1e(t){return t.matches(aM)?t:t.querySelector(aM)}const l1e={display:"none"};function c1e(t){let{id:e,value:n}=t;return oe.createElement("div",{id:e,style:l1e},n)}function u1e(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return oe.createElement("div",{id:e,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function d1e(){const[t,e]=b.useState("");return{announce:b.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const OQ=b.createContext(null);function h1e(t){const e=b.useContext(OQ);b.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of ");return e(t)},[t,e])}function f1e(){const[t]=b.useState(()=>new Set),e=b.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[b.useCallback(r=>{let{type:s,event:i}=r;t.forEach(a=>{var l;return(l=a[s])==null?void 0:l.call(a,i)})},[t]),e]}const m1e={draggable:` - To pick up a draggable item, press the space bar. - While dragging, use the arrow keys to move the item. - Press space again to drop the item in its new position, or press escape to cancel. - `},p1e={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function g1e(t){let{announcements:e=p1e,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=m1e}=t;const{announce:i,announcement:a}=d1e(),l=mg("DndLiveRegion"),[c,d]=b.useState(!1);if(b.useEffect(()=>{d(!0)},[]),h1e(b.useMemo(()=>({onDragStart(m){let{active:g}=m;i(e.onDragStart({active:g}))},onDragMove(m){let{active:g,over:x}=m;e.onDragMove&&i(e.onDragMove({active:g,over:x}))},onDragOver(m){let{active:g,over:x}=m;i(e.onDragOver({active:g,over:x}))},onDragEnd(m){let{active:g,over:x}=m;i(e.onDragEnd({active:g,over:x}))},onDragCancel(m){let{active:g,over:x}=m;i(e.onDragCancel({active:g,over:x}))}}),[i,e])),!c)return null;const h=oe.createElement(oe.Fragment,null,oe.createElement(c1e,{id:r,value:s.draggable}),oe.createElement(u1e,{id:l,announcement:a}));return n?ya.createPortal(h,n):h}var ds;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(ds||(ds={}));function by(){}function oM(t,e){return b.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function x1e(){for(var t=arguments.length,e=new Array(t),n=0;n[...e].filter(r=>r!=null),[...e])}const eo=Object.freeze({x:0,y:0});function jQ(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function NQ(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function v1e(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function lM(t){let{left:e,top:n,height:r,width:s}=t;return[{x:e,y:n},{x:e+s,y:n},{x:e,y:n+r},{x:e+s,y:n+r}]}function CQ(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function cM(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+t.width*.5,y:n+t.height*.5}}const y1e=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=cM(e,e.left,e.top),i=[];for(const a of r){const{id:l}=a,c=n.get(l);if(c){const d=jQ(cM(c),s);i.push({id:l,data:{droppableContainer:a,value:d}})}}return i.sort(NQ)},b1e=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=lM(e),i=[];for(const a of r){const{id:l}=a,c=n.get(l);if(c){const d=lM(c),h=s.reduce((g,x,y)=>g+jQ(d[y],x),0),m=Number((h/4).toFixed(4));i.push({id:l,data:{droppableContainer:a,value:m}})}}return i.sort(NQ)};function w1e(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),s=Math.min(e.left+e.width,t.left+t.width),i=Math.min(e.top+e.height,t.top+t.height),a=s-r,l=i-n;if(r{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=[];for(const i of r){const{id:a}=i,l=n.get(a);if(l){const c=w1e(l,e);c>0&&s.push({id:a,data:{droppableContainer:i,value:c}})}}return s.sort(v1e)};function k1e(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function TQ(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:eo}function O1e(t){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i({...a,top:a.top+t*l.y,bottom:a.bottom+t*l.y,left:a.left+t*l.x,right:a.right+t*l.x}),{...n})}}const j1e=O1e(1);function N1e(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function C1e(t,e,n){const r=N1e(e);if(!r)return t;const{scaleX:s,scaleY:i,x:a,y:l}=r,c=t.left-a-(1-s)*parseFloat(n),d=t.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),h=s?t.width/s:t.width,m=i?t.height/i:t.height;return{width:h,height:m,top:d,right:c+h,bottom:d+m,left:c}}const T1e={ignoreTransform:!1};function Bf(t,e){e===void 0&&(e=T1e);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:d,transformOrigin:h}=_i(t).getComputedStyle(t);d&&(n=C1e(n,d,h))}const{top:r,left:s,width:i,height:a,bottom:l,right:c}=n;return{top:r,left:s,width:i,height:a,bottom:l,right:c}}function uM(t){return Bf(t,{ignoreTransform:!0})}function E1e(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function _1e(t,e){return e===void 0&&(e=_i(t).getComputedStyle(t)),e.position==="fixed"}function A1e(t,e){e===void 0&&(e=_i(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=e[s];return typeof i=="string"?n.test(i):!1})}function zb(t,e){const n=[];function r(s){if(e!=null&&n.length>=e||!s)return n;if(sN(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!hg(s)||SQ(s)||n.includes(s))return n;const i=_i(t).getComputedStyle(s);return s!==t&&A1e(s,i)&&n.push(s),_1e(s,i)?n:r(s.parentNode)}return t?r(t):n}function EQ(t){const[e]=zb(t,1);return e??null}function TS(t){return!Pb||!t?null:If(t)?t:rN(t)?sN(t)||t===Lf(t).scrollingElement?window:hg(t)?t:null:null}function _Q(t){return If(t)?t.scrollX:t.scrollLeft}function AQ(t){return If(t)?t.scrollY:t.scrollTop}function TO(t){return{x:_Q(t),y:AQ(t)}}var bs;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(bs||(bs={}));function MQ(t){return!Pb||!t?!1:t===document.scrollingElement}function RQ(t){const e={x:0,y:0},n=MQ(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},s=t.scrollTop<=e.y,i=t.scrollLeft<=e.x,a=t.scrollTop>=r.y,l=t.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:a,isRight:l,maxScroll:r,minScroll:e}}const M1e={x:.2,y:.2};function R1e(t,e,n,r,s){let{top:i,left:a,right:l,bottom:c}=n;r===void 0&&(r=10),s===void 0&&(s=M1e);const{isTop:d,isBottom:h,isLeft:m,isRight:g}=RQ(t),x={x:0,y:0},y={x:0,y:0},w={height:e.height*s.y,width:e.width*s.x};return!d&&i<=e.top+w.height?(x.y=bs.Backward,y.y=r*Math.abs((e.top+w.height-i)/w.height)):!h&&c>=e.bottom-w.height&&(x.y=bs.Forward,y.y=r*Math.abs((e.bottom-w.height-c)/w.height)),!g&&l>=e.right-w.width?(x.x=bs.Forward,y.x=r*Math.abs((e.right-w.width-l)/w.width)):!m&&a<=e.left+w.width&&(x.x=bs.Backward,y.x=r*Math.abs((e.left+w.width-a)/w.width)),{direction:x,speed:y}}function D1e(t){if(t===document.scrollingElement){const{innerWidth:i,innerHeight:a}=window;return{top:0,left:0,right:i,bottom:a,width:i,height:a}}const{top:e,left:n,right:r,bottom:s}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:s,width:t.clientWidth,height:t.clientHeight}}function DQ(t){return t.reduce((e,n)=>qh(e,TO(n)),eo)}function P1e(t){return t.reduce((e,n)=>e+_Q(n),0)}function z1e(t){return t.reduce((e,n)=>e+AQ(n),0)}function I1e(t,e){if(e===void 0&&(e=Bf),!t)return;const{top:n,left:r,bottom:s,right:i}=e(t);EQ(t)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const L1e=[["x",["left","right"],P1e],["y",["top","bottom"],z1e]];class oN{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=zb(n),s=DQ(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,a,l]of L1e)for(const c of a)Object.defineProperty(this,c,{get:()=>{const d=l(r),h=s[i]-d;return this.rect[c]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class _0{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var s;(s=this.target)==null||s.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function B1e(t){const{EventTarget:e}=_i(t);return t instanceof e?t:Lf(t)}function ES(t,e){const n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var pa;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(pa||(pa={}));function dM(t){t.preventDefault()}function F1e(t){t.stopPropagation()}var jn;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(jn||(jn={}));const PQ={start:[jn.Space,jn.Enter],cancel:[jn.Esc],end:[jn.Space,jn.Enter,jn.Tab]},q1e=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case jn.Right:return{...n,x:n.x+25};case jn.Left:return{...n,x:n.x-25};case jn.Down:return{...n,y:n.y+25};case jn.Up:return{...n,y:n.y-25}}};class lN{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new _0(Lf(n)),this.windowListeners=new _0(_i(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(pa.Resize,this.handleCancel),this.windowListeners.add(pa.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(pa.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&I1e(r),n(eo)}handleKeyDown(e){if(aN(e)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=PQ,coordinateGetter:a=q1e,scrollBehavior:l="smooth"}=s,{code:c}=e;if(i.end.includes(c)){this.handleEnd(e);return}if(i.cancel.includes(c)){this.handleCancel(e);return}const{collisionRect:d}=r.current,h=d?{x:d.left,y:d.top}:eo;this.referenceCoordinates||(this.referenceCoordinates=h);const m=a(e,{active:n,context:r.current,currentCoordinates:h});if(m){const g=pp(m,h),x={x:0,y:0},{scrollableAncestors:y}=r.current;for(const w of y){const S=e.code,{isTop:k,isRight:j,isLeft:N,isBottom:T,maxScroll:E,minScroll:_}=RQ(w),A=D1e(w),D={x:Math.min(S===jn.Right?A.right-A.width/2:A.right,Math.max(S===jn.Right?A.left:A.left+A.width/2,m.x)),y:Math.min(S===jn.Down?A.bottom-A.height/2:A.bottom,Math.max(S===jn.Down?A.top:A.top+A.height/2,m.y))},q=S===jn.Right&&!j||S===jn.Left&&!N,B=S===jn.Down&&!T||S===jn.Up&&!k;if(q&&D.x!==m.x){const H=w.scrollLeft+g.x,W=S===jn.Right&&H<=E.x||S===jn.Left&&H>=_.x;if(W&&!g.y){w.scrollTo({left:H,behavior:l});return}W?x.x=w.scrollLeft-H:x.x=S===jn.Right?w.scrollLeft-E.x:w.scrollLeft-_.x,x.x&&w.scrollBy({left:-x.x,behavior:l});break}else if(B&&D.y!==m.y){const H=w.scrollTop+g.y,W=S===jn.Down&&H<=E.y||S===jn.Up&&H>=_.y;if(W&&!g.x){w.scrollTo({top:H,behavior:l});return}W?x.y=w.scrollTop-H:x.y=S===jn.Down?w.scrollTop-E.y:w.scrollTop-_.y,x.y&&w.scrollBy({top:-x.y,behavior:l});break}}this.handleMove(e,qh(pp(m,this.referenceCoordinates),x))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}lN.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=PQ,onActivation:s}=e,{active:i}=n;const{code:a}=t.nativeEvent;if(r.start.includes(a)){const l=i.activatorNode.current;return l&&t.target!==l?!1:(t.preventDefault(),s?.({event:t.nativeEvent}),!0)}return!1}}];function hM(t){return!!(t&&"distance"in t)}function fM(t){return!!(t&&"delay"in t)}class cN{constructor(e,n,r){var s;r===void 0&&(r=B1e(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:i}=e,{target:a}=i;this.props=e,this.events=n,this.document=Lf(a),this.documentListeners=new _0(this.document),this.listeners=new _0(r),this.windowListeners=new _0(_i(a)),this.initialCoordinates=(s=CO(i))!=null?s:eo,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(pa.Resize,this.handleCancel),this.windowListeners.add(pa.DragStart,dM),this.windowListeners.add(pa.VisibilityChange,this.handleCancel),this.windowListeners.add(pa.ContextMenu,dM),this.documentListeners.add(pa.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(fM(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(hM(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:r,onPending:s}=this.props;s(r,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(pa.Click,F1e,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(pa.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:a,options:{activationConstraint:l}}=i;if(!s)return;const c=(n=CO(e))!=null?n:eo,d=pp(s,c);if(!r&&l){if(hM(l)){if(l.tolerance!=null&&ES(d,l.tolerance))return this.handleCancel();if(ES(d,l.distance))return this.handleStart()}if(fM(l)&&ES(d,l.tolerance))return this.handleCancel();this.handlePending(l,d);return}e.cancelable&&e.preventDefault(),a(c)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===jn.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const $1e={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class uN extends cN{constructor(e){const{event:n}=e,r=Lf(n.target);super(e,$1e,r)}}uN.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const H1e={move:{name:"mousemove"},end:{name:"mouseup"}};var EO;(function(t){t[t.RightClick=2]="RightClick"})(EO||(EO={}));class Q1e extends cN{constructor(e){super(e,H1e,Lf(e.event.target))}}Q1e.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===EO.RightClick?!1:(r?.({event:n}),!0)}}];const _S={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class V1e extends cN{constructor(e){super(e,_S)}static setup(){return window.addEventListener(_S.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(_S.move.name,e)};function e(){}}}V1e.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;const{touches:s}=n;return s.length>1?!1:(r?.({event:n}),!0)}}];var A0;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(A0||(A0={}));var wy;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(wy||(wy={}));function U1e(t){let{acceleration:e,activator:n=A0.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:a=5,order:l=wy.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:h,delta:m,threshold:g}=t;const x=G1e({delta:m,disabled:!i}),[y,w]=s1e(),S=b.useRef({x:0,y:0}),k=b.useRef({x:0,y:0}),j=b.useMemo(()=>{switch(n){case A0.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case A0.DraggableRect:return s}},[n,s,c]),N=b.useRef(null),T=b.useCallback(()=>{const _=N.current;if(!_)return;const A=S.current.x*k.current.x,D=S.current.y*k.current.y;_.scrollBy(A,D)},[]),E=b.useMemo(()=>l===wy.TreeOrder?[...d].reverse():d,[l,d]);b.useEffect(()=>{if(!i||!d.length||!j){w();return}for(const _ of E){if(r?.(_)===!1)continue;const A=d.indexOf(_),D=h[A];if(!D)continue;const{direction:q,speed:B}=R1e(_,D,j,e,g);for(const H of["x","y"])x[H][q[H]]||(B[H]=0,q[H]=0);if(B.x>0||B.y>0){w(),N.current=_,y(T,a),S.current=B,k.current=q;return}}S.current={x:0,y:0},k.current={x:0,y:0},w()},[e,T,r,w,i,a,JSON.stringify(j),JSON.stringify(x),y,d,E,h,JSON.stringify(g)])}const W1e={x:{[bs.Backward]:!1,[bs.Forward]:!1},y:{[bs.Backward]:!1,[bs.Forward]:!1}};function G1e(t){let{delta:e,disabled:n}=t;const r=NO(e);return fg(s=>{if(n||!r||!s)return W1e;const i={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[bs.Backward]:s.x[bs.Backward]||i.x===-1,[bs.Forward]:s.x[bs.Forward]||i.x===1},y:{[bs.Backward]:s.y[bs.Backward]||i.y===-1,[bs.Forward]:s.y[bs.Forward]||i.y===1}}},[n,e,r])}function X1e(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return fg(s=>{var i;return e==null?null:(i=r??s)!=null?i:null},[r,e])}function Y1e(t,e){return b.useMemo(()=>t.reduce((n,r)=>{const{sensor:s}=r,i=s.activators.map(a=>({eventName:a.eventName,handler:e(a.handler,r)}));return[...n,...i]},[]),[t,e])}var xp;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(xp||(xp={}));var _O;(function(t){t.Optimized="optimized"})(_O||(_O={}));const mM=new Map;function K1e(t,e){let{dragging:n,dependencies:r,config:s}=e;const[i,a]=b.useState(null),{frequency:l,measure:c,strategy:d}=s,h=b.useRef(t),m=S(),g=mp(m),x=b.useCallback(function(k){k===void 0&&(k=[]),!g.current&&a(j=>j===null?k:j.concat(k.filter(N=>!j.includes(N))))},[g]),y=b.useRef(null),w=fg(k=>{if(m&&!n)return mM;if(!k||k===mM||h.current!==t||i!=null){const j=new Map;for(let N of t){if(!N)continue;if(i&&i.length>0&&!i.includes(N.id)&&N.rect.current){j.set(N.id,N.rect.current);continue}const T=N.node.current,E=T?new oN(c(T),T):null;N.rect.current=E,E&&j.set(N.id,E)}return j}return k},[t,i,n,m,c]);return b.useEffect(()=>{h.current=t},[t]),b.useEffect(()=>{m||x()},[n,m]),b.useEffect(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),b.useEffect(()=>{m||typeof l!="number"||y.current!==null||(y.current=setTimeout(()=>{x(),y.current=null},l))},[l,m,x,...r]),{droppableRects:w,measureDroppableContainers:x,measuringScheduled:i!=null};function S(){switch(d){case xp.Always:return!1;case xp.BeforeDragging:return n;default:return!n}}}function zQ(t,e){return fg(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function Z1e(t,e){return zQ(t,e)}function J1e(t){let{callback:e,disabled:n}=t;const r=iN(e),s=b.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return b.useEffect(()=>()=>s?.disconnect(),[s]),s}function Ib(t){let{callback:e,disabled:n}=t;const r=iN(e),s=b.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return b.useEffect(()=>()=>s?.disconnect(),[s]),s}function eve(t){return new oN(Bf(t),t)}function pM(t,e,n){e===void 0&&(e=eve);const[r,s]=b.useState(null);function i(){s(c=>{if(!t)return null;if(t.isConnected===!1){var d;return(d=c??n)!=null?d:null}const h=e(t);return JSON.stringify(c)===JSON.stringify(h)?c:h})}const a=J1e({callback(c){if(t)for(const d of c){const{type:h,target:m}=d;if(h==="childList"&&m instanceof HTMLElement&&m.contains(t)){i();break}}}}),l=Ib({callback:i});return $o(()=>{i(),t?(l?.observe(t),a?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),a?.disconnect())},[t]),r}function tve(t){const e=zQ(t);return TQ(t,e)}const gM=[];function nve(t){const e=b.useRef(t),n=fg(r=>t?r&&r!==gM&&t&&e.current&&t.parentNode===e.current.parentNode?r:zb(t):gM,[t]);return b.useEffect(()=>{e.current=t},[t]),n}function rve(t){const[e,n]=b.useState(null),r=b.useRef(t),s=b.useCallback(i=>{const a=TS(i.target);a&&n(l=>l?(l.set(a,TO(a)),new Map(l)):null)},[]);return b.useEffect(()=>{const i=r.current;if(t!==i){a(i);const l=t.map(c=>{const d=TS(c);return d?(d.addEventListener("scroll",s,{passive:!0}),[d,TO(d)]):null}).filter(c=>c!=null);n(l.length?new Map(l):null),r.current=t}return()=>{a(t),a(i)};function a(l){l.forEach(c=>{const d=TS(c);d?.removeEventListener("scroll",s)})}},[s,t]),b.useMemo(()=>t.length?e?Array.from(e.values()).reduce((i,a)=>qh(i,a),eo):DQ(t):eo,[t,e])}function xM(t,e){e===void 0&&(e=[]);const n=b.useRef(null);return b.useEffect(()=>{n.current=null},e),b.useEffect(()=>{const r=t!==eo;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?pp(t,n.current):eo}function sve(t){b.useEffect(()=>{if(!Pb)return;const e=t.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of e)n?.()}},t.map(e=>{let{sensor:n}=e;return n}))}function ive(t,e){return b.useMemo(()=>t.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=a=>{i(a,e)},n},{}),[t,e])}function IQ(t){return b.useMemo(()=>t?E1e(t):null,[t])}const vM=[];function ave(t,e){e===void 0&&(e=Bf);const[n]=t,r=IQ(n?_i(n):null),[s,i]=b.useState(vM);function a(){i(()=>t.length?t.map(c=>MQ(c)?r:new oN(e(c),c)):vM)}const l=Ib({callback:a});return $o(()=>{l?.disconnect(),a(),t.forEach(c=>l?.observe(c))},[t]),s}function ove(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return hg(e)?e:t}function lve(t){let{measure:e}=t;const[n,r]=b.useState(null),s=b.useCallback(d=>{for(const{target:h}of d)if(hg(h)){r(m=>{const g=e(h);return m?{...m,width:g.width,height:g.height}:g});break}},[e]),i=Ib({callback:s}),a=b.useCallback(d=>{const h=ove(d);i?.disconnect(),h&&i?.observe(h),r(h?e(h):null)},[e,i]),[l,c]=yy(a);return b.useMemo(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const cve=[{sensor:uN,options:{}},{sensor:lN,options:{}}],uve={current:{}},Nv={draggable:{measure:uM},droppable:{measure:uM,strategy:xp.WhileDragging,frequency:_O.Optimized},dragOverlay:{measure:Bf}};class M0 extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,r;return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const dve={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new M0,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:by},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Nv,measureDroppableContainers:by,windowRect:null,measuringScheduled:!1},hve={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:by,draggableNodes:new Map,over:null,measureDroppableContainers:by},Lb=b.createContext(hve),LQ=b.createContext(dve);function fve(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new M0}}}function mve(t,e){switch(e.type){case ds.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case ds.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case ds.DragEnd:case ds.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ds.RegisterDroppable:{const{element:n}=e,{id:r}=n,s=new M0(t.droppable.containers);return s.set(r,n),{...t,droppable:{...t.droppable,containers:s}}}case ds.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=e,i=t.droppable.containers.get(n);if(!i||r!==i.key)return t;const a=new M0(t.droppable.containers);return a.set(n,{...i,disabled:s}),{...t,droppable:{...t.droppable,containers:a}}}case ds.UnregisterDroppable:{const{id:n,key:r}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const i=new M0(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function pve(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:s}=b.useContext(Lb),i=NO(r),a=NO(n?.id);return b.useEffect(()=>{if(!e&&!r&&i&&a!=null){if(!aN(i)||document.activeElement===i.target)return;const l=s.get(a);if(!l)return;const{activatorNode:c,node:d}=l;if(!c.current&&!d.current)return;requestAnimationFrame(()=>{for(const h of[c.current,d.current]){if(!h)continue;const m=o1e(h);if(m){m.focus();break}}})}},[r,e,s,a,i]),null}function gve(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((s,i)=>i({transform:s,...r}),n):n}function xve(t){return b.useMemo(()=>({draggable:{...Nv.draggable,...t?.draggable},droppable:{...Nv.droppable,...t?.droppable},dragOverlay:{...Nv.dragOverlay,...t?.dragOverlay}}),[t?.draggable,t?.droppable,t?.dragOverlay])}function vve(t){let{activeNode:e,measure:n,initialRect:r,config:s=!0}=t;const i=b.useRef(!1),{x:a,y:l}=typeof s=="boolean"?{x:s,y:s}:s;$o(()=>{if(!a&&!l||!e){i.current=!1;return}if(i.current||!r)return;const d=e?.node.current;if(!d||d.isConnected===!1)return;const h=n(d),m=TQ(h,r);if(a||(m.x=0),l||(m.y=0),i.current=!0,Math.abs(m.x)>0||Math.abs(m.y)>0){const g=EQ(d);g&&g.scrollBy({top:m.y,left:m.x})}},[e,a,l,r,n])}const BQ=b.createContext({...eo,scaleX:1,scaleY:1});var Ic;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Ic||(Ic={}));const yve=b.memo(function(e){var n,r,s,i;let{id:a,accessibility:l,autoScroll:c=!0,children:d,sensors:h=cve,collisionDetection:m=S1e,measuring:g,modifiers:x,...y}=e;const w=b.useReducer(mve,void 0,fve),[S,k]=w,[j,N]=f1e(),[T,E]=b.useState(Ic.Uninitialized),_=T===Ic.Initialized,{draggable:{active:A,nodes:D,translate:q},droppable:{containers:B}}=S,H=A!=null?D.get(A):null,W=b.useRef({initial:null,translated:null}),ee=b.useMemo(()=>{var Gt;return A!=null?{id:A,data:(Gt=H?.data)!=null?Gt:uve,rect:W}:null},[A,H]),I=b.useRef(null),[V,L]=b.useState(null),[$,K]=b.useState(null),Y=mp(y,Object.values(y)),R=mg("DndDescribedBy",a),ie=b.useMemo(()=>B.getEnabled(),[B]),X=xve(g),{droppableRects:z,measureDroppableContainers:U,measuringScheduled:te}=K1e(ie,{dragging:_,dependencies:[q.x,q.y],config:X.droppable}),ne=X1e(D,A),G=b.useMemo(()=>$?CO($):null,[$]),se=Wt(),re=Z1e(ne,X.draggable.measure);vve({activeNode:A!=null?D.get(A):null,config:se.layoutShiftCompensation,initialRect:re,measure:X.draggable.measure});const ae=pM(ne,X.draggable.measure,re),_e=pM(ne?ne.parentElement:null),Be=b.useRef({activatorEvent:null,active:null,activeNode:ne,collisionRect:null,collisions:null,droppableRects:z,draggableNodes:D,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ye=B.getNodeFor((n=Be.current.over)==null?void 0:n.id),Je=lve({measure:X.dragOverlay.measure}),Oe=(r=Je.nodeRef.current)!=null?r:ne,Ve=_?(s=Je.rect)!=null?s:ae:null,Ue=!!(Je.nodeRef.current&&Je.rect),$e=tve(Ue?null:ae),jt=IQ(Oe?_i(Oe):null),vt=nve(_?Ye??ne:null),$n=ave(vt),qt=gve(x,{transform:{x:q.x-$e.x,y:q.y-$e.y,scaleX:1,scaleY:1},activatorEvent:$,active:ee,activeNodeRect:ae,containerNodeRect:_e,draggingNodeRect:Ve,over:Be.current.over,overlayNodeRect:Je.rect,scrollableAncestors:vt,scrollableAncestorRects:$n,windowRect:jt}),un=G?qh(G,q):null,Mt=rve(vt),ct=xM(Mt),Ne=xM(Mt,[ae]),ze=qh(qt,ct),rt=Ve?j1e(Ve,qt):null,bt=ee&&rt?m({active:ee,collisionRect:rt,droppableRects:z,droppableContainers:ie,pointerCoordinates:un}):null,zt=CQ(bt,"id"),[Rt,Hn]=b.useState(null),We=Ue?qt:qh(qt,Ne),ot=k1e(We,(i=Rt?.rect)!=null?i:null,ae),dn=b.useRef(null),Pt=b.useCallback((Gt,lt)=>{let{sensor:ve,options:He}=lt;if(I.current==null)return;const ht=D.get(I.current);if(!ht)return;const vn=Gt.nativeEvent,Qn=new ve({active:I.current,activeNode:ht,event:vn,options:He,context:Be,onAbort(ar){if(!D.get(ar))return;const{onDragAbort:vs}=Y.current,js={id:ar};vs?.(js),j({type:"onDragAbort",event:js})},onPending(ar,xs,vs,js){if(!D.get(ar))return;const{onDragPending:Ie}=Y.current,Et={id:ar,constraint:xs,initialCoordinates:vs,offset:js};Ie?.(Et),j({type:"onDragPending",event:Et})},onStart(ar){const xs=I.current;if(xs==null)return;const vs=D.get(xs);if(!vs)return;const{onDragStart:js}=Y.current,ge={activatorEvent:vn,active:{id:xs,data:vs.data,rect:W}};ya.unstable_batchedUpdates(()=>{js?.(ge),E(Ic.Initializing),k({type:ds.DragStart,initialCoordinates:ar,active:xs}),j({type:"onDragStart",event:ge}),L(dn.current),K(vn)})},onMove(ar){k({type:ds.DragMove,coordinates:ar})},onEnd:fr(ds.DragEnd),onCancel:fr(ds.DragCancel)});dn.current=Qn;function fr(ar){return async function(){const{active:vs,collisions:js,over:ge,scrollAdjustedTranslate:Ie}=Be.current;let Et=null;if(vs&&Ie){const{cancelDrop:kn}=Y.current;Et={activatorEvent:vn,active:vs,collisions:js,delta:Ie,over:ge},ar===ds.DragEnd&&typeof kn=="function"&&await Promise.resolve(kn(Et))&&(ar=ds.DragCancel)}I.current=null,ya.unstable_batchedUpdates(()=>{k({type:ar}),E(Ic.Uninitialized),Hn(null),L(null),K(null),dn.current=null;const kn=ar===ds.DragEnd?"onDragEnd":"onDragCancel";if(Et){const Hr=Y.current[kn];Hr?.(Et),j({type:kn,event:Et})}})}}},[D]),xn=b.useCallback((Gt,lt)=>(ve,He)=>{const ht=ve.nativeEvent,vn=D.get(He);if(I.current!==null||!vn||ht.dndKit||ht.defaultPrevented)return;const Qn={active:vn};Gt(ve,lt.options,Qn)===!0&&(ht.dndKit={capturedBy:lt.sensor},I.current=He,Pt(ve,lt))},[D,Pt]),dt=Y1e(h,xn);sve(h),$o(()=>{ae&&T===Ic.Initializing&&E(Ic.Initialized)},[ae,T]),b.useEffect(()=>{const{onDragMove:Gt}=Y.current,{active:lt,activatorEvent:ve,collisions:He,over:ht}=Be.current;if(!lt||!ve)return;const vn={active:lt,activatorEvent:ve,collisions:He,delta:{x:ze.x,y:ze.y},over:ht};ya.unstable_batchedUpdates(()=>{Gt?.(vn),j({type:"onDragMove",event:vn})})},[ze.x,ze.y]),b.useEffect(()=>{const{active:Gt,activatorEvent:lt,collisions:ve,droppableContainers:He,scrollAdjustedTranslate:ht}=Be.current;if(!Gt||I.current==null||!lt||!ht)return;const{onDragOver:vn}=Y.current,Qn=He.get(zt),fr=Qn&&Qn.rect.current?{id:Qn.id,rect:Qn.rect.current,data:Qn.data,disabled:Qn.disabled}:null,ar={active:Gt,activatorEvent:lt,collisions:ve,delta:{x:ht.x,y:ht.y},over:fr};ya.unstable_batchedUpdates(()=>{Hn(fr),vn?.(ar),j({type:"onDragOver",event:ar})})},[zt]),$o(()=>{Be.current={activatorEvent:$,active:ee,activeNode:ne,collisionRect:rt,collisions:bt,droppableRects:z,draggableNodes:D,draggingNode:Oe,draggingNodeRect:Ve,droppableContainers:B,over:Rt,scrollableAncestors:vt,scrollAdjustedTranslate:ze},W.current={initial:Ve,translated:rt}},[ee,ne,bt,rt,D,Oe,Ve,z,B,Rt,vt,ze]),U1e({...se,delta:q,draggingRect:rt,pointerCoordinates:un,scrollableAncestors:vt,scrollableAncestorRects:$n});const rn=b.useMemo(()=>({active:ee,activeNode:ne,activeNodeRect:ae,activatorEvent:$,collisions:bt,containerNodeRect:_e,dragOverlay:Je,draggableNodes:D,droppableContainers:B,droppableRects:z,over:Rt,measureDroppableContainers:U,scrollableAncestors:vt,scrollableAncestorRects:$n,measuringConfiguration:X,measuringScheduled:te,windowRect:jt}),[ee,ne,ae,$,bt,_e,Je,D,B,z,Rt,U,vt,$n,X,te,jt]),wt=b.useMemo(()=>({activatorEvent:$,activators:dt,active:ee,activeNodeRect:ae,ariaDescribedById:{draggable:R},dispatch:k,draggableNodes:D,over:Rt,measureDroppableContainers:U}),[$,dt,ee,ae,k,R,D,Rt,U]);return oe.createElement(OQ.Provider,{value:N},oe.createElement(Lb.Provider,{value:wt},oe.createElement(LQ.Provider,{value:rn},oe.createElement(BQ.Provider,{value:ot},d)),oe.createElement(pve,{disabled:l?.restoreFocus===!1})),oe.createElement(g1e,{...l,hiddenTextDescribedById:R}));function Wt(){const Gt=V?.autoScrollEnabled===!1,lt=typeof c=="object"?c.enabled===!1:c===!1,ve=_&&!Gt&&!lt;return typeof c=="object"?{...c,enabled:ve}:{enabled:ve}}}),bve=b.createContext(null),yM="button",wve="Draggable";function Sve(t){let{id:e,data:n,disabled:r=!1,attributes:s}=t;const i=mg(wve),{activators:a,activatorEvent:l,active:c,activeNodeRect:d,ariaDescribedById:h,draggableNodes:m,over:g}=b.useContext(Lb),{role:x=yM,roleDescription:y="draggable",tabIndex:w=0}=s??{},S=c?.id===e,k=b.useContext(S?BQ:bve),[j,N]=yy(),[T,E]=yy(),_=ive(a,e),A=mp(n);$o(()=>(m.set(e,{id:e,key:i,node:j,activatorNode:T,data:A}),()=>{const q=m.get(e);q&&q.key===i&&m.delete(e)}),[m,e]);const D=b.useMemo(()=>({role:x,tabIndex:w,"aria-disabled":r,"aria-pressed":S&&x===yM?!0:void 0,"aria-roledescription":y,"aria-describedby":h.draggable}),[r,x,w,S,y,h.draggable]);return{active:c,activatorEvent:l,activeNodeRect:d,attributes:D,isDragging:S,listeners:r?void 0:_,node:j,over:g,setNodeRef:N,setActivatorNodeRef:E,transform:k}}function kve(){return b.useContext(LQ)}const Ove="Droppable",jve={timeout:25};function Nve(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:s}=t;const i=mg(Ove),{active:a,dispatch:l,over:c,measureDroppableContainers:d}=b.useContext(Lb),h=b.useRef({disabled:n}),m=b.useRef(!1),g=b.useRef(null),x=b.useRef(null),{disabled:y,updateMeasurementsFor:w,timeout:S}={...jve,...s},k=mp(w??r),j=b.useCallback(()=>{if(!m.current){m.current=!0;return}x.current!=null&&clearTimeout(x.current),x.current=setTimeout(()=>{d(Array.isArray(k.current)?k.current:[k.current]),x.current=null},S)},[S]),N=Ib({callback:j,disabled:y||!a}),T=b.useCallback((D,q)=>{N&&(q&&(N.unobserve(q),m.current=!1),D&&N.observe(D))},[N]),[E,_]=yy(T),A=mp(e);return b.useEffect(()=>{!N||!E.current||(N.disconnect(),m.current=!1,N.observe(E.current))},[E,N]),b.useEffect(()=>(l({type:ds.RegisterDroppable,element:{id:r,key:i,disabled:n,node:E,rect:g,data:A}}),()=>l({type:ds.UnregisterDroppable,key:i,id:r})),[r]),b.useEffect(()=>{n!==h.current.disabled&&(l({type:ds.SetDroppableDisabled,id:r,key:i,disabled:n}),h.current.disabled=n)},[r,i,n,l]),{active:a,rect:g,isOver:c?.id===r,node:E,over:c,setNodeRef:_}}function dN(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function Cve(t,e){return t.reduce((n,r,s)=>{const i=e.get(r);return i&&(n[s]=i),n},Array(t.length))}function _1(t){return t!==null&&t>=0}function Tve(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n{var e;let{rects:n,activeNodeRect:r,activeIndex:s,overIndex:i,index:a}=t;const l=(e=n[s])!=null?e:r;if(!l)return null;const c=Ave(n,a,s);if(a===s){const d=n[i];return d?{x:ss&&a<=i?{x:-l.width-c,y:0,...A1}:a=i?{x:l.width+c,y:0,...A1}:{x:0,y:0,...A1}};function Ave(t,e,n){const r=t[e],s=t[e-1],i=t[e+1];return!r||!s&&!i?0:n{let{rects:e,activeIndex:n,overIndex:r,index:s}=t;const i=dN(e,r,n),a=e[s],l=i[s];return!l||!a?null:{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}},qQ="Sortable",$Q=oe.createContext({activeIndex:-1,containerId:qQ,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:FQ,disabled:{draggable:!1,droppable:!1}});function Mve(t){let{children:e,id:n,items:r,strategy:s=FQ,disabled:i=!1}=t;const{active:a,dragOverlay:l,droppableRects:c,over:d,measureDroppableContainers:h}=kve(),m=mg(qQ,n),g=l.rect!==null,x=b.useMemo(()=>r.map(_=>typeof _=="object"&&"id"in _?_.id:_),[r]),y=a!=null,w=a?x.indexOf(a.id):-1,S=d?x.indexOf(d.id):-1,k=b.useRef(x),j=!Tve(x,k.current),N=S!==-1&&w===-1||j,T=Eve(i);$o(()=>{j&&y&&h(x)},[j,x,y,h]),b.useEffect(()=>{k.current=x},[x]);const E=b.useMemo(()=>({activeIndex:w,containerId:m,disabled:T,disableTransforms:N,items:x,overIndex:S,useDragOverlay:g,sortedRects:Cve(x,c),strategy:s}),[w,m,T.draggable,T.droppable,N,x,S,c,g,s]);return oe.createElement($Q.Provider,{value:E},e)}const Rve=t=>{let{id:e,items:n,activeIndex:r,overIndex:s}=t;return dN(n,r,s).indexOf(e)},Dve=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:s,items:i,newIndex:a,previousItems:l,previousContainerId:c,transition:d}=t;return!d||!r||l!==i&&s===a?!1:n?!0:a!==s&&e===c},Pve={duration:200,easing:"ease"},HQ="transform",zve=gp.Transition.toString({property:HQ,duration:0,easing:"linear"}),Ive={roleDescription:"sortable"};function Lve(t){let{disabled:e,index:n,node:r,rect:s}=t;const[i,a]=b.useState(null),l=b.useRef(n);return $o(()=>{if(!e&&n!==l.current&&r.current){const c=s.current;if(c){const d=Bf(r.current,{ignoreTransform:!0}),h={x:c.left-d.left,y:c.top-d.top,scaleX:c.width/d.width,scaleY:c.height/d.height};(h.x||h.y)&&a(h)}}n!==l.current&&(l.current=n)},[e,n,r,s]),b.useEffect(()=>{i&&a(null)},[i]),i}function Bve(t){let{animateLayoutChanges:e=Dve,attributes:n,disabled:r,data:s,getNewIndex:i=Rve,id:a,strategy:l,resizeObserverConfig:c,transition:d=Pve}=t;const{items:h,containerId:m,activeIndex:g,disabled:x,disableTransforms:y,sortedRects:w,overIndex:S,useDragOverlay:k,strategy:j}=b.useContext($Q),N=Fve(r,x),T=h.indexOf(a),E=b.useMemo(()=>({sortable:{containerId:m,index:T,items:h},...s}),[m,s,T,h]),_=b.useMemo(()=>h.slice(h.indexOf(a)),[h,a]),{rect:A,node:D,isOver:q,setNodeRef:B}=Nve({id:a,data:E,disabled:N.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...c}}),{active:H,activatorEvent:W,activeNodeRect:ee,attributes:I,setNodeRef:V,listeners:L,isDragging:$,over:K,setActivatorNodeRef:Y,transform:R}=Sve({id:a,data:E,attributes:{...Ive,...n},disabled:N.draggable}),ie=r1e(B,V),X=!!H,z=X&&!y&&_1(g)&&_1(S),U=!k&&$,te=U&&z?R:null,G=z?te??(l??j)({rects:w,activeNodeRect:ee,activeIndex:g,overIndex:S,index:T}):null,se=_1(g)&&_1(S)?i({id:a,items:h,activeIndex:g,overIndex:S}):T,re=H?.id,ae=b.useRef({activeId:re,items:h,newIndex:se,containerId:m}),_e=h!==ae.current.items,Be=e({active:H,containerId:m,isDragging:$,isSorting:X,id:a,index:T,items:h,newIndex:ae.current.newIndex,previousItems:ae.current.items,previousContainerId:ae.current.containerId,transition:d,wasDragging:ae.current.activeId!=null}),Ye=Lve({disabled:!Be,index:T,node:D,rect:A});return b.useEffect(()=>{X&&ae.current.newIndex!==se&&(ae.current.newIndex=se),m!==ae.current.containerId&&(ae.current.containerId=m),h!==ae.current.items&&(ae.current.items=h)},[X,se,m,h]),b.useEffect(()=>{if(re===ae.current.activeId)return;if(re!=null&&ae.current.activeId==null){ae.current.activeId=re;return}const Oe=setTimeout(()=>{ae.current.activeId=re},50);return()=>clearTimeout(Oe)},[re]),{active:H,activeIndex:g,attributes:I,data:E,rect:A,index:T,newIndex:se,items:h,isOver:q,isSorting:X,isDragging:$,listeners:L,node:D,overIndex:S,over:K,setNodeRef:ie,setActivatorNodeRef:Y,setDroppableNodeRef:B,setDraggableNodeRef:V,transform:Ye??G,transition:Je()};function Je(){if(Ye||_e&&ae.current.newIndex===T)return zve;if(!(U&&!aN(W)||!d)&&(X||Be))return gp.Transition.toString({...d,property:HQ})}}function Fve(t,e){var n,r;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t?.draggable)!=null?n:e.draggable,droppable:(r=t?.droppable)!=null?r:e.droppable}}function Sy(t){if(!t)return!1;const e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const qve=[jn.Down,jn.Right,jn.Up,jn.Left],$ve=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:i,over:a,scrollableAncestors:l}}=e;if(qve.includes(t.code)){if(t.preventDefault(),!n||!r)return;const c=[];i.getEnabled().forEach(m=>{if(!m||m!=null&&m.disabled)return;const g=s.get(m.id);if(g)switch(t.code){case jn.Down:r.topg.top&&c.push(m);break;case jn.Left:r.left>g.left&&c.push(m);break;case jn.Right:r.left1&&(h=d[1].id),h!=null){const m=i.get(n.id),g=i.get(h),x=g?s.get(g.id):null,y=g?.node.current;if(y&&x&&m&&g){const S=zb(y).some((_,A)=>l[A]!==_),k=QQ(m,g),j=Hve(m,g),N=S||!k?{x:0,y:0}:{x:j?r.width-x.width:0,y:j?r.height-x.height:0},T={x:x.left,y:x.top};return N.x&&N.y?T:pp(T,N)}}}};function QQ(t,e){return!Sy(t)||!Sy(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function Hve(t,e){return!Sy(t)||!Sy(e)||!QQ(t,e)?!1:t.data.current.sortable.index{h.stopPropagation(),n(t)}})]})})}function Vve({options:t,selected:e,onChange:n,placeholder:r="选择选项...",emptyText:s="未找到选项",className:i}){const[a,l]=b.useState(!1),c=x1e(oM(uN,{activationConstraint:{distance:8}}),oM(lN,{coordinateGetter:$ve})),d=g=>{e.includes(g)?n(e.filter(x=>x!==g)):n([...e,g])},h=g=>{n(e.filter(x=>x!==g))},m=g=>{const{active:x,over:y}=g;if(y&&x.id!==y.id){const w=e.indexOf(x.id),S=e.indexOf(y.id);n(dN(e,w,S))}};return o.jsxs(Bo,{open:a,onOpenChange:l,children:[o.jsx(Fo,{asChild:!0,children:o.jsxs(ue,{variant:"outline",role:"combobox","aria-expanded":a,className:xe("w-full justify-between min-h-10 h-auto",i),children:[o.jsx(yve,{sensors:c,collisionDetection:y1e,onDragEnd:m,children:o.jsx(Mve,{items:e,strategy:_ve,children:o.jsx("div",{className:"flex gap-1 flex-wrap flex-1",children:e.length===0?o.jsx("span",{className:"text-muted-foreground",children:r}):e.map(g=>{const x=t.find(y=>y.value===g);return o.jsx(Qve,{value:g,label:x?.label||g,onRemove:h},g)})})})}),o.jsx(Lj,{className:"ml-2 h-4 w-4 shrink-0 opacity-50",strokeWidth:2,fill:"none"})]})}),o.jsx(Ka,{className:"w-full p-0",align:"start",children:o.jsxs(Tb,{children:[o.jsx(Eb,{placeholder:"搜索...",className:"h-9"}),o.jsxs(_b,{children:[o.jsx(Ab,{children:s}),o.jsx(up,{children:t.map(g=>{const x=e.includes(g.value);return o.jsxs(dp,{value:g.value,onSelect:()=>d(g.value),children:[o.jsx("div",{className:xe("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",x?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:o.jsx(zo,{className:"h-3 w-3",strokeWidth:2,fill:"none"})}),o.jsx("span",{children:g.label})]},g.value)})})]})]})})]})}const bM=new Map,Uve=300*1e3;function Wve(){const[t,e]=b.useState([]),[n,r]=b.useState([]),[s,i]=b.useState([]),[a,l]=b.useState([]),[c,d]=b.useState(null),[h,m]=b.useState(!0),[g,x]=b.useState(!1),[y,w]=b.useState(!1),[S,k]=b.useState(!1),[j,N]=b.useState(!1),[T,E]=b.useState(!1),[_,A]=b.useState(!1),[D,q]=b.useState(null),[B,H]=b.useState(null),[W,ee]=b.useState(!1),[I,V]=b.useState(null),[L,$]=b.useState(""),[K,Y]=b.useState(new Set),[R,ie]=b.useState(!1),[X,z]=b.useState(1),[U,te]=b.useState(20),[ne,G]=b.useState(""),[se,re]=b.useState([]),[ae,_e]=b.useState(!1),[Be,Ye]=b.useState(null),[Je,Oe]=b.useState(!1),[Ve,Ue]=b.useState(null),{toast:$e}=Lr(),jt=na(),{registerTour:vt,startTour:$n,state:qt,goToStep:un}=nN(),Mt=b.useRef(null),ct=b.useRef(null),Ne=b.useRef(!0);b.useEffect(()=>{vt(Rl,bQ)},[vt]),b.useEffect(()=>{if(qt.activeTourId===Rl&&qt.isRunning){const ge=wQ[qt.stepIndex];ge&&!window.location.pathname.endsWith(ge.replace("/config/",""))&&jt({to:ge})}},[qt.stepIndex,qt.activeTourId,qt.isRunning,jt]);const ze=b.useRef(qt.stepIndex);b.useEffect(()=>{if(qt.activeTourId===Rl&&qt.isRunning){const ge=ze.current,Ie=qt.stepIndex;ge>=12&&ge<=17&&Ie<12&&A(!1),ze.current=Ie}},[qt.stepIndex,qt.activeTourId,qt.isRunning]),b.useEffect(()=>{if(qt.activeTourId!==Rl||!qt.isRunning)return;const ge=Ie=>{const Et=Ie.target,kn=qt.stepIndex;kn===2&&Et.closest('[data-tour="add-provider-button"]')?setTimeout(()=>un(3),300):kn===9&&Et.closest('[data-tour="provider-cancel-button"]')?setTimeout(()=>un(10),300):kn===11&&Et.closest('[data-tour="add-model-button"]')?setTimeout(()=>un(12),300):kn===17&&Et.closest('[data-tour="model-cancel-button"]')?setTimeout(()=>un(18),300):kn===18&&Et.closest('[data-tour="tasks-tab-trigger"]')&&setTimeout(()=>un(19),300)};return document.addEventListener("click",ge,!0),()=>document.removeEventListener("click",ge,!0)},[qt,un]);const rt=()=>{$n(Rl)};b.useEffect(()=>{bt()},[]);const bt=async()=>{try{m(!0);const ge=await Dh(),Ie=ge.models||[];e(Ie),l(Ie.map(kn=>kn.name));const Et=ge.api_providers||[];r(Et.map(kn=>kn.name)),i(Et),d(ge.model_task_config||null),k(!1),Ne.current=!1}catch(ge){console.error("加载配置失败:",ge)}finally{m(!1)}},zt=b.useCallback(ge=>s.find(Ie=>Ie.name===ge),[s]),Rt=b.useCallback(async(ge,Ie=!1)=>{const Et=zt(ge);if(!Et?.base_url){re([]),Ue(null),Ye('提供商配置不完整,请先在"模型提供商配置"中配置');return}if(!Et.api_key){re([]),Ue(null),Ye('该提供商未配置 API Key,请先在"模型提供商配置"中填写');return}const kn=t1e(Et.base_url);if(Ue(kn),!kn?.modelFetcher){re([]),Ye(null);return}const Hr=`${ge}:${Et.base_url}`,Mr=bM.get(Hr);if(!Ie&&Mr&&Date.now()-Mr.timestamp{_&&D?.api_provider&&Rt(D.api_provider)},[_,D?.api_provider,Rt]);const Hn=async()=>{try{N(!0),cb().catch(()=>{}),E(!0)}catch(ge){console.error("重启失败:",ge),E(!1),$e({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),N(!1)}},We=async()=>{try{x(!0),Mt.current&&clearTimeout(Mt.current),ct.current&&clearTimeout(ct.current);const ge=await Dh();ge.models=t,ge.model_task_config=c,await Uv(ge),k(!1),$e({title:"保存成功",description:"正在重启麦麦..."}),await Hn()}catch(ge){console.error("保存配置失败:",ge),$e({title:"保存失败",description:ge.message,variant:"destructive"}),x(!1)}},ot=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},dn=()=>{E(!1),N(!1),$e({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},Pt=b.useCallback(async ge=>{if(!Ne.current)try{w(!0),await bk("models",ge),k(!1)}catch(Ie){console.error("自动保存模型列表失败:",Ie),k(!0)}finally{w(!1)}},[]),xn=b.useCallback(async ge=>{if(!Ne.current)try{w(!0),await bk("model_task_config",ge),k(!1)}catch(Ie){console.error("自动保存任务配置失败:",Ie),k(!0)}finally{w(!1)}},[]);b.useEffect(()=>{if(!Ne.current)return k(!0),Mt.current&&clearTimeout(Mt.current),Mt.current=setTimeout(()=>{Pt(t)},2e3),()=>{Mt.current&&clearTimeout(Mt.current)}},[t,Pt]),b.useEffect(()=>{if(!(Ne.current||!c))return k(!0),ct.current&&clearTimeout(ct.current),ct.current=setTimeout(()=>{xn(c)},2e3),()=>{ct.current&&clearTimeout(ct.current)}},[c,xn]);const dt=async()=>{try{x(!0),Mt.current&&clearTimeout(Mt.current),ct.current&&clearTimeout(ct.current);const ge=await Dh();ge.models=t,ge.model_task_config=c,await Uv(ge),k(!1),$e({title:"保存成功",description:"模型配置已保存"}),await bt()}catch(ge){console.error("保存配置失败:",ge),$e({title:"保存失败",description:ge.message,variant:"destructive"})}finally{x(!1)}},rn=(ge,Ie)=>{q(ge||{model_identifier:"",name:"",api_provider:n[0]||"",price_in:0,price_out:0,force_stream_mode:!1,extra_params:{}}),H(Ie),A(!0)},wt=()=>{if(!D)return;const ge={...D,price_in:D.price_in??0,price_out:D.price_out??0};let Ie;B!==null?(Ie=[...t],Ie[B]=ge):Ie=[...t,ge],e(Ie),l(Ie.map(Et=>Et.name)),A(!1),q(null),H(null)},Wt=ge=>{if(!ge&&D){const Ie={...D,price_in:D.price_in??0,price_out:D.price_out??0};q(Ie)}A(ge)},Gt=ge=>{V(ge),ee(!0)},lt=()=>{if(I!==null){const ge=t.filter((Ie,Et)=>Et!==I);e(ge),l(ge.map(Ie=>Ie.name)),$e({title:"删除成功",description:"模型已从列表中移除"})}ee(!1),V(null)},ve=ge=>{const Ie=new Set(K);Ie.has(ge)?Ie.delete(ge):Ie.add(ge),Y(Ie)},He=()=>{if(K.size===fr.length)Y(new Set);else{const ge=fr.map((Ie,Et)=>t.findIndex(kn=>kn===fr[Et]));Y(new Set(ge))}},ht=()=>{if(K.size===0){$e({title:"提示",description:"请先选择要删除的模型",variant:"default"});return}ie(!0)},vn=()=>{const ge=t.filter((Ie,Et)=>!K.has(Et));e(ge),l(ge.map(Ie=>Ie.name)),Y(new Set),ie(!1),$e({title:"批量删除成功",description:`已删除 ${K.size} 个模型`})},Qn=(ge,Ie,Et)=>{c&&d({...c,[ge]:{...c[ge],[Ie]:Et}})},fr=t.filter(ge=>{if(!L)return!0;const Ie=L.toLowerCase();return ge.name.toLowerCase().includes(Ie)||ge.model_identifier.toLowerCase().includes(Ie)||ge.api_provider.toLowerCase().includes(Ie)}),ar=Math.ceil(fr.length/U),xs=fr.slice((X-1)*U,X*U),vs=()=>{const ge=parseInt(ne);ge>=1&&ge<=ar&&(z(ge),G(""))},js=ge=>c?[c.utils?.model_list||[],c.utils_small?.model_list||[],c.tool_use?.model_list||[],c.replyer?.model_list||[],c.planner?.model_list||[],c.vlm?.model_list||[],c.voice?.model_list||[],c.embedding?.model_list||[],c.lpmm_entity_extract?.model_list||[],c.lpmm_rdf_build?.model_list||[],c.lpmm_qa?.model_list||[]].some(Et=>Et.includes(ge)):!1;return h?o.jsx(pn,{className:"h-full",children:o.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):o.jsx(pn,{className:"h-full",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型管理与分配"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"添加模型并为模型分配功能"})]}),o.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[o.jsxs(ue,{onClick:dt,disabled:g||y||!S||j,size:"sm",variant:"outline",className:"flex-1 sm:flex-none sm:min-w-[120px]",children:[o.jsx(zp,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),g?"保存中...":y?"自动保存中...":S?"保存配置":"已保存"]}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsxs(ue,{disabled:g||y||j,size:"sm",className:"flex-1 sm:flex-none sm:min-w-[120px]",children:[o.jsx(Dp,{className:"mr-2 h-4 w-4"}),j?"重启中...":S?"保存并重启":"重启麦麦"]})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认重启麦麦?"}),o.jsx(zn,{className:"space-y-3",asChild:!0,children:o.jsxs("div",{children:[o.jsx("p",{children:S?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"}),o.jsxs(ba,{className:"border-yellow-500/50 bg-yellow-500/10",children:[o.jsx(Xi,{className:"h-4 w-4 text-yellow-600"}),o.jsxs(wa,{className:"text-yellow-900 dark:text-yellow-100",children:[o.jsx("strong",{children:"重要提示:"}),"由于技术原因,使用重启功能后,将无法再使用 ",o.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。",o.jsxs(Er,{children:[o.jsx(Of,{asChild:!0,children:o.jsxs("button",{className:"ml-1 text-yellow-700 dark:text-yellow-300 underline hover:text-yellow-800 dark:hover:text-yellow-200 inline-flex items-center gap-1",children:[o.jsx(Zy,{className:"h-3 w-3"}),"如何结束程序?"]})}),o.jsxs(wr,{className:"max-w-2xl",children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"如何结束使用重启功能后的麦麦程序"}),o.jsx(Xr,{children:"由于重启功能会使程序脱离终端控制,需要通过系统命令来结束进程"})]}),o.jsxs(Yi,{defaultValue:"windows",className:"w-full",children:[o.jsxs(ji,{className:"grid w-full grid-cols-3",children:[o.jsx(Bt,{value:"windows",children:"Windows"}),o.jsx(Bt,{value:"macos",children:"macOS"}),o.jsx(Bt,{value:"linux",children:"Linux"})]}),o.jsxs(ln,{value:"windows",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法一:使用任务管理器"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Ctrl + Shift + Esc"})," 打开任务管理器"]}),o.jsxs("li",{children:['在"进程"或"详细信息"标签页中找到 ',o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"python.exe"})]}),o.jsx("li",{children:'右键点击并选择"结束任务"'})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法二:使用命令行"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开 PowerShell 或命令提示符,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:'Get-Process python | Where-Object {$_.MainWindowTitle -eq ""}'}),o.jsx("p",{className:"mt-2",children:"# 结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"Stop-Process -Name python -Force"})]})]})]}),o.jsxs(ln,{value:"macos",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法一:使用活动监视器"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Cmd + Space"}),' 打开 Spotlight,搜索"活动监视器"']}),o.jsxs("li",{children:["在进程列表中找到 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Python"})]}),o.jsx("li",{children:"选中后点击左上角的 X 按钮结束进程"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法二:使用终端"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:"ps aux | grep python | grep -v grep"}),o.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),o.jsx("p",{children:"kill -9 "}),o.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"pkill -9 python"})]})]})]}),o.jsxs(ln,{value:"linux",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"使用终端命令"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:"ps aux | grep python | grep -v grep"}),o.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),o.jsx("p",{children:"kill -9 "}),o.jsx("p",{className:"mt-2",children:"# 或使用 pkill 按名称结束"}),o.jsx("p",{children:'pkill -9 -f "bot.py"'}),o.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"pkill -9 python"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"使用 htop(如已安装)"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["在终端输入 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"htop"})]}),o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F3"})," 搜索 python"]}),o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F9"})," 发送信号,选择 SIGKILL"]})]})]})]})]}),o.jsx(fs,{children:o.jsx(e6,{asChild:!0,children:o.jsx(ue,{variant:"outline",children:"关闭"})})})]})]})]})]})]})})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:S?We:Hn,children:S?"保存并重启":"确认重启"})]})]})]})]})]}),o.jsxs(ba,{children:[o.jsx(Xi,{className:"h-4 w-4"}),o.jsxs(wa,{children:["配置更新后需要",o.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),o.jsxs(ba,{className:"hidden lg:flex border-primary/30 bg-primary/5 cursor-pointer hover:bg-primary/10 transition-colors",onClick:rt,children:[o.jsx(Zee,{className:"h-4 w-4 text-primary"}),o.jsxs(wa,{className:"flex items-center justify-between",children:[o.jsxs("span",{children:[o.jsx("strong",{className:"text-primary",children:"新手引导:"}),"不知道如何配置模型?点击这里开始学习如何为麦麦的组件分配模型。"]}),o.jsx(ue,{variant:"outline",size:"sm",className:"ml-4 shrink-0",children:"开始引导"})]})]}),o.jsxs(Yi,{defaultValue:"models",className:"w-full",children:[o.jsxs(ji,{className:"grid w-full max-w-full sm:max-w-md grid-cols-2",children:[o.jsx(Bt,{value:"models",children:"添加模型"}),o.jsx(Bt,{value:"tasks","data-tour":"tasks-tab-trigger",children:"为模型分配功能"})]}),o.jsxs(ln,{value:"models",className:"space-y-4 mt-0",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-2",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:"配置可用的模型列表"}),o.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[K.size>0&&o.jsxs(ue,{onClick:ht,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[o.jsx(Cn,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",K.size,")"]}),o.jsxs(ue,{onClick:()=>rn(null,null),size:"sm",variant:"outline",className:"w-full sm:w-auto","data-tour":"add-model-button",children:[o.jsx(Is,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加模型"]})]})]}),o.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2",children:[o.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[o.jsx(ii,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(Pe,{placeholder:"搜索模型名称、标识符或提供商...",value:L,onChange:ge=>$(ge.target.value),className:"pl-9"})]}),L&&o.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",fr.length," 个结果"]})]}),o.jsx("div",{className:"md:hidden space-y-3",children:xs.length===0?o.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:L?"未找到匹配的模型":"暂无模型配置"}):xs.map((ge,Ie)=>{const Et=t.findIndex(Hr=>Hr===ge),kn=js(ge.name);return o.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx("h3",{className:"font-semibold text-base",children:ge.name}),o.jsx(tn,{variant:kn?"default":"secondary",className:kn?"bg-green-600 hover:bg-green-700":"",children:kn?"已使用":"未使用"})]}),o.jsx("p",{className:"text-xs text-muted-foreground break-all",title:ge.model_identifier,children:ge.model_identifier})]}),o.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[o.jsxs(ue,{variant:"default",size:"sm",onClick:()=>rn(ge,Et),children:[o.jsx(Ju,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),o.jsxs(ue,{size:"sm",onClick:()=>Gt(Et),className:"bg-red-600 hover:bg-red-700 text-white",children:[o.jsx(Cn,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"提供商"}),o.jsx("p",{className:"font-medium",children:ge.api_provider})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"强制流式"}),o.jsx("p",{className:"font-medium",children:ge.force_stream_mode?"是":"否"})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"输入价格"}),o.jsxs("p",{className:"font-medium",children:["¥",ge.price_in,"/M"]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"输出价格"}),o.jsxs("p",{className:"font-medium",children:["¥",ge.price_out,"/M"]})]})]})]},Ie)})}),o.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs(Af,{children:[o.jsx(Mf,{children:o.jsxs(zs,{children:[o.jsx(mn,{className:"w-12",children:o.jsx(Ci,{checked:K.size===fr.length&&fr.length>0,onCheckedChange:He})}),o.jsx(mn,{className:"w-24",children:"使用状态"}),o.jsx(mn,{children:"模型名称"}),o.jsx(mn,{children:"模型标识符"}),o.jsx(mn,{children:"提供商"}),o.jsx(mn,{className:"text-right",children:"输入价格"}),o.jsx(mn,{className:"text-right",children:"输出价格"}),o.jsx(mn,{className:"text-center",children:"强制流式"}),o.jsx(mn,{className:"text-right",children:"操作"})]})}),o.jsx(Rf,{children:xs.length===0?o.jsx(zs,{children:o.jsx(Yt,{colSpan:9,className:"text-center text-muted-foreground py-8",children:L?"未找到匹配的模型":"暂无模型配置"})}):xs.map((ge,Ie)=>{const Et=t.findIndex(Hr=>Hr===ge),kn=js(ge.name);return o.jsxs(zs,{children:[o.jsx(Yt,{children:o.jsx(Ci,{checked:K.has(Et),onCheckedChange:()=>ve(Et)})}),o.jsx(Yt,{children:o.jsx(tn,{variant:kn?"default":"secondary",className:kn?"bg-green-600 hover:bg-green-700":"",children:kn?"已使用":"未使用"})}),o.jsx(Yt,{className:"font-medium",children:ge.name}),o.jsx(Yt,{className:"max-w-xs truncate",title:ge.model_identifier,children:ge.model_identifier}),o.jsx(Yt,{children:ge.api_provider}),o.jsxs(Yt,{className:"text-right",children:["¥",ge.price_in,"/M"]}),o.jsxs(Yt,{className:"text-right",children:["¥",ge.price_out,"/M"]}),o.jsx(Yt,{className:"text-center",children:ge.force_stream_mode?"是":"否"}),o.jsx(Yt,{className:"text-right",children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsxs(ue,{variant:"default",size:"sm",onClick:()=>rn(ge,Et),children:[o.jsx(Ju,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),o.jsxs(ue,{size:"sm",onClick:()=>Gt(Et),className:"bg-red-600 hover:bg-red-700 text-white",children:[o.jsx(Cn,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},Ie)})})]})})}),fr.length>0&&o.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{htmlFor:"page-size-model",className:"text-sm whitespace-nowrap",children:"每页显示"}),o.jsxs(Vt,{value:U.toString(),onValueChange:ge=>{te(parseInt(ge)),z(1),Y(new Set)},children:[o.jsx($t,{id:"page-size-model",className:"w-20",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"10",children:"10"}),o.jsx(De,{value:"20",children:"20"}),o.jsx(De,{value:"50",children:"50"}),o.jsx(De,{value:"100",children:"100"})]})]}),o.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(X-1)*U+1," 到"," ",Math.min(X*U,fr.length)," 条,共 ",fr.length," 条"]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>z(1),disabled:X===1,className:"hidden sm:flex",children:o.jsx(Ip,{className:"h-4 w-4"})}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>z(ge=>Math.max(1,ge-1)),disabled:X===1,children:[o.jsx(wd,{className:"h-4 w-4 sm:mr-1"}),o.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Pe,{type:"number",value:ne,onChange:ge=>G(ge.target.value),onKeyDown:ge=>ge.key==="Enter"&&vs(),placeholder:X.toString(),className:"w-16 h-8 text-center",min:1,max:ar}),o.jsx(ue,{variant:"outline",size:"sm",onClick:vs,disabled:!ne,className:"h-8",children:"跳转"})]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>z(ge=>ge+1),disabled:X>=ar,children:[o.jsx("span",{className:"hidden sm:inline",children:"下一页"}),o.jsx(Zl,{className:"h-4 w-4 sm:ml-1"})]}),o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>z(ar),disabled:X>=ar,className:"hidden sm:flex",children:o.jsx(Lp,{className:"h-4 w-4"})})]})]})]}),o.jsxs(ln,{value:"tasks",className:"space-y-6 mt-0",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:"为不同的任务配置使用的模型和参数"}),c&&o.jsxs("div",{className:"grid gap-4 sm:gap-6",children:[o.jsx(qa,{title:"组件模型 (utils)",description:"用于表情包、取名、关系、情绪变化等组件",taskConfig:c.utils,modelNames:a,onChange:(ge,Ie)=>Qn("utils",ge,Ie),dataTour:"task-model-select"}),o.jsx(qa,{title:"组件小模型 (utils_small)",description:"消耗量较大的组件,建议使用速度较快的小模型",taskConfig:c.utils_small,modelNames:a,onChange:(ge,Ie)=>Qn("utils_small",ge,Ie)}),o.jsx(qa,{title:"工具调用模型 (tool_use)",description:"需要使用支持工具调用的模型",taskConfig:c.tool_use,modelNames:a,onChange:(ge,Ie)=>Qn("tool_use",ge,Ie)}),o.jsx(qa,{title:"首要回复模型 (replyer)",description:"用于表达器和表达方式学习",taskConfig:c.replyer,modelNames:a,onChange:(ge,Ie)=>Qn("replyer",ge,Ie)}),o.jsx(qa,{title:"决策模型 (planner)",description:"负责决定麦麦该什么时候回复",taskConfig:c.planner,modelNames:a,onChange:(ge,Ie)=>Qn("planner",ge,Ie)}),o.jsx(qa,{title:"图像识别模型 (vlm)",description:"视觉语言模型",taskConfig:c.vlm,modelNames:a,onChange:(ge,Ie)=>Qn("vlm",ge,Ie),hideTemperature:!0}),o.jsx(qa,{title:"语音识别模型 (voice)",description:"语音转文字",taskConfig:c.voice,modelNames:a,onChange:(ge,Ie)=>Qn("voice",ge,Ie),hideTemperature:!0,hideMaxTokens:!0}),o.jsx(qa,{title:"嵌入模型 (embedding)",description:"用于向量化",taskConfig:c.embedding,modelNames:a,onChange:(ge,Ie)=>Qn("embedding",ge,Ie),hideTemperature:!0,hideMaxTokens:!0}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库模型"}),o.jsx(qa,{title:"实体提取模型 (lpmm_entity_extract)",description:"从文本中提取实体",taskConfig:c.lpmm_entity_extract,modelNames:a,onChange:(ge,Ie)=>Qn("lpmm_entity_extract",ge,Ie)}),o.jsx(qa,{title:"RDF 构建模型 (lpmm_rdf_build)",description:"构建知识图谱",taskConfig:c.lpmm_rdf_build,modelNames:a,onChange:(ge,Ie)=>Qn("lpmm_rdf_build",ge,Ie)}),o.jsx(qa,{title:"问答模型 (lpmm_qa)",description:"知识库问答",taskConfig:c.lpmm_qa,modelNames:a,onChange:(ge,Ie)=>Qn("lpmm_qa",ge,Ie)})]})]})]})]}),o.jsx(Er,{open:_,onOpenChange:Wt,children:o.jsxs(wr,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto","data-tour":"model-dialog",preventOutsideClose:qt.isRunning,children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:B!==null?"编辑模型":"添加模型"}),o.jsx(Xr,{children:"配置模型的基本信息和参数"})]}),o.jsxs("div",{className:"grid gap-4 py-4",children:[o.jsxs("div",{className:"grid gap-2","data-tour":"model-name-input",children:[o.jsx(he,{htmlFor:"model_name",children:"模型名称 *"}),o.jsx(Pe,{id:"model_name",value:D?.name||"",onChange:ge=>q(Ie=>Ie?{...Ie,name:ge.target.value}:null),placeholder:"例如: qwen3-30b"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"用于在任务配置中引用此模型"})]}),o.jsxs("div",{className:"grid gap-2","data-tour":"model-provider-select",children:[o.jsx(he,{htmlFor:"api_provider",children:"API 提供商 *"}),o.jsxs(Vt,{value:D?.api_provider||"",onValueChange:ge=>{q(Ie=>Ie?{...Ie,api_provider:ge}:null),re([]),Ye(null)},children:[o.jsx($t,{id:"api_provider",children:o.jsx(Ut,{placeholder:"选择提供商"})}),o.jsx(Ht,{children:n.map(ge=>o.jsx(De,{value:ge,children:ge},ge))})]})]}),o.jsxs("div",{className:"grid gap-2","data-tour":"model-identifier-input",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{htmlFor:"model_identifier",children:"模型标识符 *"}),Ve?.modelFetcher&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(tn,{variant:"secondary",className:"text-xs",children:Ve.display_name}),o.jsx(ue,{variant:"ghost",size:"sm",className:"h-6 px-2",onClick:()=>D?.api_provider&&Rt(D.api_provider,!0),disabled:ae,children:ae?o.jsx(Us,{className:"h-3 w-3 animate-spin"}):o.jsx(Qs,{className:"h-3 w-3"})})]})]}),Ve?.modelFetcher?o.jsxs(Bo,{open:Je,onOpenChange:Oe,children:[o.jsx(Fo,{asChild:!0,children:o.jsxs(ue,{variant:"outline",role:"combobox","aria-expanded":Je,className:"w-full justify-between font-normal",disabled:ae||!!Be,children:[ae?o.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx(Us,{className:"h-4 w-4 animate-spin"}),"正在获取模型列表..."]}):Be?o.jsx("span",{className:"text-muted-foreground text-sm",children:"点击下方输入框手动填写"}):D?.model_identifier?o.jsx("span",{className:"truncate",children:D.model_identifier}):o.jsx("span",{className:"text-muted-foreground",children:"搜索或选择模型..."}),o.jsx(Lj,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o.jsx(Ka,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:o.jsxs(Tb,{children:[o.jsx(Eb,{placeholder:"搜索模型..."}),o.jsx(pn,{className:"h-[300px]",children:o.jsxs(_b,{className:"max-h-none overflow-visible",children:[o.jsx(Ab,{children:Be?o.jsxs("div",{className:"py-4 px-2 text-center space-y-2",children:[o.jsx("p",{className:"text-sm text-destructive",children:Be}),!Be.includes("API Key")&&o.jsx(ue,{variant:"link",size:"sm",onClick:()=>D?.api_provider&&Rt(D.api_provider,!0),children:"重试"})]}):"未找到匹配的模型"}),o.jsx(up,{heading:"可用模型",children:se.map(ge=>o.jsxs(dp,{value:ge.id,onSelect:()=>{q(Ie=>Ie?{...Ie,model_identifier:ge.id}:null),Oe(!1)},children:[o.jsx(zo,{className:`mr-2 h-4 w-4 ${D?.model_identifier===ge.id?"opacity-100":"opacity-0"}`}),o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{children:ge.id}),ge.name!==ge.id&&o.jsx("span",{className:"text-xs text-muted-foreground",children:ge.name})]})]},ge.id))}),o.jsx(up,{heading:"手动输入",children:o.jsxs(dp,{value:"__manual_input__",onSelect:()=>{Oe(!1)},children:[o.jsx(Ju,{className:"mr-2 h-4 w-4"}),"手动输入模型标识符..."]})})]})})]})})]}):o.jsx(Pe,{id:"model_identifier",value:D?.model_identifier||"",onChange:ge=>q(Ie=>Ie?{...Ie,model_identifier:ge.target.value}:null),placeholder:"Qwen/Qwen3-30B-A3B-Instruct-2507"}),Be&&Ve?.modelFetcher&&o.jsxs(ba,{variant:"destructive",className:"mt-2 py-2",children:[o.jsx(Xi,{className:"h-4 w-4"}),o.jsx(wa,{className:"text-xs",children:Be})]}),Ve?.modelFetcher&&o.jsx(Pe,{value:D?.model_identifier||"",onChange:ge=>q(Ie=>Ie?{...Ie,model_identifier:ge.target.value}:null),placeholder:"或手动输入模型标识符",className:"mt-2"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:Be?'请手动输入模型标识符,或前往"模型提供商配置"检查 API Key':Ve?.modelFetcher?`已识别为 ${Ve.display_name},支持自动获取模型列表`:"API 提供商提供的模型 ID"})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"price_in",children:"输入价格 (¥/M token)"}),o.jsx(Pe,{id:"price_in",type:"number",step:"0.1",min:"0",value:D?.price_in??"",onChange:ge=>{const Ie=ge.target.value===""?null:parseFloat(ge.target.value);q(Et=>Et?{...Et,price_in:Ie}:null)},placeholder:"默认: 0"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"price_out",children:"输出价格 (¥/M token)"}),o.jsx(Pe,{id:"price_out",type:"number",step:"0.1",min:"0",value:D?.price_out??"",onChange:ge=>{const Ie=ge.target.value===""?null:parseFloat(ge.target.value);q(Et=>Et?{...Et,price_out:Ie}:null)},placeholder:"默认: 0"})]})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"force_stream_mode",checked:D?.force_stream_mode||!1,onCheckedChange:ge=>q(Ie=>Ie?{...Ie,force_stream_mode:ge}:null)}),o.jsx(he,{htmlFor:"force_stream_mode",className:"cursor-pointer",children:"强制流式输出模式"})]})]}),o.jsxs(fs,{children:[o.jsx(ue,{variant:"outline",onClick:()=>A(!1),"data-tour":"model-cancel-button",children:"取消"}),o.jsx(ue,{onClick:wt,"data-tour":"model-save-button",children:"保存"})]})]})}),o.jsx(Fn,{open:W,onOpenChange:ee,children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:['确定要删除模型 "',I!==null?t[I]?.name:"",'" 吗? 此操作无法撤销。']})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:lt,children:"删除"})]})]})}),o.jsx(Fn,{open:R,onOpenChange:ie,children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认批量删除"}),o.jsxs(zn,{children:["确定要删除选中的 ",K.size," 个模型吗? 此操作无法撤销。"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:vn,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),T&&o.jsx(r6,{onRestartComplete:ot,onRestartFailed:dn})]})})}function qa({title:t,description:e,taskConfig:n,modelNames:r,onChange:s,hideTemperature:i=!1,hideMaxTokens:a=!1,dataTour:l}){const c=d=>{s("model_list",d)};return o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"font-semibold text-base sm:text-lg",children:t}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:e})]}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2","data-tour":l,children:[o.jsx(he,{children:"模型列表"}),o.jsx(Vve,{options:r.map(d=>({label:d,value:d})),selected:n.model_list||[],onChange:c,placeholder:"选择模型...",emptyText:"暂无可用模型"})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[!i&&o.jsxs("div",{className:"grid gap-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{children:"温度"}),o.jsx(Pe,{type:"number",step:"0.1",min:"0",max:"1",value:n.temperature??.3,onChange:d=>{const h=parseFloat(d.target.value);!isNaN(h)&&h>=0&&h<=1&&s("temperature",h)},className:"w-20 h-8 text-sm"})]}),o.jsx(Nf,{value:[n.temperature??.3],onValueChange:d=>s("temperature",d[0]),min:0,max:1,step:.1,className:"w-full"})]}),!a&&o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"最大 Token"}),o.jsx(Pe,{type:"number",step:"1",min:"1",value:n.max_tokens??1024,onChange:d=>s("max_tokens",parseInt(d.target.value))})]})]})]})]})}const Bb="/api/webui/config";async function Gve(){const e=await(await gt(`${Bb}/adapter-config/path`)).json();return!e.success||!e.path?null:{path:e.path,lastModified:e.lastModified}}async function wM(t){const n=await(await gt(`${Bb}/adapter-config/path`,{method:"POST",headers:Tt(),body:JSON.stringify({path:t})})).json();if(!n.success)throw new Error(n.message||"保存路径失败")}async function SM(t){const n=await(await gt(`${Bb}/adapter-config?path=${encodeURIComponent(t)}`)).json();if(!n.success)throw new Error("读取配置文件失败");return n.content}async function kM(t,e){const r=await(await gt(`${Bb}/adapter-config`,{method:"POST",headers:Tt(),body:JSON.stringify({path:t,content:e})})).json();if(!r.success)throw new Error(r.message||"保存配置失败")}const $i={inner:{version:"0.1.2"},nickname:{nickname:""},napcat_server:{host:"localhost",port:8095,token:"",heartbeat_interval:30},maibot_server:{host:"localhost",port:8e3},chat:{group_list_type:"whitelist",group_list:[],private_list_type:"whitelist",private_list:[],ban_user_id:[],ban_qq_bot:!1,enable_poke:!0},voice:{use_tts:!1},debug:{level:"INFO"}},AS={oneclick:{name:"一键包",description:"使用一键包部署的适配器配置",path:"../MaiBot-Napcat-Adapter/config.toml",icon:ed},docker:{name:"Docker",description:"Docker Compose 部署的适配器配置",path:"/MaiMBot/adapters-config/config.toml",icon:Jee}};function Xve(){const[t,e]=b.useState("upload"),[n,r]=b.useState(null),[s,i]=b.useState(""),[a,l]=b.useState(""),[c,d]=b.useState("oneclick"),[h,m]=b.useState(""),[g,x]=b.useState(!1),[y,w]=b.useState(!1),[S,k]=b.useState(!1),[j,N]=b.useState(!1),[T,E]=b.useState(null),_=b.useRef(null),{toast:A}=Lr(),D=b.useRef(null),q=G=>{if(!G.trim())return{valid:!1,error:"路径不能为空"};if(!G.toLowerCase().endsWith(".toml"))return{valid:!1,error:"文件必须是 .toml 格式"};const se=/^([a-zA-Z]:\\|\\\\[^\\]+\\[^\\]+\\).+\.toml$/i,re=/^(\/|~\/).+\.toml$/i,ae=/^(\.{1,2}[\\/]|[^:\\/]).+\.toml$/i,_e=se.test(G),Be=re.test(G),Ye=ae.test(G);return!_e&&!Be&&!Ye?{valid:!1,error:"路径格式错误"}:/[<>"|?*\x00-\x1F]/.test(G)?{valid:!1,error:"路径包含非法字符"}:{valid:!0,error:""}},B=G=>{if(l(G),G.trim()){const se=q(G);m(se.error)}else m("")},H=b.useCallback(async G=>{const se=AS[G];w(!0);try{const re=await SM(se.path),ae=X(re);r(ae),d(G),l(se.path),await wM(se.path),A({title:"加载成功",description:`已从${se.name}预设加载配置`})}catch(re){console.error("加载预设配置失败:",re),A({title:"加载失败",description:re instanceof Error?re.message:"无法读取预设配置文件",variant:"destructive"})}finally{w(!1)}},[A]),W=b.useCallback(async G=>{const se=q(G);if(!se.valid){m(se.error),A({title:"路径无效",description:se.error,variant:"destructive"});return}m(""),w(!0);try{const re=await SM(G),ae=X(re);r(ae),l(G),await wM(G),A({title:"加载成功",description:"已从配置文件加载"})}catch(re){console.error("加载配置失败:",re),A({title:"加载失败",description:re instanceof Error?re.message:"无法读取配置文件",variant:"destructive"})}finally{w(!1)}},[A]);b.useEffect(()=>{(async()=>{try{const se=await Gve();if(se&&se.path){l(se.path);const re=Object.entries(AS).find(([,ae])=>ae.path===se.path);re?(e("preset"),d(re[0]),await H(re[0])):(e("path"),await W(se.path))}}catch(se){console.error("加载保存的路径失败:",se)}})()},[W,H]);const ee=b.useCallback(G=>{t!=="path"&&t!=="preset"||!a||(D.current&&clearTimeout(D.current),D.current=setTimeout(async()=>{x(!0);try{const se=z(G);await kM(a,se),A({title:"自动保存成功",description:"配置已保存到文件"})}catch(se){console.error("自动保存失败:",se),A({title:"自动保存失败",description:se instanceof Error?se.message:"保存配置失败",variant:"destructive"})}finally{x(!1)}},1e3))},[t,a,A]),I=async()=>{if(!n||!a)return;const G=q(a);if(!G.valid){A({title:"保存失败",description:G.error,variant:"destructive"});return}x(!0);try{const se=z(n);await kM(a,se),A({title:"保存成功",description:"配置已保存到文件"})}catch(se){console.error("保存失败:",se),A({title:"保存失败",description:se instanceof Error?se.message:"保存配置失败",variant:"destructive"})}finally{x(!1)}},V=async()=>{a&&await W(a)},L=G=>{if(G!==t){if(n){E(G),k(!0);return}$(G)}},$=G=>{r(null),i(""),m(""),e(G),G==="preset"&&H("oneclick"),A({title:"已切换模式",description:{upload:"现在可以上传配置文件",path:"现在可以指定配置文件路径",preset:"现在可以使用预设配置"}[G]})},K=()=>{T&&($(T),E(null)),k(!1)},Y=()=>{if(n){N(!0);return}R()},R=()=>{l(""),r(null),m(""),A({title:"已清空",description:"路径和配置已清空"})},ie=()=>{R(),N(!1)},X=G=>{const se=JSON.parse(JSON.stringify($i)),re=G.split(` -`);let ae="";for(const _e of re){const Be=_e.trim();if(!Be||Be.startsWith("#"))continue;const Ye=Be.match(/^\[(\w+)\]/);if(Ye){ae=Ye[1];continue}const Je=Be.match(/^(\w+)\s*=\s*(.+)$/);if(Je&&ae){const[,Oe,Ve]=Je;let Ue=Ve.trim();const $e=Ue.match(/^("[^"]*")/);if($e)Ue=$e[1];else{const vt=Ue.indexOf("#");vt!==-1&&(Ue=Ue.substring(0,vt).trim())}let jt;if(Ue==="true")jt=!0;else if(Ue==="false")jt=!1;else if(Ue.startsWith("[")&&Ue.endsWith("]")){const vt=Ue.slice(1,-1).trim();if(vt){const $n=vt.split(",").map(un=>{const Mt=un.trim();return isNaN(Number(Mt))?Mt.replace(/"/g,""):Number(Mt)}),qt=typeof $n[0];jt=$n.every(un=>typeof un===qt)?$n:$n.filter(un=>typeof un=="number")}else jt=[]}else Ue.startsWith('"')&&Ue.endsWith('"')?jt=Ue.slice(1,-1):isNaN(Number(Ue))?jt=Ue.replace(/"/g,""):jt=Number(Ue);if(ae in se){const vt=se[ae];vt[Oe]=jt}}}return se},z=G=>{const se=[],re=(ae,_e)=>ae===""||ae===null||ae===void 0?_e:ae;return se.push("[inner]"),se.push(`version = "${re(G.inner.version,$i.inner.version)}" # 版本号`),se.push("# 请勿修改版本号,除非你知道自己在做什么"),se.push(""),se.push("[nickname] # 现在没用"),se.push(`nickname = "${re(G.nickname.nickname,$i.nickname.nickname)}"`),se.push(""),se.push("[napcat_server] # Napcat连接的ws服务设置"),se.push(`host = "${re(G.napcat_server.host,$i.napcat_server.host)}" # Napcat设定的主机地址`),se.push(`port = ${re(G.napcat_server.port||0,$i.napcat_server.port)} # Napcat设定的端口`),se.push(`token = "${re(G.napcat_server.token,$i.napcat_server.token)}" # Napcat设定的访问令牌,若无则留空`),se.push(`heartbeat_interval = ${re(G.napcat_server.heartbeat_interval||0,$i.napcat_server.heartbeat_interval)} # 与Napcat设置的心跳相同(按秒计)`),se.push(""),se.push("[maibot_server] # 连接麦麦的ws服务设置"),se.push(`host = "${re(G.maibot_server.host,$i.maibot_server.host)}" # 麦麦在.env文件中设置的主机地址,即HOST字段`),se.push(`port = ${re(G.maibot_server.port||0,$i.maibot_server.port)} # 麦麦在.env文件中设置的端口,即PORT字段`),se.push(""),se.push("[chat] # 黑白名单功能"),se.push(`group_list_type = "${re(G.chat.group_list_type,$i.chat.group_list_type)}" # 群组名单类型,可选为:whitelist, blacklist`),se.push(`group_list = [${G.chat.group_list.join(", ")}] # 群组名单`),se.push("# 当group_list_type为whitelist时,只有群组名单中的群组可以聊天"),se.push("# 当group_list_type为blacklist时,群组名单中的任何群组无法聊天"),se.push(`private_list_type = "${re(G.chat.private_list_type,$i.chat.private_list_type)}" # 私聊名单类型,可选为:whitelist, blacklist`),se.push(`private_list = [${G.chat.private_list.join(", ")}] # 私聊名单`),se.push("# 当private_list_type为whitelist时,只有私聊名单中的用户可以聊天"),se.push("# 当private_list_type为blacklist时,私聊名单中的任何用户无法聊天"),se.push(`ban_user_id = [${G.chat.ban_user_id.join(", ")}] # 全局禁止名单(全局禁止名单中的用户无法进行任何聊天)`),se.push(`ban_qq_bot = ${G.chat.ban_qq_bot} # 是否屏蔽QQ官方机器人`),se.push(`enable_poke = ${G.chat.enable_poke} # 是否启用戳一戳功能`),se.push(""),se.push("[voice] # 发送语音设置"),se.push(`use_tts = ${G.voice.use_tts} # 是否使用tts语音(请确保你配置了tts并有对应的adapter)`),se.push(""),se.push("[debug]"),se.push(`level = "${re(G.debug.level,$i.debug.level)}" # 日志等级(DEBUG, INFO, WARNING, ERROR, CRITICAL)`),se.join(` -`)},U=G=>{const se=G.target.files?.[0];if(!se)return;const re=new FileReader;re.onload=ae=>{try{const _e=ae.target?.result,Be=X(_e);r(Be),i(se.name),A({title:"上传成功",description:`已加载配置文件:${se.name}`})}catch(_e){console.error("解析配置文件失败:",_e),A({title:"解析失败",description:"配置文件格式错误,请检查文件内容",variant:"destructive"})}},re.readAsText(se)},te=()=>{if(!n)return;const G=z(n),se=new Blob([G],{type:"text/plain;charset=utf-8"}),re=URL.createObjectURL(se),ae=document.createElement("a");ae.href=re,ae.download=s||"config.toml",document.body.appendChild(ae),ae.click(),document.body.removeChild(ae),URL.revokeObjectURL(re),A({title:"下载成功",description:"配置文件已下载,请手动覆盖并重启适配器"})},ne=()=>{r(JSON.parse(JSON.stringify($i))),i("config.toml"),A({title:"已加载默认配置",description:"可以开始编辑配置"})};return o.jsx(pn,{className:"h-full",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦适配器配置"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的 QQ 适配器的配置文件"})]})}),o.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg border border-amber-500/50 bg-amber-500/10 text-amber-700 dark:text-amber-400",children:[o.jsx(Lo,{className:"h-4 w-4 mt-0.5 flex-shrink-0"}),o.jsx("p",{className:"text-sm",children:"适配器配置保存之后使用 WebUI 的重启功能适配器并不会重启,需要手动重启适配器。"})]}),o.jsxs(Lt,{children:[o.jsxs(En,{children:[o.jsx(_n,{children:"工作模式"}),o.jsx(Wr,{children:"选择配置文件的管理方式"})]}),o.jsxs(Xn,{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 md:gap-4",children:[o.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${t==="preset"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>L("preset"),children:o.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[o.jsx(ed,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"预设模式"}),o.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"使用预设的部署配置"})]})]})}),o.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${t==="upload"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>L("upload"),children:o.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[o.jsx(N9,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"上传文件模式"}),o.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"上传配置文件,编辑后下载并手动覆盖"})]})]})}),o.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${t==="path"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>L("path"),children:o.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[o.jsx(ete,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"指定路径模式"}),o.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"指定配置文件路径,自动加载和保存"})]})]})})]}),t==="preset"&&o.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[o.jsx(he,{className:"text-sm md:text-base",children:"选择部署方式"}),o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:Object.entries(AS).map(([G,se])=>{const re=se.icon,ae=c===G;return o.jsx("div",{className:`border-2 rounded-lg p-3 cursor-pointer transition-all ${ae?"border-primary bg-primary/5":"border-muted hover:border-primary/50"}`,onClick:()=>{d(G),H(G)},children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(re,{className:"h-5 w-5 mt-0.5 flex-shrink-0"}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("h4",{className:"font-semibold text-sm",children:se.name}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:se.description}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1 font-mono break-all",children:se.path})]})]})},G)})})]}),t==="path"&&o.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"config-path",className:"text-sm md:text-base",children:"配置文件路径"}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[o.jsxs("div",{className:"flex-1 space-y-1",children:[o.jsx(Pe,{id:"config-path",value:a,onChange:G=>B(G.target.value),placeholder:"例: C:\\Adapter\\config.toml",className:`text-sm ${h?"border-destructive":""}`}),h&&o.jsx("p",{className:"text-xs text-destructive",children:h})]}),o.jsx(ue,{onClick:()=>W(a),disabled:y||!a||!!h,className:"w-full sm:w-auto",children:y?o.jsxs(o.Fragment,{children:[o.jsx(Qs,{className:"h-4 w-4 animate-spin mr-2"}),o.jsx("span",{className:"sm:hidden",children:"加载中..."})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sm:hidden",children:"加载配置"}),o.jsx("span",{className:"hidden sm:inline",children:"加载"})]})})]})]}),o.jsxs("details",{className:"rounded-lg bg-muted/50 p-3 group",children:[o.jsxs("summary",{className:"text-xs font-medium cursor-pointer select-none list-none flex items-center justify-between",children:[o.jsx("span",{children:"路径格式说明"}),o.jsx("svg",{className:"h-4 w-4 transition-transform group-open:rotate-180",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),o.jsxs("div",{className:"mt-2 space-y-2 text-xs text-muted-foreground",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("div",{className:"flex items-center gap-2",children:o.jsx("span",{className:"font-mono bg-background px-1.5 py-0.5 rounded text-[10px] md:text-xs whitespace-nowrap",children:"Windows"})}),o.jsxs("div",{className:"pl-2 space-y-0.5 text-[10px] md:text-xs break-all",children:[o.jsx("div",{children:"C:\\Adapter\\config.toml"}),o.jsx("div",{className:"hidden sm:block",children:"D:\\MaiBot\\adapter\\config.toml"}),o.jsx("div",{className:"hidden sm:block",children:"\\\\server\\share\\config.toml"})]})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("div",{className:"flex items-center gap-2",children:o.jsx("span",{className:"font-mono bg-background px-1.5 py-0.5 rounded text-[10px] md:text-xs whitespace-nowrap",children:"Linux"})}),o.jsxs("div",{className:"pl-2 space-y-0.5 text-[10px] md:text-xs break-all",children:[o.jsx("div",{children:"/opt/adapter/config.toml"}),o.jsx("div",{className:"hidden sm:block",children:"/home/user/adapter/config.toml"}),o.jsx("div",{className:"hidden sm:block",children:"~/adapter/config.toml"})]})]}),o.jsx("p",{className:"pt-1 border-t text-[10px] md:text-xs",children:"💡 配置会自动保存到指定文件,修改后 1 秒自动保存"})]})]})]})]})]}),o.jsxs(ba,{children:[o.jsx(Xi,{className:"h-4 w-4"}),o.jsx(wa,{children:t==="preset"?o.jsxs(o.Fragment,{children:[o.jsx("strong",{children:"预设模式:"}),"选择预设的部署方式,配置会自动加载,修改后 1 秒自动保存",g&&" (正在保存...)"]}):t==="upload"?o.jsxs(o.Fragment,{children:[o.jsx("strong",{children:"上传文件模式:"}),"上传配置文件 → 在线编辑 → 下载文件 → 手动覆盖并重启适配器"]}):o.jsxs(o.Fragment,{children:[o.jsx("strong",{children:"指定路径模式:"}),"指定配置文件路径后,配置会自动加载,修改后 1 秒自动保存",g&&" (正在保存...)"]})})]}),t==="upload"&&!n&&o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full",children:[o.jsx("input",{ref:_,type:"file",accept:".toml",className:"hidden",onChange:U}),o.jsxs(ue,{onClick:()=>_.current?.click(),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[o.jsx(N9,{className:"mr-2 h-4 w-4"}),"上传配置"]}),o.jsxs(ue,{onClick:ne,size:"sm",className:"w-full sm:w-auto",children:[o.jsx(Po,{className:"mr-2 h-4 w-4"}),"使用默认配置"]})]}),t==="upload"&&n&&o.jsx("div",{className:"flex gap-2",children:o.jsxs(ue,{onClick:te,size:"sm",className:"w-full sm:w-auto",children:[o.jsx(td,{className:"mr-2 h-4 w-4"}),"下载配置"]})}),(t==="preset"||t==="path")&&n&&o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[o.jsxs(ue,{onClick:I,size:"sm",disabled:g||!!h,className:"w-full sm:w-auto",children:[o.jsx(zp,{className:"mr-2 h-4 w-4"}),g?"保存中...":"立即保存"]}),o.jsxs(ue,{onClick:V,size:"sm",variant:"outline",disabled:y,className:"w-full sm:w-auto",children:[o.jsx(Qs,{className:`mr-2 h-4 w-4 ${y?"animate-spin":""}`}),"刷新"]}),t==="path"&&o.jsxs(ue,{onClick:Y,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[o.jsx(Cn,{className:"mr-2 h-4 w-4"}),"清空路径"]})]}),n?o.jsxs(Yi,{defaultValue:"napcat",className:"w-full",children:[o.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:o.jsxs(ji,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5",children:[o.jsxs(Bt,{value:"napcat",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[o.jsx("span",{className:"hidden sm:inline",children:"Napcat 连接"}),o.jsx("span",{className:"sm:hidden",children:"Napcat"})]}),o.jsxs(Bt,{value:"maibot",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[o.jsx("span",{className:"hidden sm:inline",children:"麦麦连接"}),o.jsx("span",{className:"sm:hidden",children:"麦麦"})]}),o.jsxs(Bt,{value:"chat",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[o.jsx("span",{className:"hidden sm:inline",children:"聊天控制"}),o.jsx("span",{className:"sm:hidden",children:"聊天"})]}),o.jsxs(Bt,{value:"voice",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[o.jsx("span",{className:"hidden sm:inline",children:"语音设置"}),o.jsx("span",{className:"sm:hidden",children:"语音"})]}),o.jsx(Bt,{value:"debug",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:"调试"})]})}),o.jsx(ln,{value:"napcat",className:"space-y-4",children:o.jsx(Yve,{config:n,onChange:G=>{r(G),ee(G)}})}),o.jsx(ln,{value:"maibot",className:"space-y-4",children:o.jsx(Kve,{config:n,onChange:G=>{r(G),ee(G)}})}),o.jsx(ln,{value:"chat",className:"space-y-4",children:o.jsx(Zve,{config:n,onChange:G=>{r(G),ee(G)}})}),o.jsx(ln,{value:"voice",className:"space-y-4",children:o.jsx(Jve,{config:n,onChange:G=>{r(G),ee(G)}})}),o.jsx(ln,{value:"debug",className:"space-y-4",children:o.jsx(eye,{config:n,onChange:G=>{r(G),ee(G)}})})]}):o.jsx("div",{className:"rounded-lg border bg-card p-6 md:p-12",children:o.jsxs("div",{className:"text-center space-y-3 md:space-y-4",children:[o.jsx(Po,{className:"h-12 w-12 md:h-16 md:w-16 mx-auto text-muted-foreground"}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-base md:text-lg font-semibold",children:"尚未加载配置"}),o.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-2 px-4",children:t==="preset"?"请选择预设的部署方式":t==="upload"?"请上传现有配置文件,或使用默认配置开始编辑":"请指定配置文件路径并点击加载按钮"})]})]})}),o.jsx(Fn,{open:S,onOpenChange:k,children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认切换模式"}),o.jsxs(zn,{children:["切换模式将清空当前配置,确定要继续吗?",o.jsx("br",{}),o.jsx("span",{className:"text-destructive font-medium",children:"请确保已保存重要配置"})]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{onClick:()=>{k(!1),E(null)},children:"取消"}),o.jsx(In,{onClick:K,children:"确认切换"})]})]})}),o.jsx(Fn,{open:j,onOpenChange:N,children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认清空路径"}),o.jsxs(zn,{children:["清空路径将清除当前配置,确定要继续吗?",o.jsx("br",{}),o.jsx("span",{className:"text-muted-foreground text-sm",children:"此操作不会删除配置文件,只是清除界面中的配置"})]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{onClick:()=>N(!1),children:"取消"}),o.jsx(In,{onClick:ie,className:"bg-destructive hover:bg-destructive/90",children:"确认清空"})]})]})})]})})}function Yve({config:t,onChange:e}){return o.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"Napcat WebSocket 服务设置"}),o.jsxs("div",{className:"grid gap-3 md:gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"napcat-host",className:"text-sm md:text-base",children:"主机地址"}),o.jsx(Pe,{id:"napcat-host",value:t.napcat_server.host,onChange:n=>e({...t,napcat_server:{...t.napcat_server,host:n.target.value}}),placeholder:"localhost",className:"text-sm md:text-base"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的主机地址"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"napcat-port",className:"text-sm md:text-base",children:"端口"}),o.jsx(Pe,{id:"napcat-port",type:"number",value:t.napcat_server.port||"",onChange:n=>e({...t,napcat_server:{...t.napcat_server,port:n.target.value?parseInt(n.target.value):0}}),placeholder:"8095",className:"text-sm md:text-base"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的端口(留空使用默认值 8095)"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"napcat-token",className:"text-sm md:text-base",children:"访问令牌(Token)"}),o.jsx(Pe,{id:"napcat-token",type:"password",value:t.napcat_server.token,onChange:n=>e({...t,napcat_server:{...t.napcat_server,token:n.target.value}}),placeholder:"留空表示无需令牌",className:"text-sm md:text-base"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的访问令牌,若无则留空"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"napcat-heartbeat",className:"text-sm md:text-base",children:"心跳间隔(秒)"}),o.jsx(Pe,{id:"napcat-heartbeat",type:"number",value:t.napcat_server.heartbeat_interval||"",onChange:n=>e({...t,napcat_server:{...t.napcat_server,heartbeat_interval:n.target.value?parseInt(n.target.value):0}}),placeholder:"30",className:"text-sm md:text-base"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"与 Napcat 设置的心跳间隔保持一致(留空使用默认值 30)"})]})]})]})})}function Kve({config:t,onChange:e}){return o.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"麦麦 WebSocket 服务设置"}),o.jsxs("div",{className:"grid gap-3 md:gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"maibot-host",className:"text-sm md:text-base",children:"主机地址"}),o.jsx(Pe,{id:"maibot-host",value:t.maibot_server.host,onChange:n=>e({...t,maibot_server:{...t.maibot_server,host:n.target.value}}),placeholder:"localhost",className:"text-sm md:text-base"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 HOST 字段"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"maibot-port",className:"text-sm md:text-base",children:"端口"}),o.jsx(Pe,{id:"maibot-port",type:"number",value:t.maibot_server.port||"",onChange:n=>e({...t,maibot_server:{...t.maibot_server,port:n.target.value?parseInt(n.target.value):0}}),placeholder:"8000",className:"text-sm md:text-base"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 PORT 字段(留空使用默认值 8000)"})]})]})]})})}function Zve({config:t,onChange:e}){const n=i=>{const a={...t};i==="group"?a.chat.group_list=[...a.chat.group_list,0]:i==="private"?a.chat.private_list=[...a.chat.private_list,0]:a.chat.ban_user_id=[...a.chat.ban_user_id,0],e(a)},r=(i,a)=>{const l={...t};i==="group"?l.chat.group_list=l.chat.group_list.filter((c,d)=>d!==a):i==="private"?l.chat.private_list=l.chat.private_list.filter((c,d)=>d!==a):l.chat.ban_user_id=l.chat.ban_user_id.filter((c,d)=>d!==a),e(l)},s=(i,a,l)=>{const c={...t};i==="group"?c.chat.group_list[a]=l:i==="private"?c.chat.private_list[a]=l:c.chat.ban_user_id[a]=l,e(c)};return o.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"聊天黑白名单功能"}),o.jsxs("div",{className:"grid gap-4 md:gap-6",children:[o.jsxs("div",{className:"space-y-3 md:space-y-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-sm md:text-base",children:"群组名单类型"}),o.jsxs(Vt,{value:t.chat.group_list_type,onValueChange:i=>e({...t,chat:{...t.chat,group_list_type:i}}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),o.jsx(De,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[o.jsx(he,{className:"text-sm md:text-base",children:"群组列表"}),o.jsxs(ue,{onClick:()=>n("group"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[o.jsx(Po,{className:"mr-1 h-4 w-4"}),"添加群号"]})]}),t.chat.group_list.map((i,a)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Pe,{type:"number",value:i,onChange:l=>s("group",a,parseInt(l.target.value)||0),placeholder:"输入群号",className:"text-sm md:text-base"}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsx(ue,{size:"icon",variant:"outline",children:o.jsx(Cn,{className:"h-4 w-4"})})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:["确定要删除群号 ",i," 吗?此操作无法撤销。"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>r("group",a),children:"删除"})]})]})]})]},a)),t.chat.group_list.length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无群组"})]})]}),o.jsxs("div",{className:"space-y-3 md:space-y-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-sm md:text-base",children:"私聊名单类型"}),o.jsxs(Vt,{value:t.chat.private_list_type,onValueChange:i=>e({...t,chat:{...t.chat,private_list_type:i}}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),o.jsx(De,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[o.jsx(he,{className:"text-sm md:text-base",children:"私聊列表"}),o.jsxs(ue,{onClick:()=>n("private"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[o.jsx(Po,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),t.chat.private_list.map((i,a)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Pe,{type:"number",value:i,onChange:l=>s("private",a,parseInt(l.target.value)||0),placeholder:"输入QQ号",className:"text-sm md:text-base"}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsx(ue,{size:"icon",variant:"outline",children:o.jsx(Cn,{className:"h-4 w-4"})})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:["确定要删除用户 ",i," 吗?此操作无法撤销。"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>r("private",a),children:"删除"})]})]})]})]},a)),t.chat.private_list.length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无用户"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-sm md:text-base",children:"全局禁止名单"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"名单中的用户无法进行任何聊天"})]}),o.jsxs(ue,{onClick:()=>n("ban"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[o.jsx(Po,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),t.chat.ban_user_id.map((i,a)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Pe,{type:"number",value:i,onChange:l=>s("ban",a,parseInt(l.target.value)||0),placeholder:"输入QQ号",className:"text-sm md:text-base"}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsx(ue,{size:"icon",variant:"outline",children:o.jsx(Cn,{className:"h-4 w-4"})})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:["确定要从全局禁止名单中删除用户 ",i," 吗?此操作无法撤销。"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>r("ban",a),children:"删除"})]})]})]})]},a)),t.chat.ban_user_id.length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无禁止用户"})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-sm md:text-base",children:"屏蔽QQ官方机器人"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否屏蔽来自QQ官方机器人的消息"})]}),o.jsx(Ft,{checked:t.chat.ban_qq_bot,onCheckedChange:i=>e({...t,chat:{...t.chat,ban_qq_bot:i}})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-sm md:text-base",children:"启用戳一戳功能"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否响应戳一戳消息"})]}),o.jsx(Ft,{checked:t.chat.enable_poke,onCheckedChange:i=>e({...t,chat:{...t.chat,enable_poke:i}})})]})]})]})})}function Jve({config:t,onChange:e}){return o.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"发送语音设置"}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-sm md:text-base",children:"使用 TTS 语音"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"请确保已配置 TTS 并有对应的适配器"})]}),o.jsx(Ft,{checked:t.voice.use_tts,onCheckedChange:n=>e({...t,voice:{use_tts:n}})})]})]})})}function eye({config:t,onChange:e}){return o.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"调试设置"}),o.jsx("div",{className:"grid gap-3 md:gap-4",children:o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-sm md:text-base",children:"日志等级"}),o.jsxs(Vt,{value:t.debug.level,onValueChange:n=>e({...t,debug:{level:n}}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"DEBUG",children:"DEBUG(调试)"}),o.jsx(De,{value:"INFO",children:"INFO(信息)"}),o.jsx(De,{value:"WARNING",children:"WARNING(警告)"}),o.jsx(De,{value:"ERROR",children:"ERROR(错误)"}),o.jsx(De,{value:"CRITICAL",children:"CRITICAL(严重)"})]})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"设置适配器的日志输出等级"})]})})]})})}function OM(t){const e=[],n=String(t||"");let r=n.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const a=n.slice(s,r).trim();(a||!i)&&e.push(a),s=r+1,r=n.indexOf(",",s)}return e}function tye(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const nye=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,rye=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,sye={};function jM(t,e){return(sye.jsx?rye:nye).test(t)}const iye=/[ \t\n\f\r]/g;function aye(t){return typeof t=="object"?t.type==="text"?NM(t.value):!1:NM(t)}function NM(t){return t.replace(iye,"")===""}class pg{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}pg.prototype.normal={};pg.prototype.property={};pg.prototype.space=void 0;function VQ(t,e){const n={},r={};for(const s of t)Object.assign(n,s.property),Object.assign(r,s.normal);return new pg(n,r,e)}function vp(t){return t.toLowerCase()}class Ai{constructor(e,n){this.attribute=n,this.property=e}}Ai.prototype.attribute="";Ai.prototype.booleanish=!1;Ai.prototype.boolean=!1;Ai.prototype.commaOrSpaceSeparated=!1;Ai.prototype.commaSeparated=!1;Ai.prototype.defined=!1;Ai.prototype.mustUseProperty=!1;Ai.prototype.number=!1;Ai.prototype.overloadedBoolean=!1;Ai.prototype.property="";Ai.prototype.spaceSeparated=!1;Ai.prototype.space=void 0;let oye=0;const en=kd(),ns=kd(),AO=kd(),Qe=kd(),mr=kd(),$h=kd(),Hi=kd();function kd(){return 2**++oye}const MO=Object.freeze(Object.defineProperty({__proto__:null,boolean:en,booleanish:ns,commaOrSpaceSeparated:Hi,commaSeparated:$h,number:Qe,overloadedBoolean:AO,spaceSeparated:mr},Symbol.toStringTag,{value:"Module"})),MS=Object.keys(MO);class hN extends Ai{constructor(e,n,r,s){let i=-1;if(super(e,n),CM(this,"space",s),typeof r=="number")for(;++i4&&n.slice(0,4)==="data"&&hye.test(e)){if(e.charAt(4)==="-"){const i=e.slice(5).replace(TM,mye);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=e.slice(4);if(!TM.test(i)){let a=i.replace(dye,fye);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}s=hN}return new s(r,e)}function fye(t){return"-"+t.toLowerCase()}function mye(t){return t.charAt(1).toUpperCase()}const JQ=VQ([UQ,lye,XQ,YQ,KQ],"html"),Fb=VQ([UQ,cye,XQ,YQ,KQ],"svg");function EM(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function pye(t){return t.join(" ").trim()}var ch={},RS,_M;function gye(){if(_M)return RS;_M=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,l=/^\s+|\s+$/g,c=` -`,d="/",h="*",m="",g="comment",x="declaration";function y(S,k){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];k=k||{};var j=1,N=1;function T(I){var V=I.match(e);V&&(j+=V.length);var L=I.lastIndexOf(c);N=~L?I.length-L:N+I.length}function E(){var I={line:j,column:N};return function(V){return V.position=new _(I),q(),V}}function _(I){this.start=I,this.end={line:j,column:N},this.source=k.source}_.prototype.content=S;function A(I){var V=new Error(k.source+":"+j+":"+N+": "+I);if(V.reason=I,V.filename=k.source,V.line=j,V.column=N,V.source=S,!k.silent)throw V}function D(I){var V=I.exec(S);if(V){var L=V[0];return T(L),S=S.slice(L.length),V}}function q(){D(n)}function B(I){var V;for(I=I||[];V=H();)V!==!1&&I.push(V);return I}function H(){var I=E();if(!(d!=S.charAt(0)||h!=S.charAt(1))){for(var V=2;m!=S.charAt(V)&&(h!=S.charAt(V)||d!=S.charAt(V+1));)++V;if(V+=2,m===S.charAt(V-1))return A("End of comment missing");var L=S.slice(2,V-2);return N+=2,T(L),S=S.slice(V),N+=2,I({type:g,comment:L})}}function W(){var I=E(),V=D(r);if(V){if(H(),!D(s))return A("property missing ':'");var L=D(i),$=I({type:x,property:w(V[0].replace(t,m)),value:L?w(L[0].replace(t,m)):m});return D(a),$}}function ee(){var I=[];B(I);for(var V;V=W();)V!==!1&&(I.push(V),B(I));return I}return q(),ee()}function w(S){return S?S.replace(l,m):m}return RS=y,RS}var AM;function xye(){if(AM)return ch;AM=1;var t=ch&&ch.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ch,"__esModule",{value:!0}),ch.default=n;const e=t(gye());function n(r,s){let i=null;if(!r||typeof r!="string")return i;const a=(0,e.default)(r),l=typeof s=="function";return a.forEach(c=>{if(c.type!=="declaration")return;const{property:d,value:h}=c;l?s(d,h,c):h&&(i=i||{},i[d]=h)}),i}return ch}var Km={},MM;function vye(){if(MM)return Km;MM=1,Object.defineProperty(Km,"__esModule",{value:!0}),Km.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(d){return!d||n.test(d)||t.test(d)},a=function(d,h){return h.toUpperCase()},l=function(d,h){return"".concat(h,"-")},c=function(d,h){return h===void 0&&(h={}),i(d)?d:(d=d.toLowerCase(),h.reactCompat?d=d.replace(s,l):d=d.replace(r,l),d.replace(e,a))};return Km.camelCase=c,Km}var Zm,RM;function yye(){if(RM)return Zm;RM=1;var t=Zm&&Zm.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},e=t(xye()),n=vye();function r(s,i){var a={};return!s||typeof s!="string"||(0,e.default)(s,function(l,c){l&&c&&(a[(0,n.camelCase)(l,i)]=c)}),a}return r.default=r,Zm=r,Zm}var bye=yye();const wye=yd(bye),eV=tV("end"),fN=tV("start");function tV(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Sye(t){const e=fN(t),n=eV(t);if(e&&n)return{start:e,end:n}}function R0(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?DM(t.position):"start"in t||"end"in t?DM(t):"line"in t||"column"in t?RO(t):""}function RO(t){return PM(t&&t.line)+":"+PM(t&&t.column)}function DM(t){return RO(t&&t.start)+"-"+RO(t&&t.end)}function PM(t){return t&&typeof t=="number"?t:1}class Gs extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},a=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof e=="string"?s=e:!i.cause&&e&&(a=!0,s=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?i.ruleId=r:(i.source=r.slice(0,c),i.ruleId=r.slice(c+1))}if(!i.place&&i.ancestors&&i.ancestors){const c=i.ancestors[i.ancestors.length-1];c&&(i.place=c.position)}const l=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=R0(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Gs.prototype.file="";Gs.prototype.name="";Gs.prototype.reason="";Gs.prototype.message="";Gs.prototype.stack="";Gs.prototype.column=void 0;Gs.prototype.line=void 0;Gs.prototype.ancestors=void 0;Gs.prototype.cause=void 0;Gs.prototype.fatal=void 0;Gs.prototype.place=void 0;Gs.prototype.ruleId=void 0;Gs.prototype.source=void 0;const mN={}.hasOwnProperty,kye=new Map,Oye=/[A-Z]/g,jye=new Set(["table","tbody","thead","tfoot","tr"]),Nye=new Set(["td","th"]),nV="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Cye(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Pye(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Dye(n,e.jsx,e.jsxs)}const s={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Fb:JQ,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},i=rV(s,t,void 0);return i&&typeof i!="string"?i:s.create(t,s.Fragment,{children:i||void 0},void 0)}function rV(t,e,n){if(e.type==="element")return Tye(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return Eye(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Aye(t,e,n);if(e.type==="mdxjsEsm")return _ye(t,e);if(e.type==="root")return Mye(t,e,n);if(e.type==="text")return Rye(t,e)}function Tye(t,e,n){const r=t.schema;let s=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Fb,t.schema=s),t.ancestors.push(e);const i=iV(t,e.tagName,!1),a=zye(t,e);let l=gN(t,e);return jye.has(e.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!aye(c):!0})),sV(t,a,i,e),pN(a,l),t.ancestors.pop(),t.schema=r,t.create(e,i,a,n)}function Eye(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}yp(t,e.position)}function _ye(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);yp(t,e.position)}function Aye(t,e,n){const r=t.schema;let s=r;e.name==="svg"&&r.space==="html"&&(s=Fb,t.schema=s),t.ancestors.push(e);const i=e.name===null?t.Fragment:iV(t,e.name,!0),a=Iye(t,e),l=gN(t,e);return sV(t,a,i,e),pN(a,l),t.ancestors.pop(),t.schema=r,t.create(e,i,a,n)}function Mye(t,e,n){const r={};return pN(r,gN(t,e)),t.create(e,t.Fragment,r,n)}function Rye(t,e){return e.value}function sV(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function pN(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function Dye(t,e,n){return r;function r(s,i,a,l){const d=Array.isArray(a.children)?n:e;return l?d(i,a,l):d(i,a)}}function Pye(t,e){return n;function n(r,s,i,a){const l=Array.isArray(i.children),c=fN(r);return e(s,i,a,l,{columnNumber:c?c.column-1:void 0,fileName:t,lineNumber:c?c.line:void 0},void 0)}}function zye(t,e){const n={};let r,s;for(s in e.properties)if(s!=="children"&&mN.call(e.properties,s)){const i=Lye(t,s,e.properties[s]);if(i){const[a,l]=i;t.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&Nye.has(e.tagName)?r=l:n[a]=l}}if(r){const i=n.style||(n.style={});i[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Iye(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const l=a.properties[0];l.type,Object.assign(n,t.evaluater.evaluateExpression(l.argument))}else yp(t,e.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const l=r.value.data.estree.body[0];l.type,i=t.evaluater.evaluateExpression(l.expression)}else yp(t,e.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function gN(t,e){const n=[];let r=-1;const s=t.passKeys?new Map:kye;for(;++rs?0:s+e:e=e>s?s:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);i0?(Ki(t,t.length,0,e),t):e}const LM={}.hasOwnProperty;function oV(t){const e={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Xa(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ei=fu(/[A-Za-z]/),Vs=fu(/[\dA-Za-z]/),Wye=fu(/[#-'*+\--9=?A-Z^-~]/);function ky(t){return t!==null&&(t<32||t===127)}const DO=fu(/\d/),Gye=fu(/[\dA-Fa-f]/),Xye=fu(/[!-/:-@[-`{-~]/);function St(t){return t!==null&&t<-2}function dr(t){return t!==null&&(t<0||t===32)}function gn(t){return t===-2||t===-1||t===32}const qb=fu(new RegExp("\\p{P}|\\p{S}","u")),gd=fu(/\s/);function fu(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function qf(t){const e=[];let n=-1,r=0,s=0;for(;++n55295&&i<57344){const l=t.charCodeAt(n+1);i<56320&&l>56319&&l<57344?(a=String.fromCharCode(i,l),s=1):a="�"}else a=String.fromCharCode(i);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+s+1,a=""),s&&(n+=s,s=0)}return e.join("")+t.slice(r)}function cn(t,e,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(c){return gn(c)?(t.enter(n),l(c)):e(c)}function l(c){return gn(c)&&i++a))return;const A=e.events.length;let D=A,q,B;for(;D--;)if(e.events[D][0]==="exit"&&e.events[D][1].type==="chunkFlow"){if(q){B=e.events[D][1].end;break}q=!0}for(k(r),_=A;_N;){const E=n[T];e.containerState=E[1],E[0].exit.call(e,t)}n.length=N}function j(){s.write([null]),i=void 0,s=void 0,e.containerState._closeFlow=void 0}}function ebe(t,e,n){return cn(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function hf(t){if(t===null||dr(t)||gd(t))return 1;if(qb(t))return 2}function $b(t,e,n){const r=[];let s=-1;for(;++s1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const m={...t[r][1].end},g={...t[n][1].start};FM(m,-c),FM(g,c),a={type:c>1?"strongSequence":"emphasisSequence",start:m,end:{...t[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:g},i={type:c>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},s={type:c>1?"strong":"emphasis",start:{...a.start},end:{...l.end}},t[r][1].end={...a.start},t[n][1].start={...l.end},d=[],t[r][1].end.offset-t[r][1].start.offset&&(d=xa(d,[["enter",t[r][1],e],["exit",t[r][1],e]])),d=xa(d,[["enter",s,e],["enter",a,e],["exit",a,e],["enter",i,e]]),d=xa(d,$b(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),d=xa(d,[["exit",i,e],["enter",l,e],["exit",l,e],["exit",s,e]]),t[n][1].end.offset-t[n][1].start.offset?(h=2,d=xa(d,[["enter",t[n][1],e],["exit",t[n][1],e]])):h=0,Ki(t,r-1,n-r+3,d),n=r+d.length-h-2;break}}for(n=-1;++n0&&gn(_)?cn(t,j,"linePrefix",i+1)(_):j(_)}function j(_){return _===null||St(_)?t.check(qM,w,T)(_):(t.enter("codeFlowValue"),N(_))}function N(_){return _===null||St(_)?(t.exit("codeFlowValue"),j(_)):(t.consume(_),N)}function T(_){return t.exit("codeFenced"),e(_)}function E(_,A,D){let q=0;return B;function B(V){return _.enter("lineEnding"),_.consume(V),_.exit("lineEnding"),H}function H(V){return _.enter("codeFencedFence"),gn(V)?cn(_,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):W(V)}function W(V){return V===l?(_.enter("codeFencedFenceSequence"),ee(V)):D(V)}function ee(V){return V===l?(q++,_.consume(V),ee):q>=a?(_.exit("codeFencedFenceSequence"),gn(V)?cn(_,I,"whitespace")(V):I(V)):D(V)}function I(V){return V===null||St(V)?(_.exit("codeFencedFence"),A(V)):D(V)}}}function hbe(t,e,n){const r=this;return s;function s(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const PS={name:"codeIndented",tokenize:mbe},fbe={partial:!0,tokenize:pbe};function mbe(t,e,n){const r=this;return s;function s(d){return t.enter("codeIndented"),cn(t,i,"linePrefix",5)(d)}function i(d){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?a(d):n(d)}function a(d){return d===null?c(d):St(d)?t.attempt(fbe,a,c)(d):(t.enter("codeFlowValue"),l(d))}function l(d){return d===null||St(d)?(t.exit("codeFlowValue"),a(d)):(t.consume(d),l)}function c(d){return t.exit("codeIndented"),e(d)}}function pbe(t,e,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):St(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s):cn(t,i,"linePrefix",5)(a)}function i(a){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(a):St(a)?s(a):n(a)}}const gbe={name:"codeText",previous:vbe,resolve:xbe,tokenize:ybe};function xbe(t){let e=t.length-4,n=3,r,s;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const s=n||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Jm(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Jm(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Jm(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function fV(t,e,n,r,s,i,a,l,c){const d=c||Number.POSITIVE_INFINITY;let h=0;return m;function m(k){return k===60?(t.enter(r),t.enter(s),t.enter(i),t.consume(k),t.exit(i),g):k===null||k===32||k===41||ky(k)?n(k):(t.enter(r),t.enter(a),t.enter(l),t.enter("chunkString",{contentType:"string"}),w(k))}function g(k){return k===62?(t.enter(i),t.consume(k),t.exit(i),t.exit(s),t.exit(r),e):(t.enter(l),t.enter("chunkString",{contentType:"string"}),x(k))}function x(k){return k===62?(t.exit("chunkString"),t.exit(l),g(k)):k===null||k===60||St(k)?n(k):(t.consume(k),k===92?y:x)}function y(k){return k===60||k===62||k===92?(t.consume(k),x):x(k)}function w(k){return!h&&(k===null||k===41||dr(k))?(t.exit("chunkString"),t.exit(l),t.exit(a),t.exit(r),e(k)):h999||x===null||x===91||x===93&&!c||x===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(x):x===93?(t.exit(i),t.enter(s),t.consume(x),t.exit(s),t.exit(r),e):St(x)?(t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),h):(t.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===null||x===91||x===93||St(x)||l++>999?(t.exit("chunkString"),h(x)):(t.consume(x),c||(c=!gn(x)),x===92?g:m)}function g(x){return x===91||x===92||x===93?(t.consume(x),l++,m):m(x)}}function pV(t,e,n,r,s,i){let a;return l;function l(g){return g===34||g===39||g===40?(t.enter(r),t.enter(s),t.consume(g),t.exit(s),a=g===40?41:g,c):n(g)}function c(g){return g===a?(t.enter(s),t.consume(g),t.exit(s),t.exit(r),e):(t.enter(i),d(g))}function d(g){return g===a?(t.exit(i),c(a)):g===null?n(g):St(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),cn(t,d,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===a||g===null||St(g)?(t.exit("chunkString"),d(g)):(t.consume(g),g===92?m:h)}function m(g){return g===a||g===92?(t.consume(g),h):h(g)}}function D0(t,e){let n;return r;function r(s){return St(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),n=!0,r):gn(s)?cn(t,r,n?"linePrefix":"lineSuffix")(s):e(s)}}const Cbe={name:"definition",tokenize:Ebe},Tbe={partial:!0,tokenize:_be};function Ebe(t,e,n){const r=this;let s;return i;function i(x){return t.enter("definition"),a(x)}function a(x){return mV.call(r,t,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function l(x){return s=Xa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),x===58?(t.enter("definitionMarker"),t.consume(x),t.exit("definitionMarker"),c):n(x)}function c(x){return dr(x)?D0(t,d)(x):d(x)}function d(x){return fV(t,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function h(x){return t.attempt(Tbe,m,m)(x)}function m(x){return gn(x)?cn(t,g,"whitespace")(x):g(x)}function g(x){return x===null||St(x)?(t.exit("definition"),r.parser.defined.push(s),e(x)):n(x)}}function _be(t,e,n){return r;function r(l){return dr(l)?D0(t,s)(l):n(l)}function s(l){return pV(t,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function i(l){return gn(l)?cn(t,a,"whitespace")(l):a(l)}function a(l){return l===null||St(l)?e(l):n(l)}}const Abe={name:"hardBreakEscape",tokenize:Mbe};function Mbe(t,e,n){return r;function r(i){return t.enter("hardBreakEscape"),t.consume(i),s}function s(i){return St(i)?(t.exit("hardBreakEscape"),e(i)):n(i)}}const Rbe={name:"headingAtx",resolve:Dbe,tokenize:Pbe};function Dbe(t,e){let n=t.length-2,r=3,s,i;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},i={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},Ki(t,r,n-r+1,[["enter",s,e],["enter",i,e],["exit",i,e],["exit",s,e]])),t}function Pbe(t,e,n){let r=0;return s;function s(h){return t.enter("atxHeading"),i(h)}function i(h){return t.enter("atxHeadingSequence"),a(h)}function a(h){return h===35&&r++<6?(t.consume(h),a):h===null||dr(h)?(t.exit("atxHeadingSequence"),l(h)):n(h)}function l(h){return h===35?(t.enter("atxHeadingSequence"),c(h)):h===null||St(h)?(t.exit("atxHeading"),e(h)):gn(h)?cn(t,l,"whitespace")(h):(t.enter("atxHeadingText"),d(h))}function c(h){return h===35?(t.consume(h),c):(t.exit("atxHeadingSequence"),l(h))}function d(h){return h===null||h===35||dr(h)?(t.exit("atxHeadingText"),l(h)):(t.consume(h),d)}}const zbe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],HM=["pre","script","style","textarea"],Ibe={concrete:!0,name:"htmlFlow",resolveTo:Fbe,tokenize:qbe},Lbe={partial:!0,tokenize:Hbe},Bbe={partial:!0,tokenize:$be};function Fbe(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function qbe(t,e,n){const r=this;let s,i,a,l,c;return d;function d(z){return h(z)}function h(z){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(z),m}function m(z){return z===33?(t.consume(z),g):z===47?(t.consume(z),i=!0,w):z===63?(t.consume(z),s=3,r.interrupt?e:R):ei(z)?(t.consume(z),a=String.fromCharCode(z),S):n(z)}function g(z){return z===45?(t.consume(z),s=2,x):z===91?(t.consume(z),s=5,l=0,y):ei(z)?(t.consume(z),s=4,r.interrupt?e:R):n(z)}function x(z){return z===45?(t.consume(z),r.interrupt?e:R):n(z)}function y(z){const U="CDATA[";return z===U.charCodeAt(l++)?(t.consume(z),l===U.length?r.interrupt?e:W:y):n(z)}function w(z){return ei(z)?(t.consume(z),a=String.fromCharCode(z),S):n(z)}function S(z){if(z===null||z===47||z===62||dr(z)){const U=z===47,te=a.toLowerCase();return!U&&!i&&HM.includes(te)?(s=1,r.interrupt?e(z):W(z)):zbe.includes(a.toLowerCase())?(s=6,U?(t.consume(z),k):r.interrupt?e(z):W(z)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(z):i?j(z):N(z))}return z===45||Vs(z)?(t.consume(z),a+=String.fromCharCode(z),S):n(z)}function k(z){return z===62?(t.consume(z),r.interrupt?e:W):n(z)}function j(z){return gn(z)?(t.consume(z),j):B(z)}function N(z){return z===47?(t.consume(z),B):z===58||z===95||ei(z)?(t.consume(z),T):gn(z)?(t.consume(z),N):B(z)}function T(z){return z===45||z===46||z===58||z===95||Vs(z)?(t.consume(z),T):E(z)}function E(z){return z===61?(t.consume(z),_):gn(z)?(t.consume(z),E):N(z)}function _(z){return z===null||z===60||z===61||z===62||z===96?n(z):z===34||z===39?(t.consume(z),c=z,A):gn(z)?(t.consume(z),_):D(z)}function A(z){return z===c?(t.consume(z),c=null,q):z===null||St(z)?n(z):(t.consume(z),A)}function D(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||dr(z)?E(z):(t.consume(z),D)}function q(z){return z===47||z===62||gn(z)?N(z):n(z)}function B(z){return z===62?(t.consume(z),H):n(z)}function H(z){return z===null||St(z)?W(z):gn(z)?(t.consume(z),H):n(z)}function W(z){return z===45&&s===2?(t.consume(z),L):z===60&&s===1?(t.consume(z),$):z===62&&s===4?(t.consume(z),ie):z===63&&s===3?(t.consume(z),R):z===93&&s===5?(t.consume(z),Y):St(z)&&(s===6||s===7)?(t.exit("htmlFlowData"),t.check(Lbe,X,ee)(z)):z===null||St(z)?(t.exit("htmlFlowData"),ee(z)):(t.consume(z),W)}function ee(z){return t.check(Bbe,I,X)(z)}function I(z){return t.enter("lineEnding"),t.consume(z),t.exit("lineEnding"),V}function V(z){return z===null||St(z)?ee(z):(t.enter("htmlFlowData"),W(z))}function L(z){return z===45?(t.consume(z),R):W(z)}function $(z){return z===47?(t.consume(z),a="",K):W(z)}function K(z){if(z===62){const U=a.toLowerCase();return HM.includes(U)?(t.consume(z),ie):W(z)}return ei(z)&&a.length<8?(t.consume(z),a+=String.fromCharCode(z),K):W(z)}function Y(z){return z===93?(t.consume(z),R):W(z)}function R(z){return z===62?(t.consume(z),ie):z===45&&s===2?(t.consume(z),R):W(z)}function ie(z){return z===null||St(z)?(t.exit("htmlFlowData"),X(z)):(t.consume(z),ie)}function X(z){return t.exit("htmlFlow"),e(z)}}function $be(t,e,n){const r=this;return s;function s(a){return St(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):n(a)}function i(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function Hbe(t,e,n){return r;function r(s){return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),t.attempt(gg,e,n)}}const Qbe={name:"htmlText",tokenize:Vbe};function Vbe(t,e,n){const r=this;let s,i,a;return l;function l(R){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(R),c}function c(R){return R===33?(t.consume(R),d):R===47?(t.consume(R),E):R===63?(t.consume(R),N):ei(R)?(t.consume(R),D):n(R)}function d(R){return R===45?(t.consume(R),h):R===91?(t.consume(R),i=0,y):ei(R)?(t.consume(R),j):n(R)}function h(R){return R===45?(t.consume(R),x):n(R)}function m(R){return R===null?n(R):R===45?(t.consume(R),g):St(R)?(a=m,$(R)):(t.consume(R),m)}function g(R){return R===45?(t.consume(R),x):m(R)}function x(R){return R===62?L(R):R===45?g(R):m(R)}function y(R){const ie="CDATA[";return R===ie.charCodeAt(i++)?(t.consume(R),i===ie.length?w:y):n(R)}function w(R){return R===null?n(R):R===93?(t.consume(R),S):St(R)?(a=w,$(R)):(t.consume(R),w)}function S(R){return R===93?(t.consume(R),k):w(R)}function k(R){return R===62?L(R):R===93?(t.consume(R),k):w(R)}function j(R){return R===null||R===62?L(R):St(R)?(a=j,$(R)):(t.consume(R),j)}function N(R){return R===null?n(R):R===63?(t.consume(R),T):St(R)?(a=N,$(R)):(t.consume(R),N)}function T(R){return R===62?L(R):N(R)}function E(R){return ei(R)?(t.consume(R),_):n(R)}function _(R){return R===45||Vs(R)?(t.consume(R),_):A(R)}function A(R){return St(R)?(a=A,$(R)):gn(R)?(t.consume(R),A):L(R)}function D(R){return R===45||Vs(R)?(t.consume(R),D):R===47||R===62||dr(R)?q(R):n(R)}function q(R){return R===47?(t.consume(R),L):R===58||R===95||ei(R)?(t.consume(R),B):St(R)?(a=q,$(R)):gn(R)?(t.consume(R),q):L(R)}function B(R){return R===45||R===46||R===58||R===95||Vs(R)?(t.consume(R),B):H(R)}function H(R){return R===61?(t.consume(R),W):St(R)?(a=H,$(R)):gn(R)?(t.consume(R),H):q(R)}function W(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(t.consume(R),s=R,ee):St(R)?(a=W,$(R)):gn(R)?(t.consume(R),W):(t.consume(R),I)}function ee(R){return R===s?(t.consume(R),s=void 0,V):R===null?n(R):St(R)?(a=ee,$(R)):(t.consume(R),ee)}function I(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||dr(R)?q(R):(t.consume(R),I)}function V(R){return R===47||R===62||dr(R)?q(R):n(R)}function L(R){return R===62?(t.consume(R),t.exit("htmlTextData"),t.exit("htmlText"),e):n(R)}function $(R){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),K}function K(R){return gn(R)?cn(t,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):Y(R)}function Y(R){return t.enter("htmlTextData"),a(R)}}const yN={name:"labelEnd",resolveAll:Xbe,resolveTo:Ybe,tokenize:Kbe},Ube={tokenize:Zbe},Wbe={tokenize:Jbe},Gbe={tokenize:ewe};function Xbe(t){let e=-1;const n=[];for(;++e=3&&(d===null||St(d))?(t.exit("thematicBreak"),e(d)):n(d)}function c(d){return d===s?(t.consume(d),r++,c):(t.exit("thematicBreakSequence"),gn(d)?cn(t,l,"whitespace")(d):l(d))}}const pi={continuation:{tokenize:uwe},exit:hwe,name:"list",tokenize:cwe},owe={partial:!0,tokenize:fwe},lwe={partial:!0,tokenize:dwe};function cwe(t,e,n){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return l;function l(x){const y=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:DO(x)){if(r.containerState.type||(r.containerState.type=y,t.enter(y,{_container:!0})),y==="listUnordered")return t.enter("listItemPrefix"),x===42||x===45?t.check(Cv,n,d)(x):d(x);if(!r.interrupt||x===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),c(x)}return n(x)}function c(x){return DO(x)&&++a<10?(t.consume(x),c):(!r.interrupt||a<2)&&(r.containerState.marker?x===r.containerState.marker:x===41||x===46)?(t.exit("listItemValue"),d(x)):n(x)}function d(x){return t.enter("listItemMarker"),t.consume(x),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,t.check(gg,r.interrupt?n:h,t.attempt(owe,g,m))}function h(x){return r.containerState.initialBlankLine=!0,i++,g(x)}function m(x){return gn(x)?(t.enter("listItemPrefixWhitespace"),t.consume(x),t.exit("listItemPrefixWhitespace"),g):n(x)}function g(x){return r.containerState.size=i+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(x)}}function uwe(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(gg,s,i);function s(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,cn(t,e,"listItemIndent",r.containerState.size+1)(l)}function i(l){return r.containerState.furtherBlankLines||!gn(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(lwe,e,a)(l))}function a(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,cn(t,t.attempt(pi,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function dwe(t,e,n){const r=this;return cn(t,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(i):n(i)}}function hwe(t){t.exit(this.containerState.type)}function fwe(t,e,n){const r=this;return cn(t,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!gn(i)&&a&&a[1].type==="listItemPrefixWhitespace"?e(i):n(i)}}const QM={name:"setextUnderline",resolveTo:mwe,tokenize:pwe};function mwe(t,e){let n=t.length,r,s,i;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(s=n)}else t[n][1].type==="content"&&t.splice(n,1),!i&&t[n][1].type==="definition"&&(i=n);const a={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[s][1].type="setextHeadingText",i?(t.splice(s,0,["enter",a,e]),t.splice(i+1,0,["exit",t[r][1],e]),t[r][1].end={...t[i][1].end}):t[r][1]=a,t.push(["exit",a,e]),t}function pwe(t,e,n){const r=this;let s;return i;function i(d){let h=r.events.length,m;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){m=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(t.enter("setextHeadingLine"),s=d,a(d)):n(d)}function a(d){return t.enter("setextHeadingLineSequence"),l(d)}function l(d){return d===s?(t.consume(d),l):(t.exit("setextHeadingLineSequence"),gn(d)?cn(t,c,"lineSuffix")(d):c(d))}function c(d){return d===null||St(d)?(t.exit("setextHeadingLine"),e(d)):n(d)}}const gwe={tokenize:xwe};function xwe(t){const e=this,n=t.attempt(gg,r,t.attempt(this.parser.constructs.flowInitial,s,cn(t,t.attempt(this.parser.constructs.flow,s,t.attempt(Sbe,s)),"linePrefix")));return n;function r(i){if(i===null){t.consume(i);return}return t.enter("lineEndingBlank"),t.consume(i),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function s(i){if(i===null){t.consume(i);return}return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const vwe={resolveAll:xV()},ywe=gV("string"),bwe=gV("text");function gV(t){return{resolveAll:xV(t==="text"?wwe:void 0),tokenize:e};function e(n){const r=this,s=this.parser.constructs[t],i=n.attempt(s,a,l);return a;function a(h){return d(h)?i(h):l(h)}function l(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),c}function c(h){return d(h)?(n.exit("data"),i(h)):(n.consume(h),c)}function d(h){if(h===null)return!0;const m=s[h];let g=-1;if(m)for(;++g-1){const l=a[0];typeof l=="string"?a[0]=l.slice(r):a.shift()}i>0&&a.push(t[s].slice(0,i))}return a}function Dwe(t,e){let n=-1;const r=[];let s;for(;++n0){const Rt=rt.tokenStack[rt.tokenStack.length-1];(Rt[1]||UM).call(rt,void 0,Rt[0])}for(ze.position={start:Ec(Ne.length>0?Ne[0][1].start:{line:1,column:1,offset:0}),end:Ec(Ne.length>0?Ne[Ne.length-2][1].end:{line:1,column:1,offset:0})},zt=-1;++zt1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};t.patch(e,c);const d={type:"element",tagName:"sup",properties:{},children:[c]};return t.patch(e,d),t.applyData(e,d)}function Kwe(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Zwe(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function bV(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const s=t.all(e),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function Jwe(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return bV(t,e);const s={src:qf(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return t.patch(e,i),t.applyData(e,i)}function e2e(t,e){const n={src:qf(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function t2e(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function n2e(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return bV(t,e);const s={href:qf(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function r2e(t,e){const n={href:qf(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function s2e(t,e,n){const r=t.all(e),s=n?i2e(n):wV(e),i={},a=[];if(typeof e.checked=="boolean"){const h=r[0];let m;h&&h.type==="element"&&h.tagName==="p"?m=h:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let l=-1;for(;++l1}function a2e(t,e){const n={},r=t.all(e);let s=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++s0){const a={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},l=fN(e.children[1]),c=eV(e.children[e.children.length-1]);l&&c&&(a.position={start:l,end:c}),s.push(a)}const i={type:"element",tagName:"table",properties:{},children:t.wrap(s,!0)};return t.patch(e,i),t.applyData(e,i)}function d2e(t,e,n){const r=n?n.children:void 0,i=(r?r.indexOf(e):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,l=a?a.length:e.children.length;let c=-1;const d=[];for(;++c0,!0),r[0]),s=r.index+r[0].length,r=n.exec(e);return i.push(XM(e.slice(s),s>0,!1)),i.join("")}function XM(t,e,n){let r=0,s=t.length;if(e){let i=t.codePointAt(r);for(;i===WM||i===GM;)r++,i=t.codePointAt(r)}if(n){let i=t.codePointAt(s-1);for(;i===WM||i===GM;)s--,i=t.codePointAt(s-1)}return s>r?t.slice(r,s):""}function m2e(t,e){const n={type:"text",value:f2e(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function p2e(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const g2e={blockquote:Vwe,break:Uwe,code:Wwe,delete:Gwe,emphasis:Xwe,footnoteReference:Ywe,heading:Kwe,html:Zwe,imageReference:Jwe,image:e2e,inlineCode:t2e,linkReference:n2e,link:r2e,listItem:s2e,list:a2e,paragraph:o2e,root:l2e,strong:c2e,table:u2e,tableCell:h2e,tableRow:d2e,text:m2e,thematicBreak:p2e,toml:M1,yaml:M1,definition:M1,footnoteDefinition:M1};function M1(){}const SV=-1,Hb=0,P0=1,Oy=2,bN=3,wN=4,SN=5,kN=6,kV=7,OV=8,YM=typeof self=="object"?self:globalThis,x2e=(t,e)=>{const n=(s,i)=>(t.set(i,s),s),r=s=>{if(t.has(s))return t.get(s);const[i,a]=e[s];switch(i){case Hb:case SV:return n(a,s);case P0:{const l=n([],s);for(const c of a)l.push(r(c));return l}case Oy:{const l=n({},s);for(const[c,d]of a)l[r(c)]=r(d);return l}case bN:return n(new Date(a),s);case wN:{const{source:l,flags:c}=a;return n(new RegExp(l,c),s)}case SN:{const l=n(new Map,s);for(const[c,d]of a)l.set(r(c),r(d));return l}case kN:{const l=n(new Set,s);for(const c of a)l.add(r(c));return l}case kV:{const{name:l,message:c}=a;return n(new YM[l](c),s)}case OV:return n(BigInt(a),s);case"BigInt":return n(Object(BigInt(a)),s);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:l}=new Uint8Array(a);return n(new DataView(l),a)}}return n(new YM[i](a),s)};return r},KM=t=>x2e(new Map,t)(0),uh="",{toString:v2e}={},{keys:y2e}=Object,e0=t=>{const e=typeof t;if(e!=="object"||!t)return[Hb,e];const n=v2e.call(t).slice(8,-1);switch(n){case"Array":return[P0,uh];case"Object":return[Oy,uh];case"Date":return[bN,uh];case"RegExp":return[wN,uh];case"Map":return[SN,uh];case"Set":return[kN,uh];case"DataView":return[P0,n]}return n.includes("Array")?[P0,n]:n.includes("Error")?[kV,n]:[Oy,n]},R1=([t,e])=>t===Hb&&(e==="function"||e==="symbol"),b2e=(t,e,n,r)=>{const s=(a,l)=>{const c=r.push(a)-1;return n.set(l,c),c},i=a=>{if(n.has(a))return n.get(a);let[l,c]=e0(a);switch(l){case Hb:{let h=a;switch(c){case"bigint":l=OV,h=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+c);h=null;break;case"undefined":return s([SV],a)}return s([l,h],a)}case P0:{if(c){let g=a;return c==="DataView"?g=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(g=new Uint8Array(a)),s([c,[...g]],a)}const h=[],m=s([l,h],a);for(const g of a)h.push(i(g));return m}case Oy:{if(c)switch(c){case"BigInt":return s([c,a.toString()],a);case"Boolean":case"Number":case"String":return s([c,a.valueOf()],a)}if(e&&"toJSON"in a)return i(a.toJSON());const h=[],m=s([l,h],a);for(const g of y2e(a))(t||!R1(e0(a[g])))&&h.push([i(g),i(a[g])]);return m}case bN:return s([l,a.toISOString()],a);case wN:{const{source:h,flags:m}=a;return s([l,{source:h,flags:m}],a)}case SN:{const h=[],m=s([l,h],a);for(const[g,x]of a)(t||!(R1(e0(g))||R1(e0(x))))&&h.push([i(g),i(x)]);return m}case kN:{const h=[],m=s([l,h],a);for(const g of a)(t||!R1(e0(g)))&&h.push(i(g));return m}}const{message:d}=a;return s([l,{name:c,message:d}],a)};return i},ZM=(t,{json:e,lossy:n}={})=>{const r=[];return b2e(!(e||n),!!e,new Map,r)(t),r},jy=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?KM(ZM(t,e)):structuredClone(t):(t,e)=>KM(ZM(t,e));function w2e(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function S2e(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function k2e(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||w2e,r=t.options.footnoteBackLabel||S2e,s=t.options.footnoteLabel||"Footnotes",i=t.options.footnoteLabelTagName||"h2",a=t.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&y.push({type:"text",value:" "});let j=typeof n=="string"?n:n(c,x);typeof j=="string"&&(j={type:"text",value:j}),y.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+g+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,x),className:["data-footnote-backref"]},children:Array.isArray(j)?j:[j]})}const S=h[h.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const j=S.children[S.children.length-1];j&&j.type==="text"?j.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...y)}else h.push(...y);const k={type:"element",tagName:"li",properties:{id:e+"fn-"+g},children:t.wrap(h,!0)};t.patch(d,k),l.push(k)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...jy(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:t.wrap(l,!0)},{type:"text",value:` -`}]}}const xg=(function(t){if(t==null)return C2e;if(typeof t=="function")return Qb(t);if(typeof t=="object")return Array.isArray(t)?O2e(t):j2e(t);if(typeof t=="string")return N2e(t);throw new Error("Expected function, string, or object as test")});function O2e(t){const e=[];let n=-1;for(;++n":""))+")"})}return g;function g(){let x=jV,y,w,S;if((!e||i(c,d,h[h.length-1]||void 0))&&(x=_2e(n(c,h)),x[0]===zO))return x;if("children"in c&&c.children){const k=c;if(k.children&&x[0]!==NV)for(w=(r?k.children.length:-1)+a,S=h.concat(k);w>-1&&w0&&n.push({type:"text",value:` -`}),n}function JM(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function eR(t,e){const n=M2e(t,e),r=n.one(t,void 0),s=k2e(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:` -`},s),i}function I2e(t,e){return t&&"run"in t?async function(n,r){const s=eR(n,{file:r,...e});await t.run(s,r)}:function(n,r){return eR(n,{file:r,...t||e})}}function tR(t){if(t)throw t}var IS,nR;function L2e(){if(nR)return IS;nR=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(d){return typeof Array.isArray=="function"?Array.isArray(d):e.call(d)==="[object Array]"},i=function(d){if(!d||e.call(d)!=="[object Object]")return!1;var h=t.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&t.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!h&&!m)return!1;var g;for(g in d);return typeof g>"u"||t.call(d,g)},a=function(d,h){n&&h.name==="__proto__"?n(d,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):d[h.name]=h.newValue},l=function(d,h){if(h==="__proto__")if(t.call(d,h)){if(r)return r(d,h).value}else return;return d[h]};return IS=function c(){var d,h,m,g,x,y,w=arguments[0],S=1,k=arguments.length,j=!1;for(typeof w=="boolean"&&(j=w,w=arguments[1]||{},S=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});Sa.length;let c;l&&a.push(s);try{c=t.apply(this,a)}catch(d){const h=d;if(l&&n)throw h;return s(h)}l||(c&&c.then&&typeof c.then=="function"?c.then(i,s):c instanceof Error?s(c):i(c))}function s(a,...l){n||(n=!0,e(a,...l))}function i(a){s(null,a)}}const vo={basename:$2e,dirname:H2e,extname:Q2e,join:V2e,sep:"/"};function $2e(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');vg(t);let n=0,r=-1,s=t.length,i;if(e===void 0||e.length===0||e.length>t.length){for(;s--;)if(t.codePointAt(s)===47){if(i){n=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,l=e.length-1;for(;s--;)if(t.codePointAt(s)===47){if(i){n=s+1;break}}else a<0&&(i=!0,a=s+1),l>-1&&(t.codePointAt(s)===e.codePointAt(l--)?l<0&&(r=s):(l=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function H2e(t){if(vg(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function Q2e(t){vg(t);let e=t.length,n=-1,r=0,s=-1,i=0,a;for(;e--;){const l=t.codePointAt(e);if(l===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),l===46?s<0?s=e:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||n<0||i===0||i===1&&s===n-1&&s===r+1?"":t.slice(s,n)}function V2e(...t){let e=-1,n;for(;++e0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function W2e(t,e){let n="",r=0,s=-1,i=0,a=-1,l,c;for(;++a<=t.length;){if(a2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),s=a,i=0;continue}}else if(n.length>0){n="",r=0,s=a,i=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(s+1,a):n=t.slice(s+1,a),r=a-s-1;s=a,i=0}else l===46&&i>-1?i++:i=-1}return n}function vg(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const G2e={cwd:X2e};function X2e(){return"/"}function BO(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Y2e(t){if(typeof t=="string")t=new URL(t);else if(!BO(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return K2e(t)}function K2e(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n0){let[x,...y]=h;const w=r[g][1];LO(w)&&LO(x)&&(x=LS(!0,w,x)),r[g]=[d,x,...y]}}}}const t4e=new NN().freeze();function $S(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function HS(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function QS(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function sR(t){if(!LO(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function iR(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function D1(t){return n4e(t)?t:new CV(t)}function n4e(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function r4e(t){return typeof t=="string"||s4e(t)}function s4e(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const i4e="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",aR=[],oR={allowDangerousHtml:!0},a4e=/^(https?|ircs?|mailto|xmpp)$/i,o4e=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function l4e(t){const e=c4e(t),n=u4e(t);return d4e(e.runSync(e.parse(n),n),t)}function c4e(t){const e=t.rehypePlugins||aR,n=t.remarkPlugins||aR,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...oR}:oR;return t4e().use(Qwe).use(n).use(I2e,r).use(e)}function u4e(t){const e=t.children||"",n=new CV;return typeof e=="string"&&(n.value=e),n}function d4e(t,e){const n=e.allowedElements,r=e.allowElement,s=e.components,i=e.disallowedElements,a=e.skipHtml,l=e.unwrapDisallowed,c=e.urlTransform||h4e;for(const h of o4e)Object.hasOwn(e,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+i4e+h.id,void 0);return jN(t,d),Cye(t,{Fragment:o.Fragment,components:s,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function d(h,m,g){if(h.type==="raw"&&g&&typeof m=="number")return a?g.children.splice(m,1):g.children[m]={type:"text",value:h.value},m;if(h.type==="element"){let x;for(x in DS)if(Object.hasOwn(DS,x)&&Object.hasOwn(h.properties,x)){const y=h.properties[x],w=DS[x];(w===null||w.includes(h.tagName))&&(h.properties[x]=c(String(y||""),x,h))}}if(h.type==="element"){let x=n?!n.includes(h.tagName):i?i.includes(h.tagName):!1;if(!x&&r&&typeof m=="number"&&(x=!r(h,m,g)),x&&g&&typeof m=="number")return l&&h.children?g.children.splice(m,1,...h.children):g.children.splice(m,1),m}}}function h4e(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),s=t.indexOf("/");return e===-1||s!==-1&&e>s||n!==-1&&e>n||r!==-1&&e>r||a4e.test(t.slice(0,e))?t:""}function lR(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(e);for(;s!==-1;)r++,s=n.indexOf(e,s+e.length);return r}function f4e(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function m4e(t,e,n){const s=xg((n||{}).ignore||[]),i=p4e(e);let a=-1;for(;++a0?{type:"text",value:_}:void 0),_===!1?g.lastIndex=T+1:(y!==T&&j.push({type:"text",value:d.value.slice(y,T)}),Array.isArray(_)?j.push(..._):_&&j.push(_),y=T+N[0].length,k=!0),!g.global)break;N=g.exec(d.value)}return k?(y?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],r=n.indexOf(")");const s=lR(t,"(");let i=lR(t,")");for(;r!==-1&&s>i;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[t,n]}function TV(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||gd(n)||qb(n))&&(!e||n!==47)}EV.peek=L4e;function _4e(){this.buffer()}function A4e(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function M4e(){this.buffer()}function R4e(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function D4e(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Xa(this.sliceSerialize(t)).toLowerCase(),n.label=e}function P4e(t){this.exit(t)}function z4e(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Xa(this.sliceSerialize(t)).toLowerCase(),n.label=e}function I4e(t){this.exit(t)}function L4e(){return"["}function EV(t,e,n,r){const s=n.createTracker(r);let i=s.move("[^");const a=n.enter("footnoteReference"),l=n.enter("reference");return i+=s.move(n.safe(n.associationId(t),{after:"]",before:i})),l(),a(),i+=s.move("]"),i}function B4e(){return{enter:{gfmFootnoteCallString:_4e,gfmFootnoteCall:A4e,gfmFootnoteDefinitionLabelString:M4e,gfmFootnoteDefinition:R4e},exit:{gfmFootnoteCallString:D4e,gfmFootnoteCall:P4e,gfmFootnoteDefinitionLabelString:z4e,gfmFootnoteDefinition:I4e}}}function F4e(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:EV},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,i,a){const l=i.createTracker(a);let c=l.move("[^");const d=i.enter("footnoteDefinition"),h=i.enter("label");return c+=l.move(i.safe(i.associationId(r),{before:c,after:"]"})),h(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((e?` -`:" ")+i.indentLines(i.containerFlow(r,l.current()),e?_V:q4e))),d(),c}}function q4e(t,e,n){return e===0?t:_V(t,e,n)}function _V(t,e,n){return(n?"":" ")+t}const $4e=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];AV.peek=W4e;function H4e(){return{canContainEols:["delete"],enter:{strikethrough:V4e},exit:{strikethrough:U4e}}}function Q4e(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:$4e}],handlers:{delete:AV}}}function V4e(t){this.enter({type:"delete",children:[]},t)}function U4e(t){this.exit(t)}function AV(t,e,n,r){const s=n.createTracker(r),i=n.enter("strikethrough");let a=s.move("~~");return a+=n.containerPhrasing(t,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function W4e(){return"~"}function G4e(t){return t.length}function X4e(t,e){const n=e||{},r=(n.align||[]).concat(),s=n.stringLength||G4e,i=[],a=[],l=[],c=[];let d=0,h=-1;for(;++hd&&(d=t[h].length);++kc[k])&&(c[k]=N)}w.push(j)}a[h]=w,l[h]=S}let m=-1;if(typeof r=="object"&&"length"in r)for(;++mc[m]&&(c[m]=j),x[m]=j),g[m]=N}a.splice(1,0,g),l.splice(1,0,x),h=-1;const y=[];for(;++h "),i.shift(2);const a=n.indentLines(n.containerFlow(t,i.current()),Z4e);return s(),a}function Z4e(t,e,n){return">"+(n?"":" ")+t}function J4e(t,e){return uR(t,e.inConstruct,!0)&&!uR(t,e.notInConstruct,!1)}function uR(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++ra&&(a=i):i=1,s=r+e.length,r=n.indexOf(e,s);return a}function eSe(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function tSe(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function nSe(t,e,n,r){const s=tSe(n),i=t.value||"",a=s==="`"?"GraveAccent":"Tilde";if(eSe(t,n)){const m=n.enter("codeIndented"),g=n.indentLines(i,rSe);return m(),g}const l=n.createTracker(r),c=s.repeat(Math.max(MV(i,s)+1,3)),d=n.enter("codeFenced");let h=l.move(c);if(t.lang){const m=n.enter(`codeFencedLang${a}`);h+=l.move(n.safe(t.lang,{before:h,after:" ",encode:["`"],...l.current()})),m()}if(t.lang&&t.meta){const m=n.enter(`codeFencedMeta${a}`);h+=l.move(" "),h+=l.move(n.safe(t.meta,{before:h,after:` -`,encode:["`"],...l.current()})),m()}return h+=l.move(` -`),i&&(h+=l.move(i+` -`)),h+=l.move(c),d(),h}function rSe(t,e,n){return(n?"":" ")+t}function CN(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function sSe(t,e,n,r){const s=CN(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("[");return d+=c.move(n.safe(n.associationId(t),{before:d,after:"]",...c.current()})),d+=c.move("]: "),l(),!t.url||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(t.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(l=n.enter("destinationRaw"),d+=c.move(n.safe(t.url,{before:d,after:t.title?" ":` -`,...c.current()}))),l(),t.title&&(l=n.enter(`title${i}`),d+=c.move(" "+s),d+=c.move(n.safe(t.title,{before:d,after:s,...c.current()})),d+=c.move(s),l()),a(),d}function iSe(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function bp(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Ny(t,e,n){const r=hf(t),s=hf(e);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}RV.peek=aSe;function RV(t,e,n,r){const s=iSe(n),i=n.enter("emphasis"),a=n.createTracker(r),l=a.move(s);let c=a.move(n.containerPhrasing(t,{after:s,before:l,...a.current()}));const d=c.charCodeAt(0),h=Ny(r.before.charCodeAt(r.before.length-1),d,s);h.inside&&(c=bp(d)+c.slice(1));const m=c.charCodeAt(c.length-1),g=Ny(r.after.charCodeAt(0),m,s);g.inside&&(c=c.slice(0,-1)+bp(m));const x=a.move(s);return i(),n.attentionEncodeSurroundingInfo={after:g.outside,before:h.outside},l+c+x}function aSe(t,e,n){return n.options.emphasis||"*"}function oSe(t,e){let n=!1;return jN(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,zO}),!!((!t.depth||t.depth<3)&&xN(t)&&(e.options.setext||n))}function lSe(t,e,n,r){const s=Math.max(Math.min(6,t.depth||1),1),i=n.createTracker(r);if(oSe(t,n)){const h=n.enter("headingSetext"),m=n.enter("phrasing"),g=n.containerPhrasing(t,{...i.current(),before:` -`,after:` -`});return m(),h(),g+` -`+(s===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(` -`))+1))}const a="#".repeat(s),l=n.enter("headingAtx"),c=n.enter("phrasing");i.move(a+" ");let d=n.containerPhrasing(t,{before:"# ",after:` -`,...i.current()});return/^[\t ]/.test(d)&&(d=bp(d.charCodeAt(0))+d.slice(1)),d=d?a+" "+d:a,n.options.closeAtx&&(d+=" "+a),c(),l(),d}DV.peek=cSe;function DV(t){return t.value||""}function cSe(){return"<"}PV.peek=uSe;function PV(t,e,n,r){const s=CN(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("![");return d+=c.move(n.safe(t.alt,{before:d,after:"]",...c.current()})),d+=c.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(t.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(l=n.enter("destinationRaw"),d+=c.move(n.safe(t.url,{before:d,after:t.title?" ":")",...c.current()}))),l(),t.title&&(l=n.enter(`title${i}`),d+=c.move(" "+s),d+=c.move(n.safe(t.title,{before:d,after:s,...c.current()})),d+=c.move(s),l()),d+=c.move(")"),a(),d}function uSe(){return"!"}zV.peek=dSe;function zV(t,e,n,r){const s=t.referenceType,i=n.enter("imageReference");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");const d=n.safe(t.alt,{before:c,after:"]",...l.current()});c+=l.move(d+"]["),a();const h=n.stack;n.stack=[],a=n.enter("reference");const m=n.safe(n.associationId(t),{before:c,after:"]",...l.current()});return a(),n.stack=h,i(),s==="full"||!d||d!==m?c+=l.move(m+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function dSe(){return"!"}IV.peek=hSe;function IV(t,e,n){let r=t.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i\u007F]/.test(t.url))}BV.peek=fSe;function BV(t,e,n,r){const s=CN(n),i=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let l,c;if(LV(t,n)){const h=n.stack;n.stack=[],l=n.enter("autolink");let m=a.move("<");return m+=a.move(n.containerPhrasing(t,{before:m,after:">",...a.current()})),m+=a.move(">"),l(),n.stack=h,m}l=n.enter("link"),c=n.enter("label");let d=a.move("[");return d+=a.move(n.containerPhrasing(t,{before:d,after:"](",...a.current()})),d+=a.move("]("),c(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(c=n.enter("destinationLiteral"),d+=a.move("<"),d+=a.move(n.safe(t.url,{before:d,after:">",...a.current()})),d+=a.move(">")):(c=n.enter("destinationRaw"),d+=a.move(n.safe(t.url,{before:d,after:t.title?" ":")",...a.current()}))),c(),t.title&&(c=n.enter(`title${i}`),d+=a.move(" "+s),d+=a.move(n.safe(t.title,{before:d,after:s,...a.current()})),d+=a.move(s),c()),d+=a.move(")"),l(),d}function fSe(t,e,n){return LV(t,n)?"<":"["}FV.peek=mSe;function FV(t,e,n,r){const s=t.referenceType,i=n.enter("linkReference");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");const d=n.containerPhrasing(t,{before:c,after:"]",...l.current()});c+=l.move(d+"]["),a();const h=n.stack;n.stack=[],a=n.enter("reference");const m=n.safe(n.associationId(t),{before:c,after:"]",...l.current()});return a(),n.stack=h,i(),s==="full"||!d||d!==m?c+=l.move(m+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function mSe(){return"["}function TN(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function pSe(t){const e=TN(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function gSe(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function qV(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function xSe(t,e,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=t.ordered?gSe(n):TN(n);const l=t.ordered?a==="."?")":".":pSe(n);let c=e&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!t.ordered){const h=t.children?t.children[0]:void 0;if((a==="*"||a==="-")&&h&&(!h.children||!h.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),qV(n)===a&&h){let m=-1;for(;++m-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(a=Math.ceil(a/4)*4);const l=n.createTracker(r);l.move(i+" ".repeat(a-i.length)),l.shift(a);const c=n.enter("listItem"),d=n.indentLines(n.containerFlow(t,l.current()),h);return c(),d;function h(m,g,x){return g?(x?"":" ".repeat(a))+m:(x?i:i+" ".repeat(a-i.length))+m}}function bSe(t,e,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(t,r);return i(),s(),a}const wSe=xg(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function SSe(t,e,n,r){return(t.children.some(function(a){return wSe(a)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function kSe(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}$V.peek=OSe;function $V(t,e,n,r){const s=kSe(n),i=n.enter("strong"),a=n.createTracker(r),l=a.move(s+s);let c=a.move(n.containerPhrasing(t,{after:s,before:l,...a.current()}));const d=c.charCodeAt(0),h=Ny(r.before.charCodeAt(r.before.length-1),d,s);h.inside&&(c=bp(d)+c.slice(1));const m=c.charCodeAt(c.length-1),g=Ny(r.after.charCodeAt(0),m,s);g.inside&&(c=c.slice(0,-1)+bp(m));const x=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:g.outside,before:h.outside},l+c+x}function OSe(t,e,n){return n.options.strong||"*"}function jSe(t,e,n,r){return n.safe(t.value,r)}function NSe(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function CSe(t,e,n){const r=(qV(n)+(n.options.ruleSpaces?" ":"")).repeat(NSe(n));return n.options.ruleSpaces?r.slice(0,-1):r}const HV={blockquote:K4e,break:dR,code:nSe,definition:sSe,emphasis:RV,hardBreak:dR,heading:lSe,html:DV,image:PV,imageReference:zV,inlineCode:IV,link:BV,linkReference:FV,list:xSe,listItem:ySe,paragraph:bSe,root:SSe,strong:$V,text:jSe,thematicBreak:CSe};function TSe(){return{enter:{table:ESe,tableData:hR,tableHeader:hR,tableRow:ASe},exit:{codeText:MSe,table:_Se,tableData:GS,tableHeader:GS,tableRow:GS}}}function ESe(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function _Se(t){this.exit(t),this.data.inTable=void 0}function ASe(t){this.enter({type:"tableRow",children:[]},t)}function GS(t){this.exit(t)}function hR(t){this.enter({type:"tableCell",children:[]},t)}function MSe(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,RSe));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function RSe(t,e){return e==="|"?e:t}function DSe(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,s=e.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` -`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:g,table:a,tableCell:c,tableRow:l}};function a(x,y,w,S){return d(h(x,w,S),x.align)}function l(x,y,w,S){const k=m(x,w,S),j=d([k]);return j.slice(0,j.indexOf(` -`))}function c(x,y,w,S){const k=w.enter("tableCell"),j=w.enter("phrasing"),N=w.containerPhrasing(x,{...S,before:i,after:i});return j(),k(),N}function d(x,y){return X4e(x,{align:y,alignDelimiters:r,padding:n,stringLength:s})}function h(x,y,w){const S=x.children;let k=-1;const j=[],N=y.enter("table");for(;++k0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const ZSe={tokenize:a5e,partial:!0};function JSe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:r5e,continuation:{tokenize:s5e},exit:i5e}},text:{91:{name:"gfmFootnoteCall",tokenize:n5e},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:e5e,resolveTo:t5e}}}}function e5e(t,e,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const c=r.events[s][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!a||!a._balanced)return n(c);const d=Xa(r.sliceSerialize({start:a.end,end:r.now()}));return d.codePointAt(0)!==94||!i.includes(d.slice(1))?n(c):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(c),t.exit("gfmFootnoteCallLabelMarker"),e(c))}}function t5e(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},l=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",s,e],["exit",s,e],["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...l),t}function n5e(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return l;function l(m){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(m),t.exit("gfmFootnoteCallLabelMarker"),c}function c(m){return m!==94?n(m):(t.enter("gfmFootnoteCallMarker"),t.consume(m),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",d)}function d(m){if(i>999||m===93&&!a||m===null||m===91||dr(m))return n(m);if(m===93){t.exit("chunkString");const g=t.exit("gfmFootnoteCallString");return s.includes(Xa(r.sliceSerialize(g)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(m),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(m)}return dr(m)||(a=!0),i++,t.consume(m),m===92?h:d}function h(m){return m===91||m===92||m===93?(t.consume(m),i++,d):d(m)}}function r5e(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,l;return c;function c(y){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(y){return y===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",h):n(y)}function h(y){if(a>999||y===93&&!l||y===null||y===91||dr(y))return n(y);if(y===93){t.exit("chunkString");const w=t.exit("gfmFootnoteDefinitionLabelString");return i=Xa(r.sliceSerialize(w)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),g}return dr(y)||(l=!0),a++,t.consume(y),y===92?m:h}function m(y){return y===91||y===92||y===93?(t.consume(y),a++,h):h(y)}function g(y){return y===58?(t.enter("definitionMarker"),t.consume(y),t.exit("definitionMarker"),s.includes(i)||s.push(i),cn(t,x,"gfmFootnoteDefinitionWhitespace")):n(y)}function x(y){return e(y)}}function s5e(t,e,n){return t.check(gg,e,t.attempt(ZSe,e,n))}function i5e(t){t.exit("gfmFootnoteDefinition")}function a5e(t,e,n){const r=this;return cn(t,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?e(i):n(i)}}function o5e(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,l){let c=-1;for(;++c1?c(y):(a.consume(y),m++,x);if(m<2&&!n)return c(y);const S=a.exit("strikethroughSequenceTemporary"),k=hf(y);return S._open=!k||k===2&&!!w,S._close=!w||w===2&&!!k,l(y)}}}class l5e{constructor(){this.map=[]}add(e,n,r){c5e(this,e,n,r)}consume(e){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let s=r.pop();for(;s;){for(const i of s)e.push(i);s=r.pop()}this.map.length=0}}function c5e(t,e,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s-1;){const I=r.events[H][1].type;if(I==="lineEnding"||I==="linePrefix")H--;else break}const W=H>-1?r.events[H][1].type:null,ee=W==="tableHead"||W==="tableRow"?_:c;return ee===_&&r.parser.lazy[r.now().line]?n(B):ee(B)}function c(B){return t.enter("tableHead"),t.enter("tableRow"),d(B)}function d(B){return B===124||(a=!0,i+=1),h(B)}function h(B){return B===null?n(B):St(B)?i>1?(i=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(B),t.exit("lineEnding"),x):n(B):gn(B)?cn(t,h,"whitespace")(B):(i+=1,a&&(a=!1,s+=1),B===124?(t.enter("tableCellDivider"),t.consume(B),t.exit("tableCellDivider"),a=!0,h):(t.enter("data"),m(B)))}function m(B){return B===null||B===124||dr(B)?(t.exit("data"),h(B)):(t.consume(B),B===92?g:m)}function g(B){return B===92||B===124?(t.consume(B),m):m(B)}function x(B){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(B):(t.enter("tableDelimiterRow"),a=!1,gn(B)?cn(t,y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):y(B))}function y(B){return B===45||B===58?S(B):B===124?(a=!0,t.enter("tableCellDivider"),t.consume(B),t.exit("tableCellDivider"),w):E(B)}function w(B){return gn(B)?cn(t,S,"whitespace")(B):S(B)}function S(B){return B===58?(i+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(B),t.exit("tableDelimiterMarker"),k):B===45?(i+=1,k(B)):B===null||St(B)?T(B):E(B)}function k(B){return B===45?(t.enter("tableDelimiterFiller"),j(B)):E(B)}function j(B){return B===45?(t.consume(B),j):B===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(B),t.exit("tableDelimiterMarker"),N):(t.exit("tableDelimiterFiller"),N(B))}function N(B){return gn(B)?cn(t,T,"whitespace")(B):T(B)}function T(B){return B===124?y(B):B===null||St(B)?!a||s!==i?E(B):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(B)):E(B)}function E(B){return n(B)}function _(B){return t.enter("tableRow"),A(B)}function A(B){return B===124?(t.enter("tableCellDivider"),t.consume(B),t.exit("tableCellDivider"),A):B===null||St(B)?(t.exit("tableRow"),e(B)):gn(B)?cn(t,A,"whitespace")(B):(t.enter("data"),D(B))}function D(B){return B===null||B===124||dr(B)?(t.exit("data"),A(B)):(t.consume(B),B===92?q:D)}function q(B){return B===92||B===124?(t.consume(B),D):D(B)}}function f5e(t,e){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],l=!1,c=0,d,h,m;const g=new l5e;for(;++nn[2]+1){const y=n[2]+1,w=n[3]-n[2]-1;t.add(y,w,[])}}t.add(n[3]+1,0,[["exit",m,e]])}return s!==void 0&&(i.end=Object.assign({},jh(e.events,s)),t.add(s,0,[["exit",i,e]]),i=void 0),i}function mR(t,e,n,r,s){const i=[],a=jh(e.events,n);s&&(s.end=Object.assign({},a),i.push(["exit",s,e])),r.end=Object.assign({},a),i.push(["exit",r,e]),t.add(n+1,0,i)}function jh(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const m5e={name:"tasklistCheck",tokenize:g5e};function p5e(){return{text:{91:m5e}}}function g5e(t,e,n){const r=this;return s;function s(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(c),t.exit("taskListCheckMarker"),i)}function i(c){return dr(c)?(t.enter("taskListCheckValueUnchecked"),t.consume(c),t.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(t.enter("taskListCheckValueChecked"),t.consume(c),t.exit("taskListCheckValueChecked"),a):n(c)}function a(c){return c===93?(t.enter("taskListCheckMarker"),t.consume(c),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),l):n(c)}function l(c){return St(c)?e(c):gn(c)?t.check({tokenize:x5e},e,n)(c):n(c)}}function x5e(t,e,n){return cn(t,r,"whitespace");function r(s){return s===null?n(s):e(s)}}function v5e(t){return oV([HSe(),JSe(),o5e(t),d5e(),p5e()])}const y5e={};function b5e(t){const e=this,n=t||y5e,r=e.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(v5e(n)),i.push(BSe()),a.push(FSe(n))}function w5e(){return{enter:{mathFlow:t,mathFlowFenceMeta:e,mathText:i},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:l,mathText:a,mathTextData:l}};function t(c){const d={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[d]}},c)}function e(){this.buffer()}function n(){const c=this.resume(),d=this.stack[this.stack.length-1];d.type,d.meta=c}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(c){const d=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),h=this.stack[this.stack.length-1];h.type,this.exit(c),h.value=d;const m=h.data.hChildren[0];m.type,m.tagName,m.children.push({type:"text",value:d}),this.data.mathFlowInside=void 0}function i(c){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},c),this.buffer()}function a(c){const d=this.resume(),h=this.stack[this.stack.length-1];h.type,this.exit(c),h.value=d,h.data.hChildren.push({type:"text",value:d})}function l(c){this.config.enter.data.call(this,c),this.config.exit.data.call(this,c)}}function S5e(t){let e=(t||{}).singleDollarTextMath;return e==null&&(e=!0),r.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` -`,inConstruct:"mathFlowMeta"},{character:"$",after:e?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(i,a,l,c){const d=i.value||"",h=l.createTracker(c),m="$".repeat(Math.max(MV(d,"$")+1,2)),g=l.enter("mathFlow");let x=h.move(m);if(i.meta){const y=l.enter("mathFlowMeta");x+=h.move(l.safe(i.meta,{after:` -`,before:x,encode:["$"],...h.current()})),y()}return x+=h.move(` -`),d&&(x+=h.move(d+` -`)),x+=h.move(m),g(),x}function r(i,a,l){let c=i.value||"",d=1;for(e||d++;new RegExp("(^|[^$])"+"\\$".repeat(d)+"([^$]|$)").test(c);)d++;const h="$".repeat(d);/[^ \r\n]/.test(c)&&(/^[ \r\n]/.test(c)&&/[ \r\n]$/.test(c)||/^\$|\$$/.test(c))&&(c=" "+c+" ");let m=-1;for(;++m15?d="…"+l.slice(s-15,s):d=l.slice(0,s);var h;i+15":">","<":"<",'"':""","'":"'"},D5e=/[&><"']/g;function P5e(t){return String(t).replace(D5e,e=>R5e[e])}var ZV=function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},z5e=function(e){var n=ZV(e);return n.type==="mathord"||n.type==="textord"||n.type==="atom"},I5e=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},L5e=function(e){var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},Wn={deflt:_5e,escape:P5e,hyphenate:M5e,getBaseElem:ZV,isCharacterBox:z5e,protocolFromUrl:L5e},Tv={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand ",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function B5e(t){if(t.default)return t.default;var e=t.type,n=Array.isArray(e)?e[0]:e;if(typeof n!="string")return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class _N{constructor(e){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var n in Tv)if(Tv.hasOwnProperty(n)){var r=Tv[n];this[n]=e[n]!==void 0?r.processor?r.processor(e[n]):e[n]:B5e(r)}}reportNonstrict(e,n,r){var s=this.strict;if(typeof s=="function"&&(s=s(e,n,r)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new qe("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+e+"]"),r);s==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+n+" ["+e+"]"))}}useStrictBehavior(e,n,r){var s=this.strict;if(typeof s=="function")try{s=s(e,n,r)}catch{s="error"}return!s||s==="ignore"?!1:s===!0||s==="error"?!0:s==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+n+" ["+e+"]")),!1)}isTrusted(e){if(e.url&&!e.protocol){var n=Wn.protocolFromUrl(e.url);if(n==null)return!1;e.protocol=n}var r=typeof this.trust=="function"?this.trust(e):this.trust;return!!r}}class _c{constructor(e,n,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=n,this.cramped=r}sup(){return So[F5e[this.id]]}sub(){return So[q5e[this.id]]}fracNum(){return So[$5e[this.id]]}fracDen(){return So[H5e[this.id]]}cramp(){return So[Q5e[this.id]]}text(){return So[V5e[this.id]]}isTight(){return this.size>=2}}var AN=0,Cy=1,Hh=2,Fl=3,wp=4,Na=5,ff=6,ni=7,So=[new _c(AN,0,!1),new _c(Cy,0,!0),new _c(Hh,1,!1),new _c(Fl,1,!0),new _c(wp,2,!1),new _c(Na,2,!0),new _c(ff,3,!1),new _c(ni,3,!0)],F5e=[wp,Na,wp,Na,ff,ni,ff,ni],q5e=[Na,Na,Na,Na,ni,ni,ni,ni],$5e=[Hh,Fl,wp,Na,ff,ni,ff,ni],H5e=[Fl,Fl,Na,Na,ni,ni,ni,ni],Q5e=[Cy,Cy,Fl,Fl,Na,Na,ni,ni],V5e=[AN,Cy,Hh,Fl,Hh,Fl,Hh,Fl],At={DISPLAY:So[AN],TEXT:So[Hh],SCRIPT:So[wp],SCRIPTSCRIPT:So[ff]},qO=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function U5e(t){for(var e=0;e=s[0]&&t<=s[1])return n.name}return null}var Ev=[];qO.forEach(t=>t.blocks.forEach(e=>Ev.push(...e)));function JV(t){for(var e=0;e=Ev[e]&&t<=Ev[e+1])return!0;return!1}var dh=80,W5e=function(e,n){return"M95,"+(622+e+n)+` -c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 -c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 -c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 -s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 -c69,-144,104.5,-217.7,106.5,-221 -l`+e/2.075+" -"+e+` -c5.3,-9.3,12,-14,20,-14 -H400000v`+(40+e)+`H845.2724 -s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 -c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z -M`+(834+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},G5e=function(e,n){return"M263,"+(601+e+n)+`c0.7,0,18,39.7,52,119 -c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 -c340,-704.7,510.7,-1060.3,512,-1067 -l`+e/2.084+" -"+e+` -c4.7,-7.3,11,-11,19,-11 -H40000v`+(40+e)+`H1012.3 -s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232 -c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 -s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 -c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z -M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},X5e=function(e,n){return"M983 "+(10+e+n)+` -l`+e/3.13+" -"+e+` -c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+` -H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 -s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744 -c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 -c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 -c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 -c53.7,-170.3,84.5,-266.8,92.5,-289.5z -M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},Y5e=function(e,n){return"M424,"+(2398+e+n)+` -c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 -c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 -s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 -s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081 -l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000 -v`+(40+e)+`H1014.6 -s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 -c-2,6,-10,9,-24,9 -c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+n+` -h400000v`+(40+e)+"h-400000z"},K5e=function(e,n){return"M473,"+(2713+e+n)+` -c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+` -c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7 -s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 -c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 -c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 -s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, -606zM`+(1001+e)+" "+n+"h400000v"+(40+e)+"H1017.7z"},Z5e=function(e){var n=e/2;return"M400000 "+e+" H0 L"+n+" 0 l65 45 L145 "+(e-80)+" H400000z"},J5e=function(e,n,r){var s=r-54-n-e;return"M702 "+(e+n)+"H400000"+(40+e)+` -H742v`+s+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 -h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 -c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 -219 661 l218 661zM702 `+n+"H400000v"+(40+e)+"H742z"},e3e=function(e,n,r){n=1e3*n;var s="";switch(e){case"sqrtMain":s=W5e(n,dh);break;case"sqrtSize1":s=G5e(n,dh);break;case"sqrtSize2":s=X5e(n,dh);break;case"sqrtSize3":s=Y5e(n,dh);break;case"sqrtSize4":s=K5e(n,dh);break;case"sqrtTall":s=J5e(n,dh,r)}return s},t3e=function(e,n){switch(e){case"⎜":return"M291 0 H417 V"+n+" H291z M291 0 H417 V"+n+" H291z";case"∣":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z";case"∥":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z"+("M367 0 H410 V"+n+" H367z M367 0 H410 V"+n+" H367z");case"⎟":return"M457 0 H583 V"+n+" H457z M457 0 H583 V"+n+" H457z";case"⎢":return"M319 0 H403 V"+n+" H319z M319 0 H403 V"+n+" H319z";case"⎥":return"M263 0 H347 V"+n+" H263z M263 0 H347 V"+n+" H263z";case"⎪":return"M384 0 H504 V"+n+" H384z M384 0 H504 V"+n+" H384z";case"⏐":return"M312 0 H355 V"+n+" H312z M312 0 H355 V"+n+" H312z";case"‖":return"M257 0 H300 V"+n+" H257z M257 0 H300 V"+n+" H257z"+("M478 0 H521 V"+n+" H478z M478 0 H521 V"+n+" H478z");default:return""}},gR={doubleleftarrow:`M262 157 -l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 - 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 - 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 -c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5 - 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87 --86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7 --2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z -m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l --10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5 - 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88 --33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68 --17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18 --13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782 -c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3 --107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120 - 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8 --5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247 -c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208 - 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3 - 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202 - l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117 --45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7 - 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13 - 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688 - 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7 --331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80 -H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0 - 435 0h399565z`,leftgroupunder:`M400000 262 -H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219 - 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3 --3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5 --18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7 --196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5 - 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3 --4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7 --10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z -m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333 - 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5 - 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667 --152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12 - 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7 --2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0 -v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 --83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 --68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 - 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z -M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z -M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 --.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 -c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 - 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z -M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334 -c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 --53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 - 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 - 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214 -c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14 - 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3 - 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0 --5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6 --320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z -m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8 -60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8 --451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z -m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2 -c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6 --480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z -m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0 -85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8 --707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z -m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1 -c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128 --16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 - 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 - 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85 --40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 --12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 - 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l --6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5 -s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1 -c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3 - 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237 --174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0 - 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18 - 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3 --3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2 --10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 - 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11 --18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7 - 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z -m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8 - 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5 --7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95 --27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8 - 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 - 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3 --64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z -m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 - 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 --13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 - 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z -M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 - 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 --52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 --167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 - 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69 --70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3 --40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19 --37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101 - 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167 -c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 - 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42 - 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333 --19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70 - 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7 --2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0 - 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0 - 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128 --68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418 --8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9 - 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114 -c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751 - 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457 --11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0 - 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697 - 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696 - -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345 --11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409 - 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9 - 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409 - -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5 -3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11 -10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63 --1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1 --7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59 -H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359 -c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22 -c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10 --11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10 --11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10 --11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1, --5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, --11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, --11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, --11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202 -c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5 -c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130 -s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47 -121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6 -s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11 -c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z -M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32 --27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0 -13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39 --84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5 --119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 --12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 -151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 -c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17 -c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21 -c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40 -c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z -M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0 -c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, --231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 -c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z -M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 -c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9, -1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7, --152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z -M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0 -c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, --231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 -c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z -M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},n3e=function(e,n){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 h347 v-84 -H403z M403 1759 V0 H319 V1759 v`+n+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z -M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15 -c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 -c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15 -c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 -c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z -M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15 -c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 -c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z -MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z -MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z -M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z -M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1 -c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349, --36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210, -949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9 -c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5, --544.7,-112.5,-882c-2,-104,-3,-167,-3,-189 -l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3, --210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3, -63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5 -c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+` -c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664 -c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11 -c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 -c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 -l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, --470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class yg{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),n=0;nn.toText();return this.children.map(e).join("")}}var Mo={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},z1={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},xR={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function r3e(t,e){Mo[t]=e}function MN(t,e,n){if(!Mo[e])throw new Error("Font metrics not found for font: "+e+".");var r=t.charCodeAt(0),s=Mo[e][r];if(!s&&t[0]in xR&&(r=xR[t[0]].charCodeAt(0),s=Mo[e][r]),!s&&n==="text"&&JV(r)&&(s=Mo[e][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var XS={};function s3e(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!XS[e]){var n=XS[e]={cssEmPerMu:z1.quad[e]/18};for(var r in z1)z1.hasOwnProperty(r)&&(n[r]=z1[r][e])}return XS[e]}var i3e=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],vR=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],yR=function(e,n){return n.size<2?e:i3e[e-1][n.size-1]};class Al{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||Al.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=vR[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);return new Al(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:yR(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:vR[e-1]})}havingBaseStyle(e){e=e||this.style.text();var n=yR(Al.BASESIZE,e);return this.size===n&&this.textSize===Al.BASESIZE&&this.style===e?this:this.extend({style:e,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Al.BASESIZE?["sizing","reset-size"+this.size,"size"+Al.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=s3e(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Al.BASESIZE=6;var $O={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},a3e={ex:!0,em:!0,mu:!0},eU=function(e){return typeof e!="string"&&(e=e.unit),e in $O||e in a3e||e==="ex"},Ir=function(e,n){var r;if(e.unit in $O)r=$O[e.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(e.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var s;if(n.style.isTight()?s=n.havingStyle(n.style.text()):s=n,e.unit==="ex")r=s.fontMetrics().xHeight;else if(e.unit==="em")r=s.fontMetrics().quad;else throw new qe("Invalid unit: '"+e.unit+"'");s!==n&&(r*=s.sizeMultiplier/n.sizeMultiplier)}return Math.min(e.number*r,n.maxSize)},Xe=function(e){return+e.toFixed(4)+"em"},ru=function(e){return e.filter(n=>n).join(" ")},tU=function(e,n,r){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var s=n.getColor();s&&(this.style.color=s)}},nU=function(e){var n=document.createElement(e);n.className=ru(this.classes);for(var r in this.style)this.style.hasOwnProperty(r)&&(n.style[r]=this.style[r]);for(var s in this.attributes)this.attributes.hasOwnProperty(s)&&n.setAttribute(s,this.attributes[s]);for(var i=0;i/=\x00-\x1f]/,rU=function(e){var n="<"+e;this.classes.length&&(n+=' class="'+Wn.escape(ru(this.classes))+'"');var r="";for(var s in this.style)this.style.hasOwnProperty(s)&&(r+=Wn.hyphenate(s)+":"+this.style[s]+";");r&&(n+=' style="'+Wn.escape(r)+'"');for(var i in this.attributes)if(this.attributes.hasOwnProperty(i)){if(o3e.test(i))throw new qe("Invalid attribute name '"+i+"'");n+=" "+i+'="'+Wn.escape(this.attributes[i])+'"'}n+=">";for(var a=0;a",n};class bg{constructor(e,n,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,tU.call(this,e,r,s),this.children=n||[]}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return this.classes.includes(e)}toNode(){return nU.call(this,"span")}toMarkup(){return rU.call(this,"span")}}class RN{constructor(e,n,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,tU.call(this,n,s),this.children=r||[],this.setAttribute("href",e)}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return this.classes.includes(e)}toNode(){return nU.call(this,"a")}toMarkup(){return rU.call(this,"a")}}class l3e{constructor(e,n,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=e,this.classes=["mord"],this.style=r}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var n in this.style)this.style.hasOwnProperty(n)&&(e.style[n]=this.style[n]);return e}toMarkup(){var e=''+Wn.escape(this.alt)+'0&&(n=document.createElement("span"),n.style.marginRight=Xe(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=ru(this.classes));for(var r in this.style)this.style.hasOwnProperty(r)&&(n=n||document.createElement("span"),n.style[r]=this.style[r]);return n?(n.appendChild(e),n):e}toMarkup(){var e=!1,n="0&&(r+="margin-right:"+this.italic+"em;");for(var s in this.style)this.style.hasOwnProperty(s)&&(r+=Wn.hyphenate(s)+":"+this.style[s]+";");r&&(e=!0,n+=' style="'+Wn.escape(r)+'"');var i=Wn.escape(this.text);return e?(n+=">",n+=i,n+="",n):i}}class Ul{constructor(e,n){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=n||{}}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"svg");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&n.setAttribute(r,this.attributes[r]);for(var s=0;s':''}}class HO{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"line");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var e=" but got "+String(t)+".")}var d3e={bin:1,close:1,inner:1,open:1,punct:1,rel:1},h3e={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},pr={math:{},text:{}};function M(t,e,n,r,s,i){pr[t][s]={font:e,group:n,replace:r},i&&r&&(pr[t][r]=pr[t][s])}var P="math",Le="text",Q="main",le="ams",_r="accent-token",it="bin",li="close",$f="inner",_t="mathord",os="op-token",ra="open",Vb="punct",ce="rel",tc="spacing",me="textord";M(P,Q,ce,"≡","\\equiv",!0);M(P,Q,ce,"≺","\\prec",!0);M(P,Q,ce,"≻","\\succ",!0);M(P,Q,ce,"∼","\\sim",!0);M(P,Q,ce,"⊥","\\perp");M(P,Q,ce,"⪯","\\preceq",!0);M(P,Q,ce,"⪰","\\succeq",!0);M(P,Q,ce,"≃","\\simeq",!0);M(P,Q,ce,"∣","\\mid",!0);M(P,Q,ce,"≪","\\ll",!0);M(P,Q,ce,"≫","\\gg",!0);M(P,Q,ce,"≍","\\asymp",!0);M(P,Q,ce,"∥","\\parallel");M(P,Q,ce,"⋈","\\bowtie",!0);M(P,Q,ce,"⌣","\\smile",!0);M(P,Q,ce,"⊑","\\sqsubseteq",!0);M(P,Q,ce,"⊒","\\sqsupseteq",!0);M(P,Q,ce,"≐","\\doteq",!0);M(P,Q,ce,"⌢","\\frown",!0);M(P,Q,ce,"∋","\\ni",!0);M(P,Q,ce,"∝","\\propto",!0);M(P,Q,ce,"⊢","\\vdash",!0);M(P,Q,ce,"⊣","\\dashv",!0);M(P,Q,ce,"∋","\\owns");M(P,Q,Vb,".","\\ldotp");M(P,Q,Vb,"⋅","\\cdotp");M(P,Q,me,"#","\\#");M(Le,Q,me,"#","\\#");M(P,Q,me,"&","\\&");M(Le,Q,me,"&","\\&");M(P,Q,me,"ℵ","\\aleph",!0);M(P,Q,me,"∀","\\forall",!0);M(P,Q,me,"ℏ","\\hbar",!0);M(P,Q,me,"∃","\\exists",!0);M(P,Q,me,"∇","\\nabla",!0);M(P,Q,me,"♭","\\flat",!0);M(P,Q,me,"ℓ","\\ell",!0);M(P,Q,me,"♮","\\natural",!0);M(P,Q,me,"♣","\\clubsuit",!0);M(P,Q,me,"℘","\\wp",!0);M(P,Q,me,"♯","\\sharp",!0);M(P,Q,me,"♢","\\diamondsuit",!0);M(P,Q,me,"ℜ","\\Re",!0);M(P,Q,me,"♡","\\heartsuit",!0);M(P,Q,me,"ℑ","\\Im",!0);M(P,Q,me,"♠","\\spadesuit",!0);M(P,Q,me,"§","\\S",!0);M(Le,Q,me,"§","\\S");M(P,Q,me,"¶","\\P",!0);M(Le,Q,me,"¶","\\P");M(P,Q,me,"†","\\dag");M(Le,Q,me,"†","\\dag");M(Le,Q,me,"†","\\textdagger");M(P,Q,me,"‡","\\ddag");M(Le,Q,me,"‡","\\ddag");M(Le,Q,me,"‡","\\textdaggerdbl");M(P,Q,li,"⎱","\\rmoustache",!0);M(P,Q,ra,"⎰","\\lmoustache",!0);M(P,Q,li,"⟯","\\rgroup",!0);M(P,Q,ra,"⟮","\\lgroup",!0);M(P,Q,it,"∓","\\mp",!0);M(P,Q,it,"⊖","\\ominus",!0);M(P,Q,it,"⊎","\\uplus",!0);M(P,Q,it,"⊓","\\sqcap",!0);M(P,Q,it,"∗","\\ast");M(P,Q,it,"⊔","\\sqcup",!0);M(P,Q,it,"◯","\\bigcirc",!0);M(P,Q,it,"∙","\\bullet",!0);M(P,Q,it,"‡","\\ddagger");M(P,Q,it,"≀","\\wr",!0);M(P,Q,it,"⨿","\\amalg");M(P,Q,it,"&","\\And");M(P,Q,ce,"⟵","\\longleftarrow",!0);M(P,Q,ce,"⇐","\\Leftarrow",!0);M(P,Q,ce,"⟸","\\Longleftarrow",!0);M(P,Q,ce,"⟶","\\longrightarrow",!0);M(P,Q,ce,"⇒","\\Rightarrow",!0);M(P,Q,ce,"⟹","\\Longrightarrow",!0);M(P,Q,ce,"↔","\\leftrightarrow",!0);M(P,Q,ce,"⟷","\\longleftrightarrow",!0);M(P,Q,ce,"⇔","\\Leftrightarrow",!0);M(P,Q,ce,"⟺","\\Longleftrightarrow",!0);M(P,Q,ce,"↦","\\mapsto",!0);M(P,Q,ce,"⟼","\\longmapsto",!0);M(P,Q,ce,"↗","\\nearrow",!0);M(P,Q,ce,"↩","\\hookleftarrow",!0);M(P,Q,ce,"↪","\\hookrightarrow",!0);M(P,Q,ce,"↘","\\searrow",!0);M(P,Q,ce,"↼","\\leftharpoonup",!0);M(P,Q,ce,"⇀","\\rightharpoonup",!0);M(P,Q,ce,"↙","\\swarrow",!0);M(P,Q,ce,"↽","\\leftharpoondown",!0);M(P,Q,ce,"⇁","\\rightharpoondown",!0);M(P,Q,ce,"↖","\\nwarrow",!0);M(P,Q,ce,"⇌","\\rightleftharpoons",!0);M(P,le,ce,"≮","\\nless",!0);M(P,le,ce,"","\\@nleqslant");M(P,le,ce,"","\\@nleqq");M(P,le,ce,"⪇","\\lneq",!0);M(P,le,ce,"≨","\\lneqq",!0);M(P,le,ce,"","\\@lvertneqq");M(P,le,ce,"⋦","\\lnsim",!0);M(P,le,ce,"⪉","\\lnapprox",!0);M(P,le,ce,"⊀","\\nprec",!0);M(P,le,ce,"⋠","\\npreceq",!0);M(P,le,ce,"⋨","\\precnsim",!0);M(P,le,ce,"⪹","\\precnapprox",!0);M(P,le,ce,"≁","\\nsim",!0);M(P,le,ce,"","\\@nshortmid");M(P,le,ce,"∤","\\nmid",!0);M(P,le,ce,"⊬","\\nvdash",!0);M(P,le,ce,"⊭","\\nvDash",!0);M(P,le,ce,"⋪","\\ntriangleleft");M(P,le,ce,"⋬","\\ntrianglelefteq",!0);M(P,le,ce,"⊊","\\subsetneq",!0);M(P,le,ce,"","\\@varsubsetneq");M(P,le,ce,"⫋","\\subsetneqq",!0);M(P,le,ce,"","\\@varsubsetneqq");M(P,le,ce,"≯","\\ngtr",!0);M(P,le,ce,"","\\@ngeqslant");M(P,le,ce,"","\\@ngeqq");M(P,le,ce,"⪈","\\gneq",!0);M(P,le,ce,"≩","\\gneqq",!0);M(P,le,ce,"","\\@gvertneqq");M(P,le,ce,"⋧","\\gnsim",!0);M(P,le,ce,"⪊","\\gnapprox",!0);M(P,le,ce,"⊁","\\nsucc",!0);M(P,le,ce,"⋡","\\nsucceq",!0);M(P,le,ce,"⋩","\\succnsim",!0);M(P,le,ce,"⪺","\\succnapprox",!0);M(P,le,ce,"≆","\\ncong",!0);M(P,le,ce,"","\\@nshortparallel");M(P,le,ce,"∦","\\nparallel",!0);M(P,le,ce,"⊯","\\nVDash",!0);M(P,le,ce,"⋫","\\ntriangleright");M(P,le,ce,"⋭","\\ntrianglerighteq",!0);M(P,le,ce,"","\\@nsupseteqq");M(P,le,ce,"⊋","\\supsetneq",!0);M(P,le,ce,"","\\@varsupsetneq");M(P,le,ce,"⫌","\\supsetneqq",!0);M(P,le,ce,"","\\@varsupsetneqq");M(P,le,ce,"⊮","\\nVdash",!0);M(P,le,ce,"⪵","\\precneqq",!0);M(P,le,ce,"⪶","\\succneqq",!0);M(P,le,ce,"","\\@nsubseteqq");M(P,le,it,"⊴","\\unlhd");M(P,le,it,"⊵","\\unrhd");M(P,le,ce,"↚","\\nleftarrow",!0);M(P,le,ce,"↛","\\nrightarrow",!0);M(P,le,ce,"⇍","\\nLeftarrow",!0);M(P,le,ce,"⇏","\\nRightarrow",!0);M(P,le,ce,"↮","\\nleftrightarrow",!0);M(P,le,ce,"⇎","\\nLeftrightarrow",!0);M(P,le,ce,"△","\\vartriangle");M(P,le,me,"ℏ","\\hslash");M(P,le,me,"▽","\\triangledown");M(P,le,me,"◊","\\lozenge");M(P,le,me,"Ⓢ","\\circledS");M(P,le,me,"®","\\circledR");M(Le,le,me,"®","\\circledR");M(P,le,me,"∡","\\measuredangle",!0);M(P,le,me,"∄","\\nexists");M(P,le,me,"℧","\\mho");M(P,le,me,"Ⅎ","\\Finv",!0);M(P,le,me,"⅁","\\Game",!0);M(P,le,me,"‵","\\backprime");M(P,le,me,"▲","\\blacktriangle");M(P,le,me,"▼","\\blacktriangledown");M(P,le,me,"■","\\blacksquare");M(P,le,me,"⧫","\\blacklozenge");M(P,le,me,"★","\\bigstar");M(P,le,me,"∢","\\sphericalangle",!0);M(P,le,me,"∁","\\complement",!0);M(P,le,me,"ð","\\eth",!0);M(Le,Q,me,"ð","ð");M(P,le,me,"╱","\\diagup");M(P,le,me,"╲","\\diagdown");M(P,le,me,"□","\\square");M(P,le,me,"□","\\Box");M(P,le,me,"◊","\\Diamond");M(P,le,me,"¥","\\yen",!0);M(Le,le,me,"¥","\\yen",!0);M(P,le,me,"✓","\\checkmark",!0);M(Le,le,me,"✓","\\checkmark");M(P,le,me,"ℶ","\\beth",!0);M(P,le,me,"ℸ","\\daleth",!0);M(P,le,me,"ℷ","\\gimel",!0);M(P,le,me,"ϝ","\\digamma",!0);M(P,le,me,"ϰ","\\varkappa");M(P,le,ra,"┌","\\@ulcorner",!0);M(P,le,li,"┐","\\@urcorner",!0);M(P,le,ra,"└","\\@llcorner",!0);M(P,le,li,"┘","\\@lrcorner",!0);M(P,le,ce,"≦","\\leqq",!0);M(P,le,ce,"⩽","\\leqslant",!0);M(P,le,ce,"⪕","\\eqslantless",!0);M(P,le,ce,"≲","\\lesssim",!0);M(P,le,ce,"⪅","\\lessapprox",!0);M(P,le,ce,"≊","\\approxeq",!0);M(P,le,it,"⋖","\\lessdot");M(P,le,ce,"⋘","\\lll",!0);M(P,le,ce,"≶","\\lessgtr",!0);M(P,le,ce,"⋚","\\lesseqgtr",!0);M(P,le,ce,"⪋","\\lesseqqgtr",!0);M(P,le,ce,"≑","\\doteqdot");M(P,le,ce,"≓","\\risingdotseq",!0);M(P,le,ce,"≒","\\fallingdotseq",!0);M(P,le,ce,"∽","\\backsim",!0);M(P,le,ce,"⋍","\\backsimeq",!0);M(P,le,ce,"⫅","\\subseteqq",!0);M(P,le,ce,"⋐","\\Subset",!0);M(P,le,ce,"⊏","\\sqsubset",!0);M(P,le,ce,"≼","\\preccurlyeq",!0);M(P,le,ce,"⋞","\\curlyeqprec",!0);M(P,le,ce,"≾","\\precsim",!0);M(P,le,ce,"⪷","\\precapprox",!0);M(P,le,ce,"⊲","\\vartriangleleft");M(P,le,ce,"⊴","\\trianglelefteq");M(P,le,ce,"⊨","\\vDash",!0);M(P,le,ce,"⊪","\\Vvdash",!0);M(P,le,ce,"⌣","\\smallsmile");M(P,le,ce,"⌢","\\smallfrown");M(P,le,ce,"≏","\\bumpeq",!0);M(P,le,ce,"≎","\\Bumpeq",!0);M(P,le,ce,"≧","\\geqq",!0);M(P,le,ce,"⩾","\\geqslant",!0);M(P,le,ce,"⪖","\\eqslantgtr",!0);M(P,le,ce,"≳","\\gtrsim",!0);M(P,le,ce,"⪆","\\gtrapprox",!0);M(P,le,it,"⋗","\\gtrdot");M(P,le,ce,"⋙","\\ggg",!0);M(P,le,ce,"≷","\\gtrless",!0);M(P,le,ce,"⋛","\\gtreqless",!0);M(P,le,ce,"⪌","\\gtreqqless",!0);M(P,le,ce,"≖","\\eqcirc",!0);M(P,le,ce,"≗","\\circeq",!0);M(P,le,ce,"≜","\\triangleq",!0);M(P,le,ce,"∼","\\thicksim");M(P,le,ce,"≈","\\thickapprox");M(P,le,ce,"⫆","\\supseteqq",!0);M(P,le,ce,"⋑","\\Supset",!0);M(P,le,ce,"⊐","\\sqsupset",!0);M(P,le,ce,"≽","\\succcurlyeq",!0);M(P,le,ce,"⋟","\\curlyeqsucc",!0);M(P,le,ce,"≿","\\succsim",!0);M(P,le,ce,"⪸","\\succapprox",!0);M(P,le,ce,"⊳","\\vartriangleright");M(P,le,ce,"⊵","\\trianglerighteq");M(P,le,ce,"⊩","\\Vdash",!0);M(P,le,ce,"∣","\\shortmid");M(P,le,ce,"∥","\\shortparallel");M(P,le,ce,"≬","\\between",!0);M(P,le,ce,"⋔","\\pitchfork",!0);M(P,le,ce,"∝","\\varpropto");M(P,le,ce,"◀","\\blacktriangleleft");M(P,le,ce,"∴","\\therefore",!0);M(P,le,ce,"∍","\\backepsilon");M(P,le,ce,"▶","\\blacktriangleright");M(P,le,ce,"∵","\\because",!0);M(P,le,ce,"⋘","\\llless");M(P,le,ce,"⋙","\\gggtr");M(P,le,it,"⊲","\\lhd");M(P,le,it,"⊳","\\rhd");M(P,le,ce,"≂","\\eqsim",!0);M(P,Q,ce,"⋈","\\Join");M(P,le,ce,"≑","\\Doteq",!0);M(P,le,it,"∔","\\dotplus",!0);M(P,le,it,"∖","\\smallsetminus");M(P,le,it,"⋒","\\Cap",!0);M(P,le,it,"⋓","\\Cup",!0);M(P,le,it,"⩞","\\doublebarwedge",!0);M(P,le,it,"⊟","\\boxminus",!0);M(P,le,it,"⊞","\\boxplus",!0);M(P,le,it,"⋇","\\divideontimes",!0);M(P,le,it,"⋉","\\ltimes",!0);M(P,le,it,"⋊","\\rtimes",!0);M(P,le,it,"⋋","\\leftthreetimes",!0);M(P,le,it,"⋌","\\rightthreetimes",!0);M(P,le,it,"⋏","\\curlywedge",!0);M(P,le,it,"⋎","\\curlyvee",!0);M(P,le,it,"⊝","\\circleddash",!0);M(P,le,it,"⊛","\\circledast",!0);M(P,le,it,"⋅","\\centerdot");M(P,le,it,"⊺","\\intercal",!0);M(P,le,it,"⋒","\\doublecap");M(P,le,it,"⋓","\\doublecup");M(P,le,it,"⊠","\\boxtimes",!0);M(P,le,ce,"⇢","\\dashrightarrow",!0);M(P,le,ce,"⇠","\\dashleftarrow",!0);M(P,le,ce,"⇇","\\leftleftarrows",!0);M(P,le,ce,"⇆","\\leftrightarrows",!0);M(P,le,ce,"⇚","\\Lleftarrow",!0);M(P,le,ce,"↞","\\twoheadleftarrow",!0);M(P,le,ce,"↢","\\leftarrowtail",!0);M(P,le,ce,"↫","\\looparrowleft",!0);M(P,le,ce,"⇋","\\leftrightharpoons",!0);M(P,le,ce,"↶","\\curvearrowleft",!0);M(P,le,ce,"↺","\\circlearrowleft",!0);M(P,le,ce,"↰","\\Lsh",!0);M(P,le,ce,"⇈","\\upuparrows",!0);M(P,le,ce,"↿","\\upharpoonleft",!0);M(P,le,ce,"⇃","\\downharpoonleft",!0);M(P,Q,ce,"⊶","\\origof",!0);M(P,Q,ce,"⊷","\\imageof",!0);M(P,le,ce,"⊸","\\multimap",!0);M(P,le,ce,"↭","\\leftrightsquigarrow",!0);M(P,le,ce,"⇉","\\rightrightarrows",!0);M(P,le,ce,"⇄","\\rightleftarrows",!0);M(P,le,ce,"↠","\\twoheadrightarrow",!0);M(P,le,ce,"↣","\\rightarrowtail",!0);M(P,le,ce,"↬","\\looparrowright",!0);M(P,le,ce,"↷","\\curvearrowright",!0);M(P,le,ce,"↻","\\circlearrowright",!0);M(P,le,ce,"↱","\\Rsh",!0);M(P,le,ce,"⇊","\\downdownarrows",!0);M(P,le,ce,"↾","\\upharpoonright",!0);M(P,le,ce,"⇂","\\downharpoonright",!0);M(P,le,ce,"⇝","\\rightsquigarrow",!0);M(P,le,ce,"⇝","\\leadsto");M(P,le,ce,"⇛","\\Rrightarrow",!0);M(P,le,ce,"↾","\\restriction");M(P,Q,me,"‘","`");M(P,Q,me,"$","\\$");M(Le,Q,me,"$","\\$");M(Le,Q,me,"$","\\textdollar");M(P,Q,me,"%","\\%");M(Le,Q,me,"%","\\%");M(P,Q,me,"_","\\_");M(Le,Q,me,"_","\\_");M(Le,Q,me,"_","\\textunderscore");M(P,Q,me,"∠","\\angle",!0);M(P,Q,me,"∞","\\infty",!0);M(P,Q,me,"′","\\prime");M(P,Q,me,"△","\\triangle");M(P,Q,me,"Γ","\\Gamma",!0);M(P,Q,me,"Δ","\\Delta",!0);M(P,Q,me,"Θ","\\Theta",!0);M(P,Q,me,"Λ","\\Lambda",!0);M(P,Q,me,"Ξ","\\Xi",!0);M(P,Q,me,"Π","\\Pi",!0);M(P,Q,me,"Σ","\\Sigma",!0);M(P,Q,me,"Υ","\\Upsilon",!0);M(P,Q,me,"Φ","\\Phi",!0);M(P,Q,me,"Ψ","\\Psi",!0);M(P,Q,me,"Ω","\\Omega",!0);M(P,Q,me,"A","Α");M(P,Q,me,"B","Β");M(P,Q,me,"E","Ε");M(P,Q,me,"Z","Ζ");M(P,Q,me,"H","Η");M(P,Q,me,"I","Ι");M(P,Q,me,"K","Κ");M(P,Q,me,"M","Μ");M(P,Q,me,"N","Ν");M(P,Q,me,"O","Ο");M(P,Q,me,"P","Ρ");M(P,Q,me,"T","Τ");M(P,Q,me,"X","Χ");M(P,Q,me,"¬","\\neg",!0);M(P,Q,me,"¬","\\lnot");M(P,Q,me,"⊤","\\top");M(P,Q,me,"⊥","\\bot");M(P,Q,me,"∅","\\emptyset");M(P,le,me,"∅","\\varnothing");M(P,Q,_t,"α","\\alpha",!0);M(P,Q,_t,"β","\\beta",!0);M(P,Q,_t,"γ","\\gamma",!0);M(P,Q,_t,"δ","\\delta",!0);M(P,Q,_t,"ϵ","\\epsilon",!0);M(P,Q,_t,"ζ","\\zeta",!0);M(P,Q,_t,"η","\\eta",!0);M(P,Q,_t,"θ","\\theta",!0);M(P,Q,_t,"ι","\\iota",!0);M(P,Q,_t,"κ","\\kappa",!0);M(P,Q,_t,"λ","\\lambda",!0);M(P,Q,_t,"μ","\\mu",!0);M(P,Q,_t,"ν","\\nu",!0);M(P,Q,_t,"ξ","\\xi",!0);M(P,Q,_t,"ο","\\omicron",!0);M(P,Q,_t,"π","\\pi",!0);M(P,Q,_t,"ρ","\\rho",!0);M(P,Q,_t,"σ","\\sigma",!0);M(P,Q,_t,"τ","\\tau",!0);M(P,Q,_t,"υ","\\upsilon",!0);M(P,Q,_t,"ϕ","\\phi",!0);M(P,Q,_t,"χ","\\chi",!0);M(P,Q,_t,"ψ","\\psi",!0);M(P,Q,_t,"ω","\\omega",!0);M(P,Q,_t,"ε","\\varepsilon",!0);M(P,Q,_t,"ϑ","\\vartheta",!0);M(P,Q,_t,"ϖ","\\varpi",!0);M(P,Q,_t,"ϱ","\\varrho",!0);M(P,Q,_t,"ς","\\varsigma",!0);M(P,Q,_t,"φ","\\varphi",!0);M(P,Q,it,"∗","*",!0);M(P,Q,it,"+","+");M(P,Q,it,"−","-",!0);M(P,Q,it,"⋅","\\cdot",!0);M(P,Q,it,"∘","\\circ",!0);M(P,Q,it,"÷","\\div",!0);M(P,Q,it,"±","\\pm",!0);M(P,Q,it,"×","\\times",!0);M(P,Q,it,"∩","\\cap",!0);M(P,Q,it,"∪","\\cup",!0);M(P,Q,it,"∖","\\setminus",!0);M(P,Q,it,"∧","\\land");M(P,Q,it,"∨","\\lor");M(P,Q,it,"∧","\\wedge",!0);M(P,Q,it,"∨","\\vee",!0);M(P,Q,me,"√","\\surd");M(P,Q,ra,"⟨","\\langle",!0);M(P,Q,ra,"∣","\\lvert");M(P,Q,ra,"∥","\\lVert");M(P,Q,li,"?","?");M(P,Q,li,"!","!");M(P,Q,li,"⟩","\\rangle",!0);M(P,Q,li,"∣","\\rvert");M(P,Q,li,"∥","\\rVert");M(P,Q,ce,"=","=");M(P,Q,ce,":",":");M(P,Q,ce,"≈","\\approx",!0);M(P,Q,ce,"≅","\\cong",!0);M(P,Q,ce,"≥","\\ge");M(P,Q,ce,"≥","\\geq",!0);M(P,Q,ce,"←","\\gets");M(P,Q,ce,">","\\gt",!0);M(P,Q,ce,"∈","\\in",!0);M(P,Q,ce,"","\\@not");M(P,Q,ce,"⊂","\\subset",!0);M(P,Q,ce,"⊃","\\supset",!0);M(P,Q,ce,"⊆","\\subseteq",!0);M(P,Q,ce,"⊇","\\supseteq",!0);M(P,le,ce,"⊈","\\nsubseteq",!0);M(P,le,ce,"⊉","\\nsupseteq",!0);M(P,Q,ce,"⊨","\\models");M(P,Q,ce,"←","\\leftarrow",!0);M(P,Q,ce,"≤","\\le");M(P,Q,ce,"≤","\\leq",!0);M(P,Q,ce,"<","\\lt",!0);M(P,Q,ce,"→","\\rightarrow",!0);M(P,Q,ce,"→","\\to");M(P,le,ce,"≱","\\ngeq",!0);M(P,le,ce,"≰","\\nleq",!0);M(P,Q,tc," ","\\ ");M(P,Q,tc," ","\\space");M(P,Q,tc," ","\\nobreakspace");M(Le,Q,tc," ","\\ ");M(Le,Q,tc," "," ");M(Le,Q,tc," ","\\space");M(Le,Q,tc," ","\\nobreakspace");M(P,Q,tc,null,"\\nobreak");M(P,Q,tc,null,"\\allowbreak");M(P,Q,Vb,",",",");M(P,Q,Vb,";",";");M(P,le,it,"⊼","\\barwedge",!0);M(P,le,it,"⊻","\\veebar",!0);M(P,Q,it,"⊙","\\odot",!0);M(P,Q,it,"⊕","\\oplus",!0);M(P,Q,it,"⊗","\\otimes",!0);M(P,Q,me,"∂","\\partial",!0);M(P,Q,it,"⊘","\\oslash",!0);M(P,le,it,"⊚","\\circledcirc",!0);M(P,le,it,"⊡","\\boxdot",!0);M(P,Q,it,"△","\\bigtriangleup");M(P,Q,it,"▽","\\bigtriangledown");M(P,Q,it,"†","\\dagger");M(P,Q,it,"⋄","\\diamond");M(P,Q,it,"⋆","\\star");M(P,Q,it,"◃","\\triangleleft");M(P,Q,it,"▹","\\triangleright");M(P,Q,ra,"{","\\{");M(Le,Q,me,"{","\\{");M(Le,Q,me,"{","\\textbraceleft");M(P,Q,li,"}","\\}");M(Le,Q,me,"}","\\}");M(Le,Q,me,"}","\\textbraceright");M(P,Q,ra,"{","\\lbrace");M(P,Q,li,"}","\\rbrace");M(P,Q,ra,"[","\\lbrack",!0);M(Le,Q,me,"[","\\lbrack",!0);M(P,Q,li,"]","\\rbrack",!0);M(Le,Q,me,"]","\\rbrack",!0);M(P,Q,ra,"(","\\lparen",!0);M(P,Q,li,")","\\rparen",!0);M(Le,Q,me,"<","\\textless",!0);M(Le,Q,me,">","\\textgreater",!0);M(P,Q,ra,"⌊","\\lfloor",!0);M(P,Q,li,"⌋","\\rfloor",!0);M(P,Q,ra,"⌈","\\lceil",!0);M(P,Q,li,"⌉","\\rceil",!0);M(P,Q,me,"\\","\\backslash");M(P,Q,me,"∣","|");M(P,Q,me,"∣","\\vert");M(Le,Q,me,"|","\\textbar",!0);M(P,Q,me,"∥","\\|");M(P,Q,me,"∥","\\Vert");M(Le,Q,me,"∥","\\textbardbl");M(Le,Q,me,"~","\\textasciitilde");M(Le,Q,me,"\\","\\textbackslash");M(Le,Q,me,"^","\\textasciicircum");M(P,Q,ce,"↑","\\uparrow",!0);M(P,Q,ce,"⇑","\\Uparrow",!0);M(P,Q,ce,"↓","\\downarrow",!0);M(P,Q,ce,"⇓","\\Downarrow",!0);M(P,Q,ce,"↕","\\updownarrow",!0);M(P,Q,ce,"⇕","\\Updownarrow",!0);M(P,Q,os,"∐","\\coprod");M(P,Q,os,"⋁","\\bigvee");M(P,Q,os,"⋀","\\bigwedge");M(P,Q,os,"⨄","\\biguplus");M(P,Q,os,"⋂","\\bigcap");M(P,Q,os,"⋃","\\bigcup");M(P,Q,os,"∫","\\int");M(P,Q,os,"∫","\\intop");M(P,Q,os,"∬","\\iint");M(P,Q,os,"∭","\\iiint");M(P,Q,os,"∏","\\prod");M(P,Q,os,"∑","\\sum");M(P,Q,os,"⨂","\\bigotimes");M(P,Q,os,"⨁","\\bigoplus");M(P,Q,os,"⨀","\\bigodot");M(P,Q,os,"∮","\\oint");M(P,Q,os,"∯","\\oiint");M(P,Q,os,"∰","\\oiiint");M(P,Q,os,"⨆","\\bigsqcup");M(P,Q,os,"∫","\\smallint");M(Le,Q,$f,"…","\\textellipsis");M(P,Q,$f,"…","\\mathellipsis");M(Le,Q,$f,"…","\\ldots",!0);M(P,Q,$f,"…","\\ldots",!0);M(P,Q,$f,"⋯","\\@cdots",!0);M(P,Q,$f,"⋱","\\ddots",!0);M(P,Q,me,"⋮","\\varvdots");M(Le,Q,me,"⋮","\\varvdots");M(P,Q,_r,"ˊ","\\acute");M(P,Q,_r,"ˋ","\\grave");M(P,Q,_r,"¨","\\ddot");M(P,Q,_r,"~","\\tilde");M(P,Q,_r,"ˉ","\\bar");M(P,Q,_r,"˘","\\breve");M(P,Q,_r,"ˇ","\\check");M(P,Q,_r,"^","\\hat");M(P,Q,_r,"⃗","\\vec");M(P,Q,_r,"˙","\\dot");M(P,Q,_r,"˚","\\mathring");M(P,Q,_t,"","\\@imath");M(P,Q,_t,"","\\@jmath");M(P,Q,me,"ı","ı");M(P,Q,me,"ȷ","ȷ");M(Le,Q,me,"ı","\\i",!0);M(Le,Q,me,"ȷ","\\j",!0);M(Le,Q,me,"ß","\\ss",!0);M(Le,Q,me,"æ","\\ae",!0);M(Le,Q,me,"œ","\\oe",!0);M(Le,Q,me,"ø","\\o",!0);M(Le,Q,me,"Æ","\\AE",!0);M(Le,Q,me,"Œ","\\OE",!0);M(Le,Q,me,"Ø","\\O",!0);M(Le,Q,_r,"ˊ","\\'");M(Le,Q,_r,"ˋ","\\`");M(Le,Q,_r,"ˆ","\\^");M(Le,Q,_r,"˜","\\~");M(Le,Q,_r,"ˉ","\\=");M(Le,Q,_r,"˘","\\u");M(Le,Q,_r,"˙","\\.");M(Le,Q,_r,"¸","\\c");M(Le,Q,_r,"˚","\\r");M(Le,Q,_r,"ˇ","\\v");M(Le,Q,_r,"¨",'\\"');M(Le,Q,_r,"˝","\\H");M(Le,Q,_r,"◯","\\textcircled");var sU={"--":!0,"---":!0,"``":!0,"''":!0};M(Le,Q,me,"–","--",!0);M(Le,Q,me,"–","\\textendash");M(Le,Q,me,"—","---",!0);M(Le,Q,me,"—","\\textemdash");M(Le,Q,me,"‘","`",!0);M(Le,Q,me,"‘","\\textquoteleft");M(Le,Q,me,"’","'",!0);M(Le,Q,me,"’","\\textquoteright");M(Le,Q,me,"“","``",!0);M(Le,Q,me,"“","\\textquotedblleft");M(Le,Q,me,"”","''",!0);M(Le,Q,me,"”","\\textquotedblright");M(P,Q,me,"°","\\degree",!0);M(Le,Q,me,"°","\\degree");M(Le,Q,me,"°","\\textdegree",!0);M(P,Q,me,"£","\\pounds");M(P,Q,me,"£","\\mathsterling",!0);M(Le,Q,me,"£","\\pounds");M(Le,Q,me,"£","\\textsterling",!0);M(P,le,me,"✠","\\maltese");M(Le,le,me,"✠","\\maltese");var wR='0123456789/@."';for(var YS=0;YS0)return Ha(i,d,s,n,a.concat(h));if(c){var m,g;if(c==="boldsymbol"){var x=p3e(i,s,n,a,r);m=x.fontName,g=[x.fontClass]}else l?(m=oU[c].fontName,g=[c]):(m=F1(c,n.fontWeight,n.fontShape),g=[c,n.fontWeight,n.fontShape]);if(Ub(i,m,s).metrics)return Ha(i,m,s,n,a.concat(g));if(sU.hasOwnProperty(i)&&m.slice(0,10)==="Typewriter"){for(var y=[],w=0;w{if(ru(t.classes)!==ru(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize)return!1;if(t.classes.length===1){var n=t.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r in t.style)if(t.style.hasOwnProperty(r)&&t.style[r]!==e.style[r])return!1;for(var s in e.style)if(e.style.hasOwnProperty(s)&&t.style[s]!==e.style[s])return!1;return!0},v3e=t=>{for(var e=0;en&&(n=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>s&&(s=a.maxFontSize)}e.height=n,e.depth=r,e.maxFontSize=s},gi=function(e,n,r,s){var i=new bg(e,n,r,s);return DN(i),i},iU=(t,e,n,r)=>new bg(t,e,n,r),y3e=function(e,n,r){var s=gi([e],[],n);return s.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),s.style.borderBottomWidth=Xe(s.height),s.maxFontSize=1,s},b3e=function(e,n,r,s){var i=new RN(e,n,r,s);return DN(i),i},aU=function(e){var n=new yg(e);return DN(n),n},w3e=function(e,n){return e instanceof yg?gi([],[e],n):e},S3e=function(e){if(e.positionType==="individualShift"){for(var n=e.children,r=[n[0]],s=-n[0].shift-n[0].elem.depth,i=s,a=1;a{var n=gi(["mspace"],[],e),r=Ir(t,e);return n.style.marginRight=Xe(r),n},F1=function(e,n,r){var s="";switch(e){case"amsrm":s="AMS";break;case"textrm":s="Main";break;case"textsf":s="SansSerif";break;case"texttt":s="Typewriter";break;default:s=e}var i;return n==="textbf"&&r==="textit"?i="BoldItalic":n==="textbf"?i="Bold":n==="textit"?i="Italic":i="Regular",s+"-"+i},oU={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},lU={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},j3e=function(e,n){var[r,s,i]=lU[e],a=new su(r),l=new Ul([a],{width:Xe(s),height:Xe(i),style:"width:"+Xe(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),c=iU(["overlay"],[l],n);return c.height=i,c.style.height=Xe(i),c.style.width=Xe(s),c},we={fontMap:oU,makeSymbol:Ha,mathsym:m3e,makeSpan:gi,makeSvgSpan:iU,makeLineSpan:y3e,makeAnchor:b3e,makeFragment:aU,wrapFragment:w3e,makeVList:k3e,makeOrd:g3e,makeGlue:O3e,staticSvg:j3e,svgData:lU,tryCombineChars:v3e},Pr={number:3,unit:"mu"},Bu={number:4,unit:"mu"},Sl={number:5,unit:"mu"},N3e={mord:{mop:Pr,mbin:Bu,mrel:Sl,minner:Pr},mop:{mord:Pr,mop:Pr,mrel:Sl,minner:Pr},mbin:{mord:Bu,mop:Bu,mopen:Bu,minner:Bu},mrel:{mord:Sl,mop:Sl,mopen:Sl,minner:Sl},mopen:{},mclose:{mop:Pr,mbin:Bu,mrel:Sl,minner:Pr},mpunct:{mord:Pr,mop:Pr,mrel:Sl,mopen:Pr,mclose:Pr,mpunct:Pr,minner:Pr},minner:{mord:Pr,mop:Pr,mbin:Bu,mrel:Sl,mopen:Pr,mpunct:Pr,minner:Pr}},C3e={mord:{mop:Pr},mop:{mord:Pr,mop:Pr},mbin:{},mrel:{},mopen:{},mclose:{mop:Pr},mpunct:{},minner:{mop:Pr}},cU={},Ey={},_y={};function tt(t){for(var{type:e,names:n,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=t,l={type:e,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:s},c=0;c{var S=w.classes[0],k=y.classes[0];S==="mbin"&&E3e.includes(k)?w.classes[0]="mord":k==="mbin"&&T3e.includes(S)&&(y.classes[0]="mord")},{node:m},g,x),NR(i,(y,w)=>{var S=VO(w),k=VO(y),j=S&&k?y.hasClass("mtight")?C3e[S][k]:N3e[S][k]:null;if(j)return we.makeGlue(j,d)},{node:m},g,x),i},NR=function t(e,n,r,s,i){s&&e.push(s);for(var a=0;ag=>{e.splice(m+1,0,g),a++})(a)}s&&e.pop()},uU=function(e){return e instanceof yg||e instanceof RN||e instanceof bg&&e.hasClass("enclosing")?e:null},M3e=function t(e,n){var r=uU(e);if(r){var s=r.children;if(s.length){if(n==="right")return t(s[s.length-1],"right");if(n==="left")return t(s[0],"left")}}return e},VO=function(e,n){return e?(n&&(e=M3e(e,n)),A3e[e.classes[0]]||null):null},Sp=function(e,n){var r=["nulldelimiter"].concat(e.baseSizingClasses());return Wl(n.concat(r))},qn=function(e,n,r){if(!e)return Wl();if(Ey[e.type]){var s=Ey[e.type](e,n);if(r&&n.size!==r.size){s=Wl(n.sizingClasses(r),[s],n);var i=n.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new qe("Got group of unknown type: '"+e.type+"'")};function q1(t,e){var n=Wl(["base"],t,e),r=Wl(["strut"]);return r.style.height=Xe(n.height+n.depth),n.depth&&(r.style.verticalAlign=Xe(-n.depth)),n.children.unshift(r),n}function UO(t,e){var n=null;t.length===1&&t[0].type==="tag"&&(n=t[0].tag,t=t[0].body);var r=ms(t,e,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],a=[],l=0;l0&&(i.push(q1(a,e)),a=[]),i.push(r[l]));a.length>0&&i.push(q1(a,e));var d;n?(d=q1(ms(n,e,!0)),d.classes=["tag"],i.push(d)):s&&i.push(s);var h=Wl(["katex-html"],i);if(h.setAttribute("aria-hidden","true"),d){var m=d.children[0];m.style.height=Xe(h.height+h.depth),h.depth&&(m.style.verticalAlign=Xe(-h.depth))}return h}function dU(t){return new yg(t)}class Ui{constructor(e,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(e,n){this.attributes[e]=n}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&e.setAttribute(n,this.attributes[n]);this.classes.length>0&&(e.className=ru(this.classes));for(var r=0;r0&&(e+=' class ="'+Wn.escape(ru(this.classes))+'"'),e+=">";for(var r=0;r",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Ro{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Wn.escape(this.toText())}toText(){return this.text}}class R3e{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",Xe(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var Fe={MathNode:Ui,TextNode:Ro,SpaceNode:R3e,newDocumentFragment:dU},Ra=function(e,n,r){return pr[n][e]&&pr[n][e].replace&&e.charCodeAt(0)!==55349&&!(sU.hasOwnProperty(e)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(e=pr[n][e].replace),new Fe.TextNode(e)},PN=function(e){return e.length===1?e[0]:new Fe.MathNode("mrow",e)},zN=function(e,n){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold";var r=n.font;if(!r||r==="mathnormal")return null;var s=e.mode;if(r==="mathit")return"italic";if(r==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(r==="mathbf")return"bold";if(r==="mathbb")return"double-struck";if(r==="mathsfit")return"sans-serif-italic";if(r==="mathfrak")return"fraktur";if(r==="mathscr"||r==="mathcal")return"script";if(r==="mathsf")return"sans-serif";if(r==="mathtt")return"monospace";var i=e.text;if(["\\imath","\\jmath"].includes(i))return null;pr[s][i]&&pr[s][i].replace&&(i=pr[s][i].replace);var a=we.fontMap[r].fontName;return MN(i,a,s)?we.fontMap[r].variant:null};function e5(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof Ro&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var n=t.children[0];return n instanceof Ro&&n.text===","}else return!1}var Mi=function(e,n,r){if(e.length===1){var s=hr(e[0],n);return r&&s instanceof Ui&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],a,l=0;l=1&&(a.type==="mn"||e5(a))){var d=c.children[0];d instanceof Ui&&d.type==="mn"&&(d.children=[...a.children,...d.children],i.pop())}else if(a.type==="mi"&&a.children.length===1){var h=a.children[0];if(h instanceof Ro&&h.text==="̸"&&(c.type==="mo"||c.type==="mi"||c.type==="mn")){var m=c.children[0];m instanceof Ro&&m.text.length>0&&(m.text=m.text.slice(0,1)+"̸"+m.text.slice(1),i.pop())}}}i.push(c),a=c}return i},iu=function(e,n,r){return PN(Mi(e,n,r))},hr=function(e,n){if(!e)return new Fe.MathNode("mrow");if(_y[e.type]){var r=_y[e.type](e,n);return r}else throw new qe("Got group of unknown type: '"+e.type+"'")};function CR(t,e,n,r,s){var i=Mi(t,n),a;i.length===1&&i[0]instanceof Ui&&["mrow","mtable"].includes(i[0].type)?a=i[0]:a=new Fe.MathNode("mrow",i);var l=new Fe.MathNode("annotation",[new Fe.TextNode(e)]);l.setAttribute("encoding","application/x-tex");var c=new Fe.MathNode("semantics",[a,l]),d=new Fe.MathNode("math",[c]);d.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&d.setAttribute("display","block");var h=s?"katex":"katex-mathml";return we.makeSpan([h],[d])}var hU=function(e){return new Al({style:e.displayMode?At.DISPLAY:At.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},fU=function(e,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),e=we.makeSpan(r,[e])}return e},D3e=function(e,n,r){var s=hU(r),i;if(r.output==="mathml")return CR(e,n,s,r.displayMode,!0);if(r.output==="html"){var a=UO(e,s);i=we.makeSpan(["katex"],[a])}else{var l=CR(e,n,s,r.displayMode,!1),c=UO(e,s);i=we.makeSpan(["katex"],[l,c])}return fU(i,r)},P3e=function(e,n,r){var s=hU(r),i=UO(e,s),a=we.makeSpan(["katex"],[i]);return fU(a,r)},z3e={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},I3e=function(e){var n=new Fe.MathNode("mo",[new Fe.TextNode(z3e[e.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},L3e={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},B3e=function(e){return e.type==="ordgroup"?e.body.length:1},F3e=function(e,n){function r(){var l=4e5,c=e.label.slice(1);if(["widehat","widecheck","widetilde","utilde"].includes(c)){var d=e,h=B3e(d.base),m,g,x;if(h>5)c==="widehat"||c==="widecheck"?(m=420,l=2364,x=.42,g=c+"4"):(m=312,l=2340,x=.34,g="tilde4");else{var y=[1,1,2,2,3,3][h];c==="widehat"||c==="widecheck"?(l=[0,1062,2364,2364,2364][y],m=[0,239,300,360,420][y],x=[0,.24,.3,.3,.36,.42][y],g=c+y):(l=[0,600,1033,2339,2340][y],m=[0,260,286,306,312][y],x=[0,.26,.286,.3,.306,.34][y],g="tilde"+y)}var w=new su(g),S=new Ul([w],{width:"100%",height:Xe(x),viewBox:"0 0 "+l+" "+m,preserveAspectRatio:"none"});return{span:we.makeSvgSpan([],[S],n),minWidth:0,height:x}}else{var k=[],j=L3e[c],[N,T,E]=j,_=E/1e3,A=N.length,D,q;if(A===1){var B=j[3];D=["hide-tail"],q=[B]}else if(A===2)D=["halfarrow-left","halfarrow-right"],q=["xMinYMin","xMaxYMin"];else if(A===3)D=["brace-left","brace-center","brace-right"],q=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+A+" children.");for(var H=0;H0&&(s.style.minWidth=Xe(i)),s},q3e=function(e,n,r,s,i){var a,l=e.height+e.depth+r+s;if(/fbox|color|angl/.test(n)){if(a=we.makeSpan(["stretchy",n],[],i),n==="fbox"){var c=i.color&&i.getColor();c&&(a.style.borderColor=c)}}else{var d=[];/^[bx]cancel$/.test(n)&&d.push(new HO({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&d.push(new HO({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new Ul(d,{width:"100%",height:Xe(l)});a=we.makeSvgSpan([],[h],i)}return a.height=l,a.style.height=Xe(l),a},Gl={encloseSpan:q3e,mathMLnode:I3e,svgSpan:F3e};function nn(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function IN(t){var e=Wb(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function Wb(t){return t&&(t.type==="atom"||h3e.hasOwnProperty(t.type))?t:null}var LN=(t,e)=>{var n,r,s;t&&t.type==="supsub"?(r=nn(t.base,"accent"),n=r.base,t.base=n,s=u3e(qn(t,e)),t.base=r):(r=nn(t,"accent"),n=r.base);var i=qn(n,e.havingCrampedStyle()),a=r.isShifty&&Wn.isCharacterBox(n),l=0;if(a){var c=Wn.getBaseElem(n),d=qn(c,e.havingCrampedStyle());l=bR(d).skew}var h=r.label==="\\c",m=h?i.height+i.depth:Math.min(i.height,e.fontMetrics().xHeight),g;if(r.isStretchy)g=Gl.svgSpan(r,e),g=we.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:g,wrapperClasses:["svg-align"],wrapperStyle:l>0?{width:"calc(100% - "+Xe(2*l)+")",marginLeft:Xe(2*l)}:void 0}]},e);else{var x,y;r.label==="\\vec"?(x=we.staticSvg("vec",e),y=we.svgData.vec[1]):(x=we.makeOrd({mode:r.mode,text:r.label},e,"textord"),x=bR(x),x.italic=0,y=x.width,h&&(m+=x.depth)),g=we.makeSpan(["accent-body"],[x]);var w=r.label==="\\textcircled";w&&(g.classes.push("accent-full"),m=i.height);var S=l;w||(S-=y/2),g.style.left=Xe(S),r.label==="\\textcircled"&&(g.style.top=".2em"),g=we.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-m},{type:"elem",elem:g}]},e)}var k=we.makeSpan(["mord","accent"],[g],e);return s?(s.children[0]=k,s.height=Math.max(k.height,s.height),s.classes[0]="mord",s):k},mU=(t,e)=>{var n=t.isStretchy?Gl.mathMLnode(t.label):new Fe.MathNode("mo",[Ra(t.label,t.mode)]),r=new Fe.MathNode("mover",[hr(t.base,e),n]);return r.setAttribute("accent","true"),r},$3e=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));tt({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var n=Ay(e[0]),r=!$3e.test(t.funcName),s=!r||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:r,isShifty:s,base:n}},htmlBuilder:LN,mathmlBuilder:mU});tt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var n=e[0],r=t.parser.mode;return r==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:t.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:LN,mathmlBuilder:mU});tt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0];return{type:"accentUnder",mode:n.mode,label:r,base:s}},htmlBuilder:(t,e)=>{var n=qn(t.base,e),r=Gl.svgSpan(t,e),s=t.label==="\\utilde"?.12:0,i=we.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:n}]},e);return we.makeSpan(["mord","accentunder"],[i],e)},mathmlBuilder:(t,e)=>{var n=Gl.mathMLnode(t.label),r=new Fe.MathNode("munder",[hr(t.base,e),n]);return r.setAttribute("accentunder","true"),r}});var $1=t=>{var e=new Fe.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};tt({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,n){var{parser:r,funcName:s}=t;return{type:"xArrow",mode:r.mode,label:s,body:e[0],below:n[0]}},htmlBuilder(t,e){var n=e.style,r=e.havingStyle(n.sup()),s=we.wrapFragment(qn(t.body,r,e),e),i=t.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var a;t.below&&(r=e.havingStyle(n.sub()),a=we.wrapFragment(qn(t.below,r,e),e),a.classes.push(i+"-arrow-pad"));var l=Gl.svgSpan(t,e),c=-e.fontMetrics().axisHeight+.5*l.height,d=-e.fontMetrics().axisHeight-.5*l.height-.111;(s.depth>.25||t.label==="\\xleftequilibrium")&&(d-=s.depth);var h;if(a){var m=-e.fontMetrics().axisHeight+a.height+.5*l.height+.111;h=we.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:d},{type:"elem",elem:l,shift:c},{type:"elem",elem:a,shift:m}]},e)}else h=we.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:d},{type:"elem",elem:l,shift:c}]},e);return h.children[0].children[0].children[1].classes.push("svg-align"),we.makeSpan(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var n=Gl.mathMLnode(t.label);n.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(t.body){var s=$1(hr(t.body,e));if(t.below){var i=$1(hr(t.below,e));r=new Fe.MathNode("munderover",[n,i,s])}else r=new Fe.MathNode("mover",[n,s])}else if(t.below){var a=$1(hr(t.below,e));r=new Fe.MathNode("munder",[n,a])}else r=$1(),r=new Fe.MathNode("mover",[n,r]);return r}});var H3e=we.makeSpan;function pU(t,e){var n=ms(t.body,e,!0);return H3e([t.mclass],n,e)}function gU(t,e){var n,r=Mi(t.body,e);return t.mclass==="minner"?n=new Fe.MathNode("mpadded",r):t.mclass==="mord"?t.isCharacterBox?(n=r[0],n.type="mi"):n=new Fe.MathNode("mi",r):(t.isCharacterBox?(n=r[0],n.type="mo"):n=new Fe.MathNode("mo",r),t.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):t.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):t.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}tt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:n,funcName:r}=t,s=e[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:Gr(s),isCharacterBox:Wn.isCharacterBox(s)}},htmlBuilder:pU,mathmlBuilder:gU});var Gb=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};tt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:n}=t;return{type:"mclass",mode:n.mode,mclass:Gb(e[0]),body:Gr(e[1]),isCharacterBox:Wn.isCharacterBox(e[1])}}});tt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:n,funcName:r}=t,s=e[1],i=e[0],a;r!=="\\stackrel"?a=Gb(s):a="mrel";var l={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:Gr(s)},c={type:"supsub",mode:i.mode,base:l,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:n.mode,mclass:a,body:[c],isCharacterBox:Wn.isCharacterBox(c)}},htmlBuilder:pU,mathmlBuilder:gU});tt({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"pmb",mode:n.mode,mclass:Gb(e[0]),body:Gr(e[0])}},htmlBuilder(t,e){var n=ms(t.body,e,!0),r=we.makeSpan([t.mclass],n,e);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(t,e){var n=Mi(t.body,e),r=new Fe.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var Q3e={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},TR=()=>({type:"styling",body:[],mode:"math",style:"display"}),ER=t=>t.type==="textord"&&t.text==="@",V3e=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function U3e(t,e,n){var r=Q3e[t];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var s=n.callFunction("\\\\cdleft",[e[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},a=n.callFunction("\\Big",[i],[]),l=n.callFunction("\\\\cdright",[e[1]],[]),c={type:"ordgroup",mode:"math",body:[s,a,l]};return n.callFunction("\\\\cdparent",[c],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var d={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[d],[])}default:return{type:"textord",text:" ",mode:"math"}}}function W3e(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var n=t.fetch().text;if(n==="&"||n==="\\\\")t.consume();else if(n==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new qe("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var r=[],s=[r],i=0;i-1))if("<>AV".indexOf(d)>-1)for(var m=0;m<2;m++){for(var g=!0,x=c+1;xAV=|." after @',a[c]);var y=U3e(d,h,t),w={type:"styling",body:[y],mode:"math",style:"display"};r.push(w),l=TR()}i%2===0?r.push(l):r.shift(),r=[],s.push(r)}t.gullet.endGroup(),t.gullet.endGroup();var S=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:S,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}tt({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:e[0]}},htmlBuilder(t,e){var n=e.havingStyle(e.style.sup()),r=we.wrapFragment(qn(t.label,n,e),e);return r.classes.push("cd-label-"+t.side),r.style.bottom=Xe(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(t,e){var n=new Fe.MathNode("mrow",[hr(t.label,e)]);return n=new Fe.MathNode("mpadded",[n]),n.setAttribute("width","0"),t.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new Fe.MathNode("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});tt({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:n}=t;return{type:"cdlabelparent",mode:n.mode,fragment:e[0]}},htmlBuilder(t,e){var n=we.wrapFragment(qn(t.fragment,e),e);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(t,e){return new Fe.MathNode("mrow",[hr(t.fragment,e)])}});tt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:n}=t,r=nn(e[0],"ordgroup"),s=r.body,i="",a=0;a=1114111)throw new qe("\\@char with invalid code point "+i);return c<=65535?d=String.fromCharCode(c):(c-=65536,d=String.fromCharCode((c>>10)+55296,(c&1023)+56320)),{type:"textord",mode:n.mode,text:d}}});var xU=(t,e)=>{var n=ms(t.body,e.withColor(t.color),!1);return we.makeFragment(n)},vU=(t,e)=>{var n=Mi(t.body,e.withColor(t.color)),r=new Fe.MathNode("mstyle",n);return r.setAttribute("mathcolor",t.color),r};tt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:n}=t,r=nn(e[0],"color-token").color,s=e[1];return{type:"color",mode:n.mode,color:r,body:Gr(s)}},htmlBuilder:xU,mathmlBuilder:vU});tt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:n,breakOnTokenText:r}=t,s=nn(e[0],"color-token").color;n.gullet.macros.set("\\current@color",s);var i=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:s,body:i}},htmlBuilder:xU,mathmlBuilder:vU});tt({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,n){var{parser:r}=t,s=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:s&&nn(s,"size").value}},htmlBuilder(t,e){var n=we.makeSpan(["mspace"],[],e);return t.newLine&&(n.classes.push("newline"),t.size&&(n.style.marginTop=Xe(Ir(t.size,e)))),n},mathmlBuilder(t,e){var n=new Fe.MathNode("mspace");return t.newLine&&(n.setAttribute("linebreak","newline"),t.size&&n.setAttribute("height",Xe(Ir(t.size,e)))),n}});var WO={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},yU=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new qe("Expected a control sequence",t);return e},G3e=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},bU=(t,e,n,r)=>{var s=t.gullet.macros.get(n.text);s==null&&(n.noexpand=!0,s={tokens:[n],numArgs:0,unexpandable:!t.gullet.isExpandable(n.text)}),t.gullet.macros.set(e,s,r)};tt({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:n}=t;e.consumeSpaces();var r=e.fetch();if(WO[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=WO[r.text]),nn(e.parseFunction(),"internal");throw new qe("Invalid token after macro prefix",r)}});tt({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=e.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new qe("Expected a control sequence",r);for(var i=0,a,l=[[]];e.gullet.future().text!=="{";)if(r=e.gullet.popToken(),r.text==="#"){if(e.gullet.future().text==="{"){a=e.gullet.future(),l[i].push("{");break}if(r=e.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new qe('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new qe('Argument number "'+r.text+'" out of order');i++,l.push([])}else{if(r.text==="EOF")throw new qe("Expected a macro definition");l[i].push(r.text)}var{tokens:c}=e.gullet.consumeArg();return a&&c.unshift(a),(n==="\\edef"||n==="\\xdef")&&(c=e.gullet.expandTokens(c),c.reverse()),e.gullet.macros.set(s,{tokens:c,numArgs:i,delimiters:l},n===WO[n]),{type:"internal",mode:e.mode}}});tt({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=yU(e.gullet.popToken());e.gullet.consumeSpaces();var s=G3e(e);return bU(e,r,s,n==="\\\\globallet"),{type:"internal",mode:e.mode}}});tt({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=yU(e.gullet.popToken()),s=e.gullet.popToken(),i=e.gullet.popToken();return bU(e,r,i,n==="\\\\globalfuture"),e.gullet.pushToken(i),e.gullet.pushToken(s),{type:"internal",mode:e.mode}}});var f0=function(e,n,r){var s=pr.math[e]&&pr.math[e].replace,i=MN(s||e,n,r);if(!i)throw new Error("Unsupported symbol "+e+" and font size "+n+".");return i},BN=function(e,n,r,s){var i=r.havingBaseStyle(n),a=we.makeSpan(s.concat(i.sizingClasses(r)),[e],r),l=i.sizeMultiplier/r.sizeMultiplier;return a.height*=l,a.depth*=l,a.maxFontSize=i.sizeMultiplier,a},wU=function(e,n,r){var s=n.havingBaseStyle(r),i=(1-n.sizeMultiplier/s.sizeMultiplier)*n.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Xe(i),e.height-=i,e.depth+=i},X3e=function(e,n,r,s,i,a){var l=we.makeSymbol(e,"Main-Regular",i,s),c=BN(l,n,s,a);return r&&wU(c,s,n),c},Y3e=function(e,n,r,s){return we.makeSymbol(e,"Size"+n+"-Regular",r,s)},SU=function(e,n,r,s,i,a){var l=Y3e(e,n,i,s),c=BN(we.makeSpan(["delimsizing","size"+n],[l],s),At.TEXT,s,a);return r&&wU(c,s,At.TEXT),c},t5=function(e,n,r){var s;n==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=we.makeSpan(["delimsizinginner",s],[we.makeSpan([],[we.makeSymbol(e,n,r)])]);return{type:"elem",elem:i}},n5=function(e,n,r){var s=Mo["Size4-Regular"][e.charCodeAt(0)]?Mo["Size4-Regular"][e.charCodeAt(0)][4]:Mo["Size1-Regular"][e.charCodeAt(0)][4],i=new su("inner",t3e(e,Math.round(1e3*n))),a=new Ul([i],{width:Xe(s),height:Xe(n),style:"width:"+Xe(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),l=we.makeSvgSpan([],[a],r);return l.height=n,l.style.height=Xe(n),l.style.width=Xe(s),{type:"elem",elem:l}},GO=.008,H1={type:"kern",size:-1*GO},K3e=["|","\\lvert","\\rvert","\\vert"],Z3e=["\\|","\\lVert","\\rVert","\\Vert"],kU=function(e,n,r,s,i,a){var l,c,d,h,m="",g=0;l=d=h=e,c=null;var x="Size1-Regular";e==="\\uparrow"?d=h="⏐":e==="\\Uparrow"?d=h="‖":e==="\\downarrow"?l=d="⏐":e==="\\Downarrow"?l=d="‖":e==="\\updownarrow"?(l="\\uparrow",d="⏐",h="\\downarrow"):e==="\\Updownarrow"?(l="\\Uparrow",d="‖",h="\\Downarrow"):K3e.includes(e)?(d="∣",m="vert",g=333):Z3e.includes(e)?(d="∥",m="doublevert",g=556):e==="["||e==="\\lbrack"?(l="⎡",d="⎢",h="⎣",x="Size4-Regular",m="lbrack",g=667):e==="]"||e==="\\rbrack"?(l="⎤",d="⎥",h="⎦",x="Size4-Regular",m="rbrack",g=667):e==="\\lfloor"||e==="⌊"?(d=l="⎢",h="⎣",x="Size4-Regular",m="lfloor",g=667):e==="\\lceil"||e==="⌈"?(l="⎡",d=h="⎢",x="Size4-Regular",m="lceil",g=667):e==="\\rfloor"||e==="⌋"?(d=l="⎥",h="⎦",x="Size4-Regular",m="rfloor",g=667):e==="\\rceil"||e==="⌉"?(l="⎤",d=h="⎥",x="Size4-Regular",m="rceil",g=667):e==="("||e==="\\lparen"?(l="⎛",d="⎜",h="⎝",x="Size4-Regular",m="lparen",g=875):e===")"||e==="\\rparen"?(l="⎞",d="⎟",h="⎠",x="Size4-Regular",m="rparen",g=875):e==="\\{"||e==="\\lbrace"?(l="⎧",c="⎨",h="⎩",d="⎪",x="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(l="⎫",c="⎬",h="⎭",d="⎪",x="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(l="⎧",h="⎩",d="⎪",x="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(l="⎫",h="⎭",d="⎪",x="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(l="⎧",h="⎭",d="⎪",x="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(l="⎫",h="⎩",d="⎪",x="Size4-Regular");var y=f0(l,x,i),w=y.height+y.depth,S=f0(d,x,i),k=S.height+S.depth,j=f0(h,x,i),N=j.height+j.depth,T=0,E=1;if(c!==null){var _=f0(c,x,i);T=_.height+_.depth,E=2}var A=w+N+T,D=Math.max(0,Math.ceil((n-A)/(E*k))),q=A+D*E*k,B=s.fontMetrics().axisHeight;r&&(B*=s.sizeMultiplier);var H=q/2-B,W=[];if(m.length>0){var ee=q-w-N,I=Math.round(q*1e3),V=n3e(m,Math.round(ee*1e3)),L=new su(m,V),$=(g/1e3).toFixed(3)+"em",K=(I/1e3).toFixed(3)+"em",Y=new Ul([L],{width:$,height:K,viewBox:"0 0 "+g+" "+I}),R=we.makeSvgSpan([],[Y],s);R.height=I/1e3,R.style.width=$,R.style.height=K,W.push({type:"elem",elem:R})}else{if(W.push(t5(h,x,i)),W.push(H1),c===null){var ie=q-w-N+2*GO;W.push(n5(d,ie,s))}else{var X=(q-w-N-T)/2+2*GO;W.push(n5(d,X,s)),W.push(H1),W.push(t5(c,x,i)),W.push(H1),W.push(n5(d,X,s))}W.push(H1),W.push(t5(l,x,i))}var z=s.havingBaseStyle(At.TEXT),U=we.makeVList({positionType:"bottom",positionData:H,children:W},z);return BN(we.makeSpan(["delimsizing","mult"],[U],z),At.TEXT,s,a)},r5=80,s5=.08,i5=function(e,n,r,s,i){var a=e3e(e,s,r),l=new su(e,a),c=new Ul([l],{width:"400em",height:Xe(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return we.makeSvgSpan(["hide-tail"],[c],i)},J3e=function(e,n){var r=n.havingBaseSizing(),s=CU("\\surd",e*r.sizeMultiplier,NU,r),i=r.sizeMultiplier,a=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),l,c=0,d=0,h=0,m;return s.type==="small"?(h=1e3+1e3*a+r5,e<1?i=1:e<1.4&&(i=.7),c=(1+a+s5)/i,d=(1+a)/i,l=i5("sqrtMain",c,h,a,n),l.style.minWidth="0.853em",m=.833/i):s.type==="large"?(h=(1e3+r5)*z0[s.size],d=(z0[s.size]+a)/i,c=(z0[s.size]+a+s5)/i,l=i5("sqrtSize"+s.size,c,h,a,n),l.style.minWidth="1.02em",m=1/i):(c=e+a+s5,d=e+a,h=Math.floor(1e3*e+a)+r5,l=i5("sqrtTall",c,h,a,n),l.style.minWidth="0.742em",m=1.056),l.height=d,l.style.height=Xe(c),{span:l,advanceWidth:m,ruleWidth:(n.fontMetrics().sqrtRuleThickness+a)*i}},OU=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],eke=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],jU=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],z0=[0,1.2,1.8,2.4,3],tke=function(e,n,r,s,i){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),OU.includes(e)||jU.includes(e))return SU(e,n,!1,r,s,i);if(eke.includes(e))return kU(e,z0[n],!1,r,s,i);throw new qe("Illegal delimiter: '"+e+"'")},nke=[{type:"small",style:At.SCRIPTSCRIPT},{type:"small",style:At.SCRIPT},{type:"small",style:At.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],rke=[{type:"small",style:At.SCRIPTSCRIPT},{type:"small",style:At.SCRIPT},{type:"small",style:At.TEXT},{type:"stack"}],NU=[{type:"small",style:At.SCRIPTSCRIPT},{type:"small",style:At.SCRIPT},{type:"small",style:At.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],ske=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},CU=function(e,n,r,s){for(var i=Math.min(2,3-s.style.size),a=i;an)return r[a]}return r[r.length-1]},TU=function(e,n,r,s,i,a){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var l;jU.includes(e)?l=nke:OU.includes(e)?l=NU:l=rke;var c=CU(e,n,l,s);return c.type==="small"?X3e(e,c.style,r,s,i,a):c.type==="large"?SU(e,c.size,r,s,i,a):kU(e,n,r,s,i,a)},ike=function(e,n,r,s,i,a){var l=s.fontMetrics().axisHeight*s.sizeMultiplier,c=901,d=5/s.fontMetrics().ptPerEm,h=Math.max(n-l,r+l),m=Math.max(h/500*c,2*h-d);return TU(e,m,!0,s,i,a)},ql={sqrtImage:J3e,sizedDelim:tke,sizeToMaxHeight:z0,customSizedDelim:TU,leftRightDelim:ike},_R={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},ake=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Xb(t,e){var n=Wb(t);if(n&&ake.includes(n.text))return n;throw n?new qe("Invalid delimiter '"+n.text+"' after '"+e.funcName+"'",t):new qe("Invalid delimiter type '"+t.type+"'",t)}tt({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(t,e)=>{var n=Xb(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:_R[t.funcName].size,mclass:_R[t.funcName].mclass,delim:n.text}},htmlBuilder:(t,e)=>t.delim==="."?we.makeSpan([t.mclass]):ql.sizedDelim(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(Ra(t.delim,t.mode));var n=new Fe.MathNode("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=Xe(ql.sizeToMaxHeight[t.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function AR(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}tt({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=t.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new qe("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:Xb(e[0],t).text,color:n}}});tt({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=Xb(e[0],t),r=t.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=nn(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:n.text,right:i.delim,rightColor:i.color}},htmlBuilder:(t,e)=>{AR(t);for(var n=ms(t.body,e,!0,["mopen","mclose"]),r=0,s=0,i=!1,a=0;a{AR(t);var n=Mi(t.body,e);if(t.left!=="."){var r=new Fe.MathNode("mo",[Ra(t.left,t.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(t.right!=="."){var s=new Fe.MathNode("mo",[Ra(t.right,t.mode)]);s.setAttribute("fence","true"),t.rightColor&&s.setAttribute("mathcolor",t.rightColor),n.push(s)}return PN(n)}});tt({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=Xb(e[0],t);if(!t.parser.leftrightDepth)throw new qe("\\middle without preceding \\left",n);return{type:"middle",mode:t.parser.mode,delim:n.text}},htmlBuilder:(t,e)=>{var n;if(t.delim===".")n=Sp(e,[]);else{n=ql.sizedDelim(t.delim,1,e,t.mode,[]);var r={delim:t.delim,options:e};n.isMiddle=r}return n},mathmlBuilder:(t,e)=>{var n=t.delim==="\\vert"||t.delim==="|"?Ra("|","text"):Ra(t.delim,t.mode),r=new Fe.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var FN=(t,e)=>{var n=we.wrapFragment(qn(t.body,e),e),r=t.label.slice(1),s=e.sizeMultiplier,i,a=0,l=Wn.isCharacterBox(t.body);if(r==="sout")i=we.makeSpan(["stretchy","sout"]),i.height=e.fontMetrics().defaultRuleThickness/s,a=-.5*e.fontMetrics().xHeight;else if(r==="phase"){var c=Ir({number:.6,unit:"pt"},e),d=Ir({number:.35,unit:"ex"},e),h=e.havingBaseSizing();s=s/h.sizeMultiplier;var m=n.height+n.depth+c+d;n.style.paddingLeft=Xe(m/2+c);var g=Math.floor(1e3*m*s),x=Z5e(g),y=new Ul([new su("phase",x)],{width:"400em",height:Xe(g/1e3),viewBox:"0 0 400000 "+g,preserveAspectRatio:"xMinYMin slice"});i=we.makeSvgSpan(["hide-tail"],[y],e),i.style.height=Xe(m),a=n.depth+c+d}else{/cancel/.test(r)?l||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var w=0,S=0,k=0;/box/.test(r)?(k=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),w=e.fontMetrics().fboxsep+(r==="colorbox"?0:k),S=w):r==="angl"?(k=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),w=4*k,S=Math.max(0,.25-n.depth)):(w=l?.2:0,S=w),i=Gl.encloseSpan(n,r,w,S,e),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=Xe(k)):r==="angl"&&k!==.049&&(i.style.borderTopWidth=Xe(k),i.style.borderRightWidth=Xe(k)),a=n.depth+S,t.backgroundColor&&(i.style.backgroundColor=t.backgroundColor,t.borderColor&&(i.style.borderColor=t.borderColor))}var j;if(t.backgroundColor)j=we.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:a},{type:"elem",elem:n,shift:0}]},e);else{var N=/cancel|phase/.test(r)?["svg-align"]:[];j=we.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:i,shift:a,wrapperClasses:N}]},e)}return/cancel/.test(r)&&(j.height=n.height,j.depth=n.depth),/cancel/.test(r)&&!l?we.makeSpan(["mord","cancel-lap"],[j],e):we.makeSpan(["mord"],[j],e)},qN=(t,e)=>{var n=0,r=new Fe.MathNode(t.label.indexOf("colorbox")>-1?"mpadded":"menclose",[hr(t.body,e)]);switch(t.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),t.label==="\\fcolorbox"){var s=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);r.setAttribute("style","border: "+s+"em solid "+String(t.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&r.setAttribute("mathbackground",t.backgroundColor),r};tt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(t,e,n){var{parser:r,funcName:s}=t,i=nn(e[0],"color-token").color,a=e[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:a}},htmlBuilder:FN,mathmlBuilder:qN});tt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(t,e,n){var{parser:r,funcName:s}=t,i=nn(e[0],"color-token").color,a=nn(e[1],"color-token").color,l=e[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,borderColor:i,body:l}},htmlBuilder:FN,mathmlBuilder:qN});tt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"enclose",mode:n.mode,label:"\\fbox",body:e[0]}}});tt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t,s=e[0];return{type:"enclose",mode:n.mode,label:r,body:s}},htmlBuilder:FN,mathmlBuilder:qN});tt({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:n}=t;return{type:"enclose",mode:n.mode,label:"\\angl",body:e[0]}}});var EU={};function Go(t){for(var{type:e,names:n,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=t,l={type:e,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},c=0;c{var e=t.parser.settings;if(!e.displayMode)throw new qe("{"+t.envName+"} can be used only in display mode.")};function $N(t){if(t.indexOf("ed")===-1)return t.indexOf("*")===-1}function mu(t,e,n){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:a,colSeparationType:l,autoTag:c,singleRow:d,emptySingleRow:h,maxNumCols:m,leqno:g}=e;if(t.gullet.beginGroup(),d||t.gullet.macros.set("\\cr","\\\\\\relax"),!a){var x=t.gullet.expandMacroAsText("\\arraystretch");if(x==null)a=1;else if(a=parseFloat(x),!a||a<0)throw new qe("Invalid \\arraystretch: "+x)}t.gullet.beginGroup();var y=[],w=[y],S=[],k=[],j=c!=null?[]:void 0;function N(){c&&t.gullet.macros.set("\\@eqnsw","1",!0)}function T(){j&&(t.gullet.macros.get("\\df@tag")?(j.push(t.subparse([new Zi("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):j.push(!!c&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(N(),k.push(MR(t));;){var E=t.parseExpression(!1,d?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup(),E={type:"ordgroup",mode:t.mode,body:E},n&&(E={type:"styling",mode:t.mode,style:n,body:[E]}),y.push(E);var _=t.fetch().text;if(_==="&"){if(m&&y.length===m){if(d||l)throw new qe("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(_==="\\end"){T(),y.length===1&&E.type==="styling"&&E.body[0].body.length===0&&(w.length>1||!h)&&w.pop(),k.length0&&(N+=.25),d.push({pos:N,isDashed:$e[jt]})}for(T(a[0]),r=0;r0&&(H+=j,A$e))for(r=0;r=l)){var G=void 0;(s>0||e.hskipBeforeAndAfter)&&(G=Wn.deflt(X.pregap,g),G!==0&&(V=we.makeSpan(["arraycolsep"],[]),V.style.width=Xe(G),I.push(V)));var se=[];for(r=0;r0){for(var Be=we.makeLineSpan("hline",n,h),Ye=we.makeLineSpan("hdashline",n,h),Je=[{type:"elem",elem:c,shift:0}];d.length>0;){var Oe=d.pop(),Ve=Oe.pos-W;Oe.isDashed?Je.push({type:"elem",elem:Ye,shift:Ve}):Je.push({type:"elem",elem:Be,shift:Ve})}c=we.makeVList({positionType:"individualShift",children:Je},n)}if($.length===0)return we.makeSpan(["mord"],[c],n);var Ue=we.makeVList({positionType:"individualShift",children:$},n);return Ue=we.makeSpan(["tag"],[Ue],n),we.makeFragment([c,Ue])},oke={c:"center ",l:"left ",r:"right "},Yo=function(e,n){for(var r=[],s=new Fe.MathNode("mtd",[],["mtr-glue"]),i=new Fe.MathNode("mtd",[],["mml-eqn-num"]),a=0;a0){var y=e.cols,w="",S=!1,k=0,j=y.length;y[0].type==="separator"&&(g+="top ",k=1),y[y.length-1].type==="separator"&&(g+="bottom ",j-=1);for(var N=k;N0?"left ":"",g+=D[D.length-1].length>0?"right ":"";for(var q=1;q-1?"alignat":"align",i=e.envName==="split",a=mu(e.parser,{cols:r,addJot:!0,autoTag:i?void 0:$N(e.envName),emptySingleRow:!0,colSeparationType:s,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},"display"),l,c=0,d={type:"ordgroup",mode:e.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var h="",m=0;m0&&x&&(S=1),r[y]={type:"align",align:w,pregap:S,postgap:0}}return a.colSeparationType=x?"align":"alignat",a};Go({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var n=Wb(e[0]),r=n?[e[0]]:nn(e[0],"ordgroup").body,s=r.map(function(a){var l=IN(a),c=l.text;if("lcr".indexOf(c)!==-1)return{type:"align",align:c};if(c==="|")return{type:"separator",separator:"|"};if(c===":")return{type:"separator",separator:":"};throw new qe("Unknown column alignment: "+c,a)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return mu(t.parser,i,HN(t.envName))},htmlBuilder:Xo,mathmlBuilder:Yo});Go({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(t.envName.charAt(t.envName.length-1)==="*"){var s=t.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),n=s.fetch().text,"lcr".indexOf(n)===-1)throw new qe("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:n}]}}var i=mu(t.parser,r,HN(t.envName)),a=Math.max(0,...i.body.map(l=>l.length));return i.cols=new Array(a).fill({type:"align",align:n}),e?{type:"leftright",mode:t.mode,body:[i],left:e[0],right:e[1],rightColor:void 0}:i},htmlBuilder:Xo,mathmlBuilder:Yo});Go({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},n=mu(t.parser,e,"script");return n.colSeparationType="small",n},htmlBuilder:Xo,mathmlBuilder:Yo});Go({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var n=Wb(e[0]),r=n?[e[0]]:nn(e[0],"ordgroup").body,s=r.map(function(a){var l=IN(a),c=l.text;if("lc".indexOf(c)!==-1)return{type:"align",align:c};throw new qe("Unknown column alignment: "+c,a)});if(s.length>1)throw new qe("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5};if(i=mu(t.parser,i,"script"),i.body.length>0&&i.body[0].length>1)throw new qe("{subarray} can contain only one column");return i},htmlBuilder:Xo,mathmlBuilder:Yo});Go({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=mu(t.parser,e,HN(t.envName));return{type:"leftright",mode:t.mode,body:[n],left:t.envName.indexOf("r")>-1?".":"\\{",right:t.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Xo,mathmlBuilder:Yo});Go({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:AU,htmlBuilder:Xo,mathmlBuilder:Yo});Go({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){["gather","gather*"].includes(t.envName)&&Yb(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:$N(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return mu(t.parser,e,"display")},htmlBuilder:Xo,mathmlBuilder:Yo});Go({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:AU,htmlBuilder:Xo,mathmlBuilder:Yo});Go({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){Yb(t);var e={autoTag:$N(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return mu(t.parser,e,"display")},htmlBuilder:Xo,mathmlBuilder:Yo});Go({type:"array",names:["CD"],props:{numArgs:0},handler(t){return Yb(t),W3e(t.parser)},htmlBuilder:Xo,mathmlBuilder:Yo});J("\\nonumber","\\gdef\\@eqnsw{0}");J("\\notag","\\nonumber");tt({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new qe(t.funcName+" valid only within array environment")}});var RR=EU;tt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:n,funcName:r}=t,s=e[0];if(s.type!=="ordgroup")throw new qe("Invalid environment name",s);for(var i="",a=0;a{var n=t.font,r=e.withFont(n);return qn(t.body,r)},RU=(t,e)=>{var n=t.font,r=e.withFont(n);return hr(t.body,r)},DR={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};tt({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=Ay(e[0]),i=r;return i in DR&&(i=DR[i]),{type:"font",mode:n.mode,font:i.slice(1),body:s}},htmlBuilder:MU,mathmlBuilder:RU});tt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:n}=t,r=e[0],s=Wn.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:Gb(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:s}}});tt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r,breakOnTokenText:s}=t,{mode:i}=n,a=n.parseExpression(!0,s),l="math"+r.slice(1);return{type:"font",mode:i,font:l,body:{type:"ordgroup",mode:n.mode,body:a}}},htmlBuilder:MU,mathmlBuilder:RU});var DU=(t,e)=>{var n=e;return t==="display"?n=n.id>=At.SCRIPT.id?n.text():At.DISPLAY:t==="text"&&n.size===At.DISPLAY.size?n=At.TEXT:t==="script"?n=At.SCRIPT:t==="scriptscript"&&(n=At.SCRIPTSCRIPT),n},QN=(t,e)=>{var n=DU(t.size,e.style),r=n.fracNum(),s=n.fracDen(),i;i=e.havingStyle(r);var a=qn(t.numer,i,e);if(t.continued){var l=8.5/e.fontMetrics().ptPerEm,c=3.5/e.fontMetrics().ptPerEm;a.height=a.height0?y=3*g:y=7*g,w=e.fontMetrics().denom1):(m>0?(x=e.fontMetrics().num2,y=g):(x=e.fontMetrics().num3,y=3*g),w=e.fontMetrics().denom2);var S;if(h){var j=e.fontMetrics().axisHeight;x-a.depth-(j+.5*m){var n=new Fe.MathNode("mfrac",[hr(t.numer,e),hr(t.denom,e)]);if(!t.hasBarLine)n.setAttribute("linethickness","0px");else if(t.barSize){var r=Ir(t.barSize,e);n.setAttribute("linethickness",Xe(r))}var s=DU(t.size,e.style);if(s.size!==e.style.size){n=new Fe.MathNode("mstyle",[n]);var i=s.size===At.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",i),n.setAttribute("scriptlevel","0")}if(t.leftDelim!=null||t.rightDelim!=null){var a=[];if(t.leftDelim!=null){var l=new Fe.MathNode("mo",[new Fe.TextNode(t.leftDelim.replace("\\",""))]);l.setAttribute("fence","true"),a.push(l)}if(a.push(n),t.rightDelim!=null){var c=new Fe.MathNode("mo",[new Fe.TextNode(t.rightDelim.replace("\\",""))]);c.setAttribute("fence","true"),a.push(c)}return PN(a)}return n};tt({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0],i=e[1],a,l=null,c=null,d="auto";switch(r){case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,l="(",c=")";break;case"\\\\bracefrac":a=!1,l="\\{",c="\\}";break;case"\\\\brackfrac":a=!1,l="[",c="]";break;default:throw new Error("Unrecognized genfrac command")}switch(r){case"\\dfrac":case"\\dbinom":d="display";break;case"\\tfrac":case"\\tbinom":d="text";break}return{type:"genfrac",mode:n.mode,continued:!1,numer:s,denom:i,hasBarLine:a,leftDelim:l,rightDelim:c,size:d,barSize:null}},htmlBuilder:QN,mathmlBuilder:VN});tt({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0],i=e[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:s,denom:i,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});tt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:n,token:r}=t,s;switch(n){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:s,token:r}}});var PR=["display","text","script","scriptscript"],zR=function(e){var n=null;return e.length>0&&(n=e,n=n==="."?null:n),n};tt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:n}=t,r=e[4],s=e[5],i=Ay(e[0]),a=i.type==="atom"&&i.family==="open"?zR(i.text):null,l=Ay(e[1]),c=l.type==="atom"&&l.family==="close"?zR(l.text):null,d=nn(e[2],"size"),h,m=null;d.isBlank?h=!0:(m=d.value,h=m.number>0);var g="auto",x=e[3];if(x.type==="ordgroup"){if(x.body.length>0){var y=nn(x.body[0],"textord");g=PR[Number(y.text)]}}else x=nn(x,"textord"),g=PR[Number(x.text)];return{type:"genfrac",mode:n.mode,numer:r,denom:s,continued:!1,hasBarLine:h,barSize:m,leftDelim:a,rightDelim:c,size:g}},htmlBuilder:QN,mathmlBuilder:VN});tt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:n,funcName:r,token:s}=t;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:nn(e[0],"size").value,token:s}}});tt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0],i=I5e(nn(e[1],"infix").size),a=e[2],l=i.number>0;return{type:"genfrac",mode:n.mode,numer:s,denom:a,continued:!1,hasBarLine:l,barSize:i,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:QN,mathmlBuilder:VN});var PU=(t,e)=>{var n=e.style,r,s;t.type==="supsub"?(r=t.sup?qn(t.sup,e.havingStyle(n.sup()),e):qn(t.sub,e.havingStyle(n.sub()),e),s=nn(t.base,"horizBrace")):s=nn(t,"horizBrace");var i=qn(s.base,e.havingBaseStyle(At.DISPLAY)),a=Gl.svgSpan(s,e),l;if(s.isOver?(l=we.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:a}]},e),l.children[0].children[0].children[1].classes.push("svg-align")):(l=we.makeVList({positionType:"bottom",positionData:i.depth+.1+a.height,children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:i}]},e),l.children[0].children[0].children[0].classes.push("svg-align")),r){var c=we.makeSpan(["mord",s.isOver?"mover":"munder"],[l],e);s.isOver?l=we.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:c},{type:"kern",size:.2},{type:"elem",elem:r}]},e):l=we.makeVList({positionType:"bottom",positionData:c.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:c}]},e)}return we.makeSpan(["mord",s.isOver?"mover":"munder"],[l],e)},lke=(t,e)=>{var n=Gl.mathMLnode(t.label);return new Fe.MathNode(t.isOver?"mover":"munder",[hr(t.base,e),n])};tt({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:e[0]}},htmlBuilder:PU,mathmlBuilder:lke});tt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[1],s=nn(e[0],"url").url;return n.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:n.mode,href:s,body:Gr(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var n=ms(t.body,e,!1);return we.makeAnchor(t.href,[],n,e)},mathmlBuilder:(t,e)=>{var n=iu(t.body,e);return n instanceof Ui||(n=new Ui("mrow",[n])),n.setAttribute("href",t.href),n}});tt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=nn(e[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var s=[],i=0;i{var{parser:n,funcName:r,token:s}=t,i=nn(e[0],"raw").string,a=e[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l,c={};switch(r){case"\\htmlClass":c.class=i,l={command:"\\htmlClass",class:i};break;case"\\htmlId":c.id=i,l={command:"\\htmlId",id:i};break;case"\\htmlStyle":c.style=i,l={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var d=i.split(","),h=0;h{var n=ms(t.body,e,!1),r=["enclosing"];t.attributes.class&&r.push(...t.attributes.class.trim().split(/\s+/));var s=we.makeSpan(r,n,e);for(var i in t.attributes)i!=="class"&&t.attributes.hasOwnProperty(i)&&s.setAttribute(i,t.attributes[i]);return s},mathmlBuilder:(t,e)=>iu(t.body,e)});tt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t;return{type:"htmlmathml",mode:n.mode,html:Gr(e[0]),mathml:Gr(e[1])}},htmlBuilder:(t,e)=>{var n=ms(t.html,e,!1);return we.makeFragment(n)},mathmlBuilder:(t,e)=>iu(t.mathml,e)});var a5=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!n)throw new qe("Invalid size: '"+e+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!eU(r))throw new qe("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};tt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,n)=>{var{parser:r}=t,s={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},l="";if(n[0])for(var c=nn(n[0],"raw").string,d=c.split(","),h=0;h{var n=Ir(t.height,e),r=0;t.totalheight.number>0&&(r=Ir(t.totalheight,e)-n);var s=0;t.width.number>0&&(s=Ir(t.width,e));var i={height:Xe(n+r)};s>0&&(i.width=Xe(s)),r>0&&(i.verticalAlign=Xe(-r));var a=new l3e(t.src,t.alt,i);return a.height=n,a.depth=r,a},mathmlBuilder:(t,e)=>{var n=new Fe.MathNode("mglyph",[]);n.setAttribute("alt",t.alt);var r=Ir(t.height,e),s=0;if(t.totalheight.number>0&&(s=Ir(t.totalheight,e)-r,n.setAttribute("valign",Xe(-s))),n.setAttribute("height",Xe(r+s)),t.width.number>0){var i=Ir(t.width,e);n.setAttribute("width",Xe(i))}return n.setAttribute("src",t.src),n}});tt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t,s=nn(e[0],"size");if(n.settings.strict){var i=r[1]==="m",a=s.value.unit==="mu";i?(a||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:s.value}},htmlBuilder(t,e){return we.makeGlue(t.dimension,e)},mathmlBuilder(t,e){var n=Ir(t.dimension,e);return new Fe.SpaceNode(n)}});tt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:s}},htmlBuilder:(t,e)=>{var n;t.alignment==="clap"?(n=we.makeSpan([],[qn(t.body,e)]),n=we.makeSpan(["inner"],[n],e)):n=we.makeSpan(["inner"],[qn(t.body,e)]);var r=we.makeSpan(["fix"],[]),s=we.makeSpan([t.alignment],[n,r],e),i=we.makeSpan(["strut"]);return i.style.height=Xe(s.height+s.depth),s.depth&&(i.style.verticalAlign=Xe(-s.depth)),s.children.unshift(i),s=we.makeSpan(["thinbox"],[s],e),we.makeSpan(["mord","vbox"],[s],e)},mathmlBuilder:(t,e)=>{var n=new Fe.MathNode("mpadded",[hr(t.body,e)]);if(t.alignment!=="rlap"){var r=t.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});tt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:n,parser:r}=t,s=r.mode;r.switchMode("math");var i=n==="\\("?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",body:a}}});tt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new qe("Mismatched "+t.funcName)}});var IR=(t,e)=>{switch(e.style.size){case At.DISPLAY.size:return t.display;case At.TEXT.size:return t.text;case At.SCRIPT.size:return t.script;case At.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};tt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:n}=t;return{type:"mathchoice",mode:n.mode,display:Gr(e[0]),text:Gr(e[1]),script:Gr(e[2]),scriptscript:Gr(e[3])}},htmlBuilder:(t,e)=>{var n=IR(t,e),r=ms(n,e,!1);return we.makeFragment(r)},mathmlBuilder:(t,e)=>{var n=IR(t,e);return iu(n,e)}});var zU=(t,e,n,r,s,i,a)=>{t=we.makeSpan([],[t]);var l=n&&Wn.isCharacterBox(n),c,d;if(e){var h=qn(e,r.havingStyle(s.sup()),r);d={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-h.depth)}}if(n){var m=qn(n,r.havingStyle(s.sub()),r);c={elem:m,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-m.height)}}var g;if(d&&c){var x=r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+t.depth+a;g=we.makeVList({positionType:"bottom",positionData:x,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:Xe(-i)},{type:"kern",size:c.kern},{type:"elem",elem:t},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:Xe(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(c){var y=t.height-a;g=we.makeVList({positionType:"top",positionData:y,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:Xe(-i)},{type:"kern",size:c.kern},{type:"elem",elem:t}]},r)}else if(d){var w=t.depth+a;g=we.makeVList({positionType:"bottom",positionData:w,children:[{type:"elem",elem:t},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:Xe(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else return t;var S=[g];if(c&&i!==0&&!l){var k=we.makeSpan(["mspace"],[],r);k.style.marginRight=Xe(i),S.unshift(k)}return we.makeSpan(["mop","op-limits"],S,r)},IU=["\\smallint"],Hf=(t,e)=>{var n,r,s=!1,i;t.type==="supsub"?(n=t.sup,r=t.sub,i=nn(t.base,"op"),s=!0):i=nn(t,"op");var a=e.style,l=!1;a.size===At.DISPLAY.size&&i.symbol&&!IU.includes(i.name)&&(l=!0);var c;if(i.symbol){var d=l?"Size2-Regular":"Size1-Regular",h="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(h=i.name.slice(1),i.name=h==="oiint"?"\\iint":"\\iiint"),c=we.makeSymbol(i.name,d,"math",e,["mop","op-symbol",l?"large-op":"small-op"]),h.length>0){var m=c.italic,g=we.staticSvg(h+"Size"+(l?"2":"1"),e);c=we.makeVList({positionType:"individualShift",children:[{type:"elem",elem:c,shift:0},{type:"elem",elem:g,shift:l?.08:0}]},e),i.name="\\"+h,c.classes.unshift("mop"),c.italic=m}}else if(i.body){var x=ms(i.body,e,!0);x.length===1&&x[0]instanceof Ma?(c=x[0],c.classes[0]="mop"):c=we.makeSpan(["mop"],x,e)}else{for(var y=[],w=1;w{var n;if(t.symbol)n=new Ui("mo",[Ra(t.name,t.mode)]),IU.includes(t.name)&&n.setAttribute("largeop","false");else if(t.body)n=new Ui("mo",Mi(t.body,e));else{n=new Ui("mi",[new Ro(t.name.slice(1))]);var r=new Ui("mo",[Ra("⁡","text")]);t.parentIsSupSub?n=new Ui("mrow",[n,r]):n=dU([n,r])}return n},cke={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};tt({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=r;return s.length===1&&(s=cke[s]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:Hf,mathmlBuilder:wg});tt({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Gr(r)}},htmlBuilder:Hf,mathmlBuilder:wg});var uke={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};tt({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:n}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Hf,mathmlBuilder:wg});tt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:n}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Hf,mathmlBuilder:wg});tt({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(t){var{parser:e,funcName:n}=t,r=n;return r.length===1&&(r=uke[r]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Hf,mathmlBuilder:wg});var LU=(t,e)=>{var n,r,s=!1,i;t.type==="supsub"?(n=t.sup,r=t.sub,i=nn(t.base,"operatorname"),s=!0):i=nn(t,"operatorname");var a;if(i.body.length>0){for(var l=i.body.map(m=>{var g=m.text;return typeof g=="string"?{type:"textord",mode:m.mode,text:g}:m}),c=ms(l,e.withFont("mathrm"),!0),d=0;d{for(var n=Mi(t.body,e.withFont("mathrm")),r=!0,s=0;sh.toText()).join("");n=[new Fe.TextNode(l)]}var c=new Fe.MathNode("mi",n);c.setAttribute("mathvariant","normal");var d=new Fe.MathNode("mo",[Ra("⁡","text")]);return t.parentIsSupSub?new Fe.MathNode("mrow",[c,d]):Fe.newDocumentFragment([c,d])};tt({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0];return{type:"operatorname",mode:n.mode,body:Gr(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:LU,mathmlBuilder:dke});J("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Od({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?we.makeFragment(ms(t.body,e,!1)):we.makeSpan(["mord"],ms(t.body,e,!0),e)},mathmlBuilder(t,e){return iu(t.body,e,!0)}});tt({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:n}=t,r=e[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(t,e){var n=qn(t.body,e.havingCrampedStyle()),r=we.makeLineSpan("overline-line",e),s=e.fontMetrics().defaultRuleThickness,i=we.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]},e);return we.makeSpan(["mord","overline"],[i],e)},mathmlBuilder(t,e){var n=new Fe.MathNode("mo",[new Fe.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Fe.MathNode("mover",[hr(t.body,e),n]);return r.setAttribute("accent","true"),r}});tt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"phantom",mode:n.mode,body:Gr(r)}},htmlBuilder:(t,e)=>{var n=ms(t.body,e.withPhantom(),!1);return we.makeFragment(n)},mathmlBuilder:(t,e)=>{var n=Mi(t.body,e);return new Fe.MathNode("mphantom",n)}});tt({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(t,e)=>{var n=we.makeSpan([],[qn(t.body,e.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r{var n=Mi(Gr(t.body),e),r=new Fe.MathNode("mphantom",n),s=new Fe.MathNode("mpadded",[r]);return s.setAttribute("height","0px"),s.setAttribute("depth","0px"),s}});tt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(t,e)=>{var n=we.makeSpan(["inner"],[qn(t.body,e.withPhantom())]),r=we.makeSpan(["fix"],[]);return we.makeSpan(["mord","rlap"],[n,r],e)},mathmlBuilder:(t,e)=>{var n=Mi(Gr(t.body),e),r=new Fe.MathNode("mphantom",n),s=new Fe.MathNode("mpadded",[r]);return s.setAttribute("width","0px"),s}});tt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t,r=nn(e[0],"size").value,s=e[1];return{type:"raisebox",mode:n.mode,dy:r,body:s}},htmlBuilder(t,e){var n=qn(t.body,e),r=Ir(t.dy,e);return we.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},e)},mathmlBuilder(t,e){var n=new Fe.MathNode("mpadded",[hr(t.body,e)]),r=t.dy.number+t.dy.unit;return n.setAttribute("voffset",r),n}});tt({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});tt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,n){var{parser:r}=t,s=n[0],i=nn(e[0],"size"),a=nn(e[1],"size");return{type:"rule",mode:r.mode,shift:s&&nn(s,"size").value,width:i.value,height:a.value}},htmlBuilder(t,e){var n=we.makeSpan(["mord","rule"],[],e),r=Ir(t.width,e),s=Ir(t.height,e),i=t.shift?Ir(t.shift,e):0;return n.style.borderRightWidth=Xe(r),n.style.borderTopWidth=Xe(s),n.style.bottom=Xe(i),n.width=r,n.height=s+i,n.depth=-i,n.maxFontSize=s*1.125*e.sizeMultiplier,n},mathmlBuilder(t,e){var n=Ir(t.width,e),r=Ir(t.height,e),s=t.shift?Ir(t.shift,e):0,i=e.color&&e.getColor()||"black",a=new Fe.MathNode("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",Xe(n)),a.setAttribute("height",Xe(r));var l=new Fe.MathNode("mpadded",[a]);return s>=0?l.setAttribute("height",Xe(s)):(l.setAttribute("height",Xe(s)),l.setAttribute("depth",Xe(-s))),l.setAttribute("voffset",Xe(s)),l}});function BU(t,e,n){for(var r=ms(t,e,!1),s=e.sizeMultiplier/n.sizeMultiplier,i=0;i{var n=e.havingSize(t.size);return BU(t.body,n,e)};tt({type:"sizing",names:LR,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:n,funcName:r,parser:s}=t,i=s.parseExpression(!1,n);return{type:"sizing",mode:s.mode,size:LR.indexOf(r)+1,body:i}},htmlBuilder:hke,mathmlBuilder:(t,e)=>{var n=e.havingSize(t.size),r=Mi(t.body,n),s=new Fe.MathNode("mstyle",r);return s.setAttribute("mathsize",Xe(n.sizeMultiplier)),s}});tt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,n)=>{var{parser:r}=t,s=!1,i=!1,a=n[0]&&nn(n[0],"ordgroup");if(a)for(var l="",c=0;c{var n=we.makeSpan([],[qn(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return n;if(t.smashHeight&&(n.height=0,n.children))for(var r=0;r{var n=new Fe.MathNode("mpadded",[hr(t.body,e)]);return t.smashHeight&&n.setAttribute("height","0px"),t.smashDepth&&n.setAttribute("depth","0px"),n}});tt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,n){var{parser:r}=t,s=n[0],i=e[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(t,e){var n=qn(t.body,e.havingCrampedStyle());n.height===0&&(n.height=e.fontMetrics().xHeight),n=we.wrapFragment(n,e);var r=e.fontMetrics(),s=r.defaultRuleThickness,i=s;e.style.idn.height+n.depth+a&&(a=(a+m-n.height-n.depth)/2);var g=c.height-n.height-a-d;n.style.paddingLeft=Xe(h);var x=we.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+g)},{type:"elem",elem:c},{type:"kern",size:d}]},e);if(t.index){var y=e.havingStyle(At.SCRIPTSCRIPT),w=qn(t.index,y,e),S=.6*(x.height-x.depth),k=we.makeVList({positionType:"shift",positionData:-S,children:[{type:"elem",elem:w}]},e),j=we.makeSpan(["root"],[k]);return we.makeSpan(["mord","sqrt"],[j,x],e)}else return we.makeSpan(["mord","sqrt"],[x],e)},mathmlBuilder(t,e){var{body:n,index:r}=t;return r?new Fe.MathNode("mroot",[hr(n,e),hr(r,e)]):new Fe.MathNode("msqrt",[hr(n,e)])}});var BR={display:At.DISPLAY,text:At.TEXT,script:At.SCRIPT,scriptscript:At.SCRIPTSCRIPT};tt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:n,funcName:r,parser:s}=t,i=s.parseExpression(!0,n),a=r.slice(1,r.length-5);return{type:"styling",mode:s.mode,style:a,body:i}},htmlBuilder(t,e){var n=BR[t.style],r=e.havingStyle(n).withFont("");return BU(t.body,r,e)},mathmlBuilder(t,e){var n=BR[t.style],r=e.havingStyle(n),s=Mi(t.body,r),i=new Fe.MathNode("mstyle",s),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},l=a[t.style];return i.setAttribute("scriptlevel",l[0]),i.setAttribute("displaystyle",l[1]),i}});var fke=function(e,n){var r=e.base;if(r)if(r.type==="op"){var s=r.limits&&(n.style.size===At.DISPLAY.size||r.alwaysHandleSupSub);return s?Hf:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(n.style.size===At.DISPLAY.size||r.limits);return i?LU:null}else{if(r.type==="accent")return Wn.isCharacterBox(r.base)?LN:null;if(r.type==="horizBrace"){var a=!e.sub;return a===r.isOver?PU:null}else return null}else return null};Od({type:"supsub",htmlBuilder(t,e){var n=fke(t,e);if(n)return n(t,e);var{base:r,sup:s,sub:i}=t,a=qn(r,e),l,c,d=e.fontMetrics(),h=0,m=0,g=r&&Wn.isCharacterBox(r);if(s){var x=e.havingStyle(e.style.sup());l=qn(s,x,e),g||(h=a.height-x.fontMetrics().supDrop*x.sizeMultiplier/e.sizeMultiplier)}if(i){var y=e.havingStyle(e.style.sub());c=qn(i,y,e),g||(m=a.depth+y.fontMetrics().subDrop*y.sizeMultiplier/e.sizeMultiplier)}var w;e.style===At.DISPLAY?w=d.sup1:e.style.cramped?w=d.sup3:w=d.sup2;var S=e.sizeMultiplier,k=Xe(.5/d.ptPerEm/S),j=null;if(c){var N=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");(a instanceof Ma||N)&&(j=Xe(-a.italic))}var T;if(l&&c){h=Math.max(h,w,l.depth+.25*d.xHeight),m=Math.max(m,d.sub2);var E=d.defaultRuleThickness,_=4*E;if(h-l.depth-(c.height-m)<_){m=_-(h-l.depth)+c.height;var A=.8*d.xHeight-(h-l.depth);A>0&&(h+=A,m-=A)}var D=[{type:"elem",elem:c,shift:m,marginRight:k,marginLeft:j},{type:"elem",elem:l,shift:-h,marginRight:k}];T=we.makeVList({positionType:"individualShift",children:D},e)}else if(c){m=Math.max(m,d.sub1,c.height-.8*d.xHeight);var q=[{type:"elem",elem:c,marginLeft:j,marginRight:k}];T=we.makeVList({positionType:"shift",positionData:m,children:q},e)}else if(l)h=Math.max(h,w,l.depth+.25*d.xHeight),T=we.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:l,marginRight:k}]},e);else throw new Error("supsub must have either sup or sub.");var B=VO(a,"right")||"mord";return we.makeSpan([B],[a,we.makeSpan(["msupsub"],[T])],e)},mathmlBuilder(t,e){var n=!1,r,s;t.base&&t.base.type==="horizBrace"&&(s=!!t.sup,s===t.base.isOver&&(n=!0,r=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var i=[hr(t.base,e)];t.sub&&i.push(hr(t.sub,e)),t.sup&&i.push(hr(t.sup,e));var a;if(n)a=r?"mover":"munder";else if(t.sub)if(t.sup){var d=t.base;d&&d.type==="op"&&d.limits&&e.style===At.DISPLAY||d&&d.type==="operatorname"&&d.alwaysHandleSupSub&&(e.style===At.DISPLAY||d.limits)?a="munderover":a="msubsup"}else{var c=t.base;c&&c.type==="op"&&c.limits&&(e.style===At.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||e.style===At.DISPLAY)?a="munder":a="msub"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===At.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===At.DISPLAY)?a="mover":a="msup"}return new Fe.MathNode(a,i)}});Od({type:"atom",htmlBuilder(t,e){return we.mathsym(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var n=new Fe.MathNode("mo",[Ra(t.text,t.mode)]);if(t.family==="bin"){var r=zN(t,e);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else t.family==="punct"?n.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&n.setAttribute("stretchy","false");return n}});var FU={mi:"italic",mn:"normal",mtext:"normal"};Od({type:"mathord",htmlBuilder(t,e){return we.makeOrd(t,e,"mathord")},mathmlBuilder(t,e){var n=new Fe.MathNode("mi",[Ra(t.text,t.mode,e)]),r=zN(t,e)||"italic";return r!==FU[n.type]&&n.setAttribute("mathvariant",r),n}});Od({type:"textord",htmlBuilder(t,e){return we.makeOrd(t,e,"textord")},mathmlBuilder(t,e){var n=Ra(t.text,t.mode,e),r=zN(t,e)||"normal",s;return t.mode==="text"?s=new Fe.MathNode("mtext",[n]):/[0-9]/.test(t.text)?s=new Fe.MathNode("mn",[n]):t.text==="\\prime"?s=new Fe.MathNode("mo",[n]):s=new Fe.MathNode("mi",[n]),r!==FU[s.type]&&s.setAttribute("mathvariant",r),s}});var o5={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},l5={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Od({type:"spacing",htmlBuilder(t,e){if(l5.hasOwnProperty(t.text)){var n=l5[t.text].className||"";if(t.mode==="text"){var r=we.makeOrd(t,e,"textord");return r.classes.push(n),r}else return we.makeSpan(["mspace",n],[we.mathsym(t.text,t.mode,e)],e)}else{if(o5.hasOwnProperty(t.text))return we.makeSpan(["mspace",o5[t.text]],[],e);throw new qe('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var n;if(l5.hasOwnProperty(t.text))n=new Fe.MathNode("mtext",[new Fe.TextNode(" ")]);else{if(o5.hasOwnProperty(t.text))return new Fe.MathNode("mspace");throw new qe('Unknown type of space "'+t.text+'"')}return n}});var FR=()=>{var t=new Fe.MathNode("mtd",[]);return t.setAttribute("width","50%"),t};Od({type:"tag",mathmlBuilder(t,e){var n=new Fe.MathNode("mtable",[new Fe.MathNode("mtr",[FR(),new Fe.MathNode("mtd",[iu(t.body,e)]),FR(),new Fe.MathNode("mtd",[iu(t.tag,e)])])]);return n.setAttribute("width","100%"),n}});var qR={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},$R={"\\textbf":"textbf","\\textmd":"textmd"},mke={"\\textit":"textit","\\textup":"textup"},HR=(t,e)=>{var n=t.font;if(n){if(qR[n])return e.withTextFontFamily(qR[n]);if($R[n])return e.withTextFontWeight($R[n]);if(n==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(mke[n])};tt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t,s=e[0];return{type:"text",mode:n.mode,body:Gr(s),font:r}},htmlBuilder(t,e){var n=HR(t,e),r=ms(t.body,n,!0);return we.makeSpan(["mord","text"],r,n)},mathmlBuilder(t,e){var n=HR(t,e);return iu(t.body,n)}});tt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"underline",mode:n.mode,body:e[0]}},htmlBuilder(t,e){var n=qn(t.body,e),r=we.makeLineSpan("underline-line",e),s=e.fontMetrics().defaultRuleThickness,i=we.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:n}]},e);return we.makeSpan(["mord","underline"],[i],e)},mathmlBuilder(t,e){var n=new Fe.MathNode("mo",[new Fe.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Fe.MathNode("munder",[hr(t.body,e),n]);return r.setAttribute("accentunder","true"),r}});tt({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:n}=t;return{type:"vcenter",mode:n.mode,body:e[0]}},htmlBuilder(t,e){var n=qn(t.body,e),r=e.fontMetrics().axisHeight,s=.5*(n.height-r-(n.depth+r));return we.makeVList({positionType:"shift",positionData:s,children:[{type:"elem",elem:n}]},e)},mathmlBuilder(t,e){return new Fe.MathNode("mpadded",[hr(t.body,e)],["vcenter"])}});tt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,n){throw new qe("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var n=QR(t),r=[],s=e.havingStyle(e.style.text()),i=0;it.body.replace(/ /g,t.star?"␣":" "),Qc=cU,qU=`[ \r - ]`,pke="\\\\[a-zA-Z@]+",gke="\\\\[^\uD800-\uDFFF]",xke="("+pke+")"+qU+"*",vke=`\\\\( -|[ \r ]+ -?)[ \r ]*`,XO="[̀-ͯ]",yke=new RegExp(XO+"+$"),bke="("+qU+"+)|"+(vke+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(XO+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(XO+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+xke)+("|"+gke+")");class VR{constructor(e,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=n,this.tokenRegex=new RegExp(bke,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,n){this.catcodes[e]=n}lex(){var e=this.input,n=this.tokenRegex.lastIndex;if(n===e.length)return new Zi("EOF",new xi(this,n,n));var r=this.tokenRegex.exec(e);if(r===null||r.index!==n)throw new qe("Unexpected character: '"+e[n]+"'",new Zi(e[n],new xi(this,n,n+1)));var s=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[s]===14){var i=e.indexOf(` -`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new Zi(s,new xi(this,n,this.tokenRegex.lastIndex))}}class wke{constructor(e,n){e===void 0&&(e={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new qe("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var n in e)e.hasOwnProperty(n)&&(e[n]==null?delete this.current[n]:this.current[n]=e[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,n,r){if(r===void 0&&(r=!1),r){for(var s=0;s0&&(this.undefStack[this.undefStack.length-1][e]=n)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}n==null?delete this.current[e]:this.current[e]=n}}var Ske=_U;J("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});J("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});J("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});J("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});J("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var n=t.future();return e[0].length===1&&e[0][0].text===n.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});J("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");J("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var UR={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};J("\\char",function(t){var e=t.popToken(),n,r="";if(e.text==="'")n=8,e=t.popToken();else if(e.text==='"')n=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")r=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new qe("\\char` missing argument");r=e.text.charCodeAt(0)}else n=10;if(n){if(r=UR[e.text],r==null||r>=n)throw new qe("Invalid base-"+n+" digit "+e.text);for(var s;(s=UR[t.future().text])!=null&&s{var s=t.consumeArg().tokens;if(s.length!==1)throw new qe("\\newcommand's first argument must be a macro name");var i=s[0].text,a=t.isDefined(i);if(a&&!e)throw new qe("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!n)throw new qe("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var l=0;if(s=t.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var c="",d=t.expandNextToken();d.text!=="]"&&d.text!=="EOF";)c+=d.text,d=t.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new qe("Invalid number of arguments: "+c);l=parseInt(c),s=t.consumeArg().tokens}return a&&r||t.macros.set(i,{tokens:s,numArgs:l}),""};J("\\newcommand",t=>UN(t,!1,!0,!1));J("\\renewcommand",t=>UN(t,!0,!1,!1));J("\\providecommand",t=>UN(t,!0,!0,!0));J("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(n=>n.text).join("")),""});J("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(n=>n.text).join("")),""});J("\\show",t=>{var e=t.popToken(),n=e.text;return console.log(e,t.macros.get(n),Qc[n],pr.math[n],pr.text[n]),""});J("\\bgroup","{");J("\\egroup","}");J("~","\\nobreakspace");J("\\lq","`");J("\\rq","'");J("\\aa","\\r a");J("\\AA","\\r A");J("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");J("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");J("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");J("ℬ","\\mathscr{B}");J("ℰ","\\mathscr{E}");J("ℱ","\\mathscr{F}");J("ℋ","\\mathscr{H}");J("ℐ","\\mathscr{I}");J("ℒ","\\mathscr{L}");J("ℳ","\\mathscr{M}");J("ℛ","\\mathscr{R}");J("ℭ","\\mathfrak{C}");J("ℌ","\\mathfrak{H}");J("ℨ","\\mathfrak{Z}");J("\\Bbbk","\\Bbb{k}");J("·","\\cdotp");J("\\llap","\\mathllap{\\textrm{#1}}");J("\\rlap","\\mathrlap{\\textrm{#1}}");J("\\clap","\\mathclap{\\textrm{#1}}");J("\\mathstrut","\\vphantom{(}");J("\\underbar","\\underline{\\text{#1}}");J("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');J("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");J("\\ne","\\neq");J("≠","\\neq");J("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");J("∉","\\notin");J("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");J("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");J("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");J("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");J("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");J("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");J("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");J("⟂","\\perp");J("‼","\\mathclose{!\\mkern-0.8mu!}");J("∌","\\notni");J("⌜","\\ulcorner");J("⌝","\\urcorner");J("⌞","\\llcorner");J("⌟","\\lrcorner");J("©","\\copyright");J("®","\\textregistered");J("️","\\textregistered");J("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');J("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');J("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');J("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');J("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");J("⋮","\\vdots");J("\\varGamma","\\mathit{\\Gamma}");J("\\varDelta","\\mathit{\\Delta}");J("\\varTheta","\\mathit{\\Theta}");J("\\varLambda","\\mathit{\\Lambda}");J("\\varXi","\\mathit{\\Xi}");J("\\varPi","\\mathit{\\Pi}");J("\\varSigma","\\mathit{\\Sigma}");J("\\varUpsilon","\\mathit{\\Upsilon}");J("\\varPhi","\\mathit{\\Phi}");J("\\varPsi","\\mathit{\\Psi}");J("\\varOmega","\\mathit{\\Omega}");J("\\substack","\\begin{subarray}{c}#1\\end{subarray}");J("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");J("\\boxed","\\fbox{$\\displaystyle{#1}$}");J("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");J("\\implies","\\DOTSB\\;\\Longrightarrow\\;");J("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");J("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");J("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var WR={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};J("\\dots",function(t){var e="\\dotso",n=t.expandAfterFuture().text;return n in WR?e=WR[n]:(n.slice(0,4)==="\\not"||n in pr.math&&["bin","rel"].includes(pr.math[n].group))&&(e="\\dotsb"),e});var WN={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};J("\\dotso",function(t){var e=t.future().text;return e in WN?"\\ldots\\,":"\\ldots"});J("\\dotsc",function(t){var e=t.future().text;return e in WN&&e!==","?"\\ldots\\,":"\\ldots"});J("\\cdots",function(t){var e=t.future().text;return e in WN?"\\@cdots\\,":"\\@cdots"});J("\\dotsb","\\cdots");J("\\dotsm","\\cdots");J("\\dotsi","\\!\\cdots");J("\\dotsx","\\ldots\\,");J("\\DOTSI","\\relax");J("\\DOTSB","\\relax");J("\\DOTSX","\\relax");J("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");J("\\,","\\tmspace+{3mu}{.1667em}");J("\\thinspace","\\,");J("\\>","\\mskip{4mu}");J("\\:","\\tmspace+{4mu}{.2222em}");J("\\medspace","\\:");J("\\;","\\tmspace+{5mu}{.2777em}");J("\\thickspace","\\;");J("\\!","\\tmspace-{3mu}{.1667em}");J("\\negthinspace","\\!");J("\\negmedspace","\\tmspace-{4mu}{.2222em}");J("\\negthickspace","\\tmspace-{5mu}{.277em}");J("\\enspace","\\kern.5em ");J("\\enskip","\\hskip.5em\\relax");J("\\quad","\\hskip1em\\relax");J("\\qquad","\\hskip2em\\relax");J("\\tag","\\@ifstar\\tag@literal\\tag@paren");J("\\tag@paren","\\tag@literal{({#1})}");J("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new qe("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});J("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");J("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");J("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");J("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");J("\\newline","\\\\\\relax");J("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var $U=Xe(Mo["Main-Regular"][84][1]-.7*Mo["Main-Regular"][65][1]);J("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+$U+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");J("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+$U+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");J("\\hspace","\\@ifstar\\@hspacer\\@hspace");J("\\@hspace","\\hskip #1\\relax");J("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");J("\\ordinarycolon",":");J("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");J("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');J("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');J("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');J("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');J("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');J("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');J("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');J("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');J("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');J("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');J("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');J("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');J("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');J("∷","\\dblcolon");J("∹","\\eqcolon");J("≔","\\coloneqq");J("≕","\\eqqcolon");J("⩴","\\Coloneqq");J("\\ratio","\\vcentcolon");J("\\coloncolon","\\dblcolon");J("\\colonequals","\\coloneqq");J("\\coloncolonequals","\\Coloneqq");J("\\equalscolon","\\eqqcolon");J("\\equalscoloncolon","\\Eqqcolon");J("\\colonminus","\\coloneq");J("\\coloncolonminus","\\Coloneq");J("\\minuscolon","\\eqcolon");J("\\minuscoloncolon","\\Eqcolon");J("\\coloncolonapprox","\\Colonapprox");J("\\coloncolonsim","\\Colonsim");J("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");J("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");J("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");J("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");J("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");J("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");J("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");J("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");J("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");J("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");J("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");J("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");J("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");J("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");J("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");J("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");J("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");J("\\nleqq","\\html@mathml{\\@nleqq}{≰}");J("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");J("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");J("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");J("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");J("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");J("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");J("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");J("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");J("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");J("\\imath","\\html@mathml{\\@imath}{ı}");J("\\jmath","\\html@mathml{\\@jmath}{ȷ}");J("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");J("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");J("⟦","\\llbracket");J("⟧","\\rrbracket");J("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");J("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");J("⦃","\\lBrace");J("⦄","\\rBrace");J("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");J("⦵","\\minuso");J("\\darr","\\downarrow");J("\\dArr","\\Downarrow");J("\\Darr","\\Downarrow");J("\\lang","\\langle");J("\\rang","\\rangle");J("\\uarr","\\uparrow");J("\\uArr","\\Uparrow");J("\\Uarr","\\Uparrow");J("\\N","\\mathbb{N}");J("\\R","\\mathbb{R}");J("\\Z","\\mathbb{Z}");J("\\alef","\\aleph");J("\\alefsym","\\aleph");J("\\Alpha","\\mathrm{A}");J("\\Beta","\\mathrm{B}");J("\\bull","\\bullet");J("\\Chi","\\mathrm{X}");J("\\clubs","\\clubsuit");J("\\cnums","\\mathbb{C}");J("\\Complex","\\mathbb{C}");J("\\Dagger","\\ddagger");J("\\diamonds","\\diamondsuit");J("\\empty","\\emptyset");J("\\Epsilon","\\mathrm{E}");J("\\Eta","\\mathrm{H}");J("\\exist","\\exists");J("\\harr","\\leftrightarrow");J("\\hArr","\\Leftrightarrow");J("\\Harr","\\Leftrightarrow");J("\\hearts","\\heartsuit");J("\\image","\\Im");J("\\infin","\\infty");J("\\Iota","\\mathrm{I}");J("\\isin","\\in");J("\\Kappa","\\mathrm{K}");J("\\larr","\\leftarrow");J("\\lArr","\\Leftarrow");J("\\Larr","\\Leftarrow");J("\\lrarr","\\leftrightarrow");J("\\lrArr","\\Leftrightarrow");J("\\Lrarr","\\Leftrightarrow");J("\\Mu","\\mathrm{M}");J("\\natnums","\\mathbb{N}");J("\\Nu","\\mathrm{N}");J("\\Omicron","\\mathrm{O}");J("\\plusmn","\\pm");J("\\rarr","\\rightarrow");J("\\rArr","\\Rightarrow");J("\\Rarr","\\Rightarrow");J("\\real","\\Re");J("\\reals","\\mathbb{R}");J("\\Reals","\\mathbb{R}");J("\\Rho","\\mathrm{P}");J("\\sdot","\\cdot");J("\\sect","\\S");J("\\spades","\\spadesuit");J("\\sub","\\subset");J("\\sube","\\subseteq");J("\\supe","\\supseteq");J("\\Tau","\\mathrm{T}");J("\\thetasym","\\vartheta");J("\\weierp","\\wp");J("\\Zeta","\\mathrm{Z}");J("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");J("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");J("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");J("\\bra","\\mathinner{\\langle{#1}|}");J("\\ket","\\mathinner{|{#1}\\rangle}");J("\\braket","\\mathinner{\\langle{#1}\\rangle}");J("\\Bra","\\left\\langle#1\\right|");J("\\Ket","\\left|#1\\right\\rangle");var HU=t=>e=>{var n=e.consumeArg().tokens,r=e.consumeArg().tokens,s=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.macros.get("|"),l=e.macros.get("\\|");e.macros.beginGroup();var c=m=>g=>{t&&(g.macros.set("|",a),s.length&&g.macros.set("\\|",l));var x=m;if(!m&&s.length){var y=g.future();y.text==="|"&&(g.popToken(),x=!0)}return{tokens:x?s:r,numArgs:0}};e.macros.set("|",c(!1)),s.length&&e.macros.set("\\|",c(!0));var d=e.consumeArg().tokens,h=e.expandTokens([...i,...d,...n]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};J("\\bra@ket",HU(!1));J("\\bra@set",HU(!0));J("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");J("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");J("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");J("\\angln","{\\angl n}");J("\\blue","\\textcolor{##6495ed}{#1}");J("\\orange","\\textcolor{##ffa500}{#1}");J("\\pink","\\textcolor{##ff00af}{#1}");J("\\red","\\textcolor{##df0030}{#1}");J("\\green","\\textcolor{##28ae7b}{#1}");J("\\gray","\\textcolor{gray}{#1}");J("\\purple","\\textcolor{##9d38bd}{#1}");J("\\blueA","\\textcolor{##ccfaff}{#1}");J("\\blueB","\\textcolor{##80f6ff}{#1}");J("\\blueC","\\textcolor{##63d9ea}{#1}");J("\\blueD","\\textcolor{##11accd}{#1}");J("\\blueE","\\textcolor{##0c7f99}{#1}");J("\\tealA","\\textcolor{##94fff5}{#1}");J("\\tealB","\\textcolor{##26edd5}{#1}");J("\\tealC","\\textcolor{##01d1c1}{#1}");J("\\tealD","\\textcolor{##01a995}{#1}");J("\\tealE","\\textcolor{##208170}{#1}");J("\\greenA","\\textcolor{##b6ffb0}{#1}");J("\\greenB","\\textcolor{##8af281}{#1}");J("\\greenC","\\textcolor{##74cf70}{#1}");J("\\greenD","\\textcolor{##1fab54}{#1}");J("\\greenE","\\textcolor{##0d923f}{#1}");J("\\goldA","\\textcolor{##ffd0a9}{#1}");J("\\goldB","\\textcolor{##ffbb71}{#1}");J("\\goldC","\\textcolor{##ff9c39}{#1}");J("\\goldD","\\textcolor{##e07d10}{#1}");J("\\goldE","\\textcolor{##a75a05}{#1}");J("\\redA","\\textcolor{##fca9a9}{#1}");J("\\redB","\\textcolor{##ff8482}{#1}");J("\\redC","\\textcolor{##f9685d}{#1}");J("\\redD","\\textcolor{##e84d39}{#1}");J("\\redE","\\textcolor{##bc2612}{#1}");J("\\maroonA","\\textcolor{##ffbde0}{#1}");J("\\maroonB","\\textcolor{##ff92c6}{#1}");J("\\maroonC","\\textcolor{##ed5fa6}{#1}");J("\\maroonD","\\textcolor{##ca337c}{#1}");J("\\maroonE","\\textcolor{##9e034e}{#1}");J("\\purpleA","\\textcolor{##ddd7ff}{#1}");J("\\purpleB","\\textcolor{##c6b9fc}{#1}");J("\\purpleC","\\textcolor{##aa87ff}{#1}");J("\\purpleD","\\textcolor{##7854ab}{#1}");J("\\purpleE","\\textcolor{##543b78}{#1}");J("\\mintA","\\textcolor{##f5f9e8}{#1}");J("\\mintB","\\textcolor{##edf2df}{#1}");J("\\mintC","\\textcolor{##e0e5cc}{#1}");J("\\grayA","\\textcolor{##f6f7f7}{#1}");J("\\grayB","\\textcolor{##f0f1f2}{#1}");J("\\grayC","\\textcolor{##e3e5e6}{#1}");J("\\grayD","\\textcolor{##d6d8da}{#1}");J("\\grayE","\\textcolor{##babec2}{#1}");J("\\grayF","\\textcolor{##888d93}{#1}");J("\\grayG","\\textcolor{##626569}{#1}");J("\\grayH","\\textcolor{##3b3e40}{#1}");J("\\grayI","\\textcolor{##21242c}{#1}");J("\\kaBlue","\\textcolor{##314453}{#1}");J("\\kaGreen","\\textcolor{##71B307}{#1}");var QU={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class kke{constructor(e,n,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(e),this.macros=new wke(Ske,n.macros),this.mode=r,this.stack=[]}feed(e){this.lexer=new VR(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var n,r,s;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:s,end:r}=this.consumeArg(["]"])}else({tokens:s,start:n,end:r}=this.consumeArg());return this.pushToken(new Zi("EOF",r.loc)),this.pushTokens(s),new Zi("",xi.range(n,r))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var n=[],r=e&&e.length>0;r||this.consumeSpaces();var s=this.future(),i,a=0,l=0;do{if(i=this.popToken(),n.push(i),i.text==="{")++a;else if(i.text==="}"){if(--a,a===-1)throw new qe("Extra }",i)}else if(i.text==="EOF")throw new qe("Unexpected end of input in a macro argument, expected '"+(e&&r?e[l]:"}")+"'",i);if(e&&r)if((a===0||a===1&&e[l]==="{")&&i.text===e[l]){if(++l,l===e.length){n.splice(-l,l);break}}else l=0}while(a!==0||r);return s.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:s,end:i}}consumeArgs(e,n){if(n){if(n.length!==e+1)throw new qe("The length of delimiters doesn't match the number of args!");for(var r=n[0],s=0;sthis.settings.maxExpand)throw new qe("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var n=this.popToken(),r=n.text,s=n.noexpand?null:this._getExpansion(r);if(s==null||e&&s.unexpandable){if(e&&s==null&&r[0]==="\\"&&!this.isDefined(r))throw new qe("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var i=s.tokens,a=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(var l=i.length-1;l>=0;--l){var c=i[l];if(c.text==="#"){if(l===0)throw new qe("Incomplete placeholder at end of macro body",c);if(c=i[--l],c.text==="#")i.splice(l+1,1);else if(/^[1-9]$/.test(c.text))i.splice(l,2,...a[+c.text-1]);else throw new qe("Not a valid argument number",c)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Zi(e)]):void 0}expandTokens(e){var n=[],r=this.stack.length;for(this.pushTokens(e);this.stack.length>r;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),n.push(s)}return this.countExpansion(n.length),n}expandMacroAsText(e){var n=this.expandMacro(e);return n&&n.map(r=>r.text).join("")}_getExpansion(e){var n=this.macros.get(e);if(n==null)return n;if(e.length===1){var r=this.lexer.catcodes[e];if(r!=null&&r!==13)return}var s=typeof n=="function"?n(this):n;if(typeof s=="string"){var i=0;if(s.indexOf("#")!==-1)for(var a=s.replace(/##/g,"");a.indexOf("#"+(i+1))!==-1;)++i;for(var l=new VR(s,this.settings),c=[],d=l.lex();d.text!=="EOF";)c.push(d),d=l.lex();c.reverse();var h={tokens:c,numArgs:i};return h}return s}isDefined(e){return this.macros.has(e)||Qc.hasOwnProperty(e)||pr.math.hasOwnProperty(e)||pr.text.hasOwnProperty(e)||QU.hasOwnProperty(e)}isExpandable(e){var n=this.macros.get(e);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:Qc.hasOwnProperty(e)&&!Qc[e].primitive}}var GR=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Q1=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),c5={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},XR={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Kb{constructor(e,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new kke(e,n,this.mode),this.settings=n,this.leftrightDepth=0}expect(e,n){if(n===void 0&&(n=!0),this.fetch().text!==e)throw new qe("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var n=this.nextToken;this.consume(),this.gullet.pushToken(new Zi("}")),this.gullet.pushTokens(e);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(e,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(Kb.endOfExpression.indexOf(s.text)!==-1||n&&s.text===n||e&&Qc[s.text]&&Qc[s.text].infix)break;var i=this.parseAtom(n);if(i){if(i.type==="internal")continue}else break;r.push(i)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var n=-1,r,s=0;s=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',e);var l=pr[this.mode][n].group,c=xi.range(e),d;if(d3e.hasOwnProperty(l)){var h=l;d={type:"atom",mode:this.mode,family:h,loc:c,text:n}}else d={type:l,mode:this.mode,loc:c,text:n};a=d}else if(n.charCodeAt(0)>=128)this.settings.strict&&(JV(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),e)),a={type:"textord",mode:"text",loc:xi.range(e),text:n};else return null;if(this.consume(),i)for(var m=0;md&&(d=h):h&&(d!==void 0&&d>-1&&c.push(` -`.repeat(d)||" "),d=-1,c.push(h))}return c.join("")}function KU(t,e,n){return t.type==="element"?eOe(t,e,n):t.type==="text"?n.whitespace==="normal"?ZU(t,n):tOe(t):[]}function eOe(t,e,n){const r=JU(t,n),s=t.children||[];let i=-1,a=[];if(Zke(t))return a;let l,c;for(KO(t)||sD(t)&&eD(e,t,sD)?c=` -`:Kke(t)?(l=2,c=2):YU(t)&&(l=1,c=1);++i{try{i(!0);const Oe=await dOe({page:a,page_size:h,is_registered:g==="all"?void 0:g==="registered",is_banned:y==="all"?void 0:y==="banned",format:S==="all"?void 0:S,sort_by:j,sort_order:T});e(Oe.data),d(Oe.total)}catch(Oe){const Ve=Oe instanceof Error?Oe.message:"加载表情包列表失败";X({title:"错误",description:Ve,variant:"destructive"})}finally{i(!1)}},[a,h,g,y,S,j,T,X]),U=async()=>{try{const Oe=await pOe();r(Oe.data)}catch(Oe){console.error("加载统计数据失败:",Oe)}};b.useEffect(()=>{z()},[z]),b.useEffect(()=>{U()},[]);const te=async Oe=>{try{const Ve=await hOe(Oe.id);A(Ve.data),q(!0)}catch(Ve){const Ue=Ve instanceof Error?Ve.message:"加载详情失败";X({title:"错误",description:Ue,variant:"destructive"})}},ne=Oe=>{A(Oe),H(!0)},G=Oe=>{A(Oe),ee(!0)},se=async()=>{if(_)try{await mOe(_.id),X({title:"成功",description:"表情包已删除"}),ee(!1),A(null),z(),U()}catch(Oe){const Ve=Oe instanceof Error?Oe.message:"删除失败";X({title:"错误",description:Ve,variant:"destructive"})}},re=async Oe=>{try{await gOe(Oe.id),X({title:"成功",description:"表情包已注册"}),z(),U()}catch(Ve){const Ue=Ve instanceof Error?Ve.message:"注册失败";X({title:"错误",description:Ue,variant:"destructive"})}},ae=async Oe=>{try{await xOe(Oe.id),X({title:"成功",description:"表情包已封禁"}),z(),U()}catch(Ve){const Ue=Ve instanceof Error?Ve.message:"封禁失败";X({title:"错误",description:Ue,variant:"destructive"})}},_e=Oe=>{const Ve=new Set(I);Ve.has(Oe)?Ve.delete(Oe):Ve.add(Oe),V(Ve)},Be=async()=>{try{const Oe=await vOe(Array.from(I));X({title:"批量删除完成",description:Oe.message}),V(new Set),$(!1),z(),U()}catch(Oe){X({title:"批量删除失败",description:Oe instanceof Error?Oe.message:"批量删除失败",variant:"destructive"})}},Ye=()=>{const Oe=parseInt(K),Ve=Math.ceil(c/h);Oe>=1&&Oe<=Ve?(l(Oe),Y("")):X({title:"无效的页码",description:`请输入1-${Ve}之间的页码`,variant:"destructive"})},Je=n?.formats?Object.keys(n.formats):[];return o.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[o.jsxs("div",{className:"mb-4 sm:mb-6",children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"表情包管理"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理麦麦的表情包资源"})]}),o.jsx(pn,{className:"flex-1",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[n&&o.jsxs("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:[o.jsx(Lt,{children:o.jsxs(En,{className:"pb-2",children:[o.jsx(Wr,{children:"总数"}),o.jsx(_n,{className:"text-2xl",children:n.total})]})}),o.jsx(Lt,{children:o.jsxs(En,{className:"pb-2",children:[o.jsx(Wr,{children:"已注册"}),o.jsx(_n,{className:"text-2xl text-green-600",children:n.registered})]})}),o.jsx(Lt,{children:o.jsxs(En,{className:"pb-2",children:[o.jsx(Wr,{children:"已封禁"}),o.jsx(_n,{className:"text-2xl text-red-600",children:n.banned})]})}),o.jsx(Lt,{children:o.jsxs(En,{className:"pb-2",children:[o.jsx(Wr,{children:"未注册"}),o.jsx(_n,{className:"text-2xl text-gray-600",children:n.unregistered})]})})]}),o.jsxs(Lt,{children:[o.jsx(En,{children:o.jsxs(_n,{className:"flex items-center gap-2",children:[o.jsx(ok,{className:"h-5 w-5"}),"筛选和排序"]})}),o.jsxs(Xn,{className:"space-y-4",children:[o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:"排序方式"}),o.jsxs(Vt,{value:`${j}-${T}`,onValueChange:Oe=>{const[Ve,Ue]=Oe.split("-");N(Ve),E(Ue),l(1)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"usage_count-desc",children:"使用次数 (多→少)"}),o.jsx(De,{value:"usage_count-asc",children:"使用次数 (少→多)"}),o.jsx(De,{value:"register_time-desc",children:"注册时间 (新→旧)"}),o.jsx(De,{value:"register_time-asc",children:"注册时间 (旧→新)"}),o.jsx(De,{value:"record_time-desc",children:"记录时间 (新→旧)"}),o.jsx(De,{value:"record_time-asc",children:"记录时间 (旧→新)"}),o.jsx(De,{value:"last_used_time-desc",children:"最后使用 (新→旧)"}),o.jsx(De,{value:"last_used_time-asc",children:"最后使用 (旧→新)"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:"注册状态"}),o.jsxs(Vt,{value:g,onValueChange:Oe=>{x(Oe),l(1)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部"}),o.jsx(De,{value:"registered",children:"已注册"}),o.jsx(De,{value:"unregistered",children:"未注册"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:"封禁状态"}),o.jsxs(Vt,{value:y,onValueChange:Oe=>{w(Oe),l(1)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部"}),o.jsx(De,{value:"banned",children:"已封禁"}),o.jsx(De,{value:"unbanned",children:"未封禁"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:"格式"}),o.jsxs(Vt,{value:S,onValueChange:Oe=>{k(Oe),l(1)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部"}),Je.map(Oe=>o.jsxs(De,{value:Oe,children:[Oe.toUpperCase()," (",n?.formats[Oe],")"]},Oe))]})]})]})]}),o.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 pt-4 border-t",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[I.size>0&&o.jsxs("span",{className:"text-sm text-muted-foreground",children:["已选择 ",I.size," 个表情包"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{className:"text-sm whitespace-nowrap",children:"卡片大小"}),o.jsxs(Vt,{value:R,onValueChange:Oe=>ie(Oe),children:[o.jsx($t,{className:"w-24",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"small",children:"小"}),o.jsx(De,{value:"medium",children:"中"}),o.jsx(De,{value:"large",children:"大"})]})]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{htmlFor:"emoji-page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),o.jsxs(Vt,{value:h.toString(),onValueChange:Oe=>{m(parseInt(Oe)),l(1),V(new Set)},children:[o.jsx($t,{id:"emoji-page-size",className:"w-20",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"20",children:"20"}),o.jsx(De,{value:"40",children:"40"}),o.jsx(De,{value:"60",children:"60"}),o.jsx(De,{value:"100",children:"100"})]})]}),I.size>0&&o.jsxs(o.Fragment,{children:[o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>V(new Set),children:"取消选择"}),o.jsxs(ue,{variant:"destructive",size:"sm",onClick:()=>$(!0),children:[o.jsx(Cn,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]}),o.jsx("div",{className:"flex justify-end pt-4 border-t",children:o.jsxs(ue,{variant:"outline",size:"sm",onClick:z,disabled:s,children:[o.jsx(Qs,{className:`h-4 w-4 mr-2 ${s?"animate-spin":""}`}),"刷新"]})})]})]}),o.jsxs(Lt,{children:[o.jsxs(En,{children:[o.jsx(_n,{children:"表情包列表"}),o.jsxs(Wr,{children:["共 ",c," 个表情包,当前第 ",a," 页"]})]}),o.jsxs(Xn,{children:[t.length===0?o.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"暂无数据"}):o.jsx("div",{className:`grid gap-3 ${R==="small"?"grid-cols-3 sm:grid-cols-4 md:grid-cols-6 lg:grid-cols-8 xl:grid-cols-10":R==="medium"?"grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 xl:grid-cols-8":"grid-cols-2 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5"}`,children:t.map(Oe=>o.jsxs("div",{className:`group relative rounded-lg border bg-card overflow-hidden hover:ring-2 hover:ring-primary transition-all cursor-pointer ${I.has(Oe.id)?"ring-2 ring-primary bg-primary/5":""}`,onClick:()=>_e(Oe.id),children:[o.jsx("div",{className:`absolute top-1 left-1 z-10 transition-opacity ${I.has(Oe.id)?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:o.jsx("div",{className:`w-5 h-5 rounded-full border-2 flex items-center justify-center ${I.has(Oe.id)?"bg-primary border-primary text-primary-foreground":"bg-background/80 border-muted-foreground/50"}`,children:I.has(Oe.id)&&o.jsx(Ya,{className:"h-3 w-3"})})}),o.jsxs("div",{className:"absolute top-1 right-1 z-10 flex flex-col gap-0.5",children:[Oe.is_registered&&o.jsx(tn,{variant:"default",className:"bg-green-600 text-[10px] px-1 py-0",children:"已注册"}),Oe.is_banned&&o.jsx(tn,{variant:"destructive",className:"text-[10px] px-1 py-0",children:"已封禁"})]}),o.jsx("div",{className:`aspect-square bg-muted flex items-center justify-center overflow-hidden ${R==="small"?"p-1":R==="medium"?"p-2":"p-3"}`,children:o.jsx("img",{src:eW(Oe.id),alt:"表情包",className:"w-full h-full object-contain",loading:"lazy",onError:Ve=>{const Ue=Ve.target;Ue.style.display="none";const $e=Ue.parentElement;$e&&($e.innerHTML='')}})}),o.jsxs("div",{className:`border-t bg-card ${R==="small"?"p-1":"p-2"}`,children:[o.jsxs("div",{className:"flex items-center justify-between gap-1 text-xs text-muted-foreground mb-1",children:[o.jsx(tn,{variant:"outline",className:"text-[10px] px-1 py-0",children:Oe.format.toUpperCase()}),o.jsxs("span",{className:"font-mono",children:[Oe.usage_count,"次"]})]}),o.jsxs("div",{className:`flex gap-1 justify-center opacity-0 group-hover:opacity-100 transition-opacity ${R==="small"?"flex-wrap":""}`,children:[o.jsx(ue,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:Ve=>{Ve.stopPropagation(),ne(Oe)},title:"编辑",children:o.jsx(F0,{className:"h-3 w-3"})}),o.jsx(ue,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:Ve=>{Ve.stopPropagation(),te(Oe)},title:"详情",children:o.jsx(Xi,{className:"h-3 w-3"})}),!Oe.is_registered&&o.jsx(ue,{variant:"ghost",size:"icon",className:"h-6 w-6 text-green-600 hover:text-green-700",onClick:Ve=>{Ve.stopPropagation(),re(Oe)},title:"注册",children:o.jsx(Ya,{className:"h-3 w-3"})}),!Oe.is_banned&&o.jsx(ue,{variant:"ghost",size:"icon",className:"h-6 w-6 text-orange-600 hover:text-orange-700",onClick:Ve=>{Ve.stopPropagation(),ae(Oe)},title:"封禁",children:o.jsx(tte,{className:"h-3 w-3"})}),o.jsx(ue,{variant:"ghost",size:"icon",className:"h-6 w-6 text-red-600 hover:text-red-700",onClick:Ve=>{Ve.stopPropagation(),G(Oe)},title:"删除",children:o.jsx(Cn,{className:"h-3 w-3"})})]})]})]},Oe.id))}),c>0&&o.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[o.jsxs("div",{className:"text-sm text-muted-foreground",children:["显示 ",(a-1)*h+1," 到"," ",Math.min(a*h,c)," 条,共 ",c," 条"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>l(1),disabled:a===1,className:"hidden sm:flex",children:o.jsx(Ip,{className:"h-4 w-4"})}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>l(Oe=>Math.max(1,Oe-1)),disabled:a===1,children:[o.jsx(wd,{className:"h-4 w-4 sm:mr-1"}),o.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Pe,{type:"number",value:K,onChange:Oe=>Y(Oe.target.value),onKeyDown:Oe=>Oe.key==="Enter"&&Ye(),placeholder:a.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(c/h)}),o.jsx(ue,{variant:"outline",size:"sm",onClick:Ye,disabled:!K,className:"h-8",children:"跳转"})]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>l(Oe=>Oe+1),disabled:a>=Math.ceil(c/h),children:[o.jsx("span",{className:"hidden sm:inline",children:"下一页"}),o.jsx(Zl,{className:"h-4 w-4 sm:ml-1"})]}),o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>l(Math.ceil(c/h)),disabled:a>=Math.ceil(c/h),className:"hidden sm:flex",children:o.jsx(Lp,{className:"h-4 w-4"})})]})]})]})]}),o.jsx(bOe,{emoji:_,open:D,onOpenChange:q}),o.jsx(wOe,{emoji:_,open:B,onOpenChange:H,onSuccess:()=>{z(),U()}})]})}),o.jsx(Fn,{open:L,onOpenChange:$,children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认批量删除"}),o.jsxs(zn,{children:["你确定要删除选中的 ",I.size," 个表情包吗?此操作不可撤销。"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:Be,children:"确认删除"})]})]})}),o.jsx(Er,{open:W,onOpenChange:ee,children:o.jsxs(wr,{children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"确认删除"}),o.jsx(Xr,{children:"确定要删除这个表情包吗?此操作无法撤销。"})]}),o.jsxs(fs,{children:[o.jsx(ue,{variant:"outline",onClick:()=>ee(!1),children:"取消"}),o.jsx(ue,{variant:"destructive",onClick:se,children:"删除"})]})]})})]})}function bOe({emoji:t,open:e,onOpenChange:n}){if(!t)return null;const r=s=>s?new Date(s*1e3).toLocaleString("zh-CN"):"-";return o.jsx(Er,{open:e,onOpenChange:n,children:o.jsxs(wr,{className:"max-w-2xl max-h-[90vh]",children:[o.jsx(Sr,{children:o.jsx(kr,{children:"表情包详情"})}),o.jsx(pn,{className:"max-h-[calc(90vh-8rem)] pr-4",children:o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"flex justify-center",children:o.jsx("div",{className:"w-32 h-32 bg-muted rounded-lg flex items-center justify-center overflow-hidden",children:o.jsx("img",{src:eW(t.id),alt:t.description||"表情包",className:"w-full h-full object-cover",onError:s=>{const i=s.target;i.style.display="none";const a=i.parentElement;a&&(a.innerHTML='')}})})}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"ID"}),o.jsx("div",{className:"mt-1 font-mono",children:t.id})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"格式"}),o.jsx("div",{className:"mt-1",children:o.jsx(tn,{variant:"outline",children:t.format.toUpperCase()})})]})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"文件路径"}),o.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:t.full_path})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"哈希值"}),o.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:t.emoji_hash})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"描述"}),t.description?o.jsx("div",{className:"mt-1 rounded-lg border bg-muted/50 p-3",children:o.jsx(uOe,{className:"prose-sm",children:t.description})}):o.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:"-"})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"情绪"}),o.jsx("div",{className:"mt-1",children:t.emotion?o.jsx("span",{className:"text-sm",children:t.emotion}):o.jsx("span",{className:"text-sm text-muted-foreground",children:"-"})})]}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"状态"}),o.jsxs("div",{className:"mt-2 flex gap-2",children:[t.is_registered&&o.jsx(tn,{variant:"default",className:"bg-green-600",children:"已注册"}),t.is_banned&&o.jsx(tn,{variant:"destructive",children:"已封禁"}),!t.is_registered&&!t.is_banned&&o.jsx(tn,{variant:"outline",children:"未注册"})]})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"使用次数"}),o.jsx("div",{className:"mt-1 font-mono text-lg",children:t.usage_count})]})]}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"记录时间"}),o.jsx("div",{className:"mt-1 text-sm",children:r(t.record_time)})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"注册时间"}),o.jsx("div",{className:"mt-1 text-sm",children:r(t.register_time)})]})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"最后使用"}),o.jsx("div",{className:"mt-1 text-sm",children:r(t.last_used_time)})]})]})})]})})}function wOe({emoji:t,open:e,onOpenChange:n,onSuccess:r}){const[s,i]=b.useState(""),[a,l]=b.useState(!1),[c,d]=b.useState(!1),[h,m]=b.useState(!1),{toast:g}=Lr();b.useEffect(()=>{t&&(i(t.emotion||""),l(t.is_registered),d(t.is_banned))},[t]);const x=async()=>{if(t)try{m(!0);const y=s.split(/[,,]/).map(w=>w.trim()).filter(Boolean).join(",");await fOe(t.id,{emotion:y||void 0,is_registered:a,is_banned:c}),g({title:"成功",description:"表情包信息已更新"}),n(!1),r()}catch(y){const w=y instanceof Error?y.message:"保存失败";g({title:"错误",description:w,variant:"destructive"})}finally{m(!1)}};return t?o.jsx(Er,{open:e,onOpenChange:n,children:o.jsxs(wr,{className:"max-w-2xl",children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"编辑表情包"}),o.jsx(Xr,{children:"修改表情包的情绪和状态信息"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx(he,{children:"情绪"}),o.jsx(Nr,{value:s,onChange:y=>i(y.target.value),placeholder:"输入情绪描述...",rows:2,className:"mt-1"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"输入情绪相关的文本描述"})]}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ci,{id:"is_registered",checked:a,onCheckedChange:y=>{y===!0?(l(!0),d(!1)):l(!1)}}),o.jsx(he,{htmlFor:"is_registered",className:"cursor-pointer",children:"已注册"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ci,{id:"is_banned",checked:c,onCheckedChange:y=>{y===!0?(d(!0),l(!1)):d(!1)}}),o.jsx(he,{htmlFor:"is_banned",className:"cursor-pointer",children:"已封禁"})]})]})]}),o.jsxs(fs,{children:[o.jsx(ue,{variant:"outline",onClick:()=>n(!1),children:"取消"}),o.jsx(ue,{onClick:x,disabled:h,children:h?"保存中...":"保存"})]})]})}):null}const pu="/api/webui/expression";async function SOe(){const t=await gt(`${pu}/chats`,{headers:Tt()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"获取聊天列表失败")}return t.json()}async function kOe(t){const e=new URLSearchParams;t.page&&e.append("page",t.page.toString()),t.page_size&&e.append("page_size",t.page_size.toString()),t.search&&e.append("search",t.search),t.chat_id&&e.append("chat_id",t.chat_id);const n=await gt(`${pu}/list?${e}`,{headers:Tt()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取表达方式列表失败")}return n.json()}async function OOe(t){const e=await gt(`${pu}/${t}`,{headers:Tt()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"获取表达方式详情失败")}return e.json()}async function jOe(t){const e=await gt(`${pu}/`,{method:"POST",headers:Tt(),body:JSON.stringify(t)});if(!e.ok){const n=await e.json();throw new Error(n.detail||"创建表达方式失败")}return e.json()}async function NOe(t,e){const n=await gt(`${pu}/${t}`,{method:"PATCH",headers:Tt(),body:JSON.stringify(e)});if(!n.ok){const r=await n.json();throw new Error(r.detail||"更新表达方式失败")}return n.json()}async function COe(t){const e=await gt(`${pu}/${t}`,{method:"DELETE",headers:Tt()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"删除表达方式失败")}return e.json()}async function TOe(t){const e=await gt(`${pu}/batch/delete`,{method:"POST",headers:Tt(),body:JSON.stringify({ids:t})});if(!e.ok){const n=await e.json();throw new Error(n.detail||"批量删除表达方式失败")}return e.json()}async function EOe(){const t=await gt(`${pu}/stats/summary`,{headers:Tt()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"获取统计数据失败")}return t.json()}function _Oe(){const[t,e]=b.useState([]),[n,r]=b.useState(!0),[s,i]=b.useState(0),[a,l]=b.useState(1),[c,d]=b.useState(20),[h,m]=b.useState(""),[g,x]=b.useState(null),[y,w]=b.useState(!1),[S,k]=b.useState(!1),[j,N]=b.useState(!1),[T,E]=b.useState(null),[_,A]=b.useState(new Set),[D,q]=b.useState(!1),[B,H]=b.useState(""),[W,ee]=b.useState({total:0,recent_7days:0,chat_count:0,top_chats:{}}),[I,V]=b.useState([]),[L,$]=b.useState(new Map),{toast:K}=Lr(),Y=async()=>{try{r(!0);const ae=await kOe({page:a,page_size:c,search:h||void 0});e(ae.data),i(ae.total)}catch(ae){K({title:"加载失败",description:ae instanceof Error?ae.message:"无法加载表达方式",variant:"destructive"})}finally{r(!1)}},R=async()=>{try{const ae=await EOe();ae?.data&&ee(ae.data)}catch(ae){console.error("加载统计数据失败:",ae)}},ie=async()=>{try{const ae=await SOe();if(ae?.data){V(ae.data);const _e=new Map;ae.data.forEach(Be=>{_e.set(Be.chat_id,Be.chat_name)}),$(_e)}}catch(ae){console.error("加载聊天列表失败:",ae)}},X=ae=>L.get(ae)||ae;b.useEffect(()=>{Y(),R(),ie()},[a,c,h]);const z=async ae=>{try{const _e=await OOe(ae.id);x(_e.data),w(!0)}catch(_e){K({title:"加载详情失败",description:_e instanceof Error?_e.message:"无法加载表达方式详情",variant:"destructive"})}},U=ae=>{x(ae),k(!0)},te=async ae=>{try{await COe(ae.id),K({title:"删除成功",description:`已删除表达方式: ${ae.situation}`}),E(null),Y(),R()}catch(_e){K({title:"删除失败",description:_e instanceof Error?_e.message:"无法删除表达方式",variant:"destructive"})}},ne=ae=>{const _e=new Set(_);_e.has(ae)?_e.delete(ae):_e.add(ae),A(_e)},G=()=>{_.size===t.length&&t.length>0?A(new Set):A(new Set(t.map(ae=>ae.id)))},se=async()=>{try{await TOe(Array.from(_)),K({title:"批量删除成功",description:`已删除 ${_.size} 个表达方式`}),A(new Set),q(!1),Y(),R()}catch(ae){K({title:"批量删除失败",description:ae instanceof Error?ae.message:"无法批量删除表达方式",variant:"destructive"})}},re=()=>{const ae=parseInt(B),_e=Math.ceil(s/c);ae>=1&&ae<=_e?(l(ae),H("")):K({title:"无效的页码",description:`请输入1-${_e}之间的页码`,variant:"destructive"})};return o.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[o.jsx("div",{className:"mb-4 sm:mb-6",children:o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[o.jsx(Gh,{className:"h-8 w-8",strokeWidth:2}),"表达方式管理"]}),o.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦的表达方式和话术模板"})]}),o.jsxs(ue,{onClick:()=>N(!0),className:"gap-2",children:[o.jsx(Is,{className:"h-4 w-4"}),"新增表达方式"]})]})}),o.jsx(pn,{className:"flex-1",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"总数量"}),o.jsx("div",{className:"text-2xl font-bold mt-1",children:W.total})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"近7天新增"}),o.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:W.recent_7days})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"关联聊天数"}),o.jsx("div",{className:"text-2xl font-bold mt-1 text-blue-600",children:W.chat_count})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx(he,{htmlFor:"search",children:"搜索"}),o.jsx("div",{className:"flex flex-col sm:flex-row gap-2 mt-1.5",children:o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(ii,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),o.jsx(Pe,{id:"search",placeholder:"搜索情境、风格或上下文...",value:h,onChange:ae=>m(ae.target.value),className:"pl-9"})]})}),o.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 mt-4 pt-4 border-t",children:[o.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:_.size>0&&o.jsxs("span",{children:["已选择 ",_.size," 个表达方式"]})}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),o.jsxs(Vt,{value:c.toString(),onValueChange:ae=>{d(parseInt(ae)),l(1),A(new Set)},children:[o.jsx($t,{id:"page-size",className:"w-20",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"10",children:"10"}),o.jsx(De,{value:"20",children:"20"}),o.jsx(De,{value:"50",children:"50"}),o.jsx(De,{value:"100",children:"100"})]})]}),_.size>0&&o.jsxs(o.Fragment,{children:[o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>A(new Set),children:"取消选择"}),o.jsxs(ue,{variant:"destructive",size:"sm",onClick:()=>q(!0),children:[o.jsx(Cn,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card",children:[o.jsx("div",{className:"hidden md:block",children:o.jsxs(Af,{children:[o.jsx(Mf,{children:o.jsxs(zs,{children:[o.jsx(mn,{className:"w-12",children:o.jsx(Ci,{checked:_.size===t.length&&t.length>0,onCheckedChange:G})}),o.jsx(mn,{children:"情境"}),o.jsx(mn,{children:"风格"}),o.jsx(mn,{children:"聊天"}),o.jsx(mn,{className:"text-right",children:"操作"})]})}),o.jsx(Rf,{children:n?o.jsx(zs,{children:o.jsx(Yt,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):t.length===0?o.jsx(zs,{children:o.jsx(Yt,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):t.map(ae=>o.jsxs(zs,{children:[o.jsx(Yt,{children:o.jsx(Ci,{checked:_.has(ae.id),onCheckedChange:()=>ne(ae.id)})}),o.jsx(Yt,{className:"font-medium max-w-xs truncate",children:ae.situation}),o.jsx(Yt,{className:"max-w-xs truncate",children:ae.style}),o.jsx(Yt,{className:"max-w-[200px] truncate",title:X(ae.chat_id),style:{wordBreak:"keep-all"},children:o.jsx("span",{className:"whitespace-nowrap overflow-hidden text-ellipsis block",children:X(ae.chat_id)})}),o.jsx(Yt,{className:"text-right",children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsxs(ue,{variant:"default",size:"sm",onClick:()=>U(ae),children:[o.jsx(F0,{className:"h-4 w-4 mr-1"}),"编辑"]}),o.jsx(ue,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>z(ae),title:"查看详情",children:o.jsx(Ji,{className:"h-4 w-4"})}),o.jsxs(ue,{size:"sm",onClick:()=>E(ae),className:"bg-red-600 hover:bg-red-700 text-white",children:[o.jsx(Cn,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},ae.id))})]})}),o.jsx("div",{className:"md:hidden space-y-3 p-4",children:n?o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):t.length===0?o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):t.map(ae=>o.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(Ci,{checked:_.has(ae.id),onCheckedChange:()=>ne(ae.id),className:"mt-1"}),o.jsxs("div",{className:"min-w-0 flex-1 overflow-hidden space-y-2",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"情境"}),o.jsx("h3",{className:"font-semibold text-sm line-clamp-2 w-full break-all",title:ae.situation,children:ae.situation})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"风格"}),o.jsx("p",{className:"text-sm line-clamp-2 w-full break-all",title:ae.style,children:ae.style})]})]})]}),o.jsxs("div",{className:"text-sm",children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"聊天"}),o.jsx("p",{className:"text-sm truncate",title:X(ae.chat_id),style:{wordBreak:"keep-all"},children:X(ae.chat_id)})]}),o.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>U(ae),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[o.jsx(F0,{className:"h-3 w-3 mr-1"}),"编辑"]}),o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>z(ae),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:o.jsx(Ji,{className:"h-3 w-3"})}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>E(ae),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[o.jsx(Cn,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},ae.id))}),s>0&&o.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[o.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",s," 条记录,第 ",a," / ",Math.ceil(s/c)," 页"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>l(1),disabled:a===1,className:"hidden sm:flex",children:o.jsx(Ip,{className:"h-4 w-4"})}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>l(a-1),disabled:a===1,children:[o.jsx(wd,{className:"h-4 w-4 sm:mr-1"}),o.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Pe,{type:"number",value:B,onChange:ae=>H(ae.target.value),onKeyDown:ae=>ae.key==="Enter"&&re(),placeholder:a.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(s/c)}),o.jsx(ue,{variant:"outline",size:"sm",onClick:re,disabled:!B,className:"h-8",children:"跳转"})]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>l(a+1),disabled:a>=Math.ceil(s/c),children:[o.jsx("span",{className:"hidden sm:inline",children:"下一页"}),o.jsx(Zl,{className:"h-4 w-4 sm:ml-1"})]}),o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>l(Math.ceil(s/c)),disabled:a>=Math.ceil(s/c),className:"hidden sm:flex",children:o.jsx(Lp,{className:"h-4 w-4"})})]})]})]})]})}),o.jsx(AOe,{expression:g,open:y,onOpenChange:w,chatNameMap:L}),o.jsx(MOe,{open:j,onOpenChange:N,chatList:I,onSuccess:()=>{Y(),R(),N(!1)}}),o.jsx(ROe,{expression:g,open:S,onOpenChange:k,chatList:I,onSuccess:()=>{Y(),R(),k(!1)}}),o.jsx(Fn,{open:!!T,onOpenChange:()=>E(null),children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:['确定要删除表达方式 "',T?.situation,'" 吗? 此操作不可撤销。']})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>T&&te(T),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),o.jsx(DOe,{open:D,onOpenChange:q,onConfirm:se,count:_.size})]})}function AOe({expression:t,open:e,onOpenChange:n,chatNameMap:r}){if(!t)return null;const s=a=>a?new Date(a*1e3).toLocaleString("zh-CN"):"-",i=a=>r.get(a)||a;return o.jsx(Er,{open:e,onOpenChange:n,children:o.jsxs(wr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"表达方式详情"}),o.jsx(Xr,{children:"查看表达方式的完整信息"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsx(t0,{label:"情境",value:t.situation}),o.jsx(t0,{label:"风格",value:t.style}),o.jsx(t0,{label:"聊天",value:i(t.chat_id)}),o.jsx(t0,{icon:lk,label:"记录ID",value:t.id.toString(),mono:!0})]}),o.jsx("div",{className:"grid grid-cols-2 gap-4",children:o.jsx(t0,{icon:Mh,label:"创建时间",value:s(t.create_date)})})]}),o.jsx(fs,{children:o.jsx(ue,{onClick:()=>n(!1),children:"关闭"})})]})})}function t0({icon:t,label:e,value:n,mono:r=!1}){return o.jsxs("div",{className:"space-y-1",children:[o.jsxs(he,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[t&&o.jsx(t,{className:"h-3 w-3"}),e]}),o.jsx("div",{className:xe("text-sm",r&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function MOe({open:t,onOpenChange:e,chatList:n,onSuccess:r}){const[s,i]=b.useState({situation:"",style:"",chat_id:""}),[a,l]=b.useState(!1),{toast:c}=Lr(),d=async()=>{if(!s.situation||!s.style||!s.chat_id){c({title:"验证失败",description:"请填写必填字段:情境、风格和聊天",variant:"destructive"});return}try{l(!0),await jOe(s),c({title:"创建成功",description:"表达方式已创建"}),i({situation:"",style:"",chat_id:""}),r()}catch(h){c({title:"创建失败",description:h instanceof Error?h.message:"无法创建表达方式",variant:"destructive"})}finally{l(!1)}};return o.jsx(Er,{open:t,onOpenChange:e,children:o.jsxs(wr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"新增表达方式"}),o.jsx(Xr,{children:"创建新的表达方式记录"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsxs(he,{htmlFor:"situation",children:["情境 ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsx(Pe,{id:"situation",value:s.situation,onChange:h=>i({...s,situation:h.target.value}),placeholder:"描述使用场景"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs(he,{htmlFor:"style",children:["风格 ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsx(Pe,{id:"style",value:s.style,onChange:h=>i({...s,style:h.target.value}),placeholder:"描述表达风格"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs(he,{htmlFor:"chat_id",children:["聊天 ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsxs(Vt,{value:s.chat_id,onValueChange:h=>i({...s,chat_id:h}),children:[o.jsx($t,{children:o.jsx(Ut,{placeholder:"选择关联的聊天"})}),o.jsx(Ht,{children:n.map(h=>o.jsx(De,{value:h.chat_id,children:o.jsxs("span",{className:"truncate",style:{wordBreak:"keep-all"},children:[h.chat_name,h.is_group&&o.jsx("span",{className:"text-muted-foreground ml-1",children:"(群聊)"})]})},h.chat_id))})]})]})]}),o.jsxs(fs,{children:[o.jsx(ue,{variant:"outline",onClick:()=>e(!1),children:"取消"}),o.jsx(ue,{onClick:d,disabled:a,children:a?"创建中...":"创建"})]})]})})}function ROe({expression:t,open:e,onOpenChange:n,chatList:r,onSuccess:s}){const[i,a]=b.useState({}),[l,c]=b.useState(!1),{toast:d}=Lr();b.useEffect(()=>{t&&a({situation:t.situation,style:t.style,chat_id:t.chat_id})},[t]);const h=async()=>{if(t)try{c(!0),await NOe(t.id,i),d({title:"保存成功",description:"表达方式已更新"}),s()}catch(m){d({title:"保存失败",description:m instanceof Error?m.message:"无法更新表达方式",variant:"destructive"})}finally{c(!1)}};return t?o.jsx(Er,{open:e,onOpenChange:n,children:o.jsxs(wr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"编辑表达方式"}),o.jsx(Xr,{children:"修改表达方式的信息"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"edit_situation",children:"情境"}),o.jsx(Pe,{id:"edit_situation",value:i.situation||"",onChange:m=>a({...i,situation:m.target.value}),placeholder:"描述使用场景"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"edit_style",children:"风格"}),o.jsx(Pe,{id:"edit_style",value:i.style||"",onChange:m=>a({...i,style:m.target.value}),placeholder:"描述表达风格"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"edit_chat_id",children:"聊天"}),o.jsxs(Vt,{value:i.chat_id||"",onValueChange:m=>a({...i,chat_id:m}),children:[o.jsx($t,{children:o.jsx(Ut,{placeholder:"选择关联的聊天"})}),o.jsx(Ht,{children:r.map(m=>o.jsx(De,{value:m.chat_id,children:o.jsxs("span",{className:"truncate",style:{wordBreak:"keep-all"},children:[m.chat_name,m.is_group&&o.jsx("span",{className:"text-muted-foreground ml-1",children:"(群聊)"})]})},m.chat_id))})]})]})]}),o.jsxs(fs,{children:[o.jsx(ue,{variant:"outline",onClick:()=>n(!1),children:"取消"}),o.jsx(ue,{onClick:h,disabled:l,children:l?"保存中...":"保存"})]})]})}):null}function DOe({open:t,onOpenChange:e,onConfirm:n,count:r}){return o.jsx(Fn,{open:t,onOpenChange:e,children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认批量删除"}),o.jsxs(zn,{children:["您即将删除 ",r," 个表达方式,此操作无法撤销。确定要继续吗?"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:n,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"确认删除"})]})]})})}const Qf="/api/webui/person";async function POe(t){const e=new URLSearchParams;t.page&&e.append("page",t.page.toString()),t.page_size&&e.append("page_size",t.page_size.toString()),t.search&&e.append("search",t.search),t.is_known!==void 0&&e.append("is_known",t.is_known.toString()),t.platform&&e.append("platform",t.platform);const n=await gt(`${Qf}/list?${e}`,{headers:Tt()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取人物列表失败")}return n.json()}async function zOe(t){const e=await gt(`${Qf}/${t}`,{headers:Tt()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"获取人物详情失败")}return e.json()}async function IOe(t,e){const n=await gt(`${Qf}/${t}`,{method:"PATCH",headers:Tt(),body:JSON.stringify(e)});if(!n.ok){const r=await n.json();throw new Error(r.detail||"更新人物信息失败")}return n.json()}async function LOe(t){const e=await gt(`${Qf}/${t}`,{method:"DELETE",headers:Tt()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"删除人物信息失败")}return e.json()}async function BOe(){const t=await gt(`${Qf}/stats/summary`,{headers:Tt()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"获取统计数据失败")}return t.json()}async function FOe(t){const e=await gt(`${Qf}/batch/delete`,{method:"POST",headers:Tt(),body:JSON.stringify({person_ids:t})});if(!e.ok){const n=await e.json();throw new Error(n.detail||"批量删除失败")}return e.json()}function qOe(){const[t,e]=b.useState([]),[n,r]=b.useState(!0),[s,i]=b.useState(0),[a,l]=b.useState(1),[c,d]=b.useState(20),[h,m]=b.useState(""),[g,x]=b.useState(void 0),[y,w]=b.useState(void 0),[S,k]=b.useState(null),[j,N]=b.useState(!1),[T,E]=b.useState(!1),[_,A]=b.useState(null),[D,q]=b.useState({total:0,known:0,unknown:0,platforms:{}}),[B,H]=b.useState(new Set),[W,ee]=b.useState(!1),[I,V]=b.useState(""),{toast:L}=Lr(),$=async()=>{try{r(!0);const re=await POe({page:a,page_size:c,search:h||void 0,is_known:g,platform:y});e(re.data),i(re.total)}catch(re){L({title:"加载失败",description:re instanceof Error?re.message:"无法加载人物信息",variant:"destructive"})}finally{r(!1)}},K=async()=>{try{const re=await BOe();re?.data&&q(re.data)}catch(re){console.error("加载统计数据失败:",re)}};b.useEffect(()=>{$(),K()},[a,c,h,g,y]);const Y=async re=>{try{const ae=await zOe(re.person_id);k(ae.data),N(!0)}catch(ae){L({title:"加载详情失败",description:ae instanceof Error?ae.message:"无法加载人物详情",variant:"destructive"})}},R=re=>{k(re),E(!0)},ie=async re=>{try{await LOe(re.person_id),L({title:"删除成功",description:`已删除人物信息: ${re.person_name||re.nickname||re.user_id}`}),A(null),$(),K()}catch(ae){L({title:"删除失败",description:ae instanceof Error?ae.message:"无法删除人物信息",variant:"destructive"})}},X=b.useMemo(()=>Object.keys(D.platforms),[D.platforms]),z=re=>{const ae=new Set(B);ae.has(re)?ae.delete(re):ae.add(re),H(ae)},U=()=>{B.size===t.length&&t.length>0?H(new Set):H(new Set(t.map(re=>re.person_id)))},te=()=>{if(B.size===0){L({title:"未选择任何人物",description:"请先选择要删除的人物",variant:"destructive"});return}ee(!0)},ne=async()=>{try{const re=await FOe(Array.from(B));L({title:"批量删除完成",description:re.message}),H(new Set),ee(!1),$(),K()}catch(re){L({title:"批量删除失败",description:re instanceof Error?re.message:"批量删除失败",variant:"destructive"})}},G=()=>{const re=parseInt(I),ae=Math.ceil(s/c);re>=1&&re<=ae?(l(re),V("")):L({title:"无效的页码",description:`请输入1-${ae}之间的页码`,variant:"destructive"})},se=re=>re?new Date(re*1e3).toLocaleString("zh-CN"):"-";return o.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[o.jsx("div",{className:"mb-4 sm:mb-6",children:o.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[o.jsx(nte,{className:"h-8 w-8",strokeWidth:2}),"人物信息管理"]}),o.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦认识的所有人物信息"})]})})}),o.jsx(pn,{className:"flex-1",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"总人数"}),o.jsx("div",{className:"text-2xl font-bold mt-1",children:D.total})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"已认识"}),o.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:D.known})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"未认识"}),o.jsx("div",{className:"text-2xl font-bold mt-1 text-muted-foreground",children:D.unknown})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-4",children:[o.jsxs("div",{className:"sm:col-span-2",children:[o.jsx(he,{htmlFor:"search",children:"搜索"}),o.jsxs("div",{className:"relative mt-1.5",children:[o.jsx(ii,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),o.jsx(Pe,{id:"search",placeholder:"搜索名称、昵称或用户ID...",value:h,onChange:re=>m(re.target.value),className:"pl-9"})]})]}),o.jsxs("div",{children:[o.jsx(he,{htmlFor:"filter-known",children:"认识状态"}),o.jsxs(Vt,{value:g===void 0?"all":g.toString(),onValueChange:re=>{x(re==="all"?void 0:re==="true"),l(1)},children:[o.jsx($t,{id:"filter-known",className:"mt-1.5",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部"}),o.jsx(De,{value:"true",children:"已认识"}),o.jsx(De,{value:"false",children:"未认识"})]})]})]}),o.jsxs("div",{children:[o.jsx(he,{htmlFor:"filter-platform",children:"平台"}),o.jsxs(Vt,{value:y||"all",onValueChange:re=>{w(re==="all"?void 0:re),l(1)},children:[o.jsx($t,{id:"filter-platform",className:"mt-1.5",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部平台"}),X.map(re=>o.jsxs(De,{value:re,children:[re," (",D.platforms[re],")"]},re))]})]})]})]}),o.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 mt-4 pt-4 border-t",children:[o.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:B.size>0&&o.jsxs("span",{children:["已选择 ",B.size," 个人物"]})}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),o.jsxs(Vt,{value:c.toString(),onValueChange:re=>{d(parseInt(re)),l(1),H(new Set)},children:[o.jsx($t,{id:"page-size",className:"w-20",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"10",children:"10"}),o.jsx(De,{value:"20",children:"20"}),o.jsx(De,{value:"50",children:"50"}),o.jsx(De,{value:"100",children:"100"})]})]}),B.size>0&&o.jsxs(o.Fragment,{children:[o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>H(new Set),children:"取消选择"}),o.jsxs(ue,{variant:"destructive",size:"sm",onClick:te,children:[o.jsx(Cn,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card",children:[o.jsx("div",{className:"hidden md:block",children:o.jsxs(Af,{children:[o.jsx(Mf,{children:o.jsxs(zs,{children:[o.jsx(mn,{className:"w-12",children:o.jsx(Ci,{checked:t.length>0&&B.size===t.length,onCheckedChange:U,"aria-label":"全选"})}),o.jsx(mn,{children:"状态"}),o.jsx(mn,{children:"名称"}),o.jsx(mn,{children:"昵称"}),o.jsx(mn,{children:"平台"}),o.jsx(mn,{children:"用户ID"}),o.jsx(mn,{children:"最后更新"}),o.jsx(mn,{className:"text-right",children:"操作"})]})}),o.jsx(Rf,{children:n?o.jsx(zs,{children:o.jsx(Yt,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):t.length===0?o.jsx(zs,{children:o.jsx(Yt,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):t.map(re=>o.jsxs(zs,{children:[o.jsx(Yt,{children:o.jsx(Ci,{checked:B.has(re.person_id),onCheckedChange:()=>z(re.person_id),"aria-label":`选择 ${re.person_name||re.nickname||re.user_id}`})}),o.jsx(Yt,{children:o.jsx("div",{className:xe("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",re.is_known?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"),children:re.is_known?"已认识":"未认识"})}),o.jsx(Yt,{className:"font-medium",children:re.person_name||o.jsx("span",{className:"text-muted-foreground",children:"-"})}),o.jsx(Yt,{children:re.nickname||"-"}),o.jsx(Yt,{children:re.platform}),o.jsx(Yt,{className:"font-mono text-sm",children:re.user_id}),o.jsx(Yt,{className:"text-sm text-muted-foreground",children:se(re.last_know)}),o.jsx(Yt,{className:"text-right",children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsxs(ue,{variant:"default",size:"sm",onClick:()=>Y(re),children:[o.jsx(Ji,{className:"h-4 w-4 mr-1"}),"详情"]}),o.jsxs(ue,{variant:"default",size:"sm",onClick:()=>R(re),children:[o.jsx(F0,{className:"h-4 w-4 mr-1"}),"编辑"]}),o.jsxs(ue,{size:"sm",onClick:()=>A(re),className:"bg-red-600 hover:bg-red-700 text-white",children:[o.jsx(Cn,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},re.id))})]})}),o.jsx("div",{className:"md:hidden space-y-3 p-4",children:n?o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):t.length===0?o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):t.map(re=>o.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(Ci,{checked:B.has(re.person_id),onCheckedChange:()=>z(re.person_id),className:"mt-1"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:xe("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium mb-2",re.is_known?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"),children:re.is_known?"已认识":"未认识"}),o.jsx("h3",{className:"font-semibold text-sm line-clamp-1 w-full break-all",children:re.person_name||o.jsx("span",{className:"text-muted-foreground",children:"未命名"})}),re.nickname&&o.jsxs("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-1 w-full break-all",children:["昵称: ",re.nickname]})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"平台"}),o.jsx("p",{className:"font-medium text-xs",children:re.platform})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"用户ID"}),o.jsx("p",{className:"font-mono text-xs truncate",title:re.user_id,children:re.user_id})]}),o.jsxs("div",{className:"col-span-2",children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"最后更新"}),o.jsx("p",{className:"text-xs",children:se(re.last_know)})]})]}),o.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>Y(re),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[o.jsx(Ji,{className:"h-3 w-3 mr-1"}),"查看"]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>R(re),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[o.jsx(F0,{className:"h-3 w-3 mr-1"}),"编辑"]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>A(re),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[o.jsx(Cn,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},re.id))}),s>0&&o.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[o.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",s," 条记录,第 ",a," / ",Math.ceil(s/c)," 页"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>l(1),disabled:a===1,className:"hidden sm:flex",children:o.jsx(Ip,{className:"h-4 w-4"})}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>l(a-1),disabled:a===1,children:[o.jsx(wd,{className:"h-4 w-4 sm:mr-1"}),o.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Pe,{type:"number",value:I,onChange:re=>V(re.target.value),onKeyDown:re=>re.key==="Enter"&&G(),placeholder:a.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(s/c)}),o.jsx(ue,{variant:"outline",size:"sm",onClick:G,disabled:!I,className:"h-8",children:"跳转"})]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>l(a+1),disabled:a>=Math.ceil(s/c),children:[o.jsx("span",{className:"hidden sm:inline",children:"下一页"}),o.jsx(Zl,{className:"h-4 w-4 sm:ml-1"})]}),o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>l(Math.ceil(s/c)),disabled:a>=Math.ceil(s/c),className:"hidden sm:flex",children:o.jsx(Lp,{className:"h-4 w-4"})})]})]})]})]})}),o.jsx($Oe,{person:S,open:j,onOpenChange:N}),o.jsx(HOe,{person:S,open:T,onOpenChange:E,onSuccess:()=>{$(),K(),E(!1)}}),o.jsx(Fn,{open:!!_,onOpenChange:()=>A(null),children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:['确定要删除人物信息 "',_?.person_name||_?.nickname||_?.user_id,'" 吗? 此操作不可撤销。']})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>_&&ie(_),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),o.jsx(Fn,{open:W,onOpenChange:ee,children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认批量删除"}),o.jsxs(zn,{children:["确定要删除选中的 ",B.size," 个人物信息吗? 此操作不可撤销。"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:ne,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})})]})}function $Oe({person:t,open:e,onOpenChange:n}){if(!t)return null;const r=s=>s?new Date(s*1e3).toLocaleString("zh-CN"):"-";return o.jsx(Er,{open:e,onOpenChange:n,children:o.jsxs(wr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"人物详情"}),o.jsxs(Xr,{children:["查看 ",t.person_name||t.nickname||t.user_id," 的完整信息"]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsx(kl,{icon:Lv,label:"人物名称",value:t.person_name}),o.jsx(kl,{icon:Gh,label:"昵称",value:t.nickname}),o.jsx(kl,{icon:lk,label:"用户ID",value:t.user_id,mono:!0}),o.jsx(kl,{icon:lk,label:"人物ID",value:t.person_id,mono:!0}),o.jsx(kl,{label:"平台",value:t.platform}),o.jsx(kl,{label:"状态",value:t.is_known?"已认识":"未认识"})]}),t.name_reason&&o.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[o.jsx(he,{className:"text-xs text-muted-foreground",children:"名称设定原因"}),o.jsx("p",{className:"mt-1 text-sm",children:t.name_reason})]}),t.memory_points&&o.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[o.jsx(he,{className:"text-xs text-muted-foreground",children:"个人印象"}),o.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:t.memory_points})]}),t.group_nick_name&&t.group_nick_name.length>0&&o.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[o.jsx(he,{className:"text-xs text-muted-foreground",children:"群昵称"}),o.jsx("div",{className:"mt-2 space-y-1",children:t.group_nick_name.map((s,i)=>o.jsxs("div",{className:"text-sm flex items-center gap-2",children:[o.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:s.group_id}),o.jsx("span",{children:"→"}),o.jsx("span",{children:s.group_nick_name})]},i))})]}),o.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[o.jsx(kl,{icon:Mh,label:"认识时间",value:r(t.know_times)}),o.jsx(kl,{icon:Mh,label:"首次记录",value:r(t.know_since)}),o.jsx(kl,{icon:Mh,label:"最后更新",value:r(t.last_know)})]})]}),o.jsx(fs,{children:o.jsx(ue,{onClick:()=>n(!1),children:"关闭"})})]})})}function kl({icon:t,label:e,value:n,mono:r=!1}){return o.jsxs("div",{className:"space-y-1",children:[o.jsxs(he,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[t&&o.jsx(t,{className:"h-3 w-3"}),e]}),o.jsx("div",{className:xe("text-sm",r&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function HOe({person:t,open:e,onOpenChange:n,onSuccess:r}){const[s,i]=b.useState({}),[a,l]=b.useState(!1),{toast:c}=Lr();b.useEffect(()=>{t&&i({person_name:t.person_name||"",name_reason:t.name_reason||"",nickname:t.nickname||"",memory_points:t.memory_points||"",is_known:t.is_known})},[t]);const d=async()=>{if(t)try{l(!0),await IOe(t.person_id,s),c({title:"保存成功",description:"人物信息已更新"}),r()}catch(h){c({title:"保存失败",description:h instanceof Error?h.message:"无法更新人物信息",variant:"destructive"})}finally{l(!1)}};return t?o.jsx(Er,{open:e,onOpenChange:n,children:o.jsxs(wr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"编辑人物信息"}),o.jsxs(Xr,{children:["修改 ",t.person_name||t.nickname||t.user_id," 的信息"]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"person_name",children:"人物名称"}),o.jsx(Pe,{id:"person_name",value:s.person_name||"",onChange:h=>i({...s,person_name:h.target.value}),placeholder:"为这个人设置一个名称"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"nickname",children:"昵称"}),o.jsx(Pe,{id:"nickname",value:s.nickname||"",onChange:h=>i({...s,nickname:h.target.value}),placeholder:"昵称"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"name_reason",children:"名称设定原因"}),o.jsx(Nr,{id:"name_reason",value:s.name_reason||"",onChange:h=>i({...s,name_reason:h.target.value}),placeholder:"为什么这样称呼这个人?",rows:2})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"memory_points",children:"个人印象"}),o.jsx(Nr,{id:"memory_points",value:s.memory_points||"",onChange:h=>i({...s,memory_points:h.target.value}),placeholder:"对这个人的印象和记忆点...",rows:4})]}),o.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[o.jsxs("div",{children:[o.jsx(he,{htmlFor:"is_known",className:"text-base font-medium",children:"已认识"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"标记是否已经认识这个人"})]}),o.jsx(Ft,{id:"is_known",checked:s.is_known,onCheckedChange:h=>i({...s,is_known:h})})]})]}),o.jsxs(fs,{children:[o.jsx(ue,{variant:"outline",onClick:()=>n(!1),children:"取消"}),o.jsx(ue,{onClick:d,disabled:a,children:a?"保存中...":"保存"})]})]})}):null}function Ls(t){if(typeof t=="string"||typeof t=="number")return""+t;let e="";if(Array.isArray(t))for(let n=0,r;n{let e;const n=new Set,r=(h,m)=>{const g=typeof h=="function"?h(e):h;if(!Object.is(g,e)){const x=e;e=m??(typeof g!="object"||g===null)?g:Object.assign({},e,g),n.forEach(y=>y(e,x))}},s=()=>e,c={setState:r,getState:s,getInitialState:()=>d,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(QOe?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=e=t(r,s,c);return c},VOe=t=>t?iD(t):iD,{useDebugValue:UOe}=oe,{useSyncExternalStoreWithSelector:WOe}=yJ,GOe=t=>t;function tW(t,e=GOe,n){const r=WOe(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return UOe(r),r}const aD=(t,e)=>{const n=VOe(t),r=(s,i=e)=>tW(n,s,i);return Object.assign(r,n),r},XOe=(t,e)=>t?aD(t,e):aD;function ks(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[r,s]of t)if(!Object.is(s,e.get(r)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const r of t)if(!e.has(r))return!1;return!0}const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(e,r)||!Object.is(t[r],e[r]))return!1;return!0}var YOe={value:()=>{}};function Zb(){for(var t=0,e=arguments.length,n={},r;t=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}_v.prototype=Zb.prototype={constructor:_v,on:function(t,e){var n=this._,r=KOe(t+"",n),s,i=-1,a=r.length;if(arguments.length<2){for(;++i0)for(var n=new Array(s),r=0,s,i;r=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),lD.hasOwnProperty(e)?{space:lD[e],local:t}:t}function JOe(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===ZO&&e.documentElement.namespaceURI===ZO?e.createElement(t):e.createElementNS(n,t)}}function eje(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function nW(t){var e=Jb(t);return(e.local?eje:JOe)(e)}function tje(){}function KN(t){return t==null?tje:function(){return this.querySelector(t)}}function nje(t){typeof t!="function"&&(t=KN(t));for(var e=this._groups,n=e.length,r=new Array(n),s=0;s=N&&(N=j+1);!(E=S[N])&&++N=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function Cje(t){t||(t=Tje);function e(m,g){return m&&g?t(m.__data__,g.__data__):!m-!g}for(var n=this._groups,r=n.length,s=new Array(r),i=0;ie?1:t>=e?0:NaN}function Eje(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function _je(){return Array.from(this)}function Aje(){for(var t=this._groups,e=0,n=t.length;e1?this.each((e==null?$je:typeof e=="function"?Qje:Hje)(t,e,n??"")):mf(this.node(),t)}function mf(t,e){return t.style.getPropertyValue(e)||oW(t).getComputedStyle(t,null).getPropertyValue(e)}function Uje(t){return function(){delete this[t]}}function Wje(t,e){return function(){this[t]=e}}function Gje(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Xje(t,e){return arguments.length>1?this.each((e==null?Uje:typeof e=="function"?Gje:Wje)(t,e)):this.node()[t]}function lW(t){return t.trim().split(/^|\s+/)}function ZN(t){return t.classList||new cW(t)}function cW(t){this._node=t,this._names=lW(t.getAttribute("class")||"")}cW.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function uW(t,e){for(var n=ZN(t),r=-1,s=e.length;++r=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function k6e(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,s=e.length,i;n()=>t;function JO(t,{sourceEvent:e,subject:n,target:r,identifier:s,active:i,x:a,y:l,dx:c,dy:d,dispatch:h}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:h}})}JO.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function R6e(t){return!t.ctrlKey&&!t.button}function D6e(){return this.parentNode}function P6e(t,e){return e??{x:t.x,y:t.y}}function z6e(){return navigator.maxTouchPoints||"ontouchstart"in this}function I6e(){var t=R6e,e=D6e,n=P6e,r=z6e,s={},i=Zb("start","drag","end"),a=0,l,c,d,h,m=0;function g(T){T.on("mousedown.drag",x).filter(r).on("touchstart.drag",S).on("touchmove.drag",k,M6e).on("touchend.drag touchcancel.drag",j).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(T,E){if(!(h||!t.call(this,T,E))){var _=N(this,e.call(this,T,E),T,E,"mouse");_&&(va(T.view).on("mousemove.drag",y,kp).on("mouseup.drag",w,kp),mW(T.view),d5(T),d=!1,l=T.clientX,c=T.clientY,_("start",T))}}function y(T){if(Qh(T),!d){var E=T.clientX-l,_=T.clientY-c;d=E*E+_*_>m}s.mouse("drag",T)}function w(T){va(T.view).on("mousemove.drag mouseup.drag",null),pW(T.view,d),Qh(T),s.mouse("end",T)}function S(T,E){if(t.call(this,T,E)){var _=T.changedTouches,A=e.call(this,T,E),D=_.length,q,B;for(q=0;q=0&&t._call.call(void 0,e),t=t._next;--pf}function cD(){xd=(Dy=Op.now())+ew,pf=m0=0;try{B6e()}finally{pf=0,q6e(),xd=0}}function F6e(){var t=Op.now(),e=t-Dy;e>gW&&(ew-=e,Dy=t)}function q6e(){for(var t,e=Ry,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Ry=n);p0=t,ej(r)}function ej(t){if(!pf){m0&&(m0=clearTimeout(m0));var e=t-xd;e>24?(t<1/0&&(m0=setTimeout(cD,t-Op.now()-ew)),n0&&(n0=clearInterval(n0))):(n0||(Dy=Op.now(),n0=setInterval(F6e,gW)),pf=1,xW(cD))}}function uD(t,e,n){var r=new Py;return e=e==null?0:+e,r.restart(s=>{r.stop(),t(s+e)},e,n),r}var $6e=Zb("start","end","cancel","interrupt"),H6e=[],yW=0,dD=1,tj=2,Av=3,hD=4,nj=5,Mv=6;function tw(t,e,n,r,s,i){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;Q6e(t,n,{name:e,index:r,group:s,on:$6e,tween:H6e,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:yW})}function e7(t,e){var n=oo(t,e);if(n.state>yW)throw new Error("too late; already scheduled");return n}function Ko(t,e){var n=oo(t,e);if(n.state>Av)throw new Error("too late; already running");return n}function oo(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Q6e(t,e,n){var r=t.__transition,s;r[e]=n,n.timer=vW(i,0,n.time);function i(d){n.state=dD,n.timer.restart(a,n.delay,n.time),n.delay<=d&&a(d-n.delay)}function a(d){var h,m,g,x;if(n.state!==dD)return c();for(h in r)if(x=r[h],x.name===n.name){if(x.state===Av)return uD(a);x.state===hD?(x.state=Mv,x.timer.stop(),x.on.call("interrupt",t,t.__data__,x.index,x.group),delete r[h]):+htj&&r.state=0&&(e=e.slice(0,n)),!e||e==="start"})}function bNe(t,e,n){var r,s,i=yNe(e)?e7:Ko;return function(){var a=i(this,t),l=a.on;l!==r&&(s=(r=l).copy()).on(e,n),a.on=s}}function wNe(t,e){var n=this._id;return arguments.length<2?oo(this.node(),n).on.on(t):this.each(bNe(n,t,e))}function SNe(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function kNe(){return this.on("end.remove",SNe(this._id))}function ONe(t){var e=this._name,n=this._id;typeof t!="function"&&(t=KN(t));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>t;function XNe(t,{sourceEvent:e,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function zl(t,e,n){this.k=t,this.x=e,this.y=n}zl.prototype={constructor:zl,scale:function(t){return t===1?this:new zl(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new zl(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var $l=new zl(1,0,0);zl.prototype;function h5(t){t.stopImmediatePropagation()}function r0(t){t.preventDefault(),t.stopImmediatePropagation()}function YNe(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function KNe(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function fD(){return this.__zoom||$l}function ZNe(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function JNe(){return navigator.maxTouchPoints||"ontouchstart"in this}function e7e(t,e,n){var r=t.invertX(e[0][0])-n[0][0],s=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function kW(){var t=YNe,e=KNe,n=e7e,r=ZNe,s=JNe,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=$J,d=Zb("start","zoom","end"),h,m,g,x=500,y=150,w=0,S=10;function k(I){I.property("__zoom",fD).on("wheel.zoom",D,{passive:!1}).on("mousedown.zoom",q).on("dblclick.zoom",B).filter(s).on("touchstart.zoom",H).on("touchmove.zoom",W).on("touchend.zoom touchcancel.zoom",ee).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(I,V,L,$){var K=I.selection?I.selection():I;K.property("__zoom",fD),I!==K?E(I,V,L,$):K.interrupt().each(function(){_(this,arguments).event($).start().zoom(null,typeof V=="function"?V.apply(this,arguments):V).end()})},k.scaleBy=function(I,V,L,$){k.scaleTo(I,function(){var K=this.__zoom.k,Y=typeof V=="function"?V.apply(this,arguments):V;return K*Y},L,$)},k.scaleTo=function(I,V,L,$){k.transform(I,function(){var K=e.apply(this,arguments),Y=this.__zoom,R=L==null?T(K):typeof L=="function"?L.apply(this,arguments):L,ie=Y.invert(R),X=typeof V=="function"?V.apply(this,arguments):V;return n(N(j(Y,X),R,ie),K,a)},L,$)},k.translateBy=function(I,V,L,$){k.transform(I,function(){return n(this.__zoom.translate(typeof V=="function"?V.apply(this,arguments):V,typeof L=="function"?L.apply(this,arguments):L),e.apply(this,arguments),a)},null,$)},k.translateTo=function(I,V,L,$,K){k.transform(I,function(){var Y=e.apply(this,arguments),R=this.__zoom,ie=$==null?T(Y):typeof $=="function"?$.apply(this,arguments):$;return n($l.translate(ie[0],ie[1]).scale(R.k).translate(typeof V=="function"?-V.apply(this,arguments):-V,typeof L=="function"?-L.apply(this,arguments):-L),Y,a)},$,K)};function j(I,V){return V=Math.max(i[0],Math.min(i[1],V)),V===I.k?I:new zl(V,I.x,I.y)}function N(I,V,L){var $=V[0]-L[0]*I.k,K=V[1]-L[1]*I.k;return $===I.x&&K===I.y?I:new zl(I.k,$,K)}function T(I){return[(+I[0][0]+ +I[1][0])/2,(+I[0][1]+ +I[1][1])/2]}function E(I,V,L,$){I.on("start.zoom",function(){_(this,arguments).event($).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event($).end()}).tween("zoom",function(){var K=this,Y=arguments,R=_(K,Y).event($),ie=e.apply(K,Y),X=L==null?T(ie):typeof L=="function"?L.apply(K,Y):L,z=Math.max(ie[1][0]-ie[0][0],ie[1][1]-ie[0][1]),U=K.__zoom,te=typeof V=="function"?V.apply(K,Y):V,ne=c(U.invert(X).concat(z/U.k),te.invert(X).concat(z/te.k));return function(G){if(G===1)G=te;else{var se=ne(G),re=z/se[2];G=new zl(re,X[0]-se[0]*re,X[1]-se[1]*re)}R.zoom(null,G)}})}function _(I,V,L){return!L&&I.__zooming||new A(I,V)}function A(I,V){this.that=I,this.args=V,this.active=0,this.sourceEvent=null,this.extent=e.apply(I,V),this.taps=0}A.prototype={event:function(I){return I&&(this.sourceEvent=I),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(I,V){return this.mouse&&I!=="mouse"&&(this.mouse[1]=V.invert(this.mouse[0])),this.touch0&&I!=="touch"&&(this.touch0[1]=V.invert(this.touch0[0])),this.touch1&&I!=="touch"&&(this.touch1[1]=V.invert(this.touch1[0])),this.that.__zoom=V,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(I){var V=va(this.that).datum();d.call(I,this.that,new XNe(I,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:d}),V)}};function D(I,...V){if(!t.apply(this,arguments))return;var L=_(this,V).event(I),$=this.__zoom,K=Math.max(i[0],Math.min(i[1],$.k*Math.pow(2,r.apply(this,arguments)))),Y=Qa(I);if(L.wheel)(L.mouse[0][0]!==Y[0]||L.mouse[0][1]!==Y[1])&&(L.mouse[1]=$.invert(L.mouse[0]=Y)),clearTimeout(L.wheel);else{if($.k===K)return;L.mouse=[Y,$.invert(Y)],Rv(this),L.start()}r0(I),L.wheel=setTimeout(R,y),L.zoom("mouse",n(N(j($,K),L.mouse[0],L.mouse[1]),L.extent,a));function R(){L.wheel=null,L.end()}}function q(I,...V){if(g||!t.apply(this,arguments))return;var L=I.currentTarget,$=_(this,V,!0).event(I),K=va(I.view).on("mousemove.zoom",X,!0).on("mouseup.zoom",z,!0),Y=Qa(I,L),R=I.clientX,ie=I.clientY;mW(I.view),h5(I),$.mouse=[Y,this.__zoom.invert(Y)],Rv(this),$.start();function X(U){if(r0(U),!$.moved){var te=U.clientX-R,ne=U.clientY-ie;$.moved=te*te+ne*ne>w}$.event(U).zoom("mouse",n(N($.that.__zoom,$.mouse[0]=Qa(U,L),$.mouse[1]),$.extent,a))}function z(U){K.on("mousemove.zoom mouseup.zoom",null),pW(U.view,$.moved),r0(U),$.event(U).end()}}function B(I,...V){if(t.apply(this,arguments)){var L=this.__zoom,$=Qa(I.changedTouches?I.changedTouches[0]:I,this),K=L.invert($),Y=L.k*(I.shiftKey?.5:2),R=n(N(j(L,Y),$,K),e.apply(this,V),a);r0(I),l>0?va(this).transition().duration(l).call(E,R,$,I):va(this).call(k.transform,R,$,I)}}function H(I,...V){if(t.apply(this,arguments)){var L=I.touches,$=L.length,K=_(this,V,I.changedTouches.length===$).event(I),Y,R,ie,X;for(h5(I),R=0;R<$;++R)ie=L[R],X=Qa(ie,this),X=[X,this.__zoom.invert(X),ie.identifier],K.touch0?!K.touch1&&K.touch0[2]!==X[2]&&(K.touch1=X,K.taps=0):(K.touch0=X,Y=!0,K.taps=1+!!h);h&&(h=clearTimeout(h)),Y&&(K.taps<2&&(m=X[0],h=setTimeout(function(){h=null},x)),Rv(this),K.start())}}function W(I,...V){if(this.__zooming){var L=_(this,V).event(I),$=I.changedTouches,K=$.length,Y,R,ie,X;for(r0(I),Y=0;Y"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,e)=>`Couldn't create edge for ${t?"target":"source"} handle id: "${t?e.targetHandle:e.sourceHandle}", edge id: ${e.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},OW=Yl.error001();function gr(t,e){const n=b.useContext(nw);if(n===null)throw new Error(OW);return tW(n,t,e)}const gs=()=>{const t=b.useContext(nw);if(t===null)throw new Error(OW);return b.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe,destroy:t.destroy}),[t])},n7e=t=>t.userSelectionActive?"none":"all";function rw({position:t,children:e,className:n,style:r,...s}){const i=gr(n7e),a=`${t}`.split("-");return oe.createElement("div",{className:Ls(["react-flow__panel",n,...a]),style:{...r,pointerEvents:i},...s},e)}function r7e({proOptions:t,position:e="bottom-right"}){return t?.hideAttribution?null:oe.createElement(rw,{position:e,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},oe.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const s7e=({x:t,y:e,label:n,labelStyle:r={},labelShowBg:s=!0,labelBgStyle:i={},labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:c,className:d,...h})=>{const m=b.useRef(null),[g,x]=b.useState({x:0,y:0,width:0,height:0}),y=Ls(["react-flow__edge-textwrapper",d]);return b.useEffect(()=>{if(m.current){const w=m.current.getBBox();x({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),typeof n>"u"||!n?null:oe.createElement("g",{transform:`translate(${t-g.width/2} ${e-g.height/2})`,className:y,visibility:g.width?"visible":"hidden",...h},s&&oe.createElement("rect",{width:g.width+2*a[0],x:-a[0],y:-a[1],height:g.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),oe.createElement("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:m,style:r},n),c)};var i7e=b.memo(s7e);const n7=t=>({width:t.offsetWidth,height:t.offsetHeight}),gf=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),r7=(t={x:0,y:0},e)=>({x:gf(t.x,e[0][0],e[1][0]),y:gf(t.y,e[0][1],e[1][1])}),mD=(t,e,n)=>tn?-gf(Math.abs(t-n),1,50)/50:0,jW=(t,e)=>{const n=mD(t.x,35,e.width-35)*20,r=mD(t.y,35,e.height-35)*20;return[n,r]},NW=t=>t.getRootNode?.()||window?.document,CW=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),jp=({x:t,y:e,width:n,height:r})=>({x:t,y:e,x2:t+n,y2:e+r}),TW=({x:t,y:e,x2:n,y2:r})=>({x:t,y:e,width:n-t,height:r-e}),pD=t=>({...t.positionAbsolute||{x:0,y:0},width:t.width||0,height:t.height||0}),a7e=(t,e)=>TW(CW(jp(t),jp(e))),rj=(t,e)=>{const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),r=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*r)},o7e=t=>Ca(t.width)&&Ca(t.height)&&Ca(t.x)&&Ca(t.y),Ca=t=>!isNaN(t)&&isFinite(t),$r=Symbol.for("internals"),EW=["Enter"," ","Escape"],l7e=(t,e)=>{},c7e=t=>"nativeEvent"in t;function sj(t){const n=(c7e(t)?t.nativeEvent:t).composedPath?.()?.[0]||t.target;return["INPUT","SELECT","TEXTAREA"].includes(n?.nodeName)||n?.hasAttribute("contenteditable")||!!n?.closest(".nokey")}const _W=t=>"clientX"in t,Wc=(t,e)=>{const n=_W(t),r=n?t.clientX:t.touches?.[0].clientX,s=n?t.clientY:t.touches?.[0].clientY;return{x:r-(e?.left??0),y:s-(e?.top??0)}},zy=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0,kg=({id:t,path:e,labelX:n,labelY:r,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d,style:h,markerEnd:m,markerStart:g,interactionWidth:x=20})=>oe.createElement(oe.Fragment,null,oe.createElement("path",{id:t,style:h,d:e,fill:"none",className:"react-flow__edge-path",markerEnd:m,markerStart:g}),x&&oe.createElement("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:x,className:"react-flow__edge-interaction"}),s&&Ca(n)&&Ca(r)?oe.createElement(i7e,{x:n,y:r,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d}):null);kg.displayName="BaseEdge";function s0(t,e,n){return n===void 0?n:r=>{const s=e().edges.find(i=>i.id===t);s&&n(r,{...s})}}function AW({sourceX:t,sourceY:e,targetX:n,targetY:r}){const s=Math.abs(n-t)/2,i=n{const[S,k,j]=RW({sourceX:t,sourceY:e,sourcePosition:s,targetX:n,targetY:r,targetPosition:i});return oe.createElement(kg,{path:S,labelX:k,labelY:j,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:y,interactionWidth:w})});s7.displayName="SimpleBezierEdge";const xD={[kt.Left]:{x:-1,y:0},[kt.Right]:{x:1,y:0},[kt.Top]:{x:0,y:-1},[kt.Bottom]:{x:0,y:1}},u7e=({source:t,sourcePosition:e=kt.Bottom,target:n})=>e===kt.Left||e===kt.Right?t.xMath.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function d7e({source:t,sourcePosition:e=kt.Bottom,target:n,targetPosition:r=kt.Top,center:s,offset:i}){const a=xD[e],l=xD[r],c={x:t.x+a.x*i,y:t.y+a.y*i},d={x:n.x+l.x*i,y:n.y+l.y*i},h=u7e({source:c,sourcePosition:e,target:d}),m=h.x!==0?"x":"y",g=h[m];let x=[],y,w;const S={x:0,y:0},k={x:0,y:0},[j,N,T,E]=AW({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(a[m]*l[m]===-1){y=s.x??j,w=s.y??N;const A=[{x:y,y:c.y},{x:y,y:d.y}],D=[{x:c.x,y:w},{x:d.x,y:w}];a[m]===g?x=m==="x"?A:D:x=m==="x"?D:A}else{const A=[{x:c.x,y:d.y}],D=[{x:d.x,y:c.y}];if(m==="x"?x=a.x===g?D:A:x=a.y===g?A:D,e===r){const ee=Math.abs(t[m]-n[m]);if(ee<=i){const I=Math.min(i-1,i-ee);a[m]===g?S[m]=(c[m]>t[m]?-1:1)*I:k[m]=(d[m]>n[m]?-1:1)*I}}if(e!==r){const ee=m==="x"?"y":"x",I=a[m]===l[ee],V=c[ee]>d[ee],L=c[ee]=W?(y=(q.x+B.x)/2,w=x[0].y):(y=x[0].x,w=(q.y+B.y)/2)}return[[t,{x:c.x+S.x,y:c.y+S.y},...x,{x:d.x+k.x,y:d.y+k.y},n],y,w,T,E]}function h7e(t,e,n,r){const s=Math.min(vD(t,e)/2,vD(e,n)/2,r),{x:i,y:a}=e;if(t.x===i&&i===n.x||t.y===a&&a===n.y)return`L${i} ${a}`;if(t.y===a){const d=t.x{let N="";return j>0&&j{const[k,j,N]=ij({sourceX:t,sourceY:e,sourcePosition:m,targetX:n,targetY:r,targetPosition:g,borderRadius:w?.borderRadius,offset:w?.offset});return oe.createElement(kg,{path:k,labelX:j,labelY:N,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d,style:h,markerEnd:x,markerStart:y,interactionWidth:S})});sw.displayName="SmoothStepEdge";const i7=b.memo(t=>oe.createElement(sw,{...t,pathOptions:b.useMemo(()=>({borderRadius:0,offset:t.pathOptions?.offset}),[t.pathOptions?.offset])}));i7.displayName="StepEdge";function f7e({sourceX:t,sourceY:e,targetX:n,targetY:r}){const[s,i,a,l]=AW({sourceX:t,sourceY:e,targetX:n,targetY:r});return[`M ${t},${e}L ${n},${r}`,s,i,a,l]}const a7=b.memo(({sourceX:t,sourceY:e,targetX:n,targetY:r,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d,style:h,markerEnd:m,markerStart:g,interactionWidth:x})=>{const[y,w,S]=f7e({sourceX:t,sourceY:e,targetX:n,targetY:r});return oe.createElement(kg,{path:y,labelX:w,labelY:S,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d,style:h,markerEnd:m,markerStart:g,interactionWidth:x})});a7.displayName="StraightEdge";function W1(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function yD({pos:t,x1:e,y1:n,x2:r,y2:s,c:i}){switch(t){case kt.Left:return[e-W1(e-r,i),n];case kt.Right:return[e+W1(r-e,i),n];case kt.Top:return[e,n-W1(n-s,i)];case kt.Bottom:return[e,n+W1(s-n,i)]}}function DW({sourceX:t,sourceY:e,sourcePosition:n=kt.Bottom,targetX:r,targetY:s,targetPosition:i=kt.Top,curvature:a=.25}){const[l,c]=yD({pos:n,x1:t,y1:e,x2:r,y2:s,c:a}),[d,h]=yD({pos:i,x1:r,y1:s,x2:t,y2:e,c:a}),[m,g,x,y]=MW({sourceX:t,sourceY:e,targetX:r,targetY:s,sourceControlX:l,sourceControlY:c,targetControlX:d,targetControlY:h});return[`M${t},${e} C${l},${c} ${d},${h} ${r},${s}`,m,g,x,y]}const Ly=b.memo(({sourceX:t,sourceY:e,targetX:n,targetY:r,sourcePosition:s=kt.Bottom,targetPosition:i=kt.Top,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:y,pathOptions:w,interactionWidth:S})=>{const[k,j,N]=DW({sourceX:t,sourceY:e,sourcePosition:s,targetX:n,targetY:r,targetPosition:i,curvature:w?.curvature});return oe.createElement(kg,{path:k,labelX:j,labelY:N,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:y,interactionWidth:S})});Ly.displayName="BezierEdge";const o7=b.createContext(null),m7e=o7.Provider;o7.Consumer;const p7e=()=>b.useContext(o7),g7e=t=>"id"in t&&"source"in t&&"target"in t,x7e=({source:t,sourceHandle:e,target:n,targetHandle:r})=>`reactflow__edge-${t}${e||""}-${n}${r||""}`,aj=(t,e)=>typeof t>"u"?"":typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(r=>`${r}=${t[r]}`).join("&")}`,v7e=(t,e)=>e.some(n=>n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle)),y7e=(t,e)=>{if(!t.source||!t.target)return e;let n;return g7e(t)?n={...t}:n={...t,id:x7e(t)},v7e(n,e)?e:e.concat(n)},oj=({x:t,y:e},[n,r,s],i,[a,l])=>{const c={x:(t-n)/s,y:(e-r)/s};return i?{x:a*Math.round(c.x/a),y:l*Math.round(c.y/l)}:c},PW=({x:t,y:e},[n,r,s])=>({x:t*s+n,y:e*s+r}),id=(t,e=[0,0])=>{if(!t)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(t.width??0)*e[0],r=(t.height??0)*e[1],s={x:t.position.x-n,y:t.position.y-r};return{...s,positionAbsolute:t.positionAbsolute?{x:t.positionAbsolute.x-n,y:t.positionAbsolute.y-r}:s}},iw=(t,e=[0,0])=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const n=t.reduce((r,s)=>{const{x:i,y:a}=id(s,e).positionAbsolute;return CW(r,jp({x:i,y:a,width:s.width||0,height:s.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return TW(n)},zW=(t,e,[n,r,s]=[0,0,1],i=!1,a=!1,l=[0,0])=>{const c={x:(e.x-n)/s,y:(e.y-r)/s,width:e.width/s,height:e.height/s},d=[];return t.forEach(h=>{const{width:m,height:g,selectable:x=!0,hidden:y=!1}=h;if(a&&!x||y)return!1;const{positionAbsolute:w}=id(h,l),S={x:w.x,y:w.y,width:m||0,height:g||0},k=rj(c,S),j=typeof m>"u"||typeof g>"u"||m===null||g===null,N=i&&k>0,T=(m||0)*(g||0);(j||N||k>=T||h.dragging)&&d.push(h)}),d},IW=(t,e)=>{const n=t.map(r=>r.id);return e.filter(r=>n.includes(r.source)||n.includes(r.target))},LW=(t,e,n,r,s,i=.1)=>{const a=e/(t.width*(1+i)),l=n/(t.height*(1+i)),c=Math.min(a,l),d=gf(c,r,s),h=t.x+t.width/2,m=t.y+t.height/2,g=e/2-h*d,x=n/2-m*d;return{x:g,y:x,zoom:d}},qu=(t,e=0)=>t.transition().duration(e);function bD(t,e,n,r){return(e[n]||[]).reduce((s,i)=>(`${t.id}-${i.id}-${n}`!==r&&s.push({id:i.id||null,type:n,nodeId:t.id,x:(t.positionAbsolute?.x??0)+i.x+i.width/2,y:(t.positionAbsolute?.y??0)+i.y+i.height/2}),s),[])}function b7e(t,e,n,r,s,i){const{x:a,y:l}=Wc(t),d=e.elementsFromPoint(a,l).find(y=>y.classList.contains("react-flow__handle"));if(d){const y=d.getAttribute("data-nodeid");if(y){const w=l7(void 0,d),S=d.getAttribute("data-handleid"),k=i({nodeId:y,id:S,type:w});if(k){const j=s.find(N=>N.nodeId===y&&N.type===w&&N.id===S);return{handle:{id:S,type:w,nodeId:y,x:j?.x||n.x,y:j?.y||n.y},validHandleResult:k}}}}let h=[],m=1/0;if(s.forEach(y=>{const w=Math.sqrt((y.x-n.x)**2+(y.y-n.y)**2);if(w<=r){const S=i(y);w<=m&&(wy.isValid),x=h.some(({handle:y})=>y.type==="target");return h.find(({handle:y,validHandleResult:w})=>x?y.type==="target":g?w.isValid:!0)||h[0]}const w7e={source:null,target:null,sourceHandle:null,targetHandle:null},BW=()=>({handleDomNode:null,isValid:!1,connection:w7e,endHandle:null});function FW(t,e,n,r,s,i,a){const l=s==="target",c=a.querySelector(`.react-flow__handle[data-id="${t?.nodeId}-${t?.id}-${t?.type}"]`),d={...BW(),handleDomNode:c};if(c){const h=l7(void 0,c),m=c.getAttribute("data-nodeid"),g=c.getAttribute("data-handleid"),x=c.classList.contains("connectable"),y=c.classList.contains("connectableend"),w={source:l?m:n,sourceHandle:l?g:r,target:l?n:m,targetHandle:l?r:g};d.connection=w,x&&y&&(e===vd.Strict?l&&h==="source"||!l&&h==="target":m!==n||g!==r)&&(d.endHandle={nodeId:m,handleId:g,type:h},d.isValid=i(w))}return d}function S7e({nodes:t,nodeId:e,handleId:n,handleType:r}){return t.reduce((s,i)=>{if(i[$r]){const{handleBounds:a}=i[$r];let l=[],c=[];a&&(l=bD(i,a,"source",`${e}-${n}-${r}`),c=bD(i,a,"target",`${e}-${n}-${r}`)),s.push(...l,...c)}return s},[])}function l7(t,e){return t||(e?.classList.contains("target")?"target":e?.classList.contains("source")?"source":null)}function f5(t){t?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function k7e(t,e){let n=null;return e?n="valid":t&&!e&&(n="invalid"),n}function qW({event:t,handleId:e,nodeId:n,onConnect:r,isTarget:s,getState:i,setState:a,isValidConnection:l,edgeUpdaterType:c,onReconnectEnd:d}){const h=NW(t.target),{connectionMode:m,domNode:g,autoPanOnConnect:x,connectionRadius:y,onConnectStart:w,panBy:S,getNodes:k,cancelConnection:j}=i();let N=0,T;const{x:E,y:_}=Wc(t),A=h?.elementFromPoint(E,_),D=l7(c,A),q=g?.getBoundingClientRect();if(!q||!D)return;let B,H=Wc(t,q),W=!1,ee=null,I=!1,V=null;const L=S7e({nodes:k(),nodeId:n,handleId:e,handleType:D}),$=()=>{if(!x)return;const[R,ie]=jW(H,q);S({x:R,y:ie}),N=requestAnimationFrame($)};a({connectionPosition:H,connectionStatus:null,connectionNodeId:n,connectionHandleId:e,connectionHandleType:D,connectionStartHandle:{nodeId:n,handleId:e,type:D},connectionEndHandle:null}),w?.(t,{nodeId:n,handleId:e,handleType:D});function K(R){const{transform:ie}=i();H=Wc(R,q);const{handle:X,validHandleResult:z}=b7e(R,h,oj(H,ie,!1,[1,1]),y,L,U=>FW(U,m,n,e,s?"target":"source",l,h));if(T=X,W||($(),W=!0),V=z.handleDomNode,ee=z.connection,I=z.isValid,a({connectionPosition:T&&I?PW({x:T.x,y:T.y},ie):H,connectionStatus:k7e(!!T,I),connectionEndHandle:z.endHandle}),!T&&!I&&!V)return f5(B);ee.source!==ee.target&&V&&(f5(B),B=V,V.classList.add("connecting","react-flow__handle-connecting"),V.classList.toggle("valid",I),V.classList.toggle("react-flow__handle-valid",I))}function Y(R){(T||V)&&ee&&I&&r?.(ee),i().onConnectEnd?.(R),c&&d?.(R),f5(B),j(),cancelAnimationFrame(N),W=!1,I=!1,ee=null,V=null,h.removeEventListener("mousemove",K),h.removeEventListener("mouseup",Y),h.removeEventListener("touchmove",K),h.removeEventListener("touchend",Y)}h.addEventListener("mousemove",K),h.addEventListener("mouseup",Y),h.addEventListener("touchmove",K),h.addEventListener("touchend",Y)}const wD=()=>!0,O7e=t=>({connectionStartHandle:t.connectionStartHandle,connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName}),j7e=(t,e,n)=>r=>{const{connectionStartHandle:s,connectionEndHandle:i,connectionClickStartHandle:a}=r;return{connecting:s?.nodeId===t&&s?.handleId===e&&s?.type===n||i?.nodeId===t&&i?.handleId===e&&i?.type===n,clickConnecting:a?.nodeId===t&&a?.handleId===e&&a?.type===n}},$W=b.forwardRef(({type:t="source",position:e=kt.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:l,children:c,className:d,onMouseDown:h,onTouchStart:m,...g},x)=>{const y=a||null,w=t==="target",S=gs(),k=p7e(),{connectOnClick:j,noPanClassName:N}=gr(O7e,ks),{connecting:T,clickConnecting:E}=gr(j7e(k,y,t),ks);k||S.getState().onError?.("010",Yl.error010());const _=q=>{const{defaultEdgeOptions:B,onConnect:H,hasDefaultEdges:W}=S.getState(),ee={...B,...q};if(W){const{edges:I,setEdges:V}=S.getState();V(y7e(ee,I))}H?.(ee),l?.(ee)},A=q=>{if(!k)return;const B=_W(q);s&&(B&&q.button===0||!B)&&qW({event:q,handleId:y,nodeId:k,onConnect:_,isTarget:w,getState:S.getState,setState:S.setState,isValidConnection:n||S.getState().isValidConnection||wD}),B?h?.(q):m?.(q)},D=q=>{const{onClickConnectStart:B,onClickConnectEnd:H,connectionClickStartHandle:W,connectionMode:ee,isValidConnection:I}=S.getState();if(!k||!W&&!s)return;if(!W){B?.(q,{nodeId:k,handleId:y,handleType:t}),S.setState({connectionClickStartHandle:{nodeId:k,type:t,handleId:y}});return}const V=NW(q.target),L=n||I||wD,{connection:$,isValid:K}=FW({nodeId:k,id:y,type:t},ee,W.nodeId,W.handleId||null,W.type,L,V);K&&_($),H?.(q),S.setState({connectionClickStartHandle:null})};return oe.createElement("div",{"data-handleid":y,"data-nodeid":k,"data-handlepos":e,"data-id":`${k}-${y}-${t}`,className:Ls(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",N,d,{source:!w,target:w,connectable:r,connectablestart:s,connectableend:i,connecting:E,connectionindicator:r&&(s&&!T||i&&T)}]),onMouseDown:A,onTouchStart:A,onClick:j?D:void 0,ref:x,...g},c)});$W.displayName="Handle";var au=b.memo($W);const HW=({data:t,isConnectable:e,targetPosition:n=kt.Top,sourcePosition:r=kt.Bottom})=>oe.createElement(oe.Fragment,null,oe.createElement(au,{type:"target",position:n,isConnectable:e}),t?.label,oe.createElement(au,{type:"source",position:r,isConnectable:e}));HW.displayName="DefaultNode";var lj=b.memo(HW);const QW=({data:t,isConnectable:e,sourcePosition:n=kt.Bottom})=>oe.createElement(oe.Fragment,null,t?.label,oe.createElement(au,{type:"source",position:n,isConnectable:e}));QW.displayName="InputNode";var VW=b.memo(QW);const UW=({data:t,isConnectable:e,targetPosition:n=kt.Top})=>oe.createElement(oe.Fragment,null,oe.createElement(au,{type:"target",position:n,isConnectable:e}),t?.label);UW.displayName="OutputNode";var WW=b.memo(UW);const c7=()=>null;c7.displayName="GroupNode";const N7e=t=>({selectedNodes:t.getNodes().filter(e=>e.selected),selectedEdges:t.edges.filter(e=>e.selected).map(e=>({...e}))}),G1=t=>t.id;function C7e(t,e){return ks(t.selectedNodes.map(G1),e.selectedNodes.map(G1))&&ks(t.selectedEdges.map(G1),e.selectedEdges.map(G1))}const GW=b.memo(({onSelectionChange:t})=>{const e=gs(),{selectedNodes:n,selectedEdges:r}=gr(N7e,C7e);return b.useEffect(()=>{const s={nodes:n,edges:r};t?.(s),e.getState().onSelectionChange.forEach(i=>i(s))},[n,r,t]),null});GW.displayName="SelectionListener";const T7e=t=>!!t.onSelectionChange;function E7e({onSelectionChange:t}){const e=gr(T7e);return t||e?oe.createElement(GW,{onSelectionChange:t}):null}const _7e=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset});function hh(t,e){b.useEffect(()=>{typeof t<"u"&&e(t)},[t])}function on(t,e,n){b.useEffect(()=>{typeof e<"u"&&n({[t]:e})},[e])}const A7e=({nodes:t,edges:e,defaultNodes:n,defaultEdges:r,onConnect:s,onConnectStart:i,onConnectEnd:a,onClickConnectStart:l,onClickConnectEnd:c,nodesDraggable:d,nodesConnectable:h,nodesFocusable:m,edgesFocusable:g,edgesUpdatable:x,elevateNodesOnSelect:y,minZoom:w,maxZoom:S,nodeExtent:k,onNodesChange:j,onEdgesChange:N,elementsSelectable:T,connectionMode:E,snapGrid:_,snapToGrid:A,translateExtent:D,connectOnClick:q,defaultEdgeOptions:B,fitView:H,fitViewOptions:W,onNodesDelete:ee,onEdgesDelete:I,onNodeDrag:V,onNodeDragStart:L,onNodeDragStop:$,onSelectionDrag:K,onSelectionDragStart:Y,onSelectionDragStop:R,noPanClassName:ie,nodeOrigin:X,rfId:z,autoPanOnConnect:U,autoPanOnNodeDrag:te,onError:ne,connectionRadius:G,isValidConnection:se,nodeDragThreshold:re})=>{const{setNodes:ae,setEdges:_e,setDefaultNodesAndEdges:Be,setMinZoom:Ye,setMaxZoom:Je,setTranslateExtent:Oe,setNodeExtent:Ve,reset:Ue}=gr(_7e,ks),$e=gs();return b.useEffect(()=>{const jt=r?.map(vt=>({...vt,...B}));return Be(n,jt),()=>{Ue()}},[]),on("defaultEdgeOptions",B,$e.setState),on("connectionMode",E,$e.setState),on("onConnect",s,$e.setState),on("onConnectStart",i,$e.setState),on("onConnectEnd",a,$e.setState),on("onClickConnectStart",l,$e.setState),on("onClickConnectEnd",c,$e.setState),on("nodesDraggable",d,$e.setState),on("nodesConnectable",h,$e.setState),on("nodesFocusable",m,$e.setState),on("edgesFocusable",g,$e.setState),on("edgesUpdatable",x,$e.setState),on("elementsSelectable",T,$e.setState),on("elevateNodesOnSelect",y,$e.setState),on("snapToGrid",A,$e.setState),on("snapGrid",_,$e.setState),on("onNodesChange",j,$e.setState),on("onEdgesChange",N,$e.setState),on("connectOnClick",q,$e.setState),on("fitViewOnInit",H,$e.setState),on("fitViewOnInitOptions",W,$e.setState),on("onNodesDelete",ee,$e.setState),on("onEdgesDelete",I,$e.setState),on("onNodeDrag",V,$e.setState),on("onNodeDragStart",L,$e.setState),on("onNodeDragStop",$,$e.setState),on("onSelectionDrag",K,$e.setState),on("onSelectionDragStart",Y,$e.setState),on("onSelectionDragStop",R,$e.setState),on("noPanClassName",ie,$e.setState),on("nodeOrigin",X,$e.setState),on("rfId",z,$e.setState),on("autoPanOnConnect",U,$e.setState),on("autoPanOnNodeDrag",te,$e.setState),on("onError",ne,$e.setState),on("connectionRadius",G,$e.setState),on("isValidConnection",se,$e.setState),on("nodeDragThreshold",re,$e.setState),hh(t,ae),hh(e,_e),hh(w,Ye),hh(S,Je),hh(D,Oe),hh(k,Ve),null},SD={display:"none"},M7e={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},XW="react-flow__node-desc",YW="react-flow__edge-desc",R7e="react-flow__aria-live",D7e=t=>t.ariaLiveMessage;function P7e({rfId:t}){const e=gr(D7e);return oe.createElement("div",{id:`${R7e}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:M7e},e)}function z7e({rfId:t,disableKeyboardA11y:e}){return oe.createElement(oe.Fragment,null,oe.createElement("div",{id:`${XW}-${t}`,style:SD},"Press enter or space to select a node.",!e&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),oe.createElement("div",{id:`${YW}-${t}`,style:SD},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!e&&oe.createElement(P7e,{rfId:t}))}var Cp=(t=null,e={actInsideInputWithModifier:!0})=>{const[n,r]=b.useState(!1),s=b.useRef(!1),i=b.useRef(new Set([])),[a,l]=b.useMemo(()=>{if(t!==null){const d=(Array.isArray(t)?t:[t]).filter(m=>typeof m=="string").map(m=>m.split("+")),h=d.reduce((m,g)=>m.concat(...g),[]);return[d,h]}return[[],[]]},[t]);return b.useEffect(()=>{const c=typeof document<"u"?document:null,d=e?.target||c;if(t!==null){const h=x=>{if(s.current=x.ctrlKey||x.metaKey||x.shiftKey,(!s.current||s.current&&!e.actInsideInputWithModifier)&&sj(x))return!1;const w=OD(x.code,l);i.current.add(x[w]),kD(a,i.current,!1)&&(x.preventDefault(),r(!0))},m=x=>{if((!s.current||s.current&&!e.actInsideInputWithModifier)&&sj(x))return!1;const w=OD(x.code,l);kD(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(x[w]),x.key==="Meta"&&i.current.clear(),s.current=!1},g=()=>{i.current.clear(),r(!1)};return d?.addEventListener("keydown",h),d?.addEventListener("keyup",m),window.addEventListener("blur",g),()=>{d?.removeEventListener("keydown",h),d?.removeEventListener("keyup",m),window.removeEventListener("blur",g)}}},[t,r]),n};function kD(t,e,n){return t.filter(r=>n||r.length===e.size).some(r=>r.every(s=>e.has(s)))}function OD(t,e){return e.includes(t)?"code":"key"}function KW(t,e,n,r){const s=t.parentNode||t.parentId;if(!s)return n;const i=e.get(s),a=id(i,r);return KW(i,e,{x:(n.x??0)+a.x,y:(n.y??0)+a.y,z:(i[$r]?.z??0)>(n.z??0)?i[$r]?.z??0:n.z??0},r)}function ZW(t,e,n){t.forEach(r=>{const s=r.parentNode||r.parentId;if(s&&!t.has(s))throw new Error(`Parent node ${s} not found`);if(s||n?.[r.id]){const{x:i,y:a,z:l}=KW(r,t,{...r.position,z:r[$r]?.z??0},e);r.positionAbsolute={x:i,y:a},r[$r].z=l,n?.[r.id]&&(r[$r].isParent=!0)}})}function m5(t,e,n,r){const s=new Map,i={},a=r?1e3:0;return t.forEach(l=>{const c=(Ca(l.zIndex)?l.zIndex:0)+(l.selected?a:0),d=e.get(l.id),h={...l,positionAbsolute:{x:l.position.x,y:l.position.y}},m=l.parentNode||l.parentId;m&&(i[m]=!0);const g=d?.type&&d?.type!==l.type;Object.defineProperty(h,$r,{enumerable:!1,value:{handleBounds:g?void 0:d?.[$r]?.handleBounds,z:c}}),s.set(l.id,h)}),ZW(s,n,i),s}function JW(t,e={}){const{getNodes:n,width:r,height:s,minZoom:i,maxZoom:a,d3Zoom:l,d3Selection:c,fitViewOnInitDone:d,fitViewOnInit:h,nodeOrigin:m}=t(),g=e.initial&&!d&&h;if(l&&c&&(g||!e.initial)){const y=n().filter(S=>{const k=e.includeHiddenNodes?S.width&&S.height:!S.hidden;return e.nodes?.length?k&&e.nodes.some(j=>j.id===S.id):k}),w=y.every(S=>S.width&&S.height);if(y.length>0&&w){const S=iw(y,m),{x:k,y:j,zoom:N}=LW(S,r,s,e.minZoom??i,e.maxZoom??a,e.padding??.1),T=$l.translate(k,j).scale(N);return typeof e.duration=="number"&&e.duration>0?l.transform(qu(c,e.duration),T):l.transform(c,T),!0}}return!1}function I7e(t,e){return t.forEach(n=>{const r=e.get(n.id);r&&e.set(r.id,{...r,[$r]:r[$r],selected:n.selected})}),new Map(e)}function L7e(t,e){return e.map(n=>{const r=t.find(s=>s.id===n.id);return r&&(n.selected=r.selected),n})}function X1({changedNodes:t,changedEdges:e,get:n,set:r}){const{nodeInternals:s,edges:i,onNodesChange:a,onEdgesChange:l,hasDefaultNodes:c,hasDefaultEdges:d}=n();t?.length&&(c&&r({nodeInternals:I7e(t,s)}),a?.(t)),e?.length&&(d&&r({edges:L7e(e,i)}),l?.(e))}const fh=()=>{},B7e={zoomIn:fh,zoomOut:fh,zoomTo:fh,getZoom:()=>1,setViewport:fh,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:fh,fitBounds:fh,project:t=>t,screenToFlowPosition:t=>t,flowToScreenPosition:t=>t,viewportInitialized:!1},F7e=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection}),q7e=()=>{const t=gs(),{d3Zoom:e,d3Selection:n}=gr(F7e,ks);return b.useMemo(()=>n&&e?{zoomIn:s=>e.scaleBy(qu(n,s?.duration),1.2),zoomOut:s=>e.scaleBy(qu(n,s?.duration),1/1.2),zoomTo:(s,i)=>e.scaleTo(qu(n,i?.duration),s),getZoom:()=>t.getState().transform[2],setViewport:(s,i)=>{const[a,l,c]=t.getState().transform,d=$l.translate(s.x??a,s.y??l).scale(s.zoom??c);e.transform(qu(n,i?.duration),d)},getViewport:()=>{const[s,i,a]=t.getState().transform;return{x:s,y:i,zoom:a}},fitView:s=>JW(t.getState,s),setCenter:(s,i,a)=>{const{width:l,height:c,maxZoom:d}=t.getState(),h=typeof a?.zoom<"u"?a.zoom:d,m=l/2-s*h,g=c/2-i*h,x=$l.translate(m,g).scale(h);e.transform(qu(n,a?.duration),x)},fitBounds:(s,i)=>{const{width:a,height:l,minZoom:c,maxZoom:d}=t.getState(),{x:h,y:m,zoom:g}=LW(s,a,l,c,d,i?.padding??.1),x=$l.translate(h,m).scale(g);e.transform(qu(n,i?.duration),x)},project:s=>{const{transform:i,snapToGrid:a,snapGrid:l}=t.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),oj(s,i,a,l)},screenToFlowPosition:s=>{const{transform:i,snapToGrid:a,snapGrid:l,domNode:c}=t.getState();if(!c)return s;const{x:d,y:h}=c.getBoundingClientRect(),m={x:s.x-d,y:s.y-h};return oj(m,i,a,l)},flowToScreenPosition:s=>{const{transform:i,domNode:a}=t.getState();if(!a)return s;const{x:l,y:c}=a.getBoundingClientRect(),d=PW(s,i);return{x:d.x+l,y:d.y+c}},viewportInitialized:!0}:B7e,[e,n])};function u7(){const t=q7e(),e=gs(),n=b.useCallback(()=>e.getState().getNodes().map(w=>({...w})),[]),r=b.useCallback(w=>e.getState().nodeInternals.get(w),[]),s=b.useCallback(()=>{const{edges:w=[]}=e.getState();return w.map(S=>({...S}))},[]),i=b.useCallback(w=>{const{edges:S=[]}=e.getState();return S.find(k=>k.id===w)},[]),a=b.useCallback(w=>{const{getNodes:S,setNodes:k,hasDefaultNodes:j,onNodesChange:N}=e.getState(),T=S(),E=typeof w=="function"?w(T):w;if(j)k(E);else if(N){const _=E.length===0?T.map(A=>({type:"remove",id:A.id})):E.map(A=>({item:A,type:"reset"}));N(_)}},[]),l=b.useCallback(w=>{const{edges:S=[],setEdges:k,hasDefaultEdges:j,onEdgesChange:N}=e.getState(),T=typeof w=="function"?w(S):w;if(j)k(T);else if(N){const E=T.length===0?S.map(_=>({type:"remove",id:_.id})):T.map(_=>({item:_,type:"reset"}));N(E)}},[]),c=b.useCallback(w=>{const S=Array.isArray(w)?w:[w],{getNodes:k,setNodes:j,hasDefaultNodes:N,onNodesChange:T}=e.getState();if(N){const _=[...k(),...S];j(_)}else if(T){const E=S.map(_=>({item:_,type:"add"}));T(E)}},[]),d=b.useCallback(w=>{const S=Array.isArray(w)?w:[w],{edges:k=[],setEdges:j,hasDefaultEdges:N,onEdgesChange:T}=e.getState();if(N)j([...k,...S]);else if(T){const E=S.map(_=>({item:_,type:"add"}));T(E)}},[]),h=b.useCallback(()=>{const{getNodes:w,edges:S=[],transform:k}=e.getState(),[j,N,T]=k;return{nodes:w().map(E=>({...E})),edges:S.map(E=>({...E})),viewport:{x:j,y:N,zoom:T}}},[]),m=b.useCallback(({nodes:w,edges:S})=>{const{nodeInternals:k,getNodes:j,edges:N,hasDefaultNodes:T,hasDefaultEdges:E,onNodesDelete:_,onEdgesDelete:A,onNodesChange:D,onEdgesChange:q}=e.getState(),B=(w||[]).map(V=>V.id),H=(S||[]).map(V=>V.id),W=j().reduce((V,L)=>{const $=L.parentNode||L.parentId,K=!B.includes(L.id)&&$&&V.find(R=>R.id===$);return(typeof L.deletable=="boolean"?L.deletable:!0)&&(B.includes(L.id)||K)&&V.push(L),V},[]),ee=N.filter(V=>typeof V.deletable=="boolean"?V.deletable:!0),I=ee.filter(V=>H.includes(V.id));if(W||I){const V=IW(W,ee),L=[...I,...V],$=L.reduce((K,Y)=>(K.includes(Y.id)||K.push(Y.id),K),[]);if((E||T)&&(E&&e.setState({edges:N.filter(K=>!$.includes(K.id))}),T&&(W.forEach(K=>{k.delete(K.id)}),e.setState({nodeInternals:new Map(k)}))),$.length>0&&(A?.(L),q&&q($.map(K=>({id:K,type:"remove"})))),W.length>0&&(_?.(W),D)){const K=W.map(Y=>({id:Y.id,type:"remove"}));D(K)}}},[]),g=b.useCallback(w=>{const S=o7e(w),k=S?null:e.getState().nodeInternals.get(w.id);return!S&&!k?[null,null,S]:[S?w:pD(k),k,S]},[]),x=b.useCallback((w,S=!0,k)=>{const[j,N,T]=g(w);return j?(k||e.getState().getNodes()).filter(E=>{if(!T&&(E.id===N.id||!E.positionAbsolute))return!1;const _=pD(E),A=rj(_,j);return S&&A>0||A>=j.width*j.height}):[]},[]),y=b.useCallback((w,S,k=!0)=>{const[j]=g(w);if(!j)return!1;const N=rj(j,S);return k&&N>0||N>=j.width*j.height},[]);return b.useMemo(()=>({...t,getNodes:n,getNode:r,getEdges:s,getEdge:i,setNodes:a,setEdges:l,addNodes:c,addEdges:d,toObject:h,deleteElements:m,getIntersectingNodes:x,isNodeIntersecting:y}),[t,n,r,s,i,a,l,c,d,h,m,x,y])}const $7e={actInsideInputWithModifier:!1};var H7e=({deleteKeyCode:t,multiSelectionKeyCode:e})=>{const n=gs(),{deleteElements:r}=u7(),s=Cp(t,$7e),i=Cp(e);b.useEffect(()=>{if(s){const{edges:a,getNodes:l}=n.getState(),c=l().filter(h=>h.selected),d=a.filter(h=>h.selected);r({nodes:c,edges:d}),n.setState({nodesSelectionActive:!1})}},[s]),b.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])};function Q7e(t){const e=gs();b.useEffect(()=>{let n;const r=()=>{if(!t.current)return;const s=n7(t.current);(s.height===0||s.width===0)&&e.getState().onError?.("004",Yl.error004()),e.setState({width:s.width||500,height:s.height||500})};return r(),window.addEventListener("resize",r),t.current&&(n=new ResizeObserver(()=>r()),n.observe(t.current)),()=>{window.removeEventListener("resize",r),n&&t.current&&n.unobserve(t.current)}},[])}const d7={position:"absolute",width:"100%",height:"100%",top:0,left:0},V7e=(t,e)=>t.x!==e.x||t.y!==e.y||t.zoom!==e.k,Y1=t=>({x:t.x,y:t.y,zoom:t.k}),mh=(t,e)=>t.target.closest(`.${e}`),jD=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),ND=t=>{const e=t.ctrlKey&&zy()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e},U7e=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection,d3ZoomHandler:t.d3ZoomHandler,userSelectionActive:t.userSelectionActive}),W7e=({onMove:t,onMoveStart:e,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:s=!0,zoomOnPinch:i=!0,panOnScroll:a=!1,panOnScrollSpeed:l=.5,panOnScrollMode:c=Yu.Free,zoomOnDoubleClick:d=!0,elementsSelectable:h,panOnDrag:m=!0,defaultViewport:g,translateExtent:x,minZoom:y,maxZoom:w,zoomActivationKeyCode:S,preventScrolling:k=!0,children:j,noWheelClassName:N,noPanClassName:T})=>{const E=b.useRef(),_=gs(),A=b.useRef(!1),D=b.useRef(!1),q=b.useRef(null),B=b.useRef({x:0,y:0,zoom:0}),{d3Zoom:H,d3Selection:W,d3ZoomHandler:ee,userSelectionActive:I}=gr(U7e,ks),V=Cp(S),L=b.useRef(0),$=b.useRef(!1),K=b.useRef();return Q7e(q),b.useEffect(()=>{if(q.current){const Y=q.current.getBoundingClientRect(),R=kW().scaleExtent([y,w]).translateExtent(x),ie=va(q.current).call(R),X=$l.translate(g.x,g.y).scale(gf(g.zoom,y,w)),z=[[0,0],[Y.width,Y.height]],U=R.constrain()(X,z,x);R.transform(ie,U),R.wheelDelta(ND),_.setState({d3Zoom:R,d3Selection:ie,d3ZoomHandler:ie.on("wheel.zoom"),transform:[U.x,U.y,U.k],domNode:q.current.closest(".react-flow")})}},[]),b.useEffect(()=>{W&&H&&(a&&!V&&!I?W.on("wheel.zoom",Y=>{if(mh(Y,N))return!1;Y.preventDefault(),Y.stopImmediatePropagation();const R=W.property("__zoom").k||1;if(Y.ctrlKey&&i){const se=Qa(Y),re=ND(Y),ae=R*Math.pow(2,re);H.scaleTo(W,ae,se,Y);return}const ie=Y.deltaMode===1?20:1;let X=c===Yu.Vertical?0:Y.deltaX*ie,z=c===Yu.Horizontal?0:Y.deltaY*ie;!zy()&&Y.shiftKey&&c!==Yu.Vertical&&(X=Y.deltaY*ie,z=0),H.translateBy(W,-(X/R)*l,-(z/R)*l,{internal:!0});const U=Y1(W.property("__zoom")),{onViewportChangeStart:te,onViewportChange:ne,onViewportChangeEnd:G}=_.getState();clearTimeout(K.current),$.current||($.current=!0,e?.(Y,U),te?.(U)),$.current&&(t?.(Y,U),ne?.(U),K.current=setTimeout(()=>{n?.(Y,U),G?.(U),$.current=!1},150))},{passive:!1}):typeof ee<"u"&&W.on("wheel.zoom",function(Y,R){if(!k&&Y.type==="wheel"&&!Y.ctrlKey||mh(Y,N))return null;Y.preventDefault(),ee.call(this,Y,R)},{passive:!1}))},[I,a,c,W,H,ee,V,i,k,N,e,t,n]),b.useEffect(()=>{H&&H.on("start",Y=>{if(!Y.sourceEvent||Y.sourceEvent.internal)return null;L.current=Y.sourceEvent?.button;const{onViewportChangeStart:R}=_.getState(),ie=Y1(Y.transform);A.current=!0,B.current=ie,Y.sourceEvent?.type==="mousedown"&&_.setState({paneDragging:!0}),R?.(ie),e?.(Y.sourceEvent,ie)})},[H,e]),b.useEffect(()=>{H&&(I&&!A.current?H.on("zoom",null):I||H.on("zoom",Y=>{const{onViewportChange:R}=_.getState();if(_.setState({transform:[Y.transform.x,Y.transform.y,Y.transform.k]}),D.current=!!(r&&jD(m,L.current??0)),(t||R)&&!Y.sourceEvent?.internal){const ie=Y1(Y.transform);R?.(ie),t?.(Y.sourceEvent,ie)}}))},[I,H,t,m,r]),b.useEffect(()=>{H&&H.on("end",Y=>{if(!Y.sourceEvent||Y.sourceEvent.internal)return null;const{onViewportChangeEnd:R}=_.getState();if(A.current=!1,_.setState({paneDragging:!1}),r&&jD(m,L.current??0)&&!D.current&&r(Y.sourceEvent),D.current=!1,(n||R)&&V7e(B.current,Y.transform)){const ie=Y1(Y.transform);B.current=ie,clearTimeout(E.current),E.current=setTimeout(()=>{R?.(ie),n?.(Y.sourceEvent,ie)},a?150:0)}})},[H,a,m,n,r]),b.useEffect(()=>{H&&H.filter(Y=>{const R=V||s,ie=i&&Y.ctrlKey;if((m===!0||Array.isArray(m)&&m.includes(1))&&Y.button===1&&Y.type==="mousedown"&&(mh(Y,"react-flow__node")||mh(Y,"react-flow__edge")))return!0;if(!m&&!R&&!a&&!d&&!i||I||!d&&Y.type==="dblclick"||mh(Y,N)&&Y.type==="wheel"||mh(Y,T)&&(Y.type!=="wheel"||a&&Y.type==="wheel"&&!V)||!i&&Y.ctrlKey&&Y.type==="wheel"||!R&&!a&&!ie&&Y.type==="wheel"||!m&&(Y.type==="mousedown"||Y.type==="touchstart")||Array.isArray(m)&&!m.includes(Y.button)&&Y.type==="mousedown")return!1;const X=Array.isArray(m)&&m.includes(Y.button)||!Y.button||Y.button<=1;return(!Y.ctrlKey||Y.type==="wheel")&&X})},[I,H,s,i,a,d,m,h,V]),oe.createElement("div",{className:"react-flow__renderer",ref:q,style:d7},j)},G7e=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function X7e(){const{userSelectionActive:t,userSelectionRect:e}=gr(G7e,ks);return t&&e?oe.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}function CD(t,e){const n=e.parentNode||e.parentId,r=t.find(s=>s.id===n);if(r){const s=e.position.x+e.width-r.width,i=e.position.y+e.height-r.height;if(s>0||i>0||e.position.x<0||e.position.y<0){if(r.style={...r.style},r.style.width=r.style.width??r.width,r.style.height=r.style.height??r.height,s>0&&(r.style.width+=s),i>0&&(r.style.height+=i),e.position.x<0){const a=Math.abs(e.position.x);r.position.x=r.position.x-a,r.style.width+=a,e.position.x=0}if(e.position.y<0){const a=Math.abs(e.position.y);r.position.y=r.position.y-a,r.style.height+=a,e.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function eG(t,e){if(t.some(r=>r.type==="reset"))return t.filter(r=>r.type==="reset").map(r=>r.item);const n=t.filter(r=>r.type==="add").map(r=>r.item);return e.reduce((r,s)=>{const i=t.filter(l=>l.id===s.id);if(i.length===0)return r.push(s),r;const a={...s};for(const l of i)if(l)switch(l.type){case"select":{a.selected=l.selected;break}case"position":{typeof l.position<"u"&&(a.position=l.position),typeof l.positionAbsolute<"u"&&(a.positionAbsolute=l.positionAbsolute),typeof l.dragging<"u"&&(a.dragging=l.dragging),a.expandParent&&CD(r,a);break}case"dimensions":{typeof l.dimensions<"u"&&(a.width=l.dimensions.width,a.height=l.dimensions.height),typeof l.updateStyle<"u"&&(a.style={...a.style||{},...l.dimensions}),typeof l.resizing=="boolean"&&(a.resizing=l.resizing),a.expandParent&&CD(r,a);break}case"remove":return r}return r.push(a),r},n)}function tG(t,e){return eG(t,e)}function Y7e(t,e){return eG(t,e)}const Lc=(t,e)=>({id:t,type:"select",selected:e});function Ah(t,e){return t.reduce((n,r)=>{const s=e.includes(r.id);return!r.selected&&s?(r.selected=!0,n.push(Lc(r.id,!0))):r.selected&&!s&&(r.selected=!1,n.push(Lc(r.id,!1))),n},[])}const p5=(t,e)=>n=>{n.target===e.current&&t?.(n)},K7e=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,dragging:t.paneDragging}),nG=b.memo(({isSelecting:t,selectionMode:e=Np.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:s,onPaneClick:i,onPaneContextMenu:a,onPaneScroll:l,onPaneMouseEnter:c,onPaneMouseMove:d,onPaneMouseLeave:h,children:m})=>{const g=b.useRef(null),x=gs(),y=b.useRef(0),w=b.useRef(0),S=b.useRef(),{userSelectionActive:k,elementsSelectable:j,dragging:N}=gr(K7e,ks),T=()=>{x.setState({userSelectionActive:!1,userSelectionRect:null}),y.current=0,w.current=0},E=ee=>{i?.(ee),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},_=ee=>{if(Array.isArray(n)&&n?.includes(2)){ee.preventDefault();return}a?.(ee)},A=l?ee=>l(ee):void 0,D=ee=>{const{resetSelectedElements:I,domNode:V}=x.getState();if(S.current=V?.getBoundingClientRect(),!j||!t||ee.button!==0||ee.target!==g.current||!S.current)return;const{x:L,y:$}=Wc(ee,S.current);I(),x.setState({userSelectionRect:{width:0,height:0,startX:L,startY:$,x:L,y:$}}),r?.(ee)},q=ee=>{const{userSelectionRect:I,nodeInternals:V,edges:L,transform:$,onNodesChange:K,onEdgesChange:Y,nodeOrigin:R,getNodes:ie}=x.getState();if(!t||!S.current||!I)return;x.setState({userSelectionActive:!0,nodesSelectionActive:!1});const X=Wc(ee,S.current),z=I.startX??0,U=I.startY??0,te={...I,x:X.xae.id),re=G.map(ae=>ae.id);if(y.current!==re.length){y.current=re.length;const ae=Ah(ne,re);ae.length&&K?.(ae)}if(w.current!==se.length){w.current=se.length;const ae=Ah(L,se);ae.length&&Y?.(ae)}x.setState({userSelectionRect:te})},B=ee=>{if(ee.button!==0)return;const{userSelectionRect:I}=x.getState();!k&&I&&ee.target===g.current&&E?.(ee),x.setState({nodesSelectionActive:y.current>0}),T(),s?.(ee)},H=ee=>{k&&(x.setState({nodesSelectionActive:y.current>0}),s?.(ee)),T()},W=j&&(t||k);return oe.createElement("div",{className:Ls(["react-flow__pane",{dragging:N,selection:t}]),onClick:W?void 0:p5(E,g),onContextMenu:p5(_,g),onWheel:p5(A,g),onMouseEnter:W?void 0:c,onMouseDown:W?D:void 0,onMouseMove:W?q:d,onMouseUp:W?B:void 0,onMouseLeave:W?H:h,ref:g,style:d7},m,oe.createElement(X7e,null))});nG.displayName="Pane";function rG(t,e){const n=t.parentNode||t.parentId;if(!n)return!1;const r=e.get(n);return r?r.selected?!0:rG(r,e):!1}function TD(t,e,n){let r=t;do{if(r?.matches(e))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function Z7e(t,e,n,r){return Array.from(t.values()).filter(s=>(s.selected||s.id===r)&&(!s.parentNode||s.parentId||!rG(s,t))&&(s.draggable||e&&typeof s.draggable>"u")).map(s=>({id:s.id,position:s.position||{x:0,y:0},positionAbsolute:s.positionAbsolute||{x:0,y:0},distance:{x:n.x-(s.positionAbsolute?.x??0),y:n.y-(s.positionAbsolute?.y??0)},delta:{x:0,y:0},extent:s.extent,parentNode:s.parentNode||s.parentId,parentId:s.parentNode||s.parentId,width:s.width,height:s.height,expandParent:s.expandParent}))}function J7e(t,e){return!e||e==="parent"?e:[e[0],[e[1][0]-(t.width||0),e[1][1]-(t.height||0)]]}function sG(t,e,n,r,s=[0,0],i){const a=J7e(t,t.extent||r);let l=a;const c=t.parentNode||t.parentId;if(t.extent==="parent"&&!t.expandParent)if(c&&t.width&&t.height){const m=n.get(c),{x:g,y:x}=id(m,s).positionAbsolute;l=m&&Ca(g)&&Ca(x)&&Ca(m.width)&&Ca(m.height)?[[g+t.width*s[0],x+t.height*s[1]],[g+m.width-t.width+t.width*s[0],x+m.height-t.height+t.height*s[1]]]:l}else i?.("005",Yl.error005()),l=a;else if(t.extent&&c&&t.extent!=="parent"){const m=n.get(c),{x:g,y:x}=id(m,s).positionAbsolute;l=[[t.extent[0][0]+g,t.extent[0][1]+x],[t.extent[1][0]+g,t.extent[1][1]+x]]}let d={x:0,y:0};if(c){const m=n.get(c);d=id(m,s).positionAbsolute}const h=l&&l!=="parent"?r7(e,l):e;return{position:{x:h.x-d.x,y:h.y-d.y},positionAbsolute:h}}function g5({nodeId:t,dragItems:e,nodeInternals:n}){const r=e.map(s=>({...n.get(s.id),position:s.position,positionAbsolute:s.positionAbsolute}));return[t?r.find(s=>s.id===t):r[0],r]}const ED=(t,e,n,r)=>{const s=e.querySelectorAll(t);if(!s||!s.length)return null;const i=Array.from(s),a=e.getBoundingClientRect(),l={x:a.width*r[0],y:a.height*r[1]};return i.map(c=>{const d=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),position:c.getAttribute("data-handlepos"),x:(d.left-a.left-l.x)/n,y:(d.top-a.top-l.y)/n,...n7(c)}})};function i0(t,e,n){return n===void 0?n:r=>{const s=e().nodeInternals.get(t);s&&n(r,{...s})}}function cj({id:t,store:e,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeInternals:l,onError:c}=e.getState(),d=l.get(t);if(!d){c?.("012",Yl.error012(t));return}e.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&a)&&(i({nodes:[d],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):s([t])}function eCe(){const t=gs();return b.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:s,snapToGrid:i}=t.getState(),a=n.touches?n.touches[0].clientX:n.clientX,l=n.touches?n.touches[0].clientY:n.clientY,c={x:(a-r[0])/r[2],y:(l-r[1])/r[2]};return{xSnapped:i?s[0]*Math.round(c.x/s[0]):c.x,ySnapped:i?s[1]*Math.round(c.y/s[1]):c.y,...c}},[])}function x5(t){return(e,n,r)=>t?.(e,r)}function iG({nodeRef:t,disabled:e=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:i,selectNodesOnDrag:a}){const l=gs(),[c,d]=b.useState(!1),h=b.useRef([]),m=b.useRef({x:null,y:null}),g=b.useRef(0),x=b.useRef(null),y=b.useRef({x:0,y:0}),w=b.useRef(null),S=b.useRef(!1),k=b.useRef(!1),j=b.useRef(!1),N=eCe();return b.useEffect(()=>{if(t?.current){const T=va(t.current),E=({x:D,y:q})=>{const{nodeInternals:B,onNodeDrag:H,onSelectionDrag:W,updateNodePositions:ee,nodeExtent:I,snapGrid:V,snapToGrid:L,nodeOrigin:$,onError:K}=l.getState();m.current={x:D,y:q};let Y=!1,R={x:0,y:0,x2:0,y2:0};if(h.current.length>1&&I){const X=iw(h.current,$);R=jp(X)}if(h.current=h.current.map(X=>{const z={x:D-X.distance.x,y:q-X.distance.y};L&&(z.x=V[0]*Math.round(z.x/V[0]),z.y=V[1]*Math.round(z.y/V[1]));const U=[[I[0][0],I[0][1]],[I[1][0],I[1][1]]];h.current.length>1&&I&&!X.extent&&(U[0][0]=X.positionAbsolute.x-R.x+I[0][0],U[1][0]=X.positionAbsolute.x+(X.width??0)-R.x2+I[1][0],U[0][1]=X.positionAbsolute.y-R.y+I[0][1],U[1][1]=X.positionAbsolute.y+(X.height??0)-R.y2+I[1][1]);const te=sG(X,z,B,U,$,K);return Y=Y||X.position.x!==te.position.x||X.position.y!==te.position.y,X.position=te.position,X.positionAbsolute=te.positionAbsolute,X}),!Y)return;ee(h.current,!0,!0),d(!0);const ie=s?H:x5(W);if(ie&&w.current){const[X,z]=g5({nodeId:s,dragItems:h.current,nodeInternals:B});ie(w.current,X,z)}},_=()=>{if(!x.current)return;const[D,q]=jW(y.current,x.current);if(D!==0||q!==0){const{transform:B,panBy:H}=l.getState();m.current.x=(m.current.x??0)-D/B[2],m.current.y=(m.current.y??0)-q/B[2],H({x:D,y:q})&&E(m.current)}g.current=requestAnimationFrame(_)},A=D=>{const{nodeInternals:q,multiSelectionActive:B,nodesDraggable:H,unselectNodesAndEdges:W,onNodeDragStart:ee,onSelectionDragStart:I}=l.getState();k.current=!0;const V=s?ee:x5(I);(!a||!i)&&!B&&s&&(q.get(s)?.selected||W()),s&&i&&a&&cj({id:s,store:l,nodeRef:t});const L=N(D);if(m.current=L,h.current=Z7e(q,H,L,s),V&&h.current){const[$,K]=g5({nodeId:s,dragItems:h.current,nodeInternals:q});V(D.sourceEvent,$,K)}};if(e)T.on(".drag",null);else{const D=I6e().on("start",q=>{const{domNode:B,nodeDragThreshold:H}=l.getState();H===0&&A(q),j.current=!1;const W=N(q);m.current=W,x.current=B?.getBoundingClientRect()||null,y.current=Wc(q.sourceEvent,x.current)}).on("drag",q=>{const B=N(q),{autoPanOnNodeDrag:H,nodeDragThreshold:W}=l.getState();if(q.sourceEvent.type==="touchmove"&&q.sourceEvent.touches.length>1&&(j.current=!0),!j.current){if(!S.current&&k.current&&H&&(S.current=!0,_()),!k.current){const ee=B.xSnapped-(m?.current?.x??0),I=B.ySnapped-(m?.current?.y??0);Math.sqrt(ee*ee+I*I)>W&&A(q)}(m.current.x!==B.xSnapped||m.current.y!==B.ySnapped)&&h.current&&k.current&&(w.current=q.sourceEvent,y.current=Wc(q.sourceEvent,x.current),E(B))}}).on("end",q=>{if(!(!k.current||j.current)&&(d(!1),S.current=!1,k.current=!1,cancelAnimationFrame(g.current),h.current)){const{updateNodePositions:B,nodeInternals:H,onNodeDragStop:W,onSelectionDragStop:ee}=l.getState(),I=s?W:x5(ee);if(B(h.current,!1,!1),I){const[V,L]=g5({nodeId:s,dragItems:h.current,nodeInternals:H});I(q.sourceEvent,V,L)}}}).filter(q=>{const B=q.target;return!q.button&&(!n||!TD(B,`.${n}`,t))&&(!r||TD(B,r,t))});return T.call(D),()=>{T.on(".drag",null)}}}},[t,e,n,r,i,l,s,a,N]),c}function aG(){const t=gs();return b.useCallback(n=>{const{nodeInternals:r,nodeExtent:s,updateNodePositions:i,getNodes:a,snapToGrid:l,snapGrid:c,onError:d,nodesDraggable:h}=t.getState(),m=a().filter(j=>j.selected&&(j.draggable||h&&typeof j.draggable>"u")),g=l?c[0]:5,x=l?c[1]:5,y=n.isShiftPressed?4:1,w=n.x*g*y,S=n.y*x*y,k=m.map(j=>{if(j.positionAbsolute){const N={x:j.positionAbsolute.x+w,y:j.positionAbsolute.y+S};l&&(N.x=c[0]*Math.round(N.x/c[0]),N.y=c[1]*Math.round(N.y/c[1]));const{positionAbsolute:T,position:E}=sG(j,N,r,s,void 0,d);j.position=E,j.positionAbsolute=T}return j});i(k,!0,!1)},[])}const Vh={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var a0=t=>{const e=({id:n,type:r,data:s,xPos:i,yPos:a,xPosOrigin:l,yPosOrigin:c,selected:d,onClick:h,onMouseEnter:m,onMouseMove:g,onMouseLeave:x,onContextMenu:y,onDoubleClick:w,style:S,className:k,isDraggable:j,isSelectable:N,isConnectable:T,isFocusable:E,selectNodesOnDrag:_,sourcePosition:A,targetPosition:D,hidden:q,resizeObserver:B,dragHandle:H,zIndex:W,isParent:ee,noDragClassName:I,noPanClassName:V,initialized:L,disableKeyboardA11y:$,ariaLabel:K,rfId:Y,hasHandleBounds:R})=>{const ie=gs(),X=b.useRef(null),z=b.useRef(null),U=b.useRef(A),te=b.useRef(D),ne=b.useRef(r),G=N||j||h||m||g||x,se=aG(),re=i0(n,ie.getState,m),ae=i0(n,ie.getState,g),_e=i0(n,ie.getState,x),Be=i0(n,ie.getState,y),Ye=i0(n,ie.getState,w),Je=Ue=>{const{nodeDragThreshold:$e}=ie.getState();if(N&&(!_||!j||$e>0)&&cj({id:n,store:ie,nodeRef:X}),h){const jt=ie.getState().nodeInternals.get(n);jt&&h(Ue,{...jt})}},Oe=Ue=>{if(!sj(Ue)&&!$)if(EW.includes(Ue.key)&&N){const $e=Ue.key==="Escape";cj({id:n,store:ie,unselect:$e,nodeRef:X})}else j&&d&&Object.prototype.hasOwnProperty.call(Vh,Ue.key)&&(ie.setState({ariaLiveMessage:`Moved selected node ${Ue.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~a}`}),se({x:Vh[Ue.key].x,y:Vh[Ue.key].y,isShiftPressed:Ue.shiftKey}))};b.useEffect(()=>()=>{z.current&&(B?.unobserve(z.current),z.current=null)},[]),b.useEffect(()=>{if(X.current&&!q){const Ue=X.current;(!L||!R||z.current!==Ue)&&(z.current&&B?.unobserve(z.current),B?.observe(Ue),z.current=Ue)}},[q,L,R]),b.useEffect(()=>{const Ue=ne.current!==r,$e=U.current!==A,jt=te.current!==D;X.current&&(Ue||$e||jt)&&(Ue&&(ne.current=r),$e&&(U.current=A),jt&&(te.current=D),ie.getState().updateNodeDimensions([{id:n,nodeElement:X.current,forceUpdate:!0}]))},[n,r,A,D]);const Ve=iG({nodeRef:X,disabled:q||!j,noDragClassName:I,handleSelector:H,nodeId:n,isSelectable:N,selectNodesOnDrag:_});return q?null:oe.createElement("div",{className:Ls(["react-flow__node",`react-flow__node-${r}`,{[V]:j},k,{selected:d,selectable:N,parent:ee,dragging:Ve}]),ref:X,style:{zIndex:W,transform:`translate(${l}px,${c}px)`,pointerEvents:G?"all":"none",visibility:L?"visible":"hidden",...S},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:re,onMouseMove:ae,onMouseLeave:_e,onContextMenu:Be,onClick:Je,onDoubleClick:Ye,onKeyDown:E?Oe:void 0,tabIndex:E?0:void 0,role:E?"button":void 0,"aria-describedby":$?void 0:`${XW}-${Y}`,"aria-label":K},oe.createElement(m7e,{value:n},oe.createElement(t,{id:n,data:s,type:r,xPos:i,yPos:a,selected:d,isConnectable:T,sourcePosition:A,targetPosition:D,dragging:Ve,dragHandle:H,zIndex:W})))};return e.displayName="NodeWrapper",b.memo(e)};const tCe=t=>{const e=t.getNodes().filter(n=>n.selected);return{...iw(e,t.nodeOrigin),transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`,userSelectionActive:t.userSelectionActive}};function nCe({onSelectionContextMenu:t,noPanClassName:e,disableKeyboardA11y:n}){const r=gs(),{width:s,height:i,x:a,y:l,transformString:c,userSelectionActive:d}=gr(tCe,ks),h=aG(),m=b.useRef(null);if(b.useEffect(()=>{n||m.current?.focus({preventScroll:!0})},[n]),iG({nodeRef:m}),d||!s||!i)return null;const g=t?y=>{const w=r.getState().getNodes().filter(S=>S.selected);t(y,w)}:void 0,x=y=>{Object.prototype.hasOwnProperty.call(Vh,y.key)&&h({x:Vh[y.key].x,y:Vh[y.key].y,isShiftPressed:y.shiftKey})};return oe.createElement("div",{className:Ls(["react-flow__nodesselection","react-flow__container",e]),style:{transform:c}},oe.createElement("div",{ref:m,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:n?void 0:-1,onKeyDown:n?void 0:x,style:{width:s,height:i,top:l,left:a}}))}var rCe=b.memo(nCe);const sCe=t=>t.nodesSelectionActive,oG=({children:t,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,deleteKeyCode:l,onMove:c,onMoveStart:d,onMoveEnd:h,selectionKeyCode:m,selectionOnDrag:g,selectionMode:x,onSelectionStart:y,onSelectionEnd:w,multiSelectionKeyCode:S,panActivationKeyCode:k,zoomActivationKeyCode:j,elementsSelectable:N,zoomOnScroll:T,zoomOnPinch:E,panOnScroll:_,panOnScrollSpeed:A,panOnScrollMode:D,zoomOnDoubleClick:q,panOnDrag:B,defaultViewport:H,translateExtent:W,minZoom:ee,maxZoom:I,preventScrolling:V,onSelectionContextMenu:L,noWheelClassName:$,noPanClassName:K,disableKeyboardA11y:Y})=>{const R=gr(sCe),ie=Cp(m),X=Cp(k),z=X||B,U=X||_,te=ie||g&&z!==!0;return H7e({deleteKeyCode:l,multiSelectionKeyCode:S}),oe.createElement(W7e,{onMove:c,onMoveStart:d,onMoveEnd:h,onPaneContextMenu:i,elementsSelectable:N,zoomOnScroll:T,zoomOnPinch:E,panOnScroll:U,panOnScrollSpeed:A,panOnScrollMode:D,zoomOnDoubleClick:q,panOnDrag:!ie&&z,defaultViewport:H,translateExtent:W,minZoom:ee,maxZoom:I,zoomActivationKeyCode:j,preventScrolling:V,noWheelClassName:$,noPanClassName:K},oe.createElement(nG,{onSelectionStart:y,onSelectionEnd:w,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:z,isSelecting:!!te,selectionMode:x},t,R&&oe.createElement(rCe,{onSelectionContextMenu:L,noPanClassName:K,disableKeyboardA11y:Y})))};oG.displayName="FlowRenderer";var iCe=b.memo(oG);function aCe(t){return gr(b.useCallback(n=>t?zW(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[t]))}function oCe(t){const e={input:a0(t.input||VW),default:a0(t.default||lj),output:a0(t.output||WW),group:a0(t.group||c7)},n={},r=Object.keys(t).filter(s=>!["input","default","output","group"].includes(s)).reduce((s,i)=>(s[i]=a0(t[i]||lj),s),n);return{...e,...r}}const lCe=({x:t,y:e,width:n,height:r,origin:s})=>!n||!r?{x:t,y:e}:s[0]<0||s[1]<0||s[0]>1||s[1]>1?{x:t,y:e}:{x:t-n*s[0],y:e-r*s[1]},cCe=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,updateNodeDimensions:t.updateNodeDimensions,onError:t.onError}),lG=t=>{const{nodesDraggable:e,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,updateNodeDimensions:i,onError:a}=gr(cCe,ks),l=aCe(t.onlyRenderVisibleElements),c=b.useRef(),d=b.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const h=new ResizeObserver(m=>{const g=m.map(x=>({id:x.target.getAttribute("data-id"),nodeElement:x.target,forceUpdate:!0}));i(g)});return c.current=h,h},[]);return b.useEffect(()=>()=>{c?.current?.disconnect()},[]),oe.createElement("div",{className:"react-flow__nodes",style:d7},l.map(h=>{let m=h.type||"default";t.nodeTypes[m]||(a?.("003",Yl.error003(m)),m="default");const g=t.nodeTypes[m]||t.nodeTypes.default,x=!!(h.draggable||e&&typeof h.draggable>"u"),y=!!(h.selectable||s&&typeof h.selectable>"u"),w=!!(h.connectable||n&&typeof h.connectable>"u"),S=!!(h.focusable||r&&typeof h.focusable>"u"),k=t.nodeExtent?r7(h.positionAbsolute,t.nodeExtent):h.positionAbsolute,j=k?.x??0,N=k?.y??0,T=lCe({x:j,y:N,width:h.width??0,height:h.height??0,origin:t.nodeOrigin});return oe.createElement(g,{key:h.id,id:h.id,className:h.className,style:h.style,type:m,data:h.data,sourcePosition:h.sourcePosition||kt.Bottom,targetPosition:h.targetPosition||kt.Top,hidden:h.hidden,xPos:j,yPos:N,xPosOrigin:T.x,yPosOrigin:T.y,selectNodesOnDrag:t.selectNodesOnDrag,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,selected:!!h.selected,isDraggable:x,isSelectable:y,isConnectable:w,isFocusable:S,resizeObserver:d,dragHandle:h.dragHandle,zIndex:h[$r]?.z??0,isParent:!!h[$r]?.isParent,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,initialized:!!h.width&&!!h.height,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,ariaLabel:h.ariaLabel,hasHandleBounds:!!h[$r]?.handleBounds})}))};lG.displayName="NodeRenderer";var uCe=b.memo(lG);const dCe=(t,e,n)=>n===kt.Left?t-e:n===kt.Right?t+e:t,hCe=(t,e,n)=>n===kt.Top?t-e:n===kt.Bottom?t+e:t,_D="react-flow__edgeupdater",AD=({position:t,centerX:e,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:l})=>oe.createElement("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:Ls([_D,`${_D}-${l}`]),cx:dCe(e,r,t),cy:hCe(n,r,t),r,stroke:"transparent",fill:"transparent"}),fCe=()=>!0;var ph=t=>{const e=({id:n,className:r,type:s,data:i,onClick:a,onEdgeDoubleClick:l,selected:c,animated:d,label:h,labelStyle:m,labelShowBg:g,labelBgStyle:x,labelBgPadding:y,labelBgBorderRadius:w,style:S,source:k,target:j,sourceX:N,sourceY:T,targetX:E,targetY:_,sourcePosition:A,targetPosition:D,elementsSelectable:q,hidden:B,sourceHandleId:H,targetHandleId:W,onContextMenu:ee,onMouseEnter:I,onMouseMove:V,onMouseLeave:L,reconnectRadius:$,onReconnect:K,onReconnectStart:Y,onReconnectEnd:R,markerEnd:ie,markerStart:X,rfId:z,ariaLabel:U,isFocusable:te,isReconnectable:ne,pathOptions:G,interactionWidth:se,disableKeyboardA11y:re})=>{const ae=b.useRef(null),[_e,Be]=b.useState(!1),[Ye,Je]=b.useState(!1),Oe=gs(),Ve=b.useMemo(()=>`url('#${aj(X,z)}')`,[X,z]),Ue=b.useMemo(()=>`url('#${aj(ie,z)}')`,[ie,z]);if(B)return null;const $e=Rt=>{const{edges:Hn,addSelectedEdges:We,unselectNodesAndEdges:ot,multiSelectionActive:dn}=Oe.getState(),Pt=Hn.find(xn=>xn.id===n);Pt&&(q&&(Oe.setState({nodesSelectionActive:!1}),Pt.selected&&dn?(ot({nodes:[],edges:[Pt]}),ae.current?.blur()):We([n])),a&&a(Rt,Pt))},jt=s0(n,Oe.getState,l),vt=s0(n,Oe.getState,ee),$n=s0(n,Oe.getState,I),qt=s0(n,Oe.getState,V),un=s0(n,Oe.getState,L),Mt=(Rt,Hn)=>{if(Rt.button!==0)return;const{edges:We,isValidConnection:ot}=Oe.getState(),dn=Hn?j:k,Pt=(Hn?W:H)||null,xn=Hn?"target":"source",dt=ot||fCe,rn=Hn,wt=We.find(lt=>lt.id===n);Je(!0),Y?.(Rt,wt,xn);const Wt=lt=>{Je(!1),R?.(lt,wt,xn)};qW({event:Rt,handleId:Pt,nodeId:dn,onConnect:lt=>K?.(wt,lt),isTarget:rn,getState:Oe.getState,setState:Oe.setState,isValidConnection:dt,edgeUpdaterType:xn,onReconnectEnd:Wt})},ct=Rt=>Mt(Rt,!0),Ne=Rt=>Mt(Rt,!1),ze=()=>Be(!0),rt=()=>Be(!1),bt=!q&&!a,zt=Rt=>{if(!re&&EW.includes(Rt.key)&&q){const{unselectNodesAndEdges:Hn,addSelectedEdges:We,edges:ot}=Oe.getState();Rt.key==="Escape"?(ae.current?.blur(),Hn({edges:[ot.find(Pt=>Pt.id===n)]})):We([n])}};return oe.createElement("g",{className:Ls(["react-flow__edge",`react-flow__edge-${s}`,r,{selected:c,animated:d,inactive:bt,updating:_e}]),onClick:$e,onDoubleClick:jt,onContextMenu:vt,onMouseEnter:$n,onMouseMove:qt,onMouseLeave:un,onKeyDown:te?zt:void 0,tabIndex:te?0:void 0,role:te?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":U===null?void 0:U||`Edge from ${k} to ${j}`,"aria-describedby":te?`${YW}-${z}`:void 0,ref:ae},!Ye&&oe.createElement(t,{id:n,source:k,target:j,selected:c,animated:d,label:h,labelStyle:m,labelShowBg:g,labelBgStyle:x,labelBgPadding:y,labelBgBorderRadius:w,data:i,style:S,sourceX:N,sourceY:T,targetX:E,targetY:_,sourcePosition:A,targetPosition:D,sourceHandleId:H,targetHandleId:W,markerStart:Ve,markerEnd:Ue,pathOptions:G,interactionWidth:se}),ne&&oe.createElement(oe.Fragment,null,(ne==="source"||ne===!0)&&oe.createElement(AD,{position:A,centerX:N,centerY:T,radius:$,onMouseDown:ct,onMouseEnter:ze,onMouseOut:rt,type:"source"}),(ne==="target"||ne===!0)&&oe.createElement(AD,{position:D,centerX:E,centerY:_,radius:$,onMouseDown:Ne,onMouseEnter:ze,onMouseOut:rt,type:"target"})))};return e.displayName="EdgeWrapper",b.memo(e)};function mCe(t){const e={default:ph(t.default||Ly),straight:ph(t.bezier||a7),step:ph(t.step||i7),smoothstep:ph(t.step||sw),simplebezier:ph(t.simplebezier||s7)},n={},r=Object.keys(t).filter(s=>!["default","bezier"].includes(s)).reduce((s,i)=>(s[i]=ph(t[i]||Ly),s),n);return{...e,...r}}function MD(t,e,n=null){const r=(n?.x||0)+e.x,s=(n?.y||0)+e.y,i=n?.width||e.width,a=n?.height||e.height;switch(t){case kt.Top:return{x:r+i/2,y:s};case kt.Right:return{x:r+i,y:s+a/2};case kt.Bottom:return{x:r+i/2,y:s+a};case kt.Left:return{x:r,y:s+a/2}}}function RD(t,e){return t?t.length===1||!e?t[0]:e&&t.find(n=>n.id===e)||null:null}const pCe=(t,e,n,r,s,i)=>{const a=MD(n,t,e),l=MD(i,r,s);return{sourceX:a.x,sourceY:a.y,targetX:l.x,targetY:l.y}};function gCe({sourcePos:t,targetPos:e,sourceWidth:n,sourceHeight:r,targetWidth:s,targetHeight:i,width:a,height:l,transform:c}){const d={x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x+n,e.x+s),y2:Math.max(t.y+r,e.y+i)};d.x===d.x2&&(d.x2+=1),d.y===d.y2&&(d.y2+=1);const h=jp({x:(0-c[0])/c[2],y:(0-c[1])/c[2],width:a/c[2],height:l/c[2]}),m=Math.max(0,Math.min(h.x2,d.x2)-Math.max(h.x,d.x)),g=Math.max(0,Math.min(h.y2,d.y2)-Math.max(h.y,d.y));return Math.ceil(m*g)>0}function DD(t){const e=t?.[$r]?.handleBounds||null,n=e&&t?.width&&t?.height&&typeof t?.positionAbsolute?.x<"u"&&typeof t?.positionAbsolute?.y<"u";return[{x:t?.positionAbsolute?.x||0,y:t?.positionAbsolute?.y||0,width:t?.width||0,height:t?.height||0},e,!!n]}const xCe=[{level:0,isMaxLevel:!0,edges:[]}];function vCe(t,e,n=!1){let r=-1;const s=t.reduce((a,l)=>{const c=Ca(l.zIndex);let d=c?l.zIndex:0;if(n){const h=e.get(l.target),m=e.get(l.source),g=l.selected||h?.selected||m?.selected,x=Math.max(m?.[$r]?.z||0,h?.[$r]?.z||0,1e3);d=(c?l.zIndex:0)+(g?x:0)}return a[d]?a[d].push(l):a[d]=[l],r=d>r?d:r,a},{}),i=Object.entries(s).map(([a,l])=>{const c=+a;return{edges:l,level:c,isMaxLevel:c===r}});return i.length===0?xCe:i}function yCe(t,e,n){const r=gr(b.useCallback(s=>t?s.edges.filter(i=>{const a=e.get(i.source),l=e.get(i.target);return a?.width&&a?.height&&l?.width&&l?.height&&gCe({sourcePos:a.positionAbsolute||{x:0,y:0},targetPos:l.positionAbsolute||{x:0,y:0},sourceWidth:a.width,sourceHeight:a.height,targetWidth:l.width,targetHeight:l.height,width:s.width,height:s.height,transform:s.transform})}):s.edges,[t,e]));return vCe(r,e,n)}const bCe=({color:t="none",strokeWidth:e=1})=>oe.createElement("polyline",{style:{stroke:t,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),wCe=({color:t="none",strokeWidth:e=1})=>oe.createElement("polyline",{style:{stroke:t,fill:t,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),PD={[Iy.Arrow]:bCe,[Iy.ArrowClosed]:wCe};function SCe(t){const e=gs();return b.useMemo(()=>Object.prototype.hasOwnProperty.call(PD,t)?PD[t]:(e.getState().onError?.("009",Yl.error009(t)),null),[t])}const kCe=({id:t,type:e,color:n,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{const c=SCe(e);return c?oe.createElement("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0"},oe.createElement(c,{color:n,strokeWidth:a})):null},OCe=({defaultColor:t,rfId:e})=>n=>{const r=[];return n.edges.reduce((s,i)=>([i.markerStart,i.markerEnd].forEach(a=>{if(a&&typeof a=="object"){const l=aj(a,e);r.includes(l)||(s.push({id:l,color:a.color||t,...a}),r.push(l))}}),s),[]).sort((s,i)=>s.id.localeCompare(i.id))},cG=({defaultColor:t,rfId:e})=>{const n=gr(b.useCallback(OCe({defaultColor:t,rfId:e}),[t,e]),(r,s)=>!(r.length!==s.length||r.some((i,a)=>i.id!==s[a].id)));return oe.createElement("defs",null,n.map(r=>oe.createElement(kCe,{id:r.id,key:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient})))};cG.displayName="MarkerDefinitions";var jCe=b.memo(cG);const NCe=t=>({nodesConnectable:t.nodesConnectable,edgesFocusable:t.edgesFocusable,edgesUpdatable:t.edgesUpdatable,elementsSelectable:t.elementsSelectable,width:t.width,height:t.height,connectionMode:t.connectionMode,nodeInternals:t.nodeInternals,onError:t.onError}),uG=({defaultMarkerColor:t,onlyRenderVisibleElements:e,elevateEdgesOnSelect:n,rfId:r,edgeTypes:s,noPanClassName:i,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:h,onEdgeDoubleClick:m,onReconnect:g,onReconnectStart:x,onReconnectEnd:y,reconnectRadius:w,children:S,disableKeyboardA11y:k})=>{const{edgesFocusable:j,edgesUpdatable:N,elementsSelectable:T,width:E,height:_,connectionMode:A,nodeInternals:D,onError:q}=gr(NCe,ks),B=yCe(e,D,n);return E?oe.createElement(oe.Fragment,null,B.map(({level:H,edges:W,isMaxLevel:ee})=>oe.createElement("svg",{key:H,style:{zIndex:H},width:E,height:_,className:"react-flow__edges react-flow__container"},ee&&oe.createElement(jCe,{defaultColor:t,rfId:r}),oe.createElement("g",null,W.map(I=>{const[V,L,$]=DD(D.get(I.source)),[K,Y,R]=DD(D.get(I.target));if(!$||!R)return null;let ie=I.type||"default";s[ie]||(q?.("011",Yl.error011(ie)),ie="default");const X=s[ie]||s.default,z=A===vd.Strict?Y.target:(Y.target??[]).concat(Y.source??[]),U=RD(L.source,I.sourceHandle),te=RD(z,I.targetHandle),ne=U?.position||kt.Bottom,G=te?.position||kt.Top,se=!!(I.focusable||j&&typeof I.focusable>"u"),re=I.reconnectable||I.updatable,ae=typeof g<"u"&&(re||N&&typeof re>"u");if(!U||!te)return q?.("008",Yl.error008(U,I)),null;const{sourceX:_e,sourceY:Be,targetX:Ye,targetY:Je}=pCe(V,U,ne,K,te,G);return oe.createElement(X,{key:I.id,id:I.id,className:Ls([I.className,i]),type:ie,data:I.data,selected:!!I.selected,animated:!!I.animated,hidden:!!I.hidden,label:I.label,labelStyle:I.labelStyle,labelShowBg:I.labelShowBg,labelBgStyle:I.labelBgStyle,labelBgPadding:I.labelBgPadding,labelBgBorderRadius:I.labelBgBorderRadius,style:I.style,source:I.source,target:I.target,sourceHandleId:I.sourceHandle,targetHandleId:I.targetHandle,markerEnd:I.markerEnd,markerStart:I.markerStart,sourceX:_e,sourceY:Be,targetX:Ye,targetY:Je,sourcePosition:ne,targetPosition:G,elementsSelectable:T,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,onClick:h,onEdgeDoubleClick:m,onReconnect:g,onReconnectStart:x,onReconnectEnd:y,reconnectRadius:w,rfId:r,ariaLabel:I.ariaLabel,isFocusable:se,isReconnectable:ae,pathOptions:"pathOptions"in I?I.pathOptions:void 0,interactionWidth:I.interactionWidth,disableKeyboardA11y:k})})))),S):null};uG.displayName="EdgeRenderer";var CCe=b.memo(uG);const TCe=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function ECe({children:t}){const e=gr(TCe);return oe.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:e}},t)}function _Ce(t){const e=u7(),n=b.useRef(!1);b.useEffect(()=>{!n.current&&e.viewportInitialized&&t&&(setTimeout(()=>t(e),1),n.current=!0)},[t,e.viewportInitialized])}const ACe={[kt.Left]:kt.Right,[kt.Right]:kt.Left,[kt.Top]:kt.Bottom,[kt.Bottom]:kt.Top},dG=({nodeId:t,handleType:e,style:n,type:r=qc.Bezier,CustomComponent:s,connectionStatus:i})=>{const{fromNode:a,handleId:l,toX:c,toY:d,connectionMode:h}=gr(b.useCallback(_=>({fromNode:_.nodeInternals.get(t),handleId:_.connectionHandleId,toX:(_.connectionPosition.x-_.transform[0])/_.transform[2],toY:(_.connectionPosition.y-_.transform[1])/_.transform[2],connectionMode:_.connectionMode}),[t]),ks),m=a?.[$r]?.handleBounds;let g=m?.[e];if(h===vd.Loose&&(g=g||m?.[e==="source"?"target":"source"]),!a||!g)return null;const x=l?g.find(_=>_.id===l):g[0],y=x?x.x+x.width/2:(a.width??0)/2,w=x?x.y+x.height/2:a.height??0,S=(a.positionAbsolute?.x??0)+y,k=(a.positionAbsolute?.y??0)+w,j=x?.position,N=j?ACe[j]:null;if(!j||!N)return null;if(s)return oe.createElement(s,{connectionLineType:r,connectionLineStyle:n,fromNode:a,fromHandle:x,fromX:S,fromY:k,toX:c,toY:d,fromPosition:j,toPosition:N,connectionStatus:i});let T="";const E={sourceX:S,sourceY:k,sourcePosition:j,targetX:c,targetY:d,targetPosition:N};return r===qc.Bezier?[T]=DW(E):r===qc.Step?[T]=ij({...E,borderRadius:0}):r===qc.SmoothStep?[T]=ij(E):r===qc.SimpleBezier?[T]=RW(E):T=`M${S},${k} ${c},${d}`,oe.createElement("path",{d:T,fill:"none",className:"react-flow__connection-path",style:n})};dG.displayName="ConnectionLine";const MCe=t=>({nodeId:t.connectionNodeId,handleType:t.connectionHandleType,nodesConnectable:t.nodesConnectable,connectionStatus:t.connectionStatus,width:t.width,height:t.height});function RCe({containerStyle:t,style:e,type:n,component:r}){const{nodeId:s,handleType:i,nodesConnectable:a,width:l,height:c,connectionStatus:d}=gr(MCe,ks);return!(s&&i&&l&&a)?null:oe.createElement("svg",{style:t,width:l,height:c,className:"react-flow__edges react-flow__connectionline react-flow__container"},oe.createElement("g",{className:Ls(["react-flow__connection",d])},oe.createElement(dG,{nodeId:s,handleType:i,style:e,type:n,CustomComponent:r,connectionStatus:d})))}function zD(t,e){return b.useRef(null),gs(),b.useMemo(()=>e(t),[t])}const hG=({nodeTypes:t,edgeTypes:e,onMove:n,onMoveStart:r,onMoveEnd:s,onInit:i,onNodeClick:a,onEdgeClick:l,onNodeDoubleClick:c,onEdgeDoubleClick:d,onNodeMouseEnter:h,onNodeMouseMove:m,onNodeMouseLeave:g,onNodeContextMenu:x,onSelectionContextMenu:y,onSelectionStart:w,onSelectionEnd:S,connectionLineType:k,connectionLineStyle:j,connectionLineComponent:N,connectionLineContainerStyle:T,selectionKeyCode:E,selectionOnDrag:_,selectionMode:A,multiSelectionKeyCode:D,panActivationKeyCode:q,zoomActivationKeyCode:B,deleteKeyCode:H,onlyRenderVisibleElements:W,elementsSelectable:ee,selectNodesOnDrag:I,defaultViewport:V,translateExtent:L,minZoom:$,maxZoom:K,preventScrolling:Y,defaultMarkerColor:R,zoomOnScroll:ie,zoomOnPinch:X,panOnScroll:z,panOnScrollSpeed:U,panOnScrollMode:te,zoomOnDoubleClick:ne,panOnDrag:G,onPaneClick:se,onPaneMouseEnter:re,onPaneMouseMove:ae,onPaneMouseLeave:_e,onPaneScroll:Be,onPaneContextMenu:Ye,onEdgeContextMenu:Je,onEdgeMouseEnter:Oe,onEdgeMouseMove:Ve,onEdgeMouseLeave:Ue,onReconnect:$e,onReconnectStart:jt,onReconnectEnd:vt,reconnectRadius:$n,noDragClassName:qt,noWheelClassName:un,noPanClassName:Mt,elevateEdgesOnSelect:ct,disableKeyboardA11y:Ne,nodeOrigin:ze,nodeExtent:rt,rfId:bt})=>{const zt=zD(t,oCe),Rt=zD(e,mCe);return _Ce(i),oe.createElement(iCe,{onPaneClick:se,onPaneMouseEnter:re,onPaneMouseMove:ae,onPaneMouseLeave:_e,onPaneContextMenu:Ye,onPaneScroll:Be,deleteKeyCode:H,selectionKeyCode:E,selectionOnDrag:_,selectionMode:A,onSelectionStart:w,onSelectionEnd:S,multiSelectionKeyCode:D,panActivationKeyCode:q,zoomActivationKeyCode:B,elementsSelectable:ee,onMove:n,onMoveStart:r,onMoveEnd:s,zoomOnScroll:ie,zoomOnPinch:X,zoomOnDoubleClick:ne,panOnScroll:z,panOnScrollSpeed:U,panOnScrollMode:te,panOnDrag:G,defaultViewport:V,translateExtent:L,minZoom:$,maxZoom:K,onSelectionContextMenu:y,preventScrolling:Y,noDragClassName:qt,noWheelClassName:un,noPanClassName:Mt,disableKeyboardA11y:Ne},oe.createElement(ECe,null,oe.createElement(CCe,{edgeTypes:Rt,onEdgeClick:l,onEdgeDoubleClick:d,onlyRenderVisibleElements:W,onEdgeContextMenu:Je,onEdgeMouseEnter:Oe,onEdgeMouseMove:Ve,onEdgeMouseLeave:Ue,onReconnect:$e,onReconnectStart:jt,onReconnectEnd:vt,reconnectRadius:$n,defaultMarkerColor:R,noPanClassName:Mt,elevateEdgesOnSelect:!!ct,disableKeyboardA11y:Ne,rfId:bt},oe.createElement(RCe,{style:j,type:k,component:N,containerStyle:T})),oe.createElement("div",{className:"react-flow__edgelabel-renderer"}),oe.createElement(uCe,{nodeTypes:zt,onNodeClick:a,onNodeDoubleClick:c,onNodeMouseEnter:h,onNodeMouseMove:m,onNodeMouseLeave:g,onNodeContextMenu:x,selectNodesOnDrag:I,onlyRenderVisibleElements:W,noPanClassName:Mt,noDragClassName:qt,disableKeyboardA11y:Ne,nodeOrigin:ze,nodeExtent:rt,rfId:bt})))};hG.displayName="GraphView";var DCe=b.memo(hG);const uj=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Mc={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:uj,nodeExtent:uj,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:vd.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:l7e,isValidConnection:void 0},PCe=()=>XOe((t,e)=>({...Mc,setNodes:n=>{const{nodeInternals:r,nodeOrigin:s,elevateNodesOnSelect:i}=e();t({nodeInternals:m5(n,r,s,i)})},getNodes:()=>Array.from(e().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=e();t({edges:n.map(s=>({...r,...s}))})},setDefaultNodesAndEdges:(n,r)=>{const s=typeof n<"u",i=typeof r<"u",a=s?m5(n,new Map,e().nodeOrigin,e().elevateNodesOnSelect):new Map;t({nodeInternals:a,edges:i?r:[],hasDefaultNodes:s,hasDefaultEdges:i})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:s,fitViewOnInit:i,fitViewOnInitDone:a,fitViewOnInitOptions:l,domNode:c,nodeOrigin:d}=e(),h=c?.querySelector(".react-flow__viewport");if(!h)return;const m=window.getComputedStyle(h),{m22:g}=new window.DOMMatrixReadOnly(m.transform),x=n.reduce((w,S)=>{const k=s.get(S.id);if(k?.hidden)s.set(k.id,{...k,[$r]:{...k[$r],handleBounds:void 0}});else if(k){const j=n7(S.nodeElement);!!(j.width&&j.height&&(k.width!==j.width||k.height!==j.height||S.forceUpdate))&&(s.set(k.id,{...k,[$r]:{...k[$r],handleBounds:{source:ED(".source",S.nodeElement,g,d),target:ED(".target",S.nodeElement,g,d)}},...j}),w.push({id:k.id,type:"dimensions",dimensions:j}))}return w},[]);ZW(s,d);const y=a||i&&!a&&JW(e,{initial:!0,...l});t({nodeInternals:new Map(s),fitViewOnInitDone:y}),x?.length>0&&r?.(x)},updateNodePositions:(n,r=!0,s=!1)=>{const{triggerNodeChanges:i}=e(),a=n.map(l=>{const c={id:l.id,type:"position",dragging:s};return r&&(c.positionAbsolute=l.positionAbsolute,c.position=l.position),c});i(a)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:s,hasDefaultNodes:i,nodeOrigin:a,getNodes:l,elevateNodesOnSelect:c}=e();if(n?.length){if(i){const d=tG(n,l()),h=m5(d,s,a,c);t({nodeInternals:h})}r?.(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:s,getNodes:i}=e();let a,l=null;r?a=n.map(c=>Lc(c,!0)):(a=Ah(i(),n),l=Ah(s,[])),X1({changedNodes:a,changedEdges:l,get:e,set:t})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:s,getNodes:i}=e();let a,l=null;r?a=n.map(c=>Lc(c,!0)):(a=Ah(s,n),l=Ah(i(),[])),X1({changedNodes:l,changedEdges:a,get:e,set:t})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:s,getNodes:i}=e(),a=n||i(),l=r||s,c=a.map(h=>(h.selected=!1,Lc(h.id,!1))),d=l.map(h=>Lc(h.id,!1));X1({changedNodes:c,changedEdges:d,get:e,set:t})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:s}=e();r?.scaleExtent([n,s]),t({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:s}=e();r?.scaleExtent([s,n]),t({maxZoom:n})},setTranslateExtent:n=>{e().d3Zoom?.translateExtent(n),t({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=e(),i=r().filter(l=>l.selected).map(l=>Lc(l.id,!1)),a=n.filter(l=>l.selected).map(l=>Lc(l.id,!1));X1({changedNodes:i,changedEdges:a,get:e,set:t})},setNodeExtent:n=>{const{nodeInternals:r}=e();r.forEach(s=>{s.positionAbsolute=r7(s.position,n)}),t({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:s,height:i,d3Zoom:a,d3Selection:l,translateExtent:c}=e();if(!a||!l||!n.x&&!n.y)return!1;const d=$l.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),h=[[0,0],[s,i]],m=a?.constrain()(d,h,c);return a.transform(l,m),r[0]!==m.x||r[1]!==m.y||r[2]!==m.k},cancelConnection:()=>t({connectionNodeId:Mc.connectionNodeId,connectionHandleId:Mc.connectionHandleId,connectionHandleType:Mc.connectionHandleType,connectionStatus:Mc.connectionStatus,connectionStartHandle:Mc.connectionStartHandle,connectionEndHandle:Mc.connectionEndHandle}),reset:()=>t({...Mc})}),Object.is),fG=({children:t})=>{const e=b.useRef(null);return e.current||(e.current=PCe()),oe.createElement(t7e,{value:e.current},t)};fG.displayName="ReactFlowProvider";const mG=({children:t})=>b.useContext(nw)?oe.createElement(oe.Fragment,null,t):oe.createElement(fG,null,t);mG.displayName="ReactFlowWrapper";const zCe={input:VW,default:lj,output:WW,group:c7},ICe={default:Ly,straight:a7,step:i7,smoothstep:sw,simplebezier:s7},LCe=[0,0],BCe=[15,15],FCe={x:0,y:0,zoom:1},qCe={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},pG=b.forwardRef(({nodes:t,edges:e,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:i=zCe,edgeTypes:a=ICe,onNodeClick:l,onEdgeClick:c,onInit:d,onMove:h,onMoveStart:m,onMoveEnd:g,onConnect:x,onConnectStart:y,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:k,onNodeMouseEnter:j,onNodeMouseMove:N,onNodeMouseLeave:T,onNodeContextMenu:E,onNodeDoubleClick:_,onNodeDragStart:A,onNodeDrag:D,onNodeDragStop:q,onNodesDelete:B,onEdgesDelete:H,onSelectionChange:W,onSelectionDragStart:ee,onSelectionDrag:I,onSelectionDragStop:V,onSelectionContextMenu:L,onSelectionStart:$,onSelectionEnd:K,connectionMode:Y=vd.Strict,connectionLineType:R=qc.Bezier,connectionLineStyle:ie,connectionLineComponent:X,connectionLineContainerStyle:z,deleteKeyCode:U="Backspace",selectionKeyCode:te="Shift",selectionOnDrag:ne=!1,selectionMode:G=Np.Full,panActivationKeyCode:se="Space",multiSelectionKeyCode:re=zy()?"Meta":"Control",zoomActivationKeyCode:ae=zy()?"Meta":"Control",snapToGrid:_e=!1,snapGrid:Be=BCe,onlyRenderVisibleElements:Ye=!1,selectNodesOnDrag:Je=!0,nodesDraggable:Oe,nodesConnectable:Ve,nodesFocusable:Ue,nodeOrigin:$e=LCe,edgesFocusable:jt,edgesUpdatable:vt,elementsSelectable:$n,defaultViewport:qt=FCe,minZoom:un=.5,maxZoom:Mt=2,translateExtent:ct=uj,preventScrolling:Ne=!0,nodeExtent:ze,defaultMarkerColor:rt="#b1b1b7",zoomOnScroll:bt=!0,zoomOnPinch:zt=!0,panOnScroll:Rt=!1,panOnScrollSpeed:Hn=.5,panOnScrollMode:We=Yu.Free,zoomOnDoubleClick:ot=!0,panOnDrag:dn=!0,onPaneClick:Pt,onPaneMouseEnter:xn,onPaneMouseMove:dt,onPaneMouseLeave:rn,onPaneScroll:wt,onPaneContextMenu:Wt,children:Gt,onEdgeContextMenu:lt,onEdgeDoubleClick:ve,onEdgeMouseEnter:He,onEdgeMouseMove:ht,onEdgeMouseLeave:vn,onEdgeUpdate:Qn,onEdgeUpdateStart:fr,onEdgeUpdateEnd:ar,onReconnect:xs,onReconnectStart:vs,onReconnectEnd:js,reconnectRadius:ge=10,edgeUpdaterRadius:Ie=10,onNodesChange:Et,onEdgesChange:kn,noDragClassName:Hr="nodrag",noWheelClassName:Mr="nowheel",noPanClassName:Rr="nopan",fitView:Ns=!1,fitViewOptions:Vf,connectOnClick:hw=!0,attributionPosition:fw,proOptions:Dg,defaultEdgeOptions:xu,elevateNodesOnSelect:Uf=!0,elevateEdgesOnSelect:rc=!1,disableKeyboardA11y:Jo=!1,autoPanOnConnect:vu=!0,autoPanOnNodeDrag:sc=!0,connectionRadius:Kr=20,isValidConnection:Pg,onError:zg,style:el,id:tl,nodeDragThreshold:mw,...Ig},Lg)=>{const Wf=tl||"1";return oe.createElement("div",{...Ig,style:{...el,...qCe},ref:Lg,className:Ls(["react-flow",s]),"data-testid":"rf__wrapper",id:tl},oe.createElement(mG,null,oe.createElement(DCe,{onInit:d,onMove:h,onMoveStart:m,onMoveEnd:g,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:j,onNodeMouseMove:N,onNodeMouseLeave:T,onNodeContextMenu:E,onNodeDoubleClick:_,nodeTypes:i,edgeTypes:a,connectionLineType:R,connectionLineStyle:ie,connectionLineComponent:X,connectionLineContainerStyle:z,selectionKeyCode:te,selectionOnDrag:ne,selectionMode:G,deleteKeyCode:U,multiSelectionKeyCode:re,panActivationKeyCode:se,zoomActivationKeyCode:ae,onlyRenderVisibleElements:Ye,selectNodesOnDrag:Je,defaultViewport:qt,translateExtent:ct,minZoom:un,maxZoom:Mt,preventScrolling:Ne,zoomOnScroll:bt,zoomOnPinch:zt,zoomOnDoubleClick:ot,panOnScroll:Rt,panOnScrollSpeed:Hn,panOnScrollMode:We,panOnDrag:dn,onPaneClick:Pt,onPaneMouseEnter:xn,onPaneMouseMove:dt,onPaneMouseLeave:rn,onPaneScroll:wt,onPaneContextMenu:Wt,onSelectionContextMenu:L,onSelectionStart:$,onSelectionEnd:K,onEdgeContextMenu:lt,onEdgeDoubleClick:ve,onEdgeMouseEnter:He,onEdgeMouseMove:ht,onEdgeMouseLeave:vn,onReconnect:xs??Qn,onReconnectStart:vs??fr,onReconnectEnd:js??ar,reconnectRadius:ge??Ie,defaultMarkerColor:rt,noDragClassName:Hr,noWheelClassName:Mr,noPanClassName:Rr,elevateEdgesOnSelect:rc,rfId:Wf,disableKeyboardA11y:Jo,nodeOrigin:$e,nodeExtent:ze}),oe.createElement(A7e,{nodes:t,edges:e,defaultNodes:n,defaultEdges:r,onConnect:x,onConnectStart:y,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:k,nodesDraggable:Oe,nodesConnectable:Ve,nodesFocusable:Ue,edgesFocusable:jt,edgesUpdatable:vt,elementsSelectable:$n,elevateNodesOnSelect:Uf,minZoom:un,maxZoom:Mt,nodeExtent:ze,onNodesChange:Et,onEdgesChange:kn,snapToGrid:_e,snapGrid:Be,connectionMode:Y,translateExtent:ct,connectOnClick:hw,defaultEdgeOptions:xu,fitView:Ns,fitViewOptions:Vf,onNodesDelete:B,onEdgesDelete:H,onNodeDragStart:A,onNodeDrag:D,onNodeDragStop:q,onSelectionDrag:I,onSelectionDragStart:ee,onSelectionDragStop:V,noPanClassName:Rr,nodeOrigin:$e,rfId:Wf,autoPanOnConnect:vu,autoPanOnNodeDrag:sc,onError:zg,connectionRadius:Kr,isValidConnection:Pg,nodeDragThreshold:mw}),oe.createElement(E7e,{onSelectionChange:W}),Gt,oe.createElement(r7e,{proOptions:Dg,position:fw}),oe.createElement(z7e,{rfId:Wf,disableKeyboardA11y:Jo})))});pG.displayName="ReactFlow";function gG(t){return e=>{const[n,r]=b.useState(e),s=b.useCallback(i=>r(a=>t(i,a)),[]);return[n,r,s]}}const $Ce=gG(tG),HCe=gG(Y7e),xG=({id:t,x:e,y:n,width:r,height:s,style:i,color:a,strokeColor:l,strokeWidth:c,className:d,borderRadius:h,shapeRendering:m,onClick:g,selected:x})=>{const{background:y,backgroundColor:w}=i||{},S=a||y||w;return oe.createElement("rect",{className:Ls(["react-flow__minimap-node",{selected:x},d]),x:e,y:n,rx:h,ry:h,width:r,height:s,fill:S,stroke:l,strokeWidth:c,shapeRendering:m,onClick:g?k=>g(k,t):void 0})};xG.displayName="MiniMapNode";var QCe=b.memo(xG);const VCe=t=>t.nodeOrigin,UCe=t=>t.getNodes().filter(e=>!e.hidden&&e.width&&e.height),v5=t=>t instanceof Function?t:()=>t;function WCe({nodeStrokeColor:t="transparent",nodeColor:e="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s=2,nodeComponent:i=QCe,onClick:a}){const l=gr(UCe,ks),c=gr(VCe),d=v5(e),h=v5(t),m=v5(n),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return oe.createElement(oe.Fragment,null,l.map(x=>{const{x:y,y:w}=id(x,c).positionAbsolute;return oe.createElement(i,{key:x.id,x:y,y:w,width:x.width,height:x.height,style:x.style,selected:x.selected,className:m(x),color:d(x),borderRadius:r,strokeColor:h(x),strokeWidth:s,shapeRendering:g,onClick:a,id:x.id})}))}var GCe=b.memo(WCe);const XCe=200,YCe=150,KCe=t=>{const e=t.getNodes(),n={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:n,boundingRect:e.length>0?a7e(iw(e,t.nodeOrigin),n):n,rfId:t.rfId}},ZCe="react-flow__minimap-desc";function vG({style:t,className:e,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a=2,nodeComponent:l,maskColor:c="rgb(240, 240, 240, 0.6)",maskStrokeColor:d="none",maskStrokeWidth:h=1,position:m="bottom-right",onClick:g,onNodeClick:x,pannable:y=!1,zoomable:w=!1,ariaLabel:S="React Flow mini map",inversePan:k=!1,zoomStep:j=10,offsetScale:N=5}){const T=gs(),E=b.useRef(null),{boundingRect:_,viewBB:A,rfId:D}=gr(KCe,ks),q=t?.width??XCe,B=t?.height??YCe,H=_.width/q,W=_.height/B,ee=Math.max(H,W),I=ee*q,V=ee*B,L=N*ee,$=_.x-(I-_.width)/2-L,K=_.y-(V-_.height)/2-L,Y=I+L*2,R=V+L*2,ie=`${ZCe}-${D}`,X=b.useRef(0);X.current=ee,b.useEffect(()=>{if(E.current){const te=va(E.current),ne=re=>{const{transform:ae,d3Selection:_e,d3Zoom:Be}=T.getState();if(re.sourceEvent.type!=="wheel"||!_e||!Be)return;const Ye=-re.sourceEvent.deltaY*(re.sourceEvent.deltaMode===1?.05:re.sourceEvent.deltaMode?1:.002)*j,Je=ae[2]*Math.pow(2,Ye);Be.scaleTo(_e,Je)},G=re=>{const{transform:ae,d3Selection:_e,d3Zoom:Be,translateExtent:Ye,width:Je,height:Oe}=T.getState();if(re.sourceEvent.type!=="mousemove"||!_e||!Be)return;const Ve=X.current*Math.max(1,ae[2])*(k?-1:1),Ue={x:ae[0]-re.sourceEvent.movementX*Ve,y:ae[1]-re.sourceEvent.movementY*Ve},$e=[[0,0],[Je,Oe]],jt=$l.translate(Ue.x,Ue.y).scale(ae[2]),vt=Be.constrain()(jt,$e,Ye);Be.transform(_e,vt)},se=kW().on("zoom",y?G:null).on("zoom.wheel",w?ne:null);return te.call(se),()=>{te.on("zoom",null)}}},[y,w,k,j]);const z=g?te=>{const ne=Qa(te);g(te,{x:ne[0],y:ne[1]})}:void 0,U=x?(te,ne)=>{const G=T.getState().nodeInternals.get(ne);x(te,G)}:void 0;return oe.createElement(rw,{position:m,style:t,className:Ls(["react-flow__minimap",e]),"data-testid":"rf__minimap"},oe.createElement("svg",{width:q,height:B,viewBox:`${$} ${K} ${Y} ${R}`,role:"img","aria-labelledby":ie,ref:E,onClick:z},S&&oe.createElement("title",{id:ie},S),oe.createElement(GCe,{onClick:U,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:l}),oe.createElement("path",{className:"react-flow__minimap-mask",d:`M${$-L},${K-L}h${Y+L*2}v${R+L*2}h${-Y-L*2}z - M${A.x},${A.y}h${A.width}v${A.height}h${-A.width}z`,fill:c,fillRule:"evenodd",stroke:d,strokeWidth:h,pointerEvents:"none"})))}vG.displayName="MiniMap";var JCe=b.memo(vG);function e8e(){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},oe.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function t8e(){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},oe.createElement("path",{d:"M0 0h32v4.2H0z"}))}function n8e(){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},oe.createElement("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"}))}function r8e(){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},oe.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"}))}function s8e(){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},oe.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"}))}const g0=({children:t,className:e,...n})=>oe.createElement("button",{type:"button",className:Ls(["react-flow__controls-button",e]),...n},t);g0.displayName="ControlButton";const i8e=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom}),yG=({style:t,showZoom:e=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:l,onInteractiveChange:c,className:d,children:h,position:m="bottom-left"})=>{const g=gs(),[x,y]=b.useState(!1),{isInteractive:w,minZoomReached:S,maxZoomReached:k}=gr(i8e,ks),{zoomIn:j,zoomOut:N,fitView:T}=u7();if(b.useEffect(()=>{y(!0)},[]),!x)return null;const E=()=>{j(),i?.()},_=()=>{N(),a?.()},A=()=>{T(s),l?.()},D=()=>{g.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),c?.(!w)};return oe.createElement(rw,{className:Ls(["react-flow__controls",d]),position:m,style:t,"data-testid":"rf__controls"},e&&oe.createElement(oe.Fragment,null,oe.createElement(g0,{onClick:E,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:k},oe.createElement(e8e,null)),oe.createElement(g0,{onClick:_,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:S},oe.createElement(t8e,null))),n&&oe.createElement(g0,{className:"react-flow__controls-fitview",onClick:A,title:"fit view","aria-label":"fit view"},oe.createElement(n8e,null)),r&&oe.createElement(g0,{className:"react-flow__controls-interactive",onClick:D,title:"toggle interactivity","aria-label":"toggle interactivity"},w?oe.createElement(s8e,null):oe.createElement(r8e,null)),h)};yG.displayName="Controls";var a8e=b.memo(yG),Ea;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Ea||(Ea={}));function o8e({color:t,dimensions:e,lineWidth:n}){return oe.createElement("path",{stroke:t,strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})}function l8e({color:t,radius:e}){return oe.createElement("circle",{cx:e,cy:e,r:e,fill:t})}const c8e={[Ea.Dots]:"#91919a",[Ea.Lines]:"#eee",[Ea.Cross]:"#e2e2e2"},u8e={[Ea.Dots]:1,[Ea.Lines]:1,[Ea.Cross]:6},d8e=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function bG({id:t,variant:e=Ea.Dots,gap:n=20,size:r,lineWidth:s=1,offset:i=2,color:a,style:l,className:c}){const d=b.useRef(null),{transform:h,patternId:m}=gr(d8e,ks),g=a||c8e[e],x=r||u8e[e],y=e===Ea.Dots,w=e===Ea.Cross,S=Array.isArray(n)?n:[n,n],k=[S[0]*h[2]||1,S[1]*h[2]||1],j=x*h[2],N=w?[j,j]:k,T=y?[j/i,j/i]:[N[0]/i,N[1]/i];return oe.createElement("svg",{className:Ls(["react-flow__background",c]),style:{...l,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:d,"data-testid":"rf__background"},oe.createElement("pattern",{id:m+t,x:h[0]%k[0],y:h[1]%k[1],width:k[0],height:k[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`},y?oe.createElement(l8e,{color:g,radius:j/i}):oe.createElement(o8e,{dimensions:N,color:g,lineWidth:s})),oe.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${m+t})`}))}bG.displayName="Background";var h8e=b.memo(bG);function h7(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var y5,ID;function f8e(){if(ID)return y5;ID=1;var t=Vz(),e=4;function n(r){return t(r,e)}return y5=n,y5}var b5,LD;function wG(){if(LD)return b5;LD=1;var t=HJ();function e(n){return typeof n=="function"?n:t}return b5=e,b5}var w5,BD;function SG(){if(BD)return w5;BD=1;var t=Uz(),e=wj(),n=wG(),r=bd();function s(i,a){var l=r(i)?t:e;return l(i,n(a))}return w5=s,w5}var S5,FD;function kG(){return FD||(FD=1,S5=SG()),S5}var k5,qD;function m8e(){if(qD)return k5;qD=1;var t=wj();function e(n,r){var s=[];return t(n,function(i,a,l){r(i,a,l)&&s.push(i)}),s}return k5=e,k5}var O5,$D;function OG(){if($D)return O5;$D=1;var t=QJ(),e=m8e(),n=Sj(),r=bd();function s(i,a){var l=r(i)?t:e;return l(i,n(a,3))}return O5=s,O5}var j5,HD;function p8e(){if(HD)return j5;HD=1;var t=Object.prototype,e=t.hasOwnProperty;function n(r,s){return r!=null&&e.call(r,s)}return j5=n,j5}var N5,QD;function jG(){if(QD)return N5;QD=1;var t=p8e(),e=VJ();function n(r,s){return r!=null&&e(r,s,t)}return N5=n,N5}var C5,VD;function g8e(){if(VD)return C5;VD=1;var t=Wz(),e=Gz(),n=Xz(),r=bd(),s=kj(),i=Oj(),a=UJ(),l=jj(),c="[object Map]",d="[object Set]",h=Object.prototype,m=h.hasOwnProperty;function g(x){if(x==null)return!0;if(s(x)&&(r(x)||typeof x=="string"||typeof x.splice=="function"||i(x)||l(x)||n(x)))return!x.length;var y=e(x);if(y==c||y==d)return!x.size;if(a(x))return!t(x).length;for(var w in x)if(m.call(x,w))return!1;return!0}return C5=g,C5}var T5,UD;function NG(){if(UD)return T5;UD=1;function t(e){return e===void 0}return T5=t,T5}var E5,WD;function x8e(){if(WD)return E5;WD=1;function t(e,n,r,s){var i=-1,a=e==null?0:e.length;for(s&&a&&(r=e[++i]);++i1?x.setNode(y,m):x.setNode(y)}),this},s.prototype.setNode=function(h,m){return t.has(this._nodes,h)?(arguments.length>1&&(this._nodes[h]=m),this):(this._nodes[h]=arguments.length>1?m:this._defaultNodeLabelFn(h),this._isCompound&&(this._parent[h]=n,this._children[h]={},this._children[n][h]=!0),this._in[h]={},this._preds[h]={},this._out[h]={},this._sucs[h]={},++this._nodeCount,this)},s.prototype.node=function(h){return this._nodes[h]},s.prototype.hasNode=function(h){return t.has(this._nodes,h)},s.prototype.removeNode=function(h){var m=this;if(t.has(this._nodes,h)){var g=function(x){m.removeEdge(m._edgeObjs[x])};delete this._nodes[h],this._isCompound&&(this._removeFromParentsChildList(h),delete this._parent[h],t.each(this.children(h),function(x){m.setParent(x)}),delete this._children[h]),t.each(t.keys(this._in[h]),g),delete this._in[h],delete this._preds[h],t.each(t.keys(this._out[h]),g),delete this._out[h],delete this._sucs[h],--this._nodeCount}return this},s.prototype.setParent=function(h,m){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t.isUndefined(m))m=n;else{m+="";for(var g=m;!t.isUndefined(g);g=this.parent(g))if(g===h)throw new Error("Setting "+m+" as parent of "+h+" would create a cycle");this.setNode(m)}return this.setNode(h),this._removeFromParentsChildList(h),this._parent[h]=m,this._children[m][h]=!0,this},s.prototype._removeFromParentsChildList=function(h){delete this._children[this._parent[h]][h]},s.prototype.parent=function(h){if(this._isCompound){var m=this._parent[h];if(m!==n)return m}},s.prototype.children=function(h){if(t.isUndefined(h)&&(h=n),this._isCompound){var m=this._children[h];if(m)return t.keys(m)}else{if(h===n)return this.nodes();if(this.hasNode(h))return[]}},s.prototype.predecessors=function(h){var m=this._preds[h];if(m)return t.keys(m)},s.prototype.successors=function(h){var m=this._sucs[h];if(m)return t.keys(m)},s.prototype.neighbors=function(h){var m=this.predecessors(h);if(m)return t.union(m,this.successors(h))},s.prototype.isLeaf=function(h){var m;return this.isDirected()?m=this.successors(h):m=this.neighbors(h),m.length===0},s.prototype.filterNodes=function(h){var m=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});m.setGraph(this.graph());var g=this;t.each(this._nodes,function(w,S){h(S)&&m.setNode(S,w)}),t.each(this._edgeObjs,function(w){m.hasNode(w.v)&&m.hasNode(w.w)&&m.setEdge(w,g.edge(w))});var x={};function y(w){var S=g.parent(w);return S===void 0||m.hasNode(S)?(x[w]=S,S):S in x?x[S]:y(S)}return this._isCompound&&t.each(m.nodes(),function(w){m.setParent(w,y(w))}),m},s.prototype.setDefaultEdgeLabel=function(h){return t.isFunction(h)||(h=t.constant(h)),this._defaultEdgeLabelFn=h,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return t.values(this._edgeObjs)},s.prototype.setPath=function(h,m){var g=this,x=arguments;return t.reduce(h,function(y,w){return x.length>1?g.setEdge(y,w,m):g.setEdge(y,w),w}),this},s.prototype.setEdge=function(){var h,m,g,x,y=!1,w=arguments[0];typeof w=="object"&&w!==null&&"v"in w?(h=w.v,m=w.w,g=w.name,arguments.length===2&&(x=arguments[1],y=!0)):(h=w,m=arguments[1],g=arguments[3],arguments.length>2&&(x=arguments[2],y=!0)),h=""+h,m=""+m,t.isUndefined(g)||(g=""+g);var S=l(this._isDirected,h,m,g);if(t.has(this._edgeLabels,S))return y&&(this._edgeLabels[S]=x),this;if(!t.isUndefined(g)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(h),this.setNode(m),this._edgeLabels[S]=y?x:this._defaultEdgeLabelFn(h,m,g);var k=c(this._isDirected,h,m,g);return h=k.v,m=k.w,Object.freeze(k),this._edgeObjs[S]=k,i(this._preds[m],h),i(this._sucs[h],m),this._in[m][S]=k,this._out[h][S]=k,this._edgeCount++,this},s.prototype.edge=function(h,m,g){var x=arguments.length===1?d(this._isDirected,arguments[0]):l(this._isDirected,h,m,g);return this._edgeLabels[x]},s.prototype.hasEdge=function(h,m,g){var x=arguments.length===1?d(this._isDirected,arguments[0]):l(this._isDirected,h,m,g);return t.has(this._edgeLabels,x)},s.prototype.removeEdge=function(h,m,g){var x=arguments.length===1?d(this._isDirected,arguments[0]):l(this._isDirected,h,m,g),y=this._edgeObjs[x];return y&&(h=y.v,m=y.w,delete this._edgeLabels[x],delete this._edgeObjs[x],a(this._preds[m],h),a(this._sucs[h],m),delete this._in[m][x],delete this._out[h][x],this._edgeCount--),this},s.prototype.inEdges=function(h,m){var g=this._in[h];if(g){var x=t.values(g);return m?t.filter(x,function(y){return y.v===m}):x}},s.prototype.outEdges=function(h,m){var g=this._out[h];if(g){var x=t.values(g);return m?t.filter(x,function(y){return y.w===m}):x}},s.prototype.nodeEdges=function(h,m){var g=this.inEdges(h,m);if(g)return g.concat(this.outEdges(h,m))};function i(h,m){h[m]?h[m]++:h[m]=1}function a(h,m){--h[m]||delete h[m]}function l(h,m,g,x){var y=""+m,w=""+g;if(!h&&y>w){var S=y;y=w,w=S}return y+r+w+r+(t.isUndefined(x)?e:x)}function c(h,m,g,x){var y=""+m,w=""+g;if(!h&&y>w){var S=y;y=w,w=S}var k={v:y,w};return x&&(k.name=x),k}function d(h,m){return l(h,m.v,m.w,m.name)}return $5}var H5,oP;function N8e(){return oP||(oP=1,H5="2.1.8"),H5}var Q5,lP;function C8e(){return lP||(lP=1,Q5={Graph:f7(),version:N8e()}),Q5}var V5,cP;function T8e(){if(cP)return V5;cP=1;var t=Ia(),e=f7();V5={write:n,read:i};function n(a){var l={options:{directed:a.isDirected(),multigraph:a.isMultigraph(),compound:a.isCompound()},nodes:r(a),edges:s(a)};return t.isUndefined(a.graph())||(l.value=t.clone(a.graph())),l}function r(a){return t.map(a.nodes(),function(l){var c=a.node(l),d=a.parent(l),h={v:l};return t.isUndefined(c)||(h.value=c),t.isUndefined(d)||(h.parent=d),h})}function s(a){return t.map(a.edges(),function(l){var c=a.edge(l),d={v:l.v,w:l.w};return t.isUndefined(l.name)||(d.name=l.name),t.isUndefined(c)||(d.value=c),d})}function i(a){var l=new e(a.options).setGraph(a.value);return t.each(a.nodes,function(c){l.setNode(c.v,c.value),c.parent&&l.setParent(c.v,c.parent)}),t.each(a.edges,function(c){l.setEdge({v:c.v,w:c.w,name:c.name},c.value)}),l}return V5}var U5,uP;function E8e(){if(uP)return U5;uP=1;var t=Ia();U5=e;function e(n){var r={},s=[],i;function a(l){t.has(r,l)||(r[l]=!0,i.push(l),t.each(n.successors(l),a),t.each(n.predecessors(l),a))}return t.each(n.nodes(),function(l){i=[],a(l),i.length&&s.push(i)}),s}return U5}var W5,dP;function _G(){if(dP)return W5;dP=1;var t=Ia();W5=e;function e(){this._arr=[],this._keyIndices={}}return e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map(function(n){return n.key})},e.prototype.has=function(n){return t.has(this._keyIndices,n)},e.prototype.priority=function(n){var r=this._keyIndices[n];if(r!==void 0)return this._arr[r].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(n,r){var s=this._keyIndices;if(n=String(n),!t.has(s,n)){var i=this._arr,a=i.length;return s[n]=a,i.push({key:n,priority:r}),this._decrease(a),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key},e.prototype.decrease=function(n,r){var s=this._keyIndices[n];if(r>this._arr[s].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[s].priority+" New: "+r);this._arr[s].priority=r,this._decrease(s)},e.prototype._heapify=function(n){var r=this._arr,s=2*n,i=s+1,a=n;s>1,!(r[i].priority0&&(m=h.removeMin(),g=d[m],g.distance!==Number.POSITIVE_INFINITY);)c(m).forEach(x);return d}return G5}var X5,fP;function _8e(){if(fP)return X5;fP=1;var t=AG(),e=Ia();X5=n;function n(r,s,i){return e.transform(r.nodes(),function(a,l){a[l]=t(r,l,s,i)},{})}return X5}var Y5,mP;function MG(){if(mP)return Y5;mP=1;var t=Ia();Y5=e;function e(n){var r=0,s=[],i={},a=[];function l(c){var d=i[c]={onStack:!0,lowlink:r,index:r++};if(s.push(c),n.successors(c).forEach(function(g){t.has(i,g)?i[g].onStack&&(d.lowlink=Math.min(d.lowlink,i[g].index)):(l(g),d.lowlink=Math.min(d.lowlink,i[g].lowlink))}),d.lowlink===d.index){var h=[],m;do m=s.pop(),i[m].onStack=!1,h.push(m);while(c!==m);a.push(h)}}return n.nodes().forEach(function(c){t.has(i,c)||l(c)}),a}return Y5}var K5,pP;function A8e(){if(pP)return K5;pP=1;var t=Ia(),e=MG();K5=n;function n(r){return t.filter(e(r),function(s){return s.length>1||s.length===1&&r.hasEdge(s[0],s[0])})}return K5}var Z5,gP;function M8e(){if(gP)return Z5;gP=1;var t=Ia();Z5=n;var e=t.constant(1);function n(s,i,a){return r(s,i||e,a||function(l){return s.outEdges(l)})}function r(s,i,a){var l={},c=s.nodes();return c.forEach(function(d){l[d]={},l[d][d]={distance:0},c.forEach(function(h){d!==h&&(l[d][h]={distance:Number.POSITIVE_INFINITY})}),a(d).forEach(function(h){var m=h.v===d?h.w:h.v,g=i(h);l[d][m]={distance:g,predecessor:d}})}),c.forEach(function(d){var h=l[d];c.forEach(function(m){var g=l[m];c.forEach(function(x){var y=g[d],w=h[x],S=g[x],k=y.distance+w.distance;k0;){if(d=c.removeMin(),t.has(l,d))a.setEdge(d,l[d]);else{if(m)throw new Error("Input graph is not connected: "+s);m=!0}s.nodeEdges(d).forEach(h)}return a}return s3}var i3,kP;function I8e(){return kP||(kP=1,i3={components:E8e(),dijkstra:AG(),dijkstraAll:_8e(),findCycles:A8e(),floydWarshall:M8e(),isAcyclic:R8e(),postorder:D8e(),preorder:P8e(),prim:z8e(),tarjan:MG(),topsort:RG()}),i3}var a3,OP;function L8e(){if(OP)return a3;OP=1;var t=C8e();return a3={Graph:t.Graph,json:T8e(),alg:I8e(),version:t.version},a3}var o3,jP;function to(){if(jP)return o3;jP=1;var t;if(typeof h7=="function")try{t=L8e()}catch{}return t||(t=window.graphlib),o3=t,o3}var l3,NP;function B8e(){if(NP)return l3;NP=1;var t=Vz(),e=1,n=4;function r(s){return t(s,e|n)}return l3=r,l3}var c3,CP;function F8e(){if(CP)return c3;CP=1;var t=Cj(),e=eI(),n=Jz(),r=Hy(),s=Object.prototype,i=s.hasOwnProperty,a=t(function(l,c){l=Object(l);var d=-1,h=c.length,m=h>2?c[2]:void 0;for(m&&n(c[0],c[1],m)&&(h=1);++d1?i[l-1]:void 0,d=l>2?i[2]:void 0;for(c=r.length>3&&typeof c=="function"?(l--,c):void 0,d&&e(i[0],i[1],d)&&(c=l<3?void 0:c,l=1),s=Object(s);++a0;--S)if(w=h[S].dequeue(),w){g=g.concat(a(d,h,m,w,!0));break}}}return g}function a(d,h,m,g,x){var y=x?[]:void 0;return t.forEach(d.inEdges(g.v),function(w){var S=d.edge(w),k=d.node(w.v);x&&y.push({v:w.v,w:w.w}),k.out-=S,c(h,m,k)}),t.forEach(d.outEdges(g.v),function(w){var S=d.edge(w),k=w.w,j=d.node(k);j.in-=S,c(h,m,j)}),d.removeNode(g.v),y}function l(d,h){var m=new e,g=0,x=0;t.forEach(d.nodes(),function(S){m.setNode(S,{v:S,in:0,out:0})}),t.forEach(d.edges(),function(S){var k=m.edge(S.v,S.w)||0,j=h(S),N=k+j;m.setEdge(S.v,S.w,N),x=Math.max(x,m.node(S.v).out+=j),g=Math.max(g,m.node(S.w).in+=j)});var y=t.range(x+g+3).map(function(){return new n}),w=g+1;return t.forEach(m.nodes(),function(S){c(y,w,m.node(S))}),{graph:m,buckets:y,zeroIdx:w}}function c(d,h,m){m.out?m.in?d[m.out-m.in+h].enqueue(m):d[d.length-1].enqueue(m):d[0].enqueue(m)}return C3}var T3,UP;function nTe(){if(UP)return T3;UP=1;var t=Ar(),e=tTe();T3={run:n,undo:s};function n(i){var a=i.graph().acyclicer==="greedy"?e(i,l(i)):r(i);t.forEach(a,function(c){var d=i.edge(c);i.removeEdge(c),d.forwardName=c.name,d.reversed=!0,i.setEdge(c.w,c.v,d,t.uniqueId("rev"))});function l(c){return function(d){return c.edge(d).weight}}}function r(i){var a=[],l={},c={};function d(h){t.has(c,h)||(c[h]=!0,l[h]=!0,t.forEach(i.outEdges(h),function(m){t.has(l,m.w)?a.push(m):d(m.w)}),delete l[h])}return t.forEach(i.nodes(),d),a}function s(i){t.forEach(i.edges(),function(a){var l=i.edge(a);if(l.reversed){i.removeEdge(a);var c=l.forwardName;delete l.reversed,delete l.forwardName,i.setEdge(a.w,a.v,l,c)}})}return T3}var E3,WP;function Ti(){if(WP)return E3;WP=1;var t=Ar(),e=to().Graph;E3={addDummyNode:n,simplify:r,asNonCompoundGraph:s,successorWeights:i,predecessorWeights:a,intersectRect:l,buildLayerMatrix:c,normalizeRanks:d,removeEmptyRanks:h,addBorderNode:m,maxRank:g,partition:x,time:y,notime:w};function n(S,k,j,N){var T;do T=t.uniqueId(N);while(S.hasNode(T));return j.dummy=k,S.setNode(T,j),T}function r(S){var k=new e().setGraph(S.graph());return t.forEach(S.nodes(),function(j){k.setNode(j,S.node(j))}),t.forEach(S.edges(),function(j){var N=k.edge(j.v,j.w)||{weight:0,minlen:1},T=S.edge(j);k.setEdge(j.v,j.w,{weight:N.weight+T.weight,minlen:Math.max(N.minlen,T.minlen)})}),k}function s(S){var k=new e({multigraph:S.isMultigraph()}).setGraph(S.graph());return t.forEach(S.nodes(),function(j){S.children(j).length||k.setNode(j,S.node(j))}),t.forEach(S.edges(),function(j){k.setEdge(j,S.edge(j))}),k}function i(S){var k=t.map(S.nodes(),function(j){var N={};return t.forEach(S.outEdges(j),function(T){N[T.w]=(N[T.w]||0)+S.edge(T).weight}),N});return t.zipObject(S.nodes(),k)}function a(S){var k=t.map(S.nodes(),function(j){var N={};return t.forEach(S.inEdges(j),function(T){N[T.v]=(N[T.v]||0)+S.edge(T).weight}),N});return t.zipObject(S.nodes(),k)}function l(S,k){var j=S.x,N=S.y,T=k.x-j,E=k.y-N,_=S.width/2,A=S.height/2;if(!T&&!E)throw new Error("Not possible to find intersection inside of the rectangle");var D,q;return Math.abs(E)*_>Math.abs(T)*A?(E<0&&(A=-A),D=A*T/E,q=A):(T<0&&(_=-_),D=_,q=_*E/T),{x:j+D,y:N+q}}function c(S){var k=t.map(t.range(g(S)+1),function(){return[]});return t.forEach(S.nodes(),function(j){var N=S.node(j),T=N.rank;t.isUndefined(T)||(k[T][N.order]=j)}),k}function d(S){var k=t.min(t.map(S.nodes(),function(j){return S.node(j).rank}));t.forEach(S.nodes(),function(j){var N=S.node(j);t.has(N,"rank")&&(N.rank-=k)})}function h(S){var k=t.min(t.map(S.nodes(),function(E){return S.node(E).rank})),j=[];t.forEach(S.nodes(),function(E){var _=S.node(E).rank-k;j[_]||(j[_]=[]),j[_].push(E)});var N=0,T=S.graph().nodeRankFactor;t.forEach(j,function(E,_){t.isUndefined(E)&&_%T!==0?--N:N&&t.forEach(E,function(A){S.node(A).rank+=N})})}function m(S,k,j,N){var T={width:0,height:0};return arguments.length>=4&&(T.rank=j,T.order=N),n(S,"border",T,k)}function g(S){return t.max(t.map(S.nodes(),function(k){var j=S.node(k).rank;if(!t.isUndefined(j))return j}))}function x(S,k){var j={lhs:[],rhs:[]};return t.forEach(S,function(N){k(N)?j.lhs.push(N):j.rhs.push(N)}),j}function y(S,k){var j=t.now();try{return k()}finally{console.log(S+" time: "+(t.now()-j)+"ms")}}function w(S,k){return k()}return E3}var _3,GP;function rTe(){if(GP)return _3;GP=1;var t=Ar(),e=Ti();_3={run:n,undo:s};function n(i){i.graph().dummyChains=[],t.forEach(i.edges(),function(a){r(i,a)})}function r(i,a){var l=a.v,c=i.node(l).rank,d=a.w,h=i.node(d).rank,m=a.name,g=i.edge(a),x=g.labelRank;if(h!==c+1){i.removeEdge(a);var y,w,S;for(S=0,++c;cq.lim&&(B=q,H=!0);var W=t.filter(T.edges(),function(ee){return H===j(N,N.node(ee.v),B)&&H!==j(N,N.node(ee.w),B)});return t.minBy(W,function(ee){return n(T,ee)})}function w(N,T,E,_){var A=E.v,D=E.w;N.removeEdge(A,D),N.setEdge(_.v,_.w,{}),m(N),c(N,T),S(N,T)}function S(N,T){var E=t.find(N.nodes(),function(A){return!T.node(A).parent}),_=s(N,E);_=_.slice(1),t.forEach(_,function(A){var D=N.node(A).parent,q=T.edge(A,D),B=!1;q||(q=T.edge(D,A),B=!0),T.node(A).rank=T.node(D).rank+(B?q.minlen:-q.minlen)})}function k(N,T,E){return N.hasEdge(T,E)}function j(N,T,E){return E.low<=T.lim&&T.lim<=E.lim}return R3}var D3,ZP;function iTe(){if(ZP)return D3;ZP=1;var t=By(),e=t.longestPath,n=IG(),r=sTe();D3=s;function s(c){switch(c.graph().ranker){case"network-simplex":l(c);break;case"tight-tree":a(c);break;case"longest-path":i(c);break;default:l(c)}}var i=e;function a(c){e(c),n(c)}function l(c){r(c)}return D3}var P3,JP;function aTe(){if(JP)return P3;JP=1;var t=Ar();P3=e;function e(s){var i=r(s);t.forEach(s.graph().dummyChains,function(a){for(var l=s.node(a),c=l.edgeObj,d=n(s,i,c.v,c.w),h=d.path,m=d.lca,g=0,x=h[g],y=!0;a!==c.w;){if(l=s.node(a),y){for(;(x=h[g])!==m&&s.node(x).maxRankh||m>i[g].lim));for(x=g,g=l;(g=s.parent(g))!==x;)d.push(g);return{path:c.concat(d.reverse()),lca:x}}function r(s){var i={},a=0;function l(c){var d=a;t.forEach(s.children(c),l),i[c]={low:d,lim:a++}}return t.forEach(s.children(),l),i}return P3}var z3,ez;function oTe(){if(ez)return z3;ez=1;var t=Ar(),e=Ti();z3={run:n,cleanup:a};function n(l){var c=e.addDummyNode(l,"root",{},"_root"),d=s(l),h=t.max(t.values(d))-1,m=2*h+1;l.graph().nestingRoot=c,t.forEach(l.edges(),function(x){l.edge(x).minlen*=m});var g=i(l)+1;t.forEach(l.children(),function(x){r(l,c,m,g,h,d,x)}),l.graph().nodeRankFactor=m}function r(l,c,d,h,m,g,x){var y=l.children(x);if(!y.length){x!==c&&l.setEdge(c,x,{weight:0,minlen:d});return}var w=e.addBorderNode(l,"_bt"),S=e.addBorderNode(l,"_bb"),k=l.node(x);l.setParent(w,x),k.borderTop=w,l.setParent(S,x),k.borderBottom=S,t.forEach(y,function(j){r(l,c,d,h,m,g,j);var N=l.node(j),T=N.borderTop?N.borderTop:j,E=N.borderBottom?N.borderBottom:j,_=N.borderTop?h:2*h,A=T!==E?1:m-g[x]+1;l.setEdge(w,T,{weight:_,minlen:A,nestingEdge:!0}),l.setEdge(E,S,{weight:_,minlen:A,nestingEdge:!0})}),l.parent(x)||l.setEdge(c,w,{weight:0,minlen:m+g[x]})}function s(l){var c={};function d(h,m){var g=l.children(h);g&&g.length&&t.forEach(g,function(x){d(x,m+1)}),c[h]=m}return t.forEach(l.children(),function(h){d(h,1)}),c}function i(l){return t.reduce(l.edges(),function(c,d){return c+l.edge(d).weight},0)}function a(l){var c=l.graph();l.removeNode(c.nestingRoot),delete c.nestingRoot,t.forEach(l.edges(),function(d){var h=l.edge(d);h.nestingEdge&&l.removeEdge(d)})}return z3}var I3,tz;function lTe(){if(tz)return I3;tz=1;var t=Ar(),e=Ti();I3=n;function n(s){function i(a){var l=s.children(a),c=s.node(a);if(l.length&&t.forEach(l,i),t.has(c,"minRank")){c.borderLeft=[],c.borderRight=[];for(var d=c.minRank,h=c.maxRank+1;d0;)x%2&&(y+=h[x+1]),x=x-1>>1,h[x]+=g.weight;m+=g.weight*y})),m}return F3}var q3,iz;function hTe(){if(iz)return q3;iz=1;var t=Ar();q3=e;function e(n,r){return t.map(r,function(s){var i=n.inEdges(s);if(i.length){var a=t.reduce(i,function(l,c){var d=n.edge(c),h=n.node(c.v);return{sum:l.sum+d.weight*h.order,weight:l.weight+d.weight}},{sum:0,weight:0});return{v:s,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:s}})}return q3}var $3,az;function fTe(){if(az)return $3;az=1;var t=Ar();$3=e;function e(s,i){var a={};t.forEach(s,function(c,d){var h=a[c.v]={indegree:0,in:[],out:[],vs:[c.v],i:d};t.isUndefined(c.barycenter)||(h.barycenter=c.barycenter,h.weight=c.weight)}),t.forEach(i.edges(),function(c){var d=a[c.v],h=a[c.w];!t.isUndefined(d)&&!t.isUndefined(h)&&(h.indegree++,d.out.push(a[c.w]))});var l=t.filter(a,function(c){return!c.indegree});return n(l)}function n(s){var i=[];function a(d){return function(h){h.merged||(t.isUndefined(h.barycenter)||t.isUndefined(d.barycenter)||h.barycenter>=d.barycenter)&&r(d,h)}}function l(d){return function(h){h.in.push(d),--h.indegree===0&&s.push(h)}}for(;s.length;){var c=s.pop();i.push(c),t.forEach(c.in.reverse(),a(c)),t.forEach(c.out,l(c))}return t.map(t.filter(i,function(d){return!d.merged}),function(d){return t.pick(d,["vs","i","barycenter","weight"])})}function r(s,i){var a=0,l=0;s.weight&&(a+=s.barycenter*s.weight,l+=s.weight),i.weight&&(a+=i.barycenter*i.weight,l+=i.weight),s.vs=i.vs.concat(s.vs),s.barycenter=a/l,s.weight=l,s.i=Math.min(i.i,s.i),i.merged=!0}return $3}var H3,oz;function mTe(){if(oz)return H3;oz=1;var t=Ar(),e=Ti();H3=n;function n(i,a){var l=e.partition(i,function(w){return t.has(w,"barycenter")}),c=l.lhs,d=t.sortBy(l.rhs,function(w){return-w.i}),h=[],m=0,g=0,x=0;c.sort(s(!!a)),x=r(h,d,x),t.forEach(c,function(w){x+=w.vs.length,h.push(w.vs),m+=w.barycenter*w.weight,g+=w.weight,x=r(h,d,x)});var y={vs:t.flatten(h,!0)};return g&&(y.barycenter=m/g,y.weight=g),y}function r(i,a,l){for(var c;a.length&&(c=t.last(a)).i<=l;)a.pop(),i.push(c.vs),l++;return l}function s(i){return function(a,l){return a.barycenterl.barycenter?1:i?l.i-a.i:a.i-l.i}}return H3}var Q3,lz;function pTe(){if(lz)return Q3;lz=1;var t=Ar(),e=hTe(),n=fTe(),r=mTe();Q3=s;function s(l,c,d,h){var m=l.children(c),g=l.node(c),x=g?g.borderLeft:void 0,y=g?g.borderRight:void 0,w={};x&&(m=t.filter(m,function(E){return E!==x&&E!==y}));var S=e(l,m);t.forEach(S,function(E){if(l.children(E.v).length){var _=s(l,E.v,d,h);w[E.v]=_,t.has(_,"barycenter")&&a(E,_)}});var k=n(S,d);i(k,w);var j=r(k,h);if(x&&(j.vs=t.flatten([x,j.vs,y],!0),l.predecessors(x).length)){var N=l.node(l.predecessors(x)[0]),T=l.node(l.predecessors(y)[0]);t.has(j,"barycenter")||(j.barycenter=0,j.weight=0),j.barycenter=(j.barycenter*j.weight+N.order+T.order)/(j.weight+2),j.weight+=2}return j}function i(l,c){t.forEach(l,function(d){d.vs=t.flatten(d.vs.map(function(h){return c[h]?c[h].vs:h}),!0)})}function a(l,c){t.isUndefined(l.barycenter)?(l.barycenter=c.barycenter,l.weight=c.weight):(l.barycenter=(l.barycenter*l.weight+c.barycenter*c.weight)/(l.weight+c.weight),l.weight+=c.weight)}return Q3}var V3,cz;function gTe(){if(cz)return V3;cz=1;var t=Ar(),e=to().Graph;V3=n;function n(s,i,a){var l=r(s),c=new e({compound:!0}).setGraph({root:l}).setDefaultNodeLabel(function(d){return s.node(d)});return t.forEach(s.nodes(),function(d){var h=s.node(d),m=s.parent(d);(h.rank===i||h.minRank<=i&&i<=h.maxRank)&&(c.setNode(d),c.setParent(d,m||l),t.forEach(s[a](d),function(g){var x=g.v===d?g.w:g.v,y=c.edge(x,d),w=t.isUndefined(y)?0:y.weight;c.setEdge(x,d,{weight:s.edge(g).weight+w})}),t.has(h,"minRank")&&c.setNode(d,{borderLeft:h.borderLeft[i],borderRight:h.borderRight[i]}))}),c}function r(s){for(var i;s.hasNode(i=t.uniqueId("_root")););return i}return V3}var U3,uz;function xTe(){if(uz)return U3;uz=1;var t=Ar();U3=e;function e(n,r,s){var i={},a;t.forEach(s,function(l){for(var c=n.parent(l),d,h;c;){if(d=n.parent(c),d?(h=i[d],i[d]=c):(h=a,a=c),h&&h!==c){r.setEdge(h,c);return}c=d}})}return U3}var W3,dz;function vTe(){if(dz)return W3;dz=1;var t=Ar(),e=uTe(),n=dTe(),r=pTe(),s=gTe(),i=xTe(),a=to().Graph,l=Ti();W3=c;function c(g){var x=l.maxRank(g),y=d(g,t.range(1,x+1),"inEdges"),w=d(g,t.range(x-1,-1,-1),"outEdges"),S=e(g);m(g,S);for(var k=Number.POSITIVE_INFINITY,j,N=0,T=0;T<4;++N,++T){h(N%2?y:w,N%4>=2),S=l.buildLayerMatrix(g);var E=n(g,S);EB)&&a(N,ee,H)})})}function E(_,A){var D=-1,q,B=0;return t.forEach(A,function(H,W){if(k.node(H).dummy==="border"){var ee=k.predecessors(H);ee.length&&(q=k.node(ee[0]).order,T(A,B,W,D,q),B=W,D=q)}T(A,B,A.length,q,_.length)}),A}return t.reduce(j,E),N}function i(k,j){if(k.node(j).dummy)return t.find(k.predecessors(j),function(N){return k.node(N).dummy})}function a(k,j,N){if(j>N){var T=j;j=N,N=T}var E=k[j];E||(k[j]=E={}),E[N]=!0}function l(k,j,N){if(j>N){var T=j;j=N,N=T}return t.has(k[j],N)}function c(k,j,N,T){var E={},_={},A={};return t.forEach(j,function(D){t.forEach(D,function(q,B){E[q]=q,_[q]=q,A[q]=B})}),t.forEach(j,function(D){var q=-1;t.forEach(D,function(B){var H=T(B);if(H.length){H=t.sortBy(H,function(L){return A[L]});for(var W=(H.length-1)/2,ee=Math.floor(W),I=Math.ceil(W);ee<=I;++ee){var V=H[ee];_[B]===B&&qo.jsxs("div",{className:"px-4 py-2 shadow-md rounded-lg bg-gradient-to-br from-blue-500 to-blue-600 border-2 border-blue-700 min-w-[120px]",children:[o.jsx(au,{type:"target",position:kt.Top}),o.jsx("div",{className:"font-semibold text-white text-sm truncate max-w-[200px]",title:t.content,children:t.label}),o.jsx(au,{type:"source",position:kt.Bottom})]}));LG.displayName="EntityNode";const BG=b.memo(({data:t})=>o.jsxs("div",{className:"px-3 py-2 shadow-md rounded-md bg-gradient-to-br from-green-500 to-green-600 border-2 border-green-700 min-w-[100px]",children:[o.jsx(au,{type:"target",position:kt.Top}),o.jsx("div",{className:"font-medium text-white text-xs truncate max-w-[150px]",title:t.content,children:t.label}),o.jsx(au,{type:"source",position:kt.Bottom})]}));BG.displayName="ParagraphNode";const ETe={entity:LG,paragraph:BG};function _Te(t,e){const n=new vz.graphlib.Graph;n.setDefaultEdgeLabel(()=>({})),n.setGraph({rankdir:"TB",ranksep:100,nodesep:80});const r=[],s=[];return t.forEach(i=>{n.setNode(i.id,{width:150,height:50})}),e.forEach(i=>{n.setEdge(i.source,i.target)}),vz.layout(n),t.forEach(i=>{const a=n.node(i.id);r.push({id:i.id,type:i.type,position:{x:a.x-75,y:a.y-25},data:{label:i.content.slice(0,20)+(i.content.length>20?"...":""),content:i.content}})}),e.forEach((i,a)=>{const l={id:`edge-${a}`,source:i.source,target:i.target,animated:t.length<=200&&i.weight>5,style:{strokeWidth:Math.min(i.weight/2,5),opacity:.6}};i.weight>10&&t.length<100&&(l.label=`${i.weight.toFixed(0)}`),s.push(l)}),{nodes:r,edges:s}}function ATe(){const t=na(),[e,n]=b.useState(!1),[r,s]=b.useState(null),[i,a]=b.useState(""),[l,c]=b.useState("all"),[d,h]=b.useState(50),[m,g]=b.useState("50"),[x,y]=b.useState(!1),[w,S]=b.useState(!0),[k,j]=b.useState(!1),[N,T]=b.useState(!1),[E,_,A]=$Ce([]),[D,q,B]=HCe([]),[H,W]=b.useState(0),[ee,I]=b.useState(null),[V,L]=b.useState(null),{toast:$}=Lr(),K=b.useCallback(ne=>ne.type==="entity"?"#6366f1":ne.type==="paragraph"?"#10b981":"#6b7280",[]),Y=b.useCallback(async(ne=!1)=>{try{if(!ne&&d>200){T(!0);return}n(!0);const[G,se]=await Promise.all([NTe(d,l),CTe()]);if(s(se),G.nodes.length===0){$({title:"提示",description:"知识库为空,请先导入知识数据"}),_([]),q([]);return}const{nodes:re,edges:ae}=_Te(G.nodes,G.edges);_(re),q(ae),W(re.length),se&&se.total_nodes>d&&$({title:"提示",description:`知识图谱包含 ${se.total_nodes} 个节点,当前显示 ${re.length} 个`}),$({title:"加载成功",description:`已加载 ${re.length} 个节点,${ae.length} 条边`})}catch(G){console.error("加载知识图谱失败:",G),$({title:"加载失败",description:G instanceof Error?G.message:"未知错误",variant:"destructive"})}finally{n(!1)}},[d,l,$]),R=b.useCallback(async()=>{if(!i.trim()){$({title:"提示",description:"请输入搜索关键词"});return}try{const ne=await TTe(i);if(ne.length===0){$({title:"未找到",description:"没有找到匹配的节点"});return}const G=new Set(ne.map(se=>se.id));_(se=>se.map(re=>({...re,style:{...re.style,opacity:G.has(re.id)?1:.3,filter:G.has(re.id)?"brightness(1.2)":"brightness(0.8)"}}))),$({title:"搜索完成",description:`找到 ${ne.length} 个匹配节点`})}catch(ne){console.error("搜索失败:",ne),$({title:"搜索失败",description:ne instanceof Error?ne.message:"未知错误",variant:"destructive"})}},[i,$]),ie=b.useCallback(()=>{_(ne=>ne.map(G=>({...G,style:{...G.style,opacity:1,filter:"brightness(1)"}})))},[]),X=b.useCallback(()=>{S(!1),j(!0),Y()},[Y]),z=b.useCallback(()=>{T(!1),setTimeout(()=>{Y(!0)},0)},[Y]),U=b.useCallback((ne,G)=>{E.find(re=>re.id===G.id)&&I({id:G.id,type:G.type,content:G.data.content})},[E]);b.useEffect(()=>{w||k&&Y()},[d,l,w,k]);const te=b.useCallback((ne,G)=>{const se=E.find(_e=>_e.id===G.source),re=E.find(_e=>_e.id===G.target),ae=D.find(_e=>_e.id===G.id);se&&re&&ae&&L({source:{id:se.id,type:se.type,content:se.data.content},target:{id:re.id,type:re.type,content:re.data.content},edge:{source:G.source,target:G.target,weight:parseFloat(G.label||"0")}})},[E,D]);return o.jsxs("div",{className:"h-full flex flex-col",children:[o.jsxs("div",{className:"flex-shrink-0 p-4 border-b bg-background",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦知识库图谱"}),o.jsx("p",{className:"text-muted-foreground mt-1",children:"可视化知识实体与关系网络"})]}),r&&o.jsxs("div",{className:"flex gap-2 flex-wrap",children:[o.jsxs(tn,{variant:"outline",className:"gap-1",children:[o.jsx(sk,{className:"h-3 w-3"}),"节点: ",r.total_nodes]}),o.jsxs(tn,{variant:"outline",className:"gap-1",children:[o.jsx(NI,{className:"h-3 w-3"}),"边: ",r.total_edges]}),o.jsxs(tn,{variant:"outline",className:"gap-1",children:[o.jsx(Xi,{className:"h-3 w-3"}),"实体: ",r.entity_nodes]}),o.jsxs(tn,{variant:"outline",className:"gap-1",children:[o.jsx(Po,{className:"h-3 w-3"}),"段落: ",r.paragraph_nodes]})]})]}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 mt-4",children:[o.jsxs("div",{className:"flex-1 flex gap-2",children:[o.jsx(Pe,{placeholder:"搜索节点内容...",value:i,onChange:ne=>a(ne.target.value),onKeyDown:ne=>ne.key==="Enter"&&R(),className:"flex-1"}),o.jsx(ue,{onClick:R,size:"sm",children:o.jsx(ii,{className:"h-4 w-4"})}),o.jsx(ue,{onClick:ie,variant:"outline",size:"sm",children:"重置"})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(Vt,{value:l,onValueChange:ne=>c(ne),children:[o.jsx($t,{className:"w-[120px]",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部节点"}),o.jsx(De,{value:"entity",children:"仅实体"}),o.jsx(De,{value:"paragraph",children:"仅段落"})]})]}),o.jsxs(Vt,{value:d===1e4?"all":x?"custom":d.toString(),onValueChange:ne=>{ne==="custom"?(y(!0),g(d.toString())):ne==="all"?(y(!1),h(1e4)):(y(!1),h(Number(ne)))},children:[o.jsx($t,{className:"w-[120px]",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"50",children:"50 节点"}),o.jsx(De,{value:"100",children:"100 节点"}),o.jsx(De,{value:"200",children:"200 节点"}),o.jsx(De,{value:"500",children:"500 节点"}),o.jsx(De,{value:"1000",children:"1000 节点"}),o.jsx(De,{value:"all",children:"全部 (最多10000)"}),o.jsx(De,{value:"custom",children:"自定义..."})]})]}),x&&o.jsx(Pe,{type:"number",min:"50",value:m,onChange:ne=>g(ne.target.value),onBlur:()=>{const ne=parseInt(m);!isNaN(ne)&&ne>=50?h(ne):(g("50"),h(50))},onKeyDown:ne=>{if(ne.key==="Enter"){const G=parseInt(m);!isNaN(G)&&G>=50?h(G):(g("50"),h(50))}},placeholder:"最少50个",className:"w-[120px]"}),o.jsx(ue,{onClick:()=>Y(),variant:"outline",size:"sm",disabled:e,children:o.jsx(Qs,{className:xe("h-4 w-4",e&&"animate-spin")})})]})]})]}),o.jsx("div",{className:"flex-1 relative",children:e?o.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:o.jsxs("div",{className:"text-center",children:[o.jsx(Qs,{className:"h-8 w-8 animate-spin mx-auto mb-2 text-muted-foreground"}),o.jsx("p",{className:"text-muted-foreground",children:"加载知识图谱中..."})]})}):E.length===0?o.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:o.jsxs("div",{className:"text-center",children:[o.jsx(sk,{className:"h-12 w-12 mx-auto mb-4 text-muted-foreground"}),o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"知识库为空"}),o.jsx("p",{className:"text-muted-foreground",children:"请先导入知识数据"})]})}):o.jsxs(pG,{nodes:E,edges:D,onNodesChange:A,onEdgesChange:B,onNodeClick:U,onEdgeClick:te,nodeTypes:ETe,fitView:!0,minZoom:.05,maxZoom:1.5,defaultViewport:{x:0,y:0,zoom:.5},elevateNodesOnSelect:H<=500,nodesDraggable:H<=1e3,attributionPosition:"bottom-left",children:[o.jsx(h8e,{variant:Ea.Dots,gap:12,size:1}),o.jsx(a8e,{}),H<=500&&o.jsx(JCe,{nodeColor:K,nodeBorderRadius:8,pannable:!0,zoomable:!0}),o.jsxs(rw,{position:"top-right",className:"bg-background/95 backdrop-blur-sm rounded-lg border p-3 shadow-lg",children:[o.jsx("div",{className:"text-sm font-semibold mb-2",children:"图例"}),o.jsxs("div",{className:"space-y-2 text-xs",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-blue-500 to-blue-600 border-2 border-blue-700"}),o.jsx("span",{children:"实体节点"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-green-500 to-green-600 border-2 border-green-700"}),o.jsx("span",{children:"段落节点"})]}),H>200&&o.jsxs("div",{className:"mt-2 pt-2 border-t text-yellow-600 dark:text-yellow-500",children:[o.jsx("div",{className:"font-semibold",children:"性能模式"}),o.jsx("div",{children:"已禁用动画"}),H>500&&o.jsx("div",{children:"已禁用缩略图"})]})]})]})]})}),o.jsx(Er,{open:!!ee,onOpenChange:ne=>!ne&&I(null),children:o.jsxs(wr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsx(Sr,{children:o.jsx(kr,{children:"节点详情"})}),ee&&o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"grid grid-cols-2 gap-4",children:o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"类型"}),o.jsx("div",{className:"mt-1",children:o.jsx(tn,{variant:ee.type==="entity"?"default":"secondary",children:ee.type==="entity"?"🏷️ 实体":"📄 段落"})})]})}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"ID"}),o.jsx("code",{className:"mt-1 block p-2 bg-muted rounded text-xs break-all",children:ee.id})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"内容"}),o.jsx(pn,{className:"mt-1 h-40 p-3 bg-muted rounded",children:o.jsx("p",{className:"text-sm whitespace-pre-wrap",children:ee.content})})]})]})]})}),o.jsx(Er,{open:!!V,onOpenChange:ne=>!ne&&L(null),children:o.jsxs(wr,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[o.jsx(Sr,{children:o.jsx(kr,{children:"边详情"})}),V&&o.jsx(pn,{className:"flex-1 pr-4",children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("div",{className:"flex-1 min-w-0 p-3 bg-blue-50 dark:bg-blue-950 rounded border-2 border-blue-200 dark:border-blue-800",children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"源节点"}),o.jsx("div",{className:"font-medium text-sm mb-2 truncate",children:V.source.content}),o.jsxs("code",{className:"text-xs text-muted-foreground truncate block",children:[V.source.id.slice(0,40),"..."]})]}),o.jsx("div",{className:"text-2xl text-muted-foreground flex-shrink-0",children:"→"}),o.jsxs("div",{className:"flex-1 min-w-0 p-3 bg-green-50 dark:bg-green-950 rounded border-2 border-green-200 dark:border-green-800",children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"目标节点"}),o.jsx("div",{className:"font-medium text-sm mb-2 truncate",children:V.target.content}),o.jsxs("code",{className:"text-xs text-muted-foreground truncate block",children:[V.target.id.slice(0,40),"..."]})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"权重"}),o.jsx("div",{className:"mt-1",children:o.jsx(tn,{variant:"outline",className:"text-base font-mono",children:V.edge.weight.toFixed(4)})})]})]})})]})}),o.jsx(Fn,{open:w,onOpenChange:S,children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"加载知识图谱"}),o.jsxs(zn,{children:["知识图谱的动态展示会消耗较多系统资源。",o.jsx("br",{}),"确定要加载知识图谱吗?"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{onClick:()=>t({to:"/"}),children:"取消 (返回首页)"}),o.jsx(In,{onClick:X,children:"确认加载"})]})]})}),o.jsx(Fn,{open:N,onOpenChange:T,children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"⚠️ 节点数量较多"}),o.jsx(zn,{asChild:!0,children:o.jsxs("div",{children:[o.jsxs("p",{children:["您正在尝试加载 ",o.jsx("strong",{className:"text-orange-600",children:d>=1e4?"全部 (最多10000个)":d})," 个节点。"]}),o.jsx("p",{className:"mt-4",children:"节点数量过多可能导致:"}),o.jsxs("ul",{className:"list-disc list-inside mt-2 space-y-1",children:[o.jsx("li",{children:"页面加载时间较长"}),o.jsx("li",{children:"浏览器卡顿或崩溃"}),o.jsx("li",{children:"系统资源占用过高"})]}),o.jsx("p",{className:"mt-4",children:"建议先选择较少的节点数量 (50-200 个)。"})]})})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{onClick:()=>{T(!1),d>200&&(h(50),y(!1))},children:"取消"}),o.jsx(In,{onClick:z,className:"bg-orange-600 hover:bg-orange-700",children:"我了解风险,继续加载"})]})]})})]})}function gh(t,e,n){let r=n.initialDeps??[],s;function i(){var a,l,c,d;let h;n.key&&((a=n.debug)!=null&&a.call(n))&&(h=Date.now());const m=t();if(!(m.length!==r.length||m.some((y,w)=>r[w]!==y)))return s;r=m;let x;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(x=Date.now()),s=e(...m),n.key&&((c=n.debug)!=null&&c.call(n))){const y=Math.round((Date.now()-h)*100)/100,w=Math.round((Date.now()-x)*100)/100,S=w/16,k=(j,N)=>{for(j=String(j);j.length{r=a},i}function yz(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const MTe=(t,e)=>Math.abs(t-e)<1.01,RTe=(t,e,n)=>{let r;return function(...s){t.clearTimeout(r),r=t.setTimeout(()=>e.apply(this,s),n)}},bz=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},DTe=t=>t,PTe=t=>{const e=Math.max(t.startIndex-t.overscan,0),n=Math.min(t.endIndex+t.overscan,t.count-1),r=[];for(let s=e;s<=n;s++)r.push(s);return r},zTe=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;const s=a=>{const{width:l,height:c}=a;e({width:Math.round(l),height:Math.round(c)})};if(s(bz(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(a=>{const l=()=>{const c=a[0];if(c?.borderBoxSize){const d=c.borderBoxSize[0];if(d){s({width:d.inlineSize,height:d.blockSize});return}}s(bz(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},wz={passive:!0},Sz=typeof window>"u"?!0:"onscrollend"in window,ITe=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;let s=0;const i=t.options.useScrollendEvent&&Sz?()=>{}:RTe(r,()=>{e(s,!1)},t.options.isScrollingResetDelay),a=h=>()=>{const{horizontal:m,isRtl:g}=t.options;s=m?n.scrollLeft*(g&&-1||1):n.scrollTop,i(),e(s,h)},l=a(!0),c=a(!1);c(),n.addEventListener("scroll",l,wz);const d=t.options.useScrollendEvent&&Sz;return d&&n.addEventListener("scrollend",c,wz),()=>{n.removeEventListener("scroll",l),d&&n.removeEventListener("scrollend",c)}},LTe=(t,e,n)=>{if(e?.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return t[n.options.horizontal?"offsetWidth":"offsetHeight"]},BTe=(t,{adjustments:e=0,behavior:n},r)=>{var s,i;const a=t+e;(i=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[r.options.horizontal?"left":"top"]:a,behavior:n})};class FTe{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const a=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),n=null},observe:s=>{var i;return(i=r())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=r())==null?void 0:i.unobserve(s)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,s])=>{typeof s>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:DTe,rangeExtractor:PTe,onChange:()=>{},measureElement:LTe,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,n)},this.maybeNotify=gh(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const s=new Map,i=new Map;for(let a=r-1;a>=0;a--){const l=n[a];if(s.has(l.lane))continue;const c=i.get(l.lane);if(c==null||l.end>c.end?i.set(l.lane,l):l.enda.end===l.end?a.index-l.index:a.end-l.end)[0]:void 0},this.getMeasurementOptions=gh(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,s,i,a)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a}),{key:!1}),this.getMeasurements=gh(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a},l)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const c=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const d=this.measurementsCache.slice(0,c);for(let h=c;hthis.options.debug}),this.calculateRange=gh(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,s,i)=>this.range=n.length>0&&r>0?qTe({measurements:n,outerSize:r,scrollOffset:s,lanes:i}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=gh(()=>{let n=null,r=null;const s=this.calculateRange();return s&&(n=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,s,i,a)=>i===null||a===null?[]:n({startIndex:i,endIndex:a,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,s=n.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const s=this.indexFromElement(n),i=this.measurementsCache[s];if(!i)return;const a=i.key,l=this.elementsCache.get(a);l!==n&&(l&&this.observer.unobserve(l),this.observer.observe(n),this.elementsCache.set(a,n)),n.isConnected&&this.resizeItem(s,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const s=this.measurementsCache[n];if(!s)return;const i=this.itemSizeCache.get(s.key)??s.size,a=r-i;a!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,a,this):s.start{if(!n){this.elementsCache.forEach((r,s)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(s))});return}this._measureElement(n,void 0)},this.getVirtualItems=gh(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const s=[];for(let i=0,a=n.length;ithis.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return yz(r[FG(0,r.length-1,s=>yz(r[s]).start,n)])},this.getOffsetForAlignment=(n,r,s=0)=>{const i=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=n>=a+i?"end":"start"),r==="center"?n+=(s-i)/2:r==="end"&&(n-=i);const l=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.measurementsCache[n];if(!s)return;const i=this.getSize(),a=this.getScrollOffset();if(r==="auto")if(s.end>=a+i-this.options.scrollPaddingEnd)r="end";else if(s.start<=a+this.options.scrollPaddingStart)r="start";else return[a,r];const l=r==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,r,s.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:r="start",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:s})},this.scrollToIndex=(n,{align:r="auto",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1));let i=0;const a=10,l=d=>{if(!this.targetWindow)return;const h=this.getOffsetForIndex(n,d);if(!h){console.warn("Failed to get offset for index:",n);return}const[m,g]=h;this._scrollToOffset(m,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const x=this.getScrollOffset(),y=this.getOffsetForIndex(n,g);if(!y){console.warn("Failed to get offset for index:",n);return}MTe(y[0],x)||c(g)})},c=d=>{this.targetWindow&&(i++,il(d)):console.warn(`Failed to scroll to index ${n} after ${a} attempts.`))};l(r)},this.scrollBy=(n,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((n=r[r.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&i.some(l=>l===null);){const l=r[a];i[l.lane]===null&&(i[l.lane]=l.end),a--}s=Math.max(...i.filter(l=>l!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:s})=>{this.options.scrollToFn(n,{behavior:s,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const FG=(t,e,n,r)=>{for(;t<=e;){const s=(t+e)/2|0,i=n(s);if(ir)e=s-1;else return s}return t>0?t-1:0};function qTe({measurements:t,outerSize:e,scrollOffset:n,lanes:r}){const s=t.length-1,i=c=>t[c].start;if(t.length<=r)return{startIndex:0,endIndex:s};let a=FG(0,s,i,n),l=a;if(r===1)for(;l1){const c=Array(r).fill(0);for(;lh=0&&d.some(h=>h>=n);){const h=t[a];d[h.lane]=h.start,a--}a=Math.max(0,a-a%r),l=Math.min(s,l+(r-1-l%r))}return{startIndex:a,endIndex:l}}const kz=typeof document<"u"?b.useLayoutEffect:b.useEffect;function $Te(t){const e=b.useReducer(()=>({}),{})[1],n={...t,onChange:(s,i)=>{var a;i?ya.flushSync(e):e(),(a=t.onChange)==null||a.call(t,s,i)}},[r]=b.useState(()=>new FTe(n));return r.setOptions(n),kz(()=>r._didMount(),[]),kz(()=>r._willUpdate()),r}function HTe(t){return $Te({observeElementRect:zTe,observeElementOffset:ITe,scrollToFn:BTe,...t})}function QTe(t,e,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:t,timeZoneName:n}).format(e).split(/\s/g).slice(2).join(" ")}const VTe={},x0={};function Ku(t,e){try{const r=(VTe[t]||=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"longOffset"}).format)(e).split("GMT")[1];return r in x0?x0[r]:Oz(r,r.split(":"))}catch{if(t in x0)return x0[t];const n=t?.match(UTe);return n?Oz(t,n.slice(1)):NaN}}const UTe=/([+-]\d\d):?(\d\d)?/;function Oz(t,e){const n=+(e[0]||0),r=+(e[1]||0),s=+(e[2]||0)/60;return x0[t]=n*60+r>0?n*60+r+s:n*60-r-s}class Do extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Ku(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),qG(this),dj(this)):this.setTime(Date.now())}static tz(e,...n){return n.length?new Do(...n,e):new Do(Date.now(),e)}withTimeZone(e){return new Do(+this,e)}getTimezoneOffset(){const e=-Ku(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),dj(this),+this}[Symbol.for("constructDateFrom")](e){return new Do(+new Date(e),this.timeZone)}}const jz=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!jz.test(t))return;const e=t.replace(jz,"$1UTC");Do.prototype[e]&&(t.startsWith("get")?Do.prototype[t]=function(){return this.internal[e]()}:(Do.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),WTe(this),+this},Do.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),dj(this),+this}))});function dj(t){t.internal.setTime(+t),t.internal.setUTCSeconds(t.internal.getUTCSeconds()-Math.round(-Ku(t.timeZone,t)*60))}function WTe(t){Date.prototype.setFullYear.call(t,t.internal.getUTCFullYear(),t.internal.getUTCMonth(),t.internal.getUTCDate()),Date.prototype.setHours.call(t,t.internal.getUTCHours(),t.internal.getUTCMinutes(),t.internal.getUTCSeconds(),t.internal.getUTCMilliseconds()),qG(t)}function qG(t){const e=Ku(t.timeZone,t),n=e>0?Math.floor(e):Math.ceil(e),r=new Date(+t);r.setUTCHours(r.getUTCHours()-1);const s=-new Date(+t).getTimezoneOffset(),i=-new Date(+r).getTimezoneOffset(),a=s-i,l=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();a&&l&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+a);const c=s-n;c&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+c);const d=new Date(+t);d.setUTCSeconds(0);const h=s>0?d.getSeconds():(d.getSeconds()-60)%60,m=Math.round(-(Ku(t.timeZone,t)*60))%60;(m||h)&&(t.internal.setUTCSeconds(t.internal.getUTCSeconds()+m),Date.prototype.setUTCSeconds.call(t,Date.prototype.getUTCSeconds.call(t)+m+h));const g=Ku(t.timeZone,t),x=g>0?Math.floor(g):Math.ceil(g),w=-new Date(+t).getTimezoneOffset()-x,S=x!==n,k=w-c;if(S&&k){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+k);const j=Ku(t.timeZone,t),N=j>0?Math.floor(j):Math.ceil(j),T=x-N;T&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+T),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+T))}}class Bs extends Do{static tz(e,...n){return n.length?new Bs(...n,e):new Bs(Date.now(),e)}toISOString(){const[e,n,r]=this.tzComponents(),s=`${e}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+s}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,n,r,s]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${r} ${n} ${s}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[n,r,s]=this.tzComponents();return`${e} GMT${n}${r}${s} (${QTe(this.timeZone,this)})`}toLocaleString(e,n){return Date.prototype.toLocaleString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(e,n){return Date.prototype.toLocaleDateString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(e,n){return Date.prototype.toLocaleTimeString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),n=e>0?"-":"+",r=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),s=String(Math.abs(e)%60).padStart(2,"0");return[n,r,s]}withTimeZone(e){return new Bs(+this,e)}[Symbol.for("constructDateFrom")](e){return new Bs(+new Date(e),this.timeZone)}}const $G=6048e5,GTe=864e5,Nz=Symbol.for("constructDateFrom");function as(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Nz in t?t[Nz](e):t instanceof Date?new t.constructor(e):new Date(e)}function ir(t,e){return as(e||t,t)}function HG(t,e,n){const r=ir(t,n?.in);return isNaN(e)?as(t,NaN):(e&&r.setDate(r.getDate()+e),r)}function QG(t,e,n){const r=ir(t,n?.in);if(isNaN(e))return as(t,NaN);if(!e)return r;const s=r.getDate(),i=as(t,r.getTime());i.setMonth(r.getMonth()+e+1,0);const a=i.getDate();return s>=a?i:(r.setFullYear(i.getFullYear(),i.getMonth(),s),r)}let XTe={};function Og(){return XTe}function ou(t,e){const n=Og(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=ir(t,e?.in),i=s.getDay(),a=(i=i.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function Cz(t){const e=ir(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function Nd(t,...e){const n=as.bind(null,t||e.find(r=>typeof r=="object"));return e.map(n)}function Ep(t,e){const n=ir(t,e?.in);return n.setHours(0,0,0,0),n}function UG(t,e,n){const[r,s]=Nd(n?.in,t,e),i=Ep(r),a=Ep(s),l=+i-Cz(i),c=+a-Cz(a);return Math.round((l-c)/GTe)}function YTe(t,e){const n=VG(t,e),r=as(t,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Tp(r)}function KTe(t,e,n){return HG(t,e*7,n)}function ZTe(t,e,n){return QG(t,e*12,n)}function JTe(t,e){let n,r=e?.in;return t.forEach(s=>{!r&&typeof s=="object"&&(r=as.bind(null,s));const i=ir(s,r);(!n||n{!r&&typeof s=="object"&&(r=as.bind(null,s));const i=ir(s,r);(!n||n>i||isNaN(+i))&&(n=i)}),as(r,n||NaN)}function t9e(t,e,n){const[r,s]=Nd(n?.in,t,e);return+Ep(r)==+Ep(s)}function WG(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function n9e(t){return!(!WG(t)&&typeof t!="number"||isNaN(+ir(t)))}function r9e(t,e,n){const[r,s]=Nd(n?.in,t,e),i=r.getFullYear()-s.getFullYear(),a=r.getMonth()-s.getMonth();return i*12+a}function s9e(t,e){const n=ir(t,e?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function GG(t,e){const[n,r]=Nd(t,e.start,e.end);return{start:n,end:r}}function i9e(t,e){const{start:n,end:r}=GG(e?.in,t);let s=+n>+r;const i=s?+n:+r,a=s?r:n;a.setHours(0,0,0,0),a.setDate(1);let l=1;const c=[];for(;+a<=i;)c.push(as(n,a)),a.setMonth(a.getMonth()+l);return s?c.reverse():c}function a9e(t,e){const n=ir(t,e?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function o9e(t,e){const n=ir(t,e?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function XG(t,e){const n=ir(t,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function l9e(t,e){const{start:n,end:r}=GG(e?.in,t);let s=+n>+r;const i=s?+n:+r,a=s?r:n;a.setHours(0,0,0,0),a.setMonth(0,1);let l=1;const c=[];for(;+a<=i;)c.push(as(n,a)),a.setFullYear(a.getFullYear()+l);return s?c.reverse():c}function YG(t,e){const n=Og(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=ir(t,e?.in),i=s.getDay(),a=(i{let r;const s=u9e[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Uh(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const h9e={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},f9e={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},m9e={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},p9e={date:Uh({formats:h9e,defaultWidth:"full"}),time:Uh({formats:f9e,defaultWidth:"full"}),dateTime:Uh({formats:m9e,defaultWidth:"full"})},g9e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},x9e=(t,e,n,r)=>g9e[t];function jo(t){return(e,n)=>{const r=n?.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=n?.width?String(n.width):a;s=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=n?.width?String(n.width):t.defaultWidth;s=t.values[l]||t.values[a]}const i=t.argumentCallback?t.argumentCallback(e):e;return s[i]}}const v9e={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},y9e={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},b9e={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},w9e={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},S9e={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},k9e={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},O9e=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},j9e={ordinalNumber:O9e,era:jo({values:v9e,defaultWidth:"wide"}),quarter:jo({values:y9e,defaultWidth:"wide",argumentCallback:t=>t-1}),month:jo({values:b9e,defaultWidth:"wide"}),day:jo({values:w9e,defaultWidth:"wide"}),dayPeriod:jo({values:S9e,defaultWidth:"wide",formattingValues:k9e,defaultFormattingWidth:"wide"})};function No(t){return(e,n={})=>{const r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(s);if(!i)return null;const a=i[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?C9e(l,m=>m.test(a)):N9e(l,m=>m.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const h=e.slice(a.length);return{value:d,rest:h}}}function N9e(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function C9e(t,e){for(let n=0;n{const r=e.match(t.matchPattern);if(!r)return null;const s=r[0],i=e.match(t.parsePattern);if(!i)return null;let a=t.valueCallback?t.valueCallback(i[0]):i[0];a=n.valueCallback?n.valueCallback(a):a;const l=e.slice(s.length);return{value:a,rest:l}}}const T9e=/^(\d+)(th|st|nd|rd)?/i,E9e=/\d+/i,_9e={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},A9e={any:[/^b/i,/^(a|c)/i]},M9e={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},R9e={any:[/1/i,/2/i,/3/i,/4/i]},D9e={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},P9e={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},z9e={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},I9e={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},L9e={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},B9e={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},F9e={ordinalNumber:KG({matchPattern:T9e,parsePattern:E9e,valueCallback:t=>parseInt(t,10)}),era:No({matchPatterns:_9e,defaultMatchWidth:"wide",parsePatterns:A9e,defaultParseWidth:"any"}),quarter:No({matchPatterns:M9e,defaultMatchWidth:"wide",parsePatterns:R9e,defaultParseWidth:"any",valueCallback:t=>t+1}),month:No({matchPatterns:D9e,defaultMatchWidth:"wide",parsePatterns:P9e,defaultParseWidth:"any"}),day:No({matchPatterns:z9e,defaultMatchWidth:"wide",parsePatterns:I9e,defaultParseWidth:"any"}),dayPeriod:No({matchPatterns:L9e,defaultMatchWidth:"any",parsePatterns:B9e,defaultParseWidth:"any"})},p7={code:"en-US",formatDistance:d9e,formatLong:p9e,formatRelative:x9e,localize:j9e,match:F9e,options:{weekStartsOn:0,firstWeekContainsDate:1}};function q9e(t,e){const n=ir(t,e?.in);return UG(n,XG(n))+1}function ZG(t,e){const n=ir(t,e?.in),r=+Tp(n)-+YTe(n);return Math.round(r/$G)+1}function JG(t,e){const n=ir(t,e?.in),r=n.getFullYear(),s=Og(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,a=as(e?.in||t,0);a.setFullYear(r+1,0,i),a.setHours(0,0,0,0);const l=ou(a,e),c=as(e?.in||t,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const d=ou(c,e);return+n>=+l?r+1:+n>=+d?r:r-1}function $9e(t,e){const n=Og(),r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=JG(t,e),i=as(e?.in||t,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),ou(i,e)}function eX(t,e){const n=ir(t,e?.in),r=+ou(n,e)-+$9e(n,e);return Math.round(r/$G)+1}function Jn(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const Rc={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return Jn(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):Jn(n+1,2)},d(t,e){return Jn(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return Jn(t.getHours()%12||12,e.length)},H(t,e){return Jn(t.getHours(),e.length)},m(t,e){return Jn(t.getMinutes(),e.length)},s(t,e){return Jn(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return Jn(s,e.length)}},xh={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Tz={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return Rc.y(t,e)},Y:function(t,e,n,r){const s=JG(t,r),i=s>0?s:1-s;if(e==="YY"){const a=i%100;return Jn(a,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):Jn(i,e.length)},R:function(t,e){const n=VG(t);return Jn(n,e.length)},u:function(t,e){const n=t.getFullYear();return Jn(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return Jn(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return Jn(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return Rc.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return Jn(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const s=eX(t,r);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):Jn(s,e.length)},I:function(t,e,n){const r=ZG(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):Jn(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Rc.d(t,e)},D:function(t,e,n){const r=q9e(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Jn(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return Jn(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return Jn(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),s=r===0?7:r;switch(e){case"i":return String(s);case"ii":return Jn(s,e.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const s=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let s;switch(r===12?s=xh.noon:r===0?s=xh.midnight:s=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let s;switch(r>=17?s=xh.evening:r>=12?s=xh.afternoon:r>=4?s=xh.morning:s=xh.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Rc.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Rc.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Jn(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):Jn(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Rc.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Rc.s(t,e)},S:function(t,e){return Rc.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return _z(r);case"XXXX":case"XX":return $u(r);case"XXXXX":case"XXX":default:return $u(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return _z(r);case"xxxx":case"xx":return $u(r);case"xxxxx":case"xxx":default:return $u(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ez(r,":");case"OOOO":default:return"GMT"+$u(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ez(r,":");case"zzzz":default:return"GMT"+$u(r,":")}},t:function(t,e,n){const r=Math.trunc(+t/1e3);return Jn(r,e.length)},T:function(t,e,n){return Jn(+t,e.length)}};function Ez(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=Math.trunc(r/60),i=r%60;return i===0?n+String(s):n+String(s)+e+Jn(i,2)}function _z(t,e){return t%60===0?(t>0?"-":"+")+Jn(Math.abs(t)/60,2):$u(t,e)}function $u(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=Jn(Math.trunc(r/60),2),i=Jn(r%60,2);return n+s+e+i}const Az=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},tX=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},H9e=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return Az(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",Az(r,e)).replace("{{time}}",tX(s,e))},Q9e={p:tX,P:H9e},V9e=/^D+$/,U9e=/^Y+$/,W9e=["D","DD","YY","YYYY"];function G9e(t){return V9e.test(t)}function X9e(t){return U9e.test(t)}function Y9e(t,e,n){const r=K9e(t,e,n);if(console.warn(r),W9e.includes(t))throw new RangeError(r)}function K9e(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Z9e=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,J9e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,eEe=/^'([^]*?)'?$/,tEe=/''/g,nEe=/[a-zA-Z]/;function Dv(t,e,n){const r=Og(),s=n?.locale??r.locale??p7,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,l=ir(t,n?.in);if(!n9e(l))throw new RangeError("Invalid time value");let c=e.match(J9e).map(h=>{const m=h[0];if(m==="p"||m==="P"){const g=Q9e[m];return g(h,s.formatLong)}return h}).join("").match(Z9e).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const m=h[0];if(m==="'")return{isToken:!1,value:rEe(h)};if(Tz[m])return{isToken:!0,value:h};if(m.match(nEe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:h}});s.localize.preprocessor&&(c=s.localize.preprocessor(l,c));const d={firstWeekContainsDate:i,weekStartsOn:a,locale:s};return c.map(h=>{if(!h.isToken)return h.value;const m=h.value;(!n?.useAdditionalWeekYearTokens&&X9e(m)||!n?.useAdditionalDayOfYearTokens&&G9e(m))&&Y9e(m,e,String(t));const g=Tz[m[0]];return g(l,m,s.localize,d)}).join("")}function rEe(t){const e=t.match(eEe);return e?e[1].replace(tEe,"'"):t}function sEe(t,e){const n=ir(t,e?.in),r=n.getFullYear(),s=n.getMonth(),i=as(n,0);return i.setFullYear(r,s+1,0),i.setHours(0,0,0,0),i.getDate()}function iEe(t,e){return ir(t,e?.in).getMonth()}function aEe(t,e){return ir(t,e?.in).getFullYear()}function oEe(t,e){return+ir(t)>+ir(e)}function lEe(t,e){return+ir(t)<+ir(e)}function cEe(t,e,n){const[r,s]=Nd(n?.in,t,e);return+ou(r,n)==+ou(s,n)}function uEe(t,e,n){const[r,s]=Nd(n?.in,t,e);return r.getFullYear()===s.getFullYear()&&r.getMonth()===s.getMonth()}function dEe(t,e,n){const[r,s]=Nd(n?.in,t,e);return r.getFullYear()===s.getFullYear()}function hEe(t,e,n){const r=ir(t,n?.in),s=r.getFullYear(),i=r.getDate(),a=as(t,0);a.setFullYear(s,e,15),a.setHours(0,0,0,0);const l=sEe(a);return r.setMonth(e,Math.min(i,l)),r}function fEe(t,e,n){const r=ir(t,n?.in);return isNaN(+r)?as(t,NaN):(r.setFullYear(e),r)}const Mz=5,mEe=4;function pEe(t,e){const n=e.startOfMonth(t),r=n.getDay()>0?n.getDay():7,s=e.addDays(t,-r+1),i=e.addDays(s,Mz*7-1);return e.getMonth(t)===e.getMonth(i)?Mz:mEe}function nX(t,e){const n=e.startOfMonth(t),r=n.getDay();return r===1?n:r===0?e.addDays(n,-6):e.addDays(n,-1*(r-1))}function gEe(t,e){const n=nX(t,e),r=pEe(t,e);return e.addDays(n,r*7-1)}class ta{constructor(e,n){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?Bs.tz(this.options.timeZone):new this.Date,this.newDate=(r,s,i)=>this.overrides?.newDate?this.overrides.newDate(r,s,i):this.options.timeZone?new Bs(r,s,i,this.options.timeZone):new Date(r,s,i),this.addDays=(r,s)=>this.overrides?.addDays?this.overrides.addDays(r,s):HG(r,s),this.addMonths=(r,s)=>this.overrides?.addMonths?this.overrides.addMonths(r,s):QG(r,s),this.addWeeks=(r,s)=>this.overrides?.addWeeks?this.overrides.addWeeks(r,s):KTe(r,s),this.addYears=(r,s)=>this.overrides?.addYears?this.overrides.addYears(r,s):ZTe(r,s),this.differenceInCalendarDays=(r,s)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,s):UG(r,s),this.differenceInCalendarMonths=(r,s)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,s):r9e(r,s),this.eachMonthOfInterval=r=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):i9e(r),this.eachYearOfInterval=r=>{const s=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(r):l9e(r),i=new Set(s.map(l=>this.getYear(l)));if(i.size===s.length)return s;const a=[];return i.forEach(l=>{a.push(new Date(l,0,1))}),a},this.endOfBroadcastWeek=r=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):gEe(r,this),this.endOfISOWeek=r=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(r):c9e(r),this.endOfMonth=r=>this.overrides?.endOfMonth?this.overrides.endOfMonth(r):s9e(r),this.endOfWeek=(r,s)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(r,s):YG(r,this.options),this.endOfYear=r=>this.overrides?.endOfYear?this.overrides.endOfYear(r):o9e(r),this.format=(r,s,i)=>{const a=this.overrides?.format?this.overrides.format(r,s,this.options):Dv(r,s,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(a):a},this.getISOWeek=r=>this.overrides?.getISOWeek?this.overrides.getISOWeek(r):ZG(r),this.getMonth=(r,s)=>this.overrides?.getMonth?this.overrides.getMonth(r,this.options):iEe(r,this.options),this.getYear=(r,s)=>this.overrides?.getYear?this.overrides.getYear(r,this.options):aEe(r,this.options),this.getWeek=(r,s)=>this.overrides?.getWeek?this.overrides.getWeek(r,this.options):eX(r,this.options),this.isAfter=(r,s)=>this.overrides?.isAfter?this.overrides.isAfter(r,s):oEe(r,s),this.isBefore=(r,s)=>this.overrides?.isBefore?this.overrides.isBefore(r,s):lEe(r,s),this.isDate=r=>this.overrides?.isDate?this.overrides.isDate(r):WG(r),this.isSameDay=(r,s)=>this.overrides?.isSameDay?this.overrides.isSameDay(r,s):t9e(r,s),this.isSameMonth=(r,s)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(r,s):uEe(r,s),this.isSameYear=(r,s)=>this.overrides?.isSameYear?this.overrides.isSameYear(r,s):dEe(r,s),this.max=r=>this.overrides?.max?this.overrides.max(r):JTe(r),this.min=r=>this.overrides?.min?this.overrides.min(r):e9e(r),this.setMonth=(r,s)=>this.overrides?.setMonth?this.overrides.setMonth(r,s):hEe(r,s),this.setYear=(r,s)=>this.overrides?.setYear?this.overrides.setYear(r,s):fEe(r,s),this.startOfBroadcastWeek=(r,s)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):nX(r,this),this.startOfDay=r=>this.overrides?.startOfDay?this.overrides.startOfDay(r):Ep(r),this.startOfISOWeek=r=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(r):Tp(r),this.startOfMonth=r=>this.overrides?.startOfMonth?this.overrides.startOfMonth(r):a9e(r),this.startOfWeek=(r,s)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(r,this.options):ou(r,this.options),this.startOfYear=r=>this.overrides?.startOfYear?this.overrides.startOfYear(r):XG(r),this.options={locale:p7,...e},this.overrides=n}getDigitMap(){const{numerals:e="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:e}),r={};for(let s=0;s<10;s++)r[s.toString()]=n.format(s);return r}replaceDigits(e){const n=this.getDigitMap();return e.replace(/\d/g,r=>n[r]||r)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){const e=this.options.locale?.code;return e&&ta.yearFirstLocales.has(e)?"year-first":"month-first"}formatMonthYear(e){const{locale:n,timeZone:r,numerals:s}=this.options,i=n?.code;if(i&&ta.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:r,numberingSystem:s}).format(e)}catch{}const a=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(e,a)}}ta.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Zo=new ta;class rX{constructor(e,n,r=Zo){this.date=e,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(e,n)),this.dateLib=r}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class xEe{constructor(e,n){this.date=e,this.weeks=n}}class vEe{constructor(e,n){this.days=n,this.weekNumber=e}}function yEe(t){return oe.createElement("button",{...t})}function bEe(t){return oe.createElement("span",{...t})}function wEe(t){const{size:e=24,orientation:n="left",className:r}=t;return oe.createElement("svg",{className:r,width:e,height:e,viewBox:"0 0 24 24"},n==="up"&&oe.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&oe.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&oe.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&oe.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function SEe(t){const{day:e,modifiers:n,...r}=t;return oe.createElement("td",{...r})}function kEe(t){const{day:e,modifiers:n,...r}=t,s=oe.useRef(null);return oe.useEffect(()=>{n.focused&&s.current?.focus()},[n.focused]),oe.createElement("button",{ref:s,...r})}var Nt;(function(t){t.Root="root",t.Chevron="chevron",t.Day="day",t.DayButton="day_button",t.CaptionLabel="caption_label",t.Dropdowns="dropdowns",t.Dropdown="dropdown",t.DropdownRoot="dropdown_root",t.Footer="footer",t.MonthGrid="month_grid",t.MonthCaption="month_caption",t.MonthsDropdown="months_dropdown",t.Month="month",t.Months="months",t.Nav="nav",t.NextMonthButton="button_next",t.PreviousMonthButton="button_previous",t.Week="week",t.Weeks="weeks",t.Weekday="weekday",t.Weekdays="weekdays",t.WeekNumber="week_number",t.WeekNumberHeader="week_number_header",t.YearsDropdown="years_dropdown"})(Nt||(Nt={}));var zr;(function(t){t.disabled="disabled",t.hidden="hidden",t.outside="outside",t.focused="focused",t.today="today"})(zr||(zr={}));var Wa;(function(t){t.range_end="range_end",t.range_middle="range_middle",t.range_start="range_start",t.selected="selected"})(Wa||(Wa={}));var Vi;(function(t){t.weeks_before_enter="weeks_before_enter",t.weeks_before_exit="weeks_before_exit",t.weeks_after_enter="weeks_after_enter",t.weeks_after_exit="weeks_after_exit",t.caption_after_enter="caption_after_enter",t.caption_after_exit="caption_after_exit",t.caption_before_enter="caption_before_enter",t.caption_before_exit="caption_before_exit"})(Vi||(Vi={}));function OEe(t){const{options:e,className:n,components:r,classNames:s,...i}=t,a=[s[Nt.Dropdown],n].join(" "),l=e?.find(({value:c})=>c===i.value);return oe.createElement("span",{"data-disabled":i.disabled,className:s[Nt.DropdownRoot]},oe.createElement(r.Select,{className:a,...i},e?.map(({value:c,label:d,disabled:h})=>oe.createElement(r.Option,{key:c,value:c,disabled:h},d))),oe.createElement("span",{className:s[Nt.CaptionLabel],"aria-hidden":!0},l?.label,oe.createElement(r.Chevron,{orientation:"down",size:18,className:s[Nt.Chevron]})))}function jEe(t){return oe.createElement("div",{...t})}function NEe(t){return oe.createElement("div",{...t})}function CEe(t){const{calendarMonth:e,displayIndex:n,...r}=t;return oe.createElement("div",{...r},t.children)}function TEe(t){const{calendarMonth:e,displayIndex:n,...r}=t;return oe.createElement("div",{...r})}function EEe(t){return oe.createElement("table",{...t})}function _Ee(t){return oe.createElement("div",{...t})}const sX=b.createContext(void 0);function jg(){const t=b.useContext(sX);if(t===void 0)throw new Error("useDayPicker() must be used within a custom component.");return t}function AEe(t){const{components:e}=jg();return oe.createElement(e.Dropdown,{...t})}function MEe(t){const{onPreviousClick:e,onNextClick:n,previousMonth:r,nextMonth:s,...i}=t,{components:a,classNames:l,labels:{labelPrevious:c,labelNext:d}}=jg(),h=b.useCallback(g=>{s&&n?.(g)},[s,n]),m=b.useCallback(g=>{r&&e?.(g)},[r,e]);return oe.createElement("nav",{...i},oe.createElement(a.PreviousMonthButton,{type:"button",className:l[Nt.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:m},oe.createElement(a.Chevron,{disabled:r?void 0:!0,className:l[Nt.Chevron],orientation:"left"})),oe.createElement(a.NextMonthButton,{type:"button",className:l[Nt.NextMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":d(s),onClick:h},oe.createElement(a.Chevron,{disabled:s?void 0:!0,orientation:"right",className:l[Nt.Chevron]})))}function REe(t){const{components:e}=jg();return oe.createElement(e.Button,{...t})}function DEe(t){return oe.createElement("option",{...t})}function PEe(t){const{components:e}=jg();return oe.createElement(e.Button,{...t})}function zEe(t){const{rootRef:e,...n}=t;return oe.createElement("div",{...n,ref:e})}function IEe(t){return oe.createElement("select",{...t})}function LEe(t){const{week:e,...n}=t;return oe.createElement("tr",{...n})}function BEe(t){return oe.createElement("th",{...t})}function FEe(t){return oe.createElement("thead",{"aria-hidden":!0},oe.createElement("tr",{...t}))}function qEe(t){const{week:e,...n}=t;return oe.createElement("th",{...n})}function $Ee(t){return oe.createElement("th",{...t})}function HEe(t){return oe.createElement("tbody",{...t})}function QEe(t){const{components:e}=jg();return oe.createElement(e.Dropdown,{...t})}const VEe=Object.freeze(Object.defineProperty({__proto__:null,Button:yEe,CaptionLabel:bEe,Chevron:wEe,Day:SEe,DayButton:kEe,Dropdown:OEe,DropdownNav:jEe,Footer:NEe,Month:CEe,MonthCaption:TEe,MonthGrid:EEe,Months:_Ee,MonthsDropdown:AEe,Nav:MEe,NextMonthButton:REe,Option:DEe,PreviousMonthButton:PEe,Root:zEe,Select:IEe,Week:LEe,WeekNumber:qEe,WeekNumberHeader:$Ee,Weekday:BEe,Weekdays:FEe,Weeks:HEe,YearsDropdown:QEe},Symbol.toStringTag,{value:"Module"}));function Il(t,e,n=!1,r=Zo){let{from:s,to:i}=t;const{differenceInCalendarDays:a,isSameDay:l}=r;return s&&i?(a(i,s)<0&&([s,i]=[i,s]),a(e,s)>=(n?1:0)&&a(i,e)>=(n?1:0)):!n&&i?l(i,e):!n&&s?l(s,e):!1}function iX(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function g7(t){return!!(t&&typeof t=="object"&&"from"in t)}function aX(t){return!!(t&&typeof t=="object"&&"after"in t)}function oX(t){return!!(t&&typeof t=="object"&&"before"in t)}function lX(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function cX(t,e){return Array.isArray(t)&&t.every(e.isDate)}function Ll(t,e,n=Zo){const r=Array.isArray(e)?e:[e],{isSameDay:s,differenceInCalendarDays:i,isAfter:a}=n;return r.some(l=>{if(typeof l=="boolean")return l;if(n.isDate(l))return s(t,l);if(cX(l,n))return l.includes(t);if(g7(l))return Il(l,t,!1,n);if(lX(l))return Array.isArray(l.dayOfWeek)?l.dayOfWeek.includes(t.getDay()):l.dayOfWeek===t.getDay();if(iX(l)){const c=i(l.before,t),d=i(l.after,t),h=c>0,m=d<0;return a(l.before,l.after)?m&&h:h||m}return aX(l)?i(t,l.after)>0:oX(l)?i(l.before,t)>0:typeof l=="function"?l(t):!1})}function UEe(t,e,n,r,s){const{disabled:i,hidden:a,modifiers:l,showOutsideDays:c,broadcastCalendar:d,today:h}=e,{isSameDay:m,isSameMonth:g,startOfMonth:x,isBefore:y,endOfMonth:w,isAfter:S}=s,k=n&&x(n),j=r&&w(r),N={[zr.focused]:[],[zr.outside]:[],[zr.disabled]:[],[zr.hidden]:[],[zr.today]:[]},T={};for(const E of t){const{date:_,displayMonth:A}=E,D=!!(A&&!g(_,A)),q=!!(k&&y(_,k)),B=!!(j&&S(_,j)),H=!!(i&&Ll(_,i,s)),W=!!(a&&Ll(_,a,s))||q||B||!d&&!c&&D||d&&c===!1&&D,ee=m(_,h??s.today());D&&N.outside.push(E),H&&N.disabled.push(E),W&&N.hidden.push(E),ee&&N.today.push(E),l&&Object.keys(l).forEach(I=>{const V=l?.[I];V&&Ll(_,V,s)&&(T[I]?T[I].push(E):T[I]=[E])})}return E=>{const _={[zr.focused]:!1,[zr.disabled]:!1,[zr.hidden]:!1,[zr.outside]:!1,[zr.today]:!1},A={};for(const D in N){const q=N[D];_[D]=q.some(B=>B===E)}for(const D in T)A[D]=T[D].some(q=>q===E);return{..._,...A}}}function WEe(t,e,n={}){return Object.entries(t).filter(([,s])=>s===!0).reduce((s,[i])=>(n[i]?s.push(n[i]):e[zr[i]]?s.push(e[zr[i]]):e[Wa[i]]&&s.push(e[Wa[i]]),s),[e[Nt.Day]])}function GEe(t){return{...VEe,...t}}function XEe(t){const e={"data-mode":t.mode??void 0,"data-required":"required"in t?t.required:void 0,"data-multiple-months":t.numberOfMonths&&t.numberOfMonths>1||void 0,"data-week-numbers":t.showWeekNumber||void 0,"data-broadcast-calendar":t.broadcastCalendar||void 0,"data-nav-layout":t.navLayout||void 0};return Object.entries(t).forEach(([n,r])=>{n.startsWith("data-")&&(e[n]=r)}),e}function x7(){const t={};for(const e in Nt)t[Nt[e]]=`rdp-${Nt[e]}`;for(const e in zr)t[zr[e]]=`rdp-${zr[e]}`;for(const e in Wa)t[Wa[e]]=`rdp-${Wa[e]}`;for(const e in Vi)t[Vi[e]]=`rdp-${Vi[e]}`;return t}function uX(t,e,n){return(n??new ta(e)).formatMonthYear(t)}const YEe=uX;function KEe(t,e,n){return(n??new ta(e)).format(t,"d")}function ZEe(t,e=Zo){return e.format(t,"LLLL")}function JEe(t,e,n){return(n??new ta(e)).format(t,"cccccc")}function e_e(t,e=Zo){return t<10?e.formatNumber(`0${t.toLocaleString()}`):e.formatNumber(`${t.toLocaleString()}`)}function t_e(){return""}function dX(t,e=Zo){return e.format(t,"yyyy")}const n_e=dX,r_e=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:uX,formatDay:KEe,formatMonthCaption:YEe,formatMonthDropdown:ZEe,formatWeekNumber:e_e,formatWeekNumberHeader:t_e,formatWeekdayName:JEe,formatYearCaption:n_e,formatYearDropdown:dX},Symbol.toStringTag,{value:"Module"}));function s_e(t){return t?.formatMonthCaption&&!t.formatCaption&&(t.formatCaption=t.formatMonthCaption),t?.formatYearCaption&&!t.formatYearDropdown&&(t.formatYearDropdown=t.formatYearCaption),{...r_e,...t}}function i_e(t,e,n,r,s){const{startOfMonth:i,startOfYear:a,endOfYear:l,eachMonthOfInterval:c,getMonth:d}=s;return c({start:a(t),end:l(t)}).map(g=>{const x=r.formatMonthDropdown(g,s),y=d(g),w=e&&gi(n)||!1;return{value:y,label:x,disabled:w}})}function a_e(t,e={},n={}){let r={...e?.[Nt.Day]};return Object.entries(t).filter(([,s])=>s===!0).forEach(([s])=>{r={...r,...n?.[s]}}),r}function o_e(t,e,n){const r=t.today(),s=e?t.startOfISOWeek(r):t.startOfWeek(r),i=[];for(let a=0;a<7;a++){const l=t.addDays(s,a);i.push(l)}return i}function l_e(t,e,n,r,s=!1){if(!t||!e)return;const{startOfYear:i,endOfYear:a,eachYearOfInterval:l,getYear:c}=r,d=i(t),h=a(e),m=l({start:d,end:h});return s&&m.reverse(),m.map(g=>{const x=n.formatYearDropdown(g,r);return{value:c(g),label:x,disabled:!1}})}function hX(t,e,n,r){let s=(r??new ta(n)).format(t,"PPPP");return e.today&&(s=`Today, ${s}`),e.selected&&(s=`${s}, selected`),s}const c_e=hX;function fX(t,e,n){return(n??new ta(e)).formatMonthYear(t)}const u_e=fX;function d_e(t,e,n,r){let s=(r??new ta(n)).format(t,"PPPP");return e?.today&&(s=`Today, ${s}`),s}function h_e(t){return"Choose the Month"}function f_e(){return""}function m_e(t){return"Go to the Next Month"}function p_e(t){return"Go to the Previous Month"}function g_e(t,e,n){return(n??new ta(e)).format(t,"cccc")}function x_e(t,e){return`Week ${t}`}function v_e(t){return"Week Number"}function y_e(t){return"Choose the Year"}const b_e=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:u_e,labelDay:c_e,labelDayButton:hX,labelGrid:fX,labelGridcell:d_e,labelMonthDropdown:h_e,labelNav:f_e,labelNext:m_e,labelPrevious:p_e,labelWeekNumber:x_e,labelWeekNumberHeader:v_e,labelWeekday:g_e,labelYearDropdown:y_e},Symbol.toStringTag,{value:"Module"})),Ng=t=>t instanceof HTMLElement?t:null,ek=t=>[...t.querySelectorAll("[data-animated-month]")??[]],w_e=t=>Ng(t.querySelector("[data-animated-month]")),tk=t=>Ng(t.querySelector("[data-animated-caption]")),nk=t=>Ng(t.querySelector("[data-animated-weeks]")),S_e=t=>Ng(t.querySelector("[data-animated-nav]")),k_e=t=>Ng(t.querySelector("[data-animated-weekdays]"));function O_e(t,e,{classNames:n,months:r,focused:s,dateLib:i}){const a=b.useRef(null),l=b.useRef(r),c=b.useRef(!1);b.useLayoutEffect(()=>{const d=l.current;if(l.current=r,!e||!t.current||!(t.current instanceof HTMLElement)||r.length===0||d.length===0||r.length!==d.length)return;const h=i.isSameMonth(r[0].date,d[0].date),m=i.isAfter(r[0].date,d[0].date),g=m?n[Vi.caption_after_enter]:n[Vi.caption_before_enter],x=m?n[Vi.weeks_after_enter]:n[Vi.weeks_before_enter],y=a.current,w=t.current.cloneNode(!0);if(w instanceof HTMLElement?(ek(w).forEach(N=>{if(!(N instanceof HTMLElement))return;const T=w_e(N);T&&N.contains(T)&&N.removeChild(T);const E=tk(N);E&&E.classList.remove(g);const _=nk(N);_&&_.classList.remove(x)}),a.current=w):a.current=null,c.current||h||s)return;const S=y instanceof HTMLElement?ek(y):[],k=ek(t.current);if(k?.every(j=>j instanceof HTMLElement)&&S&&S.every(j=>j instanceof HTMLElement)){c.current=!0,t.current.style.isolation="isolate";const j=S_e(t.current);j&&(j.style.zIndex="1"),k.forEach((N,T)=>{const E=S[T];if(!E)return;N.style.position="relative",N.style.overflow="hidden";const _=tk(N);_&&_.classList.add(g);const A=nk(N);A&&A.classList.add(x);const D=()=>{c.current=!1,t.current&&(t.current.style.isolation=""),j&&(j.style.zIndex=""),_&&_.classList.remove(g),A&&A.classList.remove(x),N.style.position="",N.style.overflow="",N.contains(E)&&N.removeChild(E)};E.style.pointerEvents="none",E.style.position="absolute",E.style.overflow="hidden",E.setAttribute("aria-hidden","true");const q=k_e(E);q&&(q.style.opacity="0");const B=tk(E);B&&(B.classList.add(m?n[Vi.caption_before_exit]:n[Vi.caption_after_exit]),B.addEventListener("animationend",D));const H=nk(E);H&&H.classList.add(m?n[Vi.weeks_before_exit]:n[Vi.weeks_after_exit]),N.insertBefore(E,N.firstChild)})}})}function j_e(t,e,n,r){const s=t[0],i=t[t.length-1],{ISOWeek:a,fixedWeeks:l,broadcastCalendar:c}=n??{},{addDays:d,differenceInCalendarDays:h,differenceInCalendarMonths:m,endOfBroadcastWeek:g,endOfISOWeek:x,endOfMonth:y,endOfWeek:w,isAfter:S,startOfBroadcastWeek:k,startOfISOWeek:j,startOfWeek:N}=r,T=c?k(s,r):a?j(s):N(s),E=c?g(i):a?x(y(i)):w(y(i)),_=h(E,T),A=m(i,s)+1,D=[];for(let H=0;H<=_;H++){const W=d(T,H);if(e&&S(W,e))break;D.push(W)}const B=(c?35:42)*A;if(l&&D.length{const s=r.weeks.reduce((i,a)=>i.concat(a.days.slice()),e.slice());return n.concat(s.slice())},e.slice())}function C_e(t,e,n,r){const{numberOfMonths:s=1}=n,i=[];for(let a=0;ae)break;i.push(l)}return i}function Rz(t,e,n,r){const{month:s,defaultMonth:i,today:a=r.today(),numberOfMonths:l=1}=t;let c=s||i||a;const{differenceInCalendarMonths:d,addMonths:h,startOfMonth:m}=r;if(n&&d(n,c){const k=n.broadcastCalendar?m(S,r):n.ISOWeek?g(S):x(S),j=n.broadcastCalendar?i(S):n.ISOWeek?a(l(S)):c(l(S)),N=e.filter(A=>A>=k&&A<=j),T=n.broadcastCalendar?35:42;if(n.fixedWeeks&&N.length{const q=T-N.length;return D>j&&D<=s(j,q)});N.push(...A)}const E=N.reduce((A,D)=>{const q=n.ISOWeek?d(D):h(D),B=A.find(W=>W.weekNumber===q),H=new rX(D,S,r);return B?B.days.push(H):A.push(new vEe(q,[H])),A},[]),_=new xEe(S,E);return w.push(_),w},[]);return n.reverseMonths?y.reverse():y}function E_e(t,e){let{startMonth:n,endMonth:r}=t;const{startOfYear:s,startOfDay:i,startOfMonth:a,endOfMonth:l,addYears:c,endOfYear:d,newDate:h,today:m}=e,{fromYear:g,toYear:x,fromMonth:y,toMonth:w}=t;!n&&y&&(n=y),!n&&g&&(n=e.newDate(g,0,1)),!r&&w&&(r=w),!r&&x&&(r=h(x,11,31));const S=t.captionLayout==="dropdown"||t.captionLayout==="dropdown-years";return n?n=a(n):g?n=h(g,0,1):!n&&S&&(n=s(c(t.today??m(),-100))),r?r=l(r):x?r=h(x,11,31):!r&&S&&(r=d(t.today??m())),[n&&i(n),r&&i(r)]}function __e(t,e,n,r){if(n.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:i=1}=n,{startOfMonth:a,addMonths:l,differenceInCalendarMonths:c}=r,d=s?i:1,h=a(t);if(!e)return l(h,d);if(!(c(e,t)n.concat(r.weeks.slice()),e.slice())}function aw(t,e){const[n,r]=b.useState(t);return[e===void 0?n:e,r]}function R_e(t,e){const[n,r]=E_e(t,e),{startOfMonth:s,endOfMonth:i}=e,a=Rz(t,n,r,e),[l,c]=aw(a,t.month?a:void 0);b.useEffect(()=>{const _=Rz(t,n,r,e);c(_)},[t.timeZone]);const d=C_e(l,r,t,e),h=j_e(d,t.endMonth?i(t.endMonth):void 0,t,e),m=T_e(d,h,t,e),g=M_e(m),x=N_e(m),y=A_e(l,n,t,e),w=__e(l,r,t,e),{disableNavigation:S,onMonthChange:k}=t,j=_=>g.some(A=>A.days.some(D=>D.isEqualTo(_))),N=_=>{if(S)return;let A=s(_);n&&As(r)&&(A=s(r)),c(A),k?.(A)};return{months:m,weeks:g,days:x,navStart:n,navEnd:r,previousMonth:y,nextMonth:w,goToMonth:N,goToDay:_=>{j(_)||N(_.date)}}}var yo;(function(t){t[t.Today=0]="Today",t[t.Selected=1]="Selected",t[t.LastFocused=2]="LastFocused",t[t.FocusedModifier=3]="FocusedModifier"})(yo||(yo={}));function Dz(t){return!t[zr.disabled]&&!t[zr.hidden]&&!t[zr.outside]}function D_e(t,e,n,r){let s,i=-1;for(const a of t){const l=e(a);Dz(l)&&(l[zr.focused]&&iDz(e(a)))),s}function P_e(t,e,n,r,s,i,a){const{ISOWeek:l,broadcastCalendar:c}=i,{addDays:d,addMonths:h,addWeeks:m,addYears:g,endOfBroadcastWeek:x,endOfISOWeek:y,endOfWeek:w,max:S,min:k,startOfBroadcastWeek:j,startOfISOWeek:N,startOfWeek:T}=a;let _={day:d,week:m,month:h,year:g,startOfWeek:A=>c?j(A,a):l?N(A):T(A),endOfWeek:A=>c?x(A):l?y(A):w(A)}[t](n,e==="after"?1:-1);return e==="before"&&r?_=S([r,_]):e==="after"&&s&&(_=k([s,_])),_}function mX(t,e,n,r,s,i,a,l=0){if(l>365)return;const c=P_e(t,e,n.date,r,s,i,a),d=!!(i.disabled&&Ll(c,i.disabled,a)),h=!!(i.hidden&&Ll(c,i.hidden,a)),m=c,g=new rX(c,m,a);return!d&&!h?g:mX(t,e,g,r,s,i,a,l+1)}function z_e(t,e,n,r,s){const{autoFocus:i}=t,[a,l]=b.useState(),c=D_e(e.days,n,r||(()=>!1),a),[d,h]=b.useState(i?c:void 0);return{isFocusTarget:w=>!!c?.isEqualTo(w),setFocused:h,focused:d,blur:()=>{l(d),h(void 0)},moveFocus:(w,S)=>{if(!d)return;const k=mX(w,S,d,e.navStart,e.navEnd,t,s);k&&(t.disableNavigation&&!e.days.some(N=>N.isEqualTo(k))||(e.goToDay(k),h(k)))}}}function I_e(t,e){const{selected:n,required:r,onSelect:s}=t,[i,a]=aw(n,s?n:void 0),l=s?n:i,{isSameDay:c}=e,d=x=>l?.some(y=>c(y,x))??!1,{min:h,max:m}=t;return{selected:l,select:(x,y,w)=>{let S=[...l??[]];if(d(x)){if(l?.length===h||r&&l?.length===1)return;S=l?.filter(k=>!c(k,x))}else l?.length===m?S=[x]:S=[...S,x];return s||a(S),s?.(S,x,y,w),S},isSelected:d}}function L_e(t,e,n=0,r=0,s=!1,i=Zo){const{from:a,to:l}=e||{},{isSameDay:c,isAfter:d,isBefore:h}=i;let m;if(!a&&!l)m={from:t,to:n>0?void 0:t};else if(a&&!l)c(a,t)?n===0?m={from:a,to:t}:s?m={from:a,to:void 0}:m=void 0:h(t,a)?m={from:t,to:a}:m={from:a,to:t};else if(a&&l)if(c(a,t)&&c(l,t))s?m={from:a,to:l}:m=void 0;else if(c(a,t))m={from:a,to:n>0?void 0:t};else if(c(l,t))m={from:t,to:n>0?void 0:t};else if(h(t,a))m={from:t,to:l};else if(d(t,a))m={from:a,to:t};else if(d(t,l))m={from:a,to:t};else throw new Error("Invalid range");if(m?.from&&m?.to){const g=i.differenceInCalendarDays(m.to,m.from);r>0&&g>r?m={from:t,to:void 0}:n>1&&gtypeof l!="function").some(l=>typeof l=="boolean"?l:n.isDate(l)?Il(t,l,!1,n):cX(l,n)?l.some(c=>Il(t,c,!1,n)):g7(l)?l.from&&l.to?Pz(t,{from:l.from,to:l.to},n):!1:lX(l)?B_e(t,l.dayOfWeek,n):iX(l)?n.isAfter(l.before,l.after)?Pz(t,{from:n.addDays(l.after,1),to:n.addDays(l.before,-1)},n):Ll(t.from,l,n)||Ll(t.to,l,n):aX(l)||oX(l)?Ll(t.from,l,n)||Ll(t.to,l,n):!1))return!0;const a=r.filter(l=>typeof l=="function");if(a.length){let l=t.from;const c=n.differenceInCalendarDays(t.to,t.from);for(let d=0;d<=c;d++){if(a.some(h=>h(l)))return!0;l=n.addDays(l,1)}}return!1}function q_e(t,e){const{disabled:n,excludeDisabled:r,selected:s,required:i,onSelect:a}=t,[l,c]=aw(s,a?s:void 0),d=a?s:l;return{selected:d,select:(g,x,y)=>{const{min:w,max:S}=t,k=g?L_e(g,d,w,S,i,e):void 0;return r&&n&&k?.from&&k.to&&F_e({from:k.from,to:k.to},n,e)&&(k.from=g,k.to=void 0),a||c(k),a?.(k,g,x,y),k},isSelected:g=>d&&Il(d,g,!1,e)}}function $_e(t,e){const{selected:n,required:r,onSelect:s}=t,[i,a]=aw(n,s?n:void 0),l=s?n:i,{isSameDay:c}=e;return{selected:l,select:(m,g,x)=>{let y=m;return!r&&l&&l&&c(m,l)&&(y=void 0),s||a(y),s?.(y,m,g,x),y},isSelected:m=>l?c(l,m):!1}}function H_e(t,e){const n=$_e(t,e),r=I_e(t,e),s=q_e(t,e);switch(t.mode){case"single":return n;case"multiple":return r;case"range":return s;default:return}}function Q_e(t){let e=t;e.timeZone&&(e={...t},e.today&&(e.today=new Bs(e.today,e.timeZone)),e.month&&(e.month=new Bs(e.month,e.timeZone)),e.defaultMonth&&(e.defaultMonth=new Bs(e.defaultMonth,e.timeZone)),e.startMonth&&(e.startMonth=new Bs(e.startMonth,e.timeZone)),e.endMonth&&(e.endMonth=new Bs(e.endMonth,e.timeZone)),e.mode==="single"&&e.selected?e.selected=new Bs(e.selected,e.timeZone):e.mode==="multiple"&&e.selected?e.selected=e.selected?.map(dt=>new Bs(dt,e.timeZone)):e.mode==="range"&&e.selected&&(e.selected={from:e.selected.from?new Bs(e.selected.from,e.timeZone):void 0,to:e.selected.to?new Bs(e.selected.to,e.timeZone):void 0}));const{components:n,formatters:r,labels:s,dateLib:i,locale:a,classNames:l}=b.useMemo(()=>{const dt={...p7,...e.locale};return{dateLib:new ta({locale:dt,weekStartsOn:e.broadcastCalendar?1:e.weekStartsOn,firstWeekContainsDate:e.firstWeekContainsDate,useAdditionalWeekYearTokens:e.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:e.useAdditionalDayOfYearTokens,timeZone:e.timeZone,numerals:e.numerals},e.dateLib),components:GEe(e.components),formatters:s_e(e.formatters),labels:{...b_e,...e.labels},locale:dt,classNames:{...x7(),...e.classNames}}},[e.locale,e.broadcastCalendar,e.weekStartsOn,e.firstWeekContainsDate,e.useAdditionalWeekYearTokens,e.useAdditionalDayOfYearTokens,e.timeZone,e.numerals,e.dateLib,e.components,e.formatters,e.labels,e.classNames]),{captionLayout:c,mode:d,navLayout:h,numberOfMonths:m=1,onDayBlur:g,onDayClick:x,onDayFocus:y,onDayKeyDown:w,onDayMouseEnter:S,onDayMouseLeave:k,onNextClick:j,onPrevClick:N,showWeekNumber:T,styles:E}=e,{formatCaption:_,formatDay:A,formatMonthDropdown:D,formatWeekNumber:q,formatWeekNumberHeader:B,formatWeekdayName:H,formatYearDropdown:W}=r,ee=R_e(e,i),{days:I,months:V,navStart:L,navEnd:$,previousMonth:K,nextMonth:Y,goToMonth:R}=ee,ie=UEe(I,e,L,$,i),{isSelected:X,select:z,selected:U}=H_e(e,i)??{},{blur:te,focused:ne,isFocusTarget:G,moveFocus:se,setFocused:re}=z_e(e,ee,ie,X??(()=>!1),i),{labelDayButton:ae,labelGridcell:_e,labelGrid:Be,labelMonthDropdown:Ye,labelNav:Je,labelPrevious:Oe,labelNext:Ve,labelWeekday:Ue,labelWeekNumber:$e,labelWeekNumberHeader:jt,labelYearDropdown:vt}=s,$n=b.useMemo(()=>o_e(i,e.ISOWeek),[i,e.ISOWeek]),qt=d!==void 0||x!==void 0,un=b.useCallback(()=>{K&&(R(K),N?.(K))},[K,R,N]),Mt=b.useCallback(()=>{Y&&(R(Y),j?.(Y))},[R,Y,j]),ct=b.useCallback((dt,rn)=>wt=>{wt.preventDefault(),wt.stopPropagation(),re(dt),z?.(dt.date,rn,wt),x?.(dt.date,rn,wt)},[z,x,re]),Ne=b.useCallback((dt,rn)=>wt=>{re(dt),y?.(dt.date,rn,wt)},[y,re]),ze=b.useCallback((dt,rn)=>wt=>{te(),g?.(dt.date,rn,wt)},[te,g]),rt=b.useCallback((dt,rn)=>wt=>{const Wt={ArrowLeft:[wt.shiftKey?"month":"day",e.dir==="rtl"?"after":"before"],ArrowRight:[wt.shiftKey?"month":"day",e.dir==="rtl"?"before":"after"],ArrowDown:[wt.shiftKey?"year":"week","after"],ArrowUp:[wt.shiftKey?"year":"week","before"],PageUp:[wt.shiftKey?"year":"month","before"],PageDown:[wt.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Wt[wt.key]){wt.preventDefault(),wt.stopPropagation();const[Gt,lt]=Wt[wt.key];se(Gt,lt)}w?.(dt.date,rn,wt)},[se,w,e.dir]),bt=b.useCallback((dt,rn)=>wt=>{S?.(dt.date,rn,wt)},[S]),zt=b.useCallback((dt,rn)=>wt=>{k?.(dt.date,rn,wt)},[k]),Rt=b.useCallback(dt=>rn=>{const wt=Number(rn.target.value),Wt=i.setMonth(i.startOfMonth(dt),wt);R(Wt)},[i,R]),Hn=b.useCallback(dt=>rn=>{const wt=Number(rn.target.value),Wt=i.setYear(i.startOfMonth(dt),wt);R(Wt)},[i,R]),{className:We,style:ot}=b.useMemo(()=>({className:[l[Nt.Root],e.className].filter(Boolean).join(" "),style:{...E?.[Nt.Root],...e.style}}),[l,e.className,e.style,E]),dn=XEe(e),Pt=b.useRef(null);O_e(Pt,!!e.animate,{classNames:l,months:V,focused:ne,dateLib:i});const xn={dayPickerProps:e,selected:U,select:z,isSelected:X,months:V,nextMonth:Y,previousMonth:K,goToMonth:R,getModifiers:ie,components:n,classNames:l,styles:E,labels:s,formatters:r};return oe.createElement(sX.Provider,{value:xn},oe.createElement(n.Root,{rootRef:e.animate?Pt:void 0,className:We,style:ot,dir:e.dir,id:e.id,lang:e.lang,nonce:e.nonce,title:e.title,role:e.role,"aria-label":e["aria-label"],"aria-labelledby":e["aria-labelledby"],...dn},oe.createElement(n.Months,{className:l[Nt.Months],style:E?.[Nt.Months]},!e.hideNavigation&&!h&&oe.createElement(n.Nav,{"data-animated-nav":e.animate?"true":void 0,className:l[Nt.Nav],style:E?.[Nt.Nav],"aria-label":Je(),onPreviousClick:un,onNextClick:Mt,previousMonth:K,nextMonth:Y}),V.map((dt,rn)=>oe.createElement(n.Month,{"data-animated-month":e.animate?"true":void 0,className:l[Nt.Month],style:E?.[Nt.Month],key:rn,displayIndex:rn,calendarMonth:dt},h==="around"&&!e.hideNavigation&&rn===0&&oe.createElement(n.PreviousMonthButton,{type:"button",className:l[Nt.PreviousMonthButton],tabIndex:K?void 0:-1,"aria-disabled":K?void 0:!0,"aria-label":Oe(K),onClick:un,"data-animated-button":e.animate?"true":void 0},oe.createElement(n.Chevron,{disabled:K?void 0:!0,className:l[Nt.Chevron],orientation:e.dir==="rtl"?"right":"left"})),oe.createElement(n.MonthCaption,{"data-animated-caption":e.animate?"true":void 0,className:l[Nt.MonthCaption],style:E?.[Nt.MonthCaption],calendarMonth:dt,displayIndex:rn},c?.startsWith("dropdown")?oe.createElement(n.DropdownNav,{className:l[Nt.Dropdowns],style:E?.[Nt.Dropdowns]},(()=>{const wt=c==="dropdown"||c==="dropdown-months"?oe.createElement(n.MonthsDropdown,{key:"month",className:l[Nt.MonthsDropdown],"aria-label":Ye(),classNames:l,components:n,disabled:!!e.disableNavigation,onChange:Rt(dt.date),options:i_e(dt.date,L,$,r,i),style:E?.[Nt.Dropdown],value:i.getMonth(dt.date)}):oe.createElement("span",{key:"month"},D(dt.date,i)),Wt=c==="dropdown"||c==="dropdown-years"?oe.createElement(n.YearsDropdown,{key:"year",className:l[Nt.YearsDropdown],"aria-label":vt(i.options),classNames:l,components:n,disabled:!!e.disableNavigation,onChange:Hn(dt.date),options:l_e(L,$,r,i,!!e.reverseYears),style:E?.[Nt.Dropdown],value:i.getYear(dt.date)}):oe.createElement("span",{key:"year"},W(dt.date,i));return i.getMonthYearOrder()==="year-first"?[Wt,wt]:[wt,Wt]})(),oe.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},_(dt.date,i.options,i))):oe.createElement(n.CaptionLabel,{className:l[Nt.CaptionLabel],role:"status","aria-live":"polite"},_(dt.date,i.options,i))),h==="around"&&!e.hideNavigation&&rn===m-1&&oe.createElement(n.NextMonthButton,{type:"button",className:l[Nt.NextMonthButton],tabIndex:Y?void 0:-1,"aria-disabled":Y?void 0:!0,"aria-label":Ve(Y),onClick:Mt,"data-animated-button":e.animate?"true":void 0},oe.createElement(n.Chevron,{disabled:Y?void 0:!0,className:l[Nt.Chevron],orientation:e.dir==="rtl"?"left":"right"})),rn===m-1&&h==="after"&&!e.hideNavigation&&oe.createElement(n.Nav,{"data-animated-nav":e.animate?"true":void 0,className:l[Nt.Nav],style:E?.[Nt.Nav],"aria-label":Je(),onPreviousClick:un,onNextClick:Mt,previousMonth:K,nextMonth:Y}),oe.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":d==="multiple"||d==="range","aria-label":Be(dt.date,i.options,i)||void 0,className:l[Nt.MonthGrid],style:E?.[Nt.MonthGrid]},!e.hideWeekdays&&oe.createElement(n.Weekdays,{"data-animated-weekdays":e.animate?"true":void 0,className:l[Nt.Weekdays],style:E?.[Nt.Weekdays]},T&&oe.createElement(n.WeekNumberHeader,{"aria-label":jt(i.options),className:l[Nt.WeekNumberHeader],style:E?.[Nt.WeekNumberHeader],scope:"col"},B()),$n.map(wt=>oe.createElement(n.Weekday,{"aria-label":Ue(wt,i.options,i),className:l[Nt.Weekday],key:String(wt),style:E?.[Nt.Weekday],scope:"col"},H(wt,i.options,i)))),oe.createElement(n.Weeks,{"data-animated-weeks":e.animate?"true":void 0,className:l[Nt.Weeks],style:E?.[Nt.Weeks]},dt.weeks.map(wt=>oe.createElement(n.Week,{className:l[Nt.Week],key:wt.weekNumber,style:E?.[Nt.Week],week:wt},T&&oe.createElement(n.WeekNumber,{week:wt,style:E?.[Nt.WeekNumber],"aria-label":$e(wt.weekNumber,{locale:a}),className:l[Nt.WeekNumber],scope:"row",role:"rowheader"},q(wt.weekNumber,i)),wt.days.map(Wt=>{const{date:Gt}=Wt,lt=ie(Wt);if(lt[zr.focused]=!lt.hidden&&!!ne?.isEqualTo(Wt),lt[Wa.selected]=X?.(Gt)||lt.selected,g7(U)){const{from:vn,to:Qn}=U;lt[Wa.range_start]=!!(vn&&Qn&&i.isSameDay(Gt,vn)),lt[Wa.range_end]=!!(vn&&Qn&&i.isSameDay(Gt,Qn)),lt[Wa.range_middle]=Il(U,Gt,!0,i)}const ve=a_e(lt,E,e.modifiersStyles),He=WEe(lt,l,e.modifiersClassNames),ht=!qt&&!lt.hidden?_e(Gt,lt,i.options,i):void 0;return oe.createElement(n.Day,{key:`${i.format(Gt,"yyyy-MM-dd")}_${i.format(Wt.displayMonth,"yyyy-MM")}`,day:Wt,modifiers:lt,className:He.join(" "),style:ve,role:"gridcell","aria-selected":lt.selected||void 0,"aria-label":ht,"data-day":i.format(Gt,"yyyy-MM-dd"),"data-month":Wt.outside?i.format(Gt,"yyyy-MM"):void 0,"data-selected":lt.selected||void 0,"data-disabled":lt.disabled||void 0,"data-hidden":lt.hidden||void 0,"data-outside":Wt.outside||void 0,"data-focused":lt.focused||void 0,"data-today":lt.today||void 0},!lt.hidden&&qt?oe.createElement(n.DayButton,{className:l[Nt.DayButton],style:E?.[Nt.DayButton],type:"button",day:Wt,modifiers:lt,disabled:lt.disabled||void 0,tabIndex:G(Wt)?0:-1,"aria-label":ae(Gt,lt,i.options,i),onClick:ct(Wt,lt),onBlur:ze(Wt,lt),onFocus:Ne(Wt,lt),onKeyDown:rt(Wt,lt),onMouseEnter:bt(Wt,lt),onMouseLeave:zt(Wt,lt)},A(Gt,i.options,i)):!lt.hidden&&A(Wt.date,i.options,i))})))))))),e.footer&&oe.createElement(n.Footer,{className:l[Nt.Footer],style:E?.[Nt.Footer],role:"status","aria-live":"polite"},e.footer)))}function zz({className:t,classNames:e,showOutsideDays:n=!0,captionLayout:r="label",buttonVariant:s="ghost",formatters:i,components:a,...l}){const c=x7();return o.jsx(Q_e,{showOutsideDays:n,className:xe("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,t),captionLayout:r,formatters:{formatMonthDropdown:d=>d.toLocaleString("default",{month:"short"}),...i},classNames:{root:xe("w-fit",c.root),months:xe("relative flex flex-col gap-4 md:flex-row",c.months),month:xe("flex w-full flex-col gap-4",c.month),nav:xe("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",c.nav),button_previous:xe(q0({variant:s}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_previous),button_next:xe(q0({variant:s}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_next),month_caption:xe("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",c.month_caption),dropdowns:xe("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",c.dropdowns),dropdown_root:xe("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",c.dropdown_root),dropdown:xe("bg-popover absolute inset-0 opacity-0",c.dropdown),caption_label:xe("select-none font-medium",r==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",c.caption_label),table:"w-full border-collapse",weekdays:xe("flex",c.weekdays),weekday:xe("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",c.weekday),week:xe("mt-2 flex w-full",c.week),week_number_header:xe("w-[--cell-size] select-none",c.week_number_header),week_number:xe("text-muted-foreground select-none text-[0.8rem]",c.week_number),day:xe("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",c.day),range_start:xe("bg-accent rounded-l-md",c.range_start),range_middle:xe("rounded-none",c.range_middle),range_end:xe("bg-accent rounded-r-md",c.range_end),today:xe("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",c.today),outside:xe("text-muted-foreground aria-selected:text-muted-foreground",c.outside),disabled:xe("text-muted-foreground opacity-50",c.disabled),hidden:xe("invisible",c.hidden),...e},components:{Root:({className:d,rootRef:h,...m})=>o.jsx("div",{"data-slot":"calendar",ref:h,className:xe(d),...m}),Chevron:({className:d,orientation:h,...m})=>h==="left"?o.jsx(wd,{className:xe("size-4",d),...m}):h==="right"?o.jsx(Zl,{className:xe("size-4",d),...m}):o.jsx(Xc,{className:xe("size-4",d),...m}),DayButton:V_e,WeekNumber:({children:d,...h})=>o.jsx("td",{...h,children:o.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:d})}),...a},...l})}function V_e({className:t,day:e,modifiers:n,...r}){const s=x7(),i=b.useRef(null);return b.useEffect(()=>{n.focused&&i.current?.focus()},[n.focused]),o.jsx(ue,{ref:i,variant:"ghost",size:"icon","data-day":e.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:xe("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",s.day,t),...r})}class U_e{ws=null;reconnectTimeout=null;reconnectAttempts=0;maxReconnectAttempts=10;heartbeatInterval=null;logCallbacks=new Set;connectionCallbacks=new Set;isConnected=!1;logCache=[];maxCacheSize=1e3;getWebSocketUrl(){{const e=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.host;return`${e}//${n}/ws/logs`}}connect(){if(this.ws?.readyState===WebSocket.OPEN||this.ws?.readyState===WebSocket.CONNECTING)return;const e=this.getWebSocketUrl();try{this.ws=new WebSocket(e),this.ws.onopen=()=>{this.isConnected=!0,this.reconnectAttempts=0,this.notifyConnection(!0),this.startHeartbeat()},this.ws.onmessage=n=>{try{if(n.data==="pong")return;const r=JSON.parse(n.data);this.notifyLog(r)}catch(r){console.error("解析日志消息失败:",r)}},this.ws.onerror=n=>{console.error("❌ WebSocket 错误:",n),this.isConnected=!1,this.notifyConnection(!1)},this.ws.onclose=()=>{this.isConnected=!1,this.notifyConnection(!1),this.stopHeartbeat(),this.attemptReconnect()}}catch(n){console.error("创建 WebSocket 连接失败:",n),this.attemptReconnect()}}attemptReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts)return;this.reconnectAttempts+=1;const e=Math.min(1e3*this.reconnectAttempts,1e4);this.reconnectTimeout=window.setTimeout(()=>{this.connect()},e)}startHeartbeat(){this.heartbeatInterval=window.setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send("ping")},3e4)}stopHeartbeat(){this.heartbeatInterval!==null&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null)}disconnect(){this.reconnectTimeout!==null&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.stopHeartbeat(),this.ws&&(this.ws.close(),this.ws=null),this.isConnected=!1,this.reconnectAttempts=0}onLog(e){return this.logCallbacks.add(e),()=>this.logCallbacks.delete(e)}onConnectionChange(e){return this.connectionCallbacks.add(e),e(this.isConnected),()=>this.connectionCallbacks.delete(e)}notifyLog(e){this.logCache.some(r=>r.id===e.id)||(this.logCache.push(e),this.logCache.length>this.maxCacheSize&&(this.logCache=this.logCache.slice(-this.maxCacheSize)),this.logCallbacks.forEach(r=>{try{r(e)}catch(s){console.error("日志回调执行失败:",s)}}))}notifyConnection(e){this.connectionCallbacks.forEach(n=>{try{n(e)}catch(r){console.error("连接状态回调执行失败:",r)}})}getAllLogs(){return[...this.logCache]}clearLogs(){this.logCache=[]}getConnectionStatus(){return this.isConnected}}const Nh=new U_e;typeof window<"u"&&Nh.connect();const W_e={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},G_e=(t,e,n)=>{let r;const s=W_e[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",String(e)),n?.addSuffix?n.comparison&&n.comparison>0?r+"内":r+"前":r},X_e={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},Y_e={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},K_e={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},Z_e={date:Uh({formats:X_e,defaultWidth:"full"}),time:Uh({formats:Y_e,defaultWidth:"full"}),dateTime:Uh({formats:K_e,defaultWidth:"full"})};function Iz(t,e,n){const r="eeee p";return cEe(t,e,n)?r:t.getTime()>e.getTime()?"'下个'"+r:"'上个'"+r}const J_e={lastWeek:Iz,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:Iz,other:"PP p"},eAe=(t,e,n,r)=>{const s=J_e[t];return typeof s=="function"?s(e,n,r):s},tAe={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},nAe={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},rAe={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},sAe={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},iAe={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},aAe={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},oAe=(t,e)=>{const n=Number(t);switch(e?.unit){case"date":return n.toString()+"日";case"hour":return n.toString()+"时";case"minute":return n.toString()+"分";case"second":return n.toString()+"秒";default:return"第 "+n.toString()}},lAe={ordinalNumber:oAe,era:jo({values:tAe,defaultWidth:"wide"}),quarter:jo({values:nAe,defaultWidth:"wide",argumentCallback:t=>t-1}),month:jo({values:rAe,defaultWidth:"wide"}),day:jo({values:sAe,defaultWidth:"wide"}),dayPeriod:jo({values:iAe,defaultWidth:"wide",formattingValues:aAe,defaultFormattingWidth:"wide"})},cAe=/^(第\s*)?\d+(日|时|分|秒)?/i,uAe=/\d+/i,dAe={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},hAe={any:[/^(前)/i,/^(公元)/i]},fAe={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},mAe={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},pAe={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},gAe={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},xAe={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},vAe={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},yAe={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},bAe={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},wAe={ordinalNumber:KG({matchPattern:cAe,parsePattern:uAe,valueCallback:t=>parseInt(t,10)}),era:No({matchPatterns:dAe,defaultMatchWidth:"wide",parsePatterns:hAe,defaultParseWidth:"any"}),quarter:No({matchPatterns:fAe,defaultMatchWidth:"wide",parsePatterns:mAe,defaultParseWidth:"any",valueCallback:t=>t+1}),month:No({matchPatterns:pAe,defaultMatchWidth:"wide",parsePatterns:gAe,defaultParseWidth:"any"}),day:No({matchPatterns:xAe,defaultMatchWidth:"wide",parsePatterns:vAe,defaultParseWidth:"any"}),dayPeriod:No({matchPatterns:yAe,defaultMatchWidth:"any",parsePatterns:bAe,defaultParseWidth:"any"})},K1={code:"zh-CN",formatDistance:G_e,formatLong:Z_e,formatRelative:eAe,localize:lAe,match:wAe,options:{weekStartsOn:1,firstWeekContainsDate:4}},Z1={xs:{label:"小",rowHeight:28,class:"text-[10px] sm:text-xs"},sm:{label:"中",rowHeight:36,class:"text-xs sm:text-sm"},base:{label:"大",rowHeight:44,class:"text-sm sm:text-base"}};function SAe(){const[t,e]=b.useState([]),[n,r]=b.useState(""),[s,i]=b.useState("all"),[a,l]=b.useState("all"),[c,d]=b.useState(void 0),[h,m]=b.useState(void 0),[g,x]=b.useState(!0),[y,w]=b.useState(!1),[S,k]=b.useState("xs"),[j,N]=b.useState(4),T=b.useRef(null);b.useEffect(()=>{const L=Nh.getAllLogs();e(L);const $=Nh.onLog(()=>{e(Nh.getAllLogs())}),K=Nh.onConnectionChange(Y=>{w(Y)});return()=>{$(),K()}},[]);const E=b.useMemo(()=>{const L=new Set(t.map($=>$.module));return Array.from(L).sort()},[t]),_=L=>{switch(L){case"DEBUG":return"text-muted-foreground";case"INFO":return"text-blue-500 dark:text-blue-400";case"WARNING":return"text-yellow-600 dark:text-yellow-500";case"ERROR":return"text-red-600 dark:text-red-500";case"CRITICAL":return"text-red-700 dark:text-red-400 font-bold";default:return"text-foreground"}},A=L=>{switch(L){case"DEBUG":return"bg-gray-800/30 dark:bg-gray-800/50";case"INFO":return"bg-blue-900/20 dark:bg-blue-500/20";case"WARNING":return"bg-yellow-900/20 dark:bg-yellow-500/20";case"ERROR":return"bg-red-900/20 dark:bg-red-500/20";case"CRITICAL":return"bg-red-900/30 dark:bg-red-600/30";default:return"bg-gray-800/20 dark:bg-gray-800/30"}},D=()=>{window.location.reload()},q=()=>{Nh.clearLogs(),e([])},B=()=>{const L=ee.map(R=>`${R.timestamp} [${R.level.padEnd(8)}] [${R.module}] ${R.message}`).join(` -`),$=new Blob([L],{type:"text/plain;charset=utf-8"}),K=URL.createObjectURL($),Y=document.createElement("a");Y.href=K,Y.download=`logs-${Dv(new Date,"yyyy-MM-dd-HHmmss")}.txt`,Y.click(),URL.revokeObjectURL(K)},H=()=>{x(!g)},W=()=>{d(void 0),m(void 0)},ee=b.useMemo(()=>t.filter(L=>{const $=n===""||L.message.toLowerCase().includes(n.toLowerCase())||L.module.toLowerCase().includes(n.toLowerCase()),K=s==="all"||L.level===s,Y=a==="all"||L.module===a;let R=!0;if(c||h){const ie=new Date(L.timestamp);if(c){const X=new Date(c);X.setHours(0,0,0,0),R=R&&ie>=X}if(h){const X=new Date(h);X.setHours(23,59,59,999),R=R&&ie<=X}}return $&&K&&Y&&R}),[t,n,s,a,c,h]),I=Z1[S].rowHeight+j,V=HTe({count:ee.length,getScrollElement:()=>T.current,estimateSize:()=>I,overscan:15});return b.useEffect(()=>{g&&ee.length>0&&V.scrollToIndex(ee.length-1,{align:"end",behavior:"auto"})},[ee.length,g,V]),o.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[o.jsxs("div",{className:"flex-shrink-0 space-y-4 p-3 sm:p-4 lg:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-xl sm:text-2xl lg:text-3xl font-bold",children:"日志查看器"}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:"实时查看和分析麦麦运行日志"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:xe("h-2.5 w-2.5 sm:h-3 sm:w-3 rounded-full",y?"bg-green-500 animate-pulse":"bg-red-500")}),o.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground",children:y?"已连接":"未连接"})]})]}),o.jsx(Lt,{className:"p-3 sm:p-4",children:o.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[o.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:gap-4",children:[o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(ii,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(Pe,{placeholder:"搜索日志...",value:n,onChange:L=>r(L.target.value),className:"pl-9 h-9 text-sm"})]}),o.jsxs(Vt,{value:s,onValueChange:i,children:[o.jsxs($t,{className:"w-full sm:w-[140px] lg:w-[180px] h-9 text-sm",children:[o.jsx(ok,{className:"h-4 w-4 mr-2"}),o.jsx(Ut,{placeholder:"级别"})]}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部级别"}),o.jsx(De,{value:"DEBUG",children:"DEBUG"}),o.jsx(De,{value:"INFO",children:"INFO"}),o.jsx(De,{value:"WARNING",children:"WARNING"}),o.jsx(De,{value:"ERROR",children:"ERROR"}),o.jsx(De,{value:"CRITICAL",children:"CRITICAL"})]})]}),o.jsxs(Vt,{value:a,onValueChange:l,children:[o.jsxs($t,{className:"w-full sm:w-[160px] lg:w-[200px] h-9 text-sm",children:[o.jsx(ok,{className:"h-4 w-4 mr-2"}),o.jsx(Ut,{placeholder:"模块"})]}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部模块"}),E.map(L=>o.jsx(De,{value:L,children:L},L))]})]})]}),o.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-4",children:[o.jsxs(Bo,{children:[o.jsx(Fo,{asChild:!0,children:o.jsxs(ue,{variant:"outline",size:"sm",className:xe("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!c&&"text-muted-foreground"),children:[o.jsx(C9,{className:"mr-2 h-4 w-4"}),o.jsx("span",{className:"text-xs sm:text-sm",children:c?Dv(c,"PPP",{locale:K1}):"开始日期"})]})}),o.jsx(Ka,{className:"w-auto p-0",align:"start",children:o.jsx(zz,{mode:"single",selected:c,onSelect:d,initialFocus:!0,locale:K1})})]}),o.jsxs(Bo,{children:[o.jsx(Fo,{asChild:!0,children:o.jsxs(ue,{variant:"outline",size:"sm",className:xe("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!h&&"text-muted-foreground"),children:[o.jsx(C9,{className:"mr-2 h-4 w-4"}),o.jsx("span",{className:"text-xs sm:text-sm",children:h?Dv(h,"PPP",{locale:K1}):"结束日期"})]})}),o.jsx(Ka,{className:"w-auto p-0",align:"start",children:o.jsx(zz,{mode:"single",selected:h,onSelect:m,initialFocus:!0,locale:K1})})]}),(c||h)&&o.jsxs(ue,{variant:"outline",size:"sm",onClick:W,className:"w-full sm:w-auto h-9",children:[o.jsx(Pp,{className:"h-4 w-4 sm:mr-2"}),o.jsx("span",{className:"hidden sm:inline text-sm",children:"清除时间筛选"}),o.jsx("span",{className:"sm:hidden text-sm",children:"清除"})]})]}),o.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center",children:[o.jsxs("div",{className:"flex gap-2 flex-wrap",children:[o.jsxs(ue,{variant:g?"default":"outline",size:"sm",onClick:H,className:"flex-1 sm:flex-none h-9",children:[g?o.jsx(rte,{className:"h-4 w-4"}):o.jsx(ste,{className:"h-4 w-4"}),o.jsx("span",{className:"ml-2 text-sm",children:g?"自动滚动":"已暂停"})]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:D,className:"flex-1 sm:flex-none h-9",children:[o.jsx(Qs,{className:"h-4 w-4"}),o.jsx("span",{className:"ml-2 text-sm",children:"刷新"})]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:q,className:"flex-1 sm:flex-none h-9",children:[o.jsx(Cn,{className:"h-4 w-4"}),o.jsx("span",{className:"ml-2 text-sm",children:"清空"})]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:B,className:"flex-1 sm:flex-none h-9",children:[o.jsx(td,{className:"h-4 w-4"}),o.jsx("span",{className:"ml-2 text-sm",children:"导出"})]})]}),o.jsx("div",{className:"flex-1 hidden sm:block"}),o.jsxs("div",{className:"text-xs sm:text-sm text-muted-foreground flex items-center justify-center sm:justify-end",children:[o.jsxs("span",{className:"font-mono",children:[ee.length," / ",t.length]}),o.jsx("span",{className:"ml-1",children:"条日志"})]})]}),o.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-6 pt-2 border-t border-border/50",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[o.jsx(ite,{className:"h-4 w-4"}),o.jsx("span",{children:"字号"})]}),o.jsx("div",{className:"flex gap-1",children:Object.keys(Z1).map(L=>o.jsx(ue,{variant:S===L?"default":"outline",size:"sm",onClick:()=>k(L),className:"h-7 px-3 text-xs",children:Z1[L].label},L))})]}),o.jsxs("div",{className:"flex items-center gap-3 flex-1 max-w-xs",children:[o.jsx("span",{className:"text-sm text-muted-foreground whitespace-nowrap",children:"行距"}),o.jsx(Nf,{value:[j],onValueChange:([L])=>N(L),min:0,max:12,step:2,className:"flex-1"}),o.jsxs("span",{className:"text-xs text-muted-foreground w-8",children:[j,"px"]})]})]})]})})]}),o.jsx("div",{className:"flex-1 min-h-0 px-3 sm:px-4 lg:px-6 pb-3 sm:pb-4 lg:pb-6",children:o.jsx(Lt,{className:"bg-black dark:bg-gray-950 border-gray-800 dark:border-gray-900 h-full",children:o.jsx(pn,{viewportRef:T,className:"h-full",children:o.jsx("div",{className:xe("p-2 sm:p-3 font-mono relative",Z1[S].class),style:{height:`${V.getTotalSize()}px`},children:ee.length===0?o.jsx("div",{className:"text-gray-500 dark:text-gray-600 text-center py-8 text-sm",children:"暂无日志数据"}):V.getVirtualItems().map(L=>{const $=ee[L.index];return o.jsxs("div",{"data-index":L.index,ref:V.measureElement,className:xe("absolute top-0 left-0 w-full px-2 sm:px-3 rounded hover:bg-white/5 transition-colors group",A($.level)),style:{transform:`translateY(${L.start}px)`,paddingTop:`${j/2}px`,paddingBottom:`${j/2}px`},children:[o.jsxs("div",{className:"flex flex-col gap-0.5 sm:hidden",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-gray-500 dark:text-gray-600",children:$.timestamp}),o.jsxs("span",{className:xe("font-semibold",_($.level)),children:["[",$.level,"]"]})]}),o.jsx("div",{className:"text-cyan-400 dark:text-cyan-500 truncate",children:$.module}),o.jsx("div",{className:"text-gray-300 dark:text-gray-400 whitespace-pre-wrap break-words",children:$.message})]}),o.jsxs("div",{className:"hidden sm:flex gap-2 items-start",children:[o.jsx("span",{className:"text-gray-500 dark:text-gray-600 flex-shrink-0 w-[130px] lg:w-[160px]",children:$.timestamp}),o.jsxs("span",{className:xe("flex-shrink-0 w-[65px] lg:w-[75px] font-semibold",_($.level)),children:["[",$.level,"]"]}),o.jsx("span",{className:"text-cyan-400 dark:text-cyan-500 flex-shrink-0 w-[100px] lg:w-[130px] truncate",children:$.module}),o.jsx("span",{className:"text-gray-300 dark:text-gray-400 flex-1 whitespace-pre-wrap break-words",children:$.message})]})]},L.key)})})})})})]})}const kAe="Mai-with-u",OAe="plugin-repo",jAe="main",NAe="plugin_details.json";async function CAe(){try{const t=await gt("/api/webui/plugins/fetch-raw",{method:"POST",headers:Tt(),body:JSON.stringify({owner:kAe,repo:OAe,branch:jAe,file_path:NAe})});if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const e=await t.json();if(!e.success||!e.data)throw new Error(e.error||"获取插件列表失败");return JSON.parse(e.data).filter(s=>!s?.id||!s?.manifest?(console.warn("跳过无效插件数据:",s),!1):!s.manifest.name||!s.manifest.version?(console.warn("跳过缺少必需字段的插件:",s.id),!1):!0).map(s=>({id:s.id,manifest:{manifest_version:s.manifest.manifest_version||1,name:s.manifest.name,version:s.manifest.version,description:s.manifest.description||"",author:s.manifest.author||{name:"Unknown"},license:s.manifest.license||"Unknown",host_application:s.manifest.host_application||{min_version:"0.0.0"},homepage_url:s.manifest.homepage_url,repository_url:s.manifest.repository_url,keywords:s.manifest.keywords||[],categories:s.manifest.categories||[],default_locale:s.manifest.default_locale||"zh-CN",locales_path:s.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!1,published_at:new Date().toISOString(),updated_at:new Date().toISOString()}))}catch(t){throw console.error("Failed to fetch plugin list:",t),t}}async function TAe(){try{const t=await gt("/api/webui/plugins/git-status");if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return await t.json()}catch(t){return console.error("Failed to check Git status:",t),{installed:!1,error:"无法检测 Git 安装状态"}}}async function EAe(){try{const t=await gt("/api/webui/plugins/version");if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return await t.json()}catch(t){return console.error("Failed to get Maimai version:",t),{version:"0.0.0",version_major:0,version_minor:0,version_patch:0}}}function _Ae(t,e,n){const r=t.split(".").map(l=>parseInt(l)||0),s=r[0]||0,i=r[1]||0,a=r[2]||0;if(n.version_majorparseInt(m)||0),c=l[0]||0,d=l[1]||0,h=l[2]||0;if(n.version_major>c||n.version_major===c&&n.version_minor>d||n.version_major===c&&n.version_minor===d&&n.version_patch>h)return!1}return!0}function AAe(t,e){const n=window.location.protocol==="https:"?"wss:":"ws:",r=window.location.host,s=new WebSocket(`${n}//${r}/api/webui/ws/plugin-progress`);return s.onopen=()=>{console.log("Plugin progress WebSocket connected");const i=setInterval(()=>{s.readyState===WebSocket.OPEN?s.send("ping"):clearInterval(i)},3e4)},s.onmessage=i=>{try{if(i.data==="pong")return;const a=JSON.parse(i.data);t(a)}catch(a){console.error("Failed to parse progress data:",a)}},s.onerror=i=>{console.error("Plugin progress WebSocket error:",i),e?.(i)},s.onclose=()=>{console.log("Plugin progress WebSocket disconnected")},s}async function v0(){try{const t=await gt("/api/webui/plugins/installed",{headers:Tt()});if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const e=await t.json();if(!e.success)throw new Error(e.message||"获取已安装插件列表失败");return e.plugins||[]}catch(t){return console.error("Failed to get installed plugins:",t),[]}}function J1(t,e){return e.some(n=>n.id===t)}function ev(t,e){const n=e.find(r=>r.id===t);if(n)return n.manifest?.version||n.version}async function MAe(t,e,n="main"){const r=await gt("/api/webui/plugins/install",{method:"POST",headers:Tt(),body:JSON.stringify({plugin_id:t,repository_url:e,branch:n})});if(!r.ok){const s=await r.json();throw new Error(s.detail||"安装失败")}return await r.json()}async function RAe(t){const e=await gt("/api/webui/plugins/uninstall",{method:"POST",headers:Tt(),body:JSON.stringify({plugin_id:t})});if(!e.ok){const n=await e.json();throw new Error(n.detail||"卸载失败")}return await e.json()}async function DAe(t,e,n="main"){const r=await gt("/api/webui/plugins/update",{method:"POST",headers:Tt(),body:JSON.stringify({plugin_id:t,repository_url:e,branch:n})});if(!r.ok){const s=await r.json();throw new Error(s.detail||"更新失败")}return await r.json()}async function PAe(t){const e=await gt(`/api/webui/plugins/config/${t}/schema`,{headers:Tt()});if(!e.ok){const r=await e.json();throw new Error(r.detail||"获取配置 Schema 失败")}const n=await e.json();if(!n.success)throw new Error(n.message||"获取配置 Schema 失败");return n.schema}async function zAe(t){const e=await gt(`/api/webui/plugins/config/${t}`,{headers:Tt()});if(!e.ok){const r=await e.json();throw new Error(r.detail||"获取配置失败")}const n=await e.json();if(!n.success)throw new Error(n.message||"获取配置失败");return n.config}async function IAe(t,e){const n=await gt(`/api/webui/plugins/config/${t}`,{method:"PUT",headers:Tt(),body:JSON.stringify({config:e})});if(!n.ok){const r=await n.json();throw new Error(r.detail||"保存配置失败")}return await n.json()}async function LAe(t){const e=await gt(`/api/webui/plugins/config/${t}/reset`,{method:"POST",headers:Tt()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"重置配置失败")}return await e.json()}async function BAe(t){const e=await gt(`/api/webui/plugins/config/${t}/toggle`,{method:"POST",headers:Tt()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"切换状态失败")}return await e.json()}const Cg="https://maibot-plugin-stats.maibot-webui.workers.dev";async function pX(t){try{const e=await fetch(`${Cg}/stats/${t}`);return e.ok?await e.json():(console.error("Failed to fetch plugin stats:",e.statusText),null)}catch(e){return console.error("Error fetching plugin stats:",e),null}}async function FAe(t,e){try{const n=e||v7(),r=await fetch(`${Cg}/stats/like`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:t,user_id:n})}),s=await r.json();return r.status===429?{success:!1,error:"操作过于频繁,请稍后再试"}:r.ok?{success:!0,...s}:{success:!1,error:s.error||"点赞失败"}}catch(n){return console.error("Error liking plugin:",n),{success:!1,error:"网络错误"}}}async function qAe(t,e){try{const n=e||v7(),r=await fetch(`${Cg}/stats/dislike`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:t,user_id:n})}),s=await r.json();return r.status===429?{success:!1,error:"操作过于频繁,请稍后再试"}:r.ok?{success:!0,...s}:{success:!1,error:s.error||"点踩失败"}}catch(n){return console.error("Error disliking plugin:",n),{success:!1,error:"网络错误"}}}async function $Ae(t,e,n,r){if(e<1||e>5)return{success:!1,error:"评分必须在 1-5 之间"};try{const s=r||v7(),i=await fetch(`${Cg}/stats/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:t,rating:e,comment:n,user_id:s})}),a=await i.json();return i.status===429?{success:!1,error:"每天最多评分 3 次"}:i.ok?{success:!0,...a}:{success:!1,error:a.error||"评分失败"}}catch(s){return console.error("Error rating plugin:",s),{success:!1,error:"网络错误"}}}async function HAe(t){try{const e=await fetch(`${Cg}/stats/download`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:t})}),n=await e.json();return e.status===429?(console.warn("Download recording rate limited"),{success:!0}):e.ok?{success:!0,...n}:(console.error("Failed to record download:",n.error),{success:!1,error:n.error})}catch(e){return console.error("Error recording download:",e),{success:!1,error:"网络错误"}}}function QAe(){const t=navigator,e=[navigator.userAgent,navigator.language,navigator.languages?.join(",")||"",navigator.platform,navigator.hardwareConcurrency||0,screen.width,screen.height,screen.colorDepth,screen.pixelDepth,new Date().getTimezoneOffset(),Intl.DateTimeFormat().resolvedOptions().timeZone,navigator.maxTouchPoints||0,t.deviceMemory||0].join("|");let n=0;for(let r=0;r{i(!0);const k=await pX(t);k&&r(k),i(!1)};b.useEffect(()=>{x()},[t]);const y=async()=>{const k=await FAe(t);k.success?(g({title:"已点赞",description:"感谢你的支持!"}),x()):g({title:"点赞失败",description:k.error||"未知错误",variant:"destructive"})},w=async()=>{const k=await qAe(t);k.success?(g({title:"已反馈",description:"感谢你的反馈!"}),x()):g({title:"操作失败",description:k.error||"未知错误",variant:"destructive"})},S=async()=>{if(a===0){g({title:"请选择评分",description:"至少选择 1 颗星",variant:"destructive"});return}const k=await $Ae(t,a,c||void 0);k.success?(g({title:"评分成功",description:"感谢你的评价!"}),m(!1),l(0),d(""),x()):g({title:"评分失败",description:k.error||"未知错误",variant:"destructive"})};return s?o.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(td,{className:"h-4 w-4"}),o.jsx("span",{children:"-"})]}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Dc,{className:"h-4 w-4"}),o.jsx("span",{children:"-"})]})]}):n?e?o.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[o.jsxs("div",{className:"flex items-center gap-1",title:`下载量: ${n.downloads.toLocaleString()}`,children:[o.jsx(td,{className:"h-4 w-4"}),o.jsx("span",{children:n.downloads.toLocaleString()})]}),o.jsxs("div",{className:"flex items-center gap-1",title:`评分: ${n.rating.toFixed(1)} (${n.rating_count} 条评价)`,children:[o.jsx(Dc,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),o.jsx("span",{children:n.rating.toFixed(1)})]}),o.jsxs("div",{className:"flex items-center gap-1",title:`点赞数: ${n.likes}`,children:[o.jsx(k4,{className:"h-4 w-4"}),o.jsx("span",{children:n.likes})]})]}):o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[o.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[o.jsx(td,{className:"h-5 w-5 text-muted-foreground mb-1"}),o.jsx("span",{className:"text-2xl font-bold",children:n.downloads.toLocaleString()}),o.jsx("span",{className:"text-xs text-muted-foreground",children:"下载量"})]}),o.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[o.jsx(Dc,{className:"h-5 w-5 text-yellow-400 mb-1 fill-yellow-400"}),o.jsx("span",{className:"text-2xl font-bold",children:n.rating.toFixed(1)}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:[n.rating_count," 条评价"]})]}),o.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[o.jsx(k4,{className:"h-5 w-5 text-green-500 mb-1"}),o.jsx("span",{className:"text-2xl font-bold",children:n.likes}),o.jsx("span",{className:"text-xs text-muted-foreground",children:"点赞"})]}),o.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[o.jsx(T9,{className:"h-5 w-5 text-red-500 mb-1"}),o.jsx("span",{className:"text-2xl font-bold",children:n.dislikes}),o.jsx("span",{className:"text-xs text-muted-foreground",children:"点踩"})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(ue,{variant:"outline",size:"sm",onClick:y,children:[o.jsx(k4,{className:"h-4 w-4 mr-1"}),"点赞"]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:w,children:[o.jsx(T9,{className:"h-4 w-4 mr-1"}),"点踩"]}),o.jsxs(Er,{open:h,onOpenChange:m,children:[o.jsx(Of,{asChild:!0,children:o.jsxs(ue,{variant:"default",size:"sm",children:[o.jsx(Dc,{className:"h-4 w-4 mr-1"}),"评分"]})}),o.jsxs(wr,{children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"为插件评分"}),o.jsx(Xr,{children:"分享你的使用体验,帮助其他用户"})]}),o.jsxs("div",{className:"space-y-4 py-4",children:[o.jsxs("div",{className:"flex flex-col items-center gap-2",children:[o.jsx("div",{className:"flex gap-2",children:[1,2,3,4,5].map(k=>o.jsx("button",{onClick:()=>l(k),className:"focus:outline-none",children:o.jsx(Dc,{className:`h-8 w-8 transition-colors ${k<=a?"fill-yellow-400 text-yellow-400":"text-muted-foreground hover:text-yellow-300"}`})},k))}),o.jsxs("span",{className:"text-sm text-muted-foreground",children:[a===0&&"点击星星进行评分",a===1&&"很差",a===2&&"一般",a===3&&"还行",a===4&&"不错",a===5&&"非常好"]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium mb-2 block",children:"评论(可选)"}),o.jsx(Nr,{value:c,onChange:k=>d(k.target.value),placeholder:"分享你的使用体验...",rows:4,maxLength:500}),o.jsxs("div",{className:"text-xs text-muted-foreground mt-1 text-right",children:[c.length," / 500"]})]})]}),o.jsxs(fs,{children:[o.jsx(ue,{variant:"outline",onClick:()=>m(!1),children:"取消"}),o.jsx(ue,{onClick:S,disabled:a===0,children:"提交评分"})]})]})]})]}),n.recent_ratings&&n.recent_ratings.length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"text-sm font-semibold",children:"最近评价"}),o.jsx("div",{className:"space-y-3",children:n.recent_ratings.map((k,j)=>o.jsxs("div",{className:"p-3 rounded-lg border bg-muted/50",children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("div",{className:"flex gap-1",children:[1,2,3,4,5].map(N=>o.jsx(Dc,{className:`h-3 w-3 ${N<=k.rating?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},N))}),o.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(k.created_at).toLocaleDateString()})]}),k.comment&&o.jsx("p",{className:"text-sm text-muted-foreground",children:k.comment})]},j))})]})]}):null}const Lz={"Group Management":"群组管理","Entertainment & Interaction":"娱乐互动","Utility Tools":"实用工具","Content Generation":"内容生成",Multimedia:"多媒体","External Integration":"外部集成","Data Analysis & Insights":"数据分析与洞察",Other:"其他"};function UAe(){const t=na(),[e,n]=b.useState(null),[r,s]=b.useState(""),[i,a]=b.useState("all"),[l,c]=b.useState("all"),[d,h]=b.useState(!0),[m,g]=b.useState([]),[x,y]=b.useState(!0),[w,S]=b.useState(null),[k,j]=b.useState(null),[N,T]=b.useState(null),[E,_]=b.useState(null),[,A]=b.useState([]),[D,q]=b.useState({}),{toast:B}=Lr(),H=async R=>{const ie=R.map(async U=>{try{const te=await pX(U.id);return{id:U.id,stats:te}}catch(te){return console.warn(`Failed to load stats for ${U.id}:`,te),{id:U.id,stats:null}}}),X=await Promise.all(ie),z={};X.forEach(({id:U,stats:te})=>{te&&(z[U]=te)}),q(z)};b.useEffect(()=>{let R=null,ie=!1;return(async()=>{if(R=AAe(z=>{ie||(T(z),z.stage==="success"?setTimeout(()=>{ie||T(null)},2e3):z.stage==="error"&&(y(!1),S(z.error||"加载失败")))},z=>{console.error("WebSocket error:",z),ie||B({title:"WebSocket 连接失败",description:"无法实时显示加载进度",variant:"destructive"})}),await new Promise(z=>{if(!R){z();return}const U=()=>{R&&R.readyState===WebSocket.OPEN?(console.log("WebSocket connected, starting to load plugins"),z()):R&&R.readyState===WebSocket.CLOSED?(console.warn("WebSocket closed before loading plugins"),z()):setTimeout(U,100)};U()}),!ie){const z=await TAe();j(z),z.installed||B({title:"Git 未安装",description:z.error||"请先安装 Git 才能使用插件安装功能",variant:"destructive"})}if(!ie){const z=await EAe();_(z)}if(!ie)try{y(!0),S(null);const z=await CAe();if(!ie){const U=await v0();A(U);const te=z.map(ne=>{const G=J1(ne.id,U),se=ev(ne.id,U);return{...ne,installed:G,installed_version:se}});for(const ne of U)!te.some(se=>se.id===ne.id)&&ne.manifest&&te.push({id:ne.id,manifest:{manifest_version:ne.manifest.manifest_version||1,name:ne.manifest.name,version:ne.manifest.version,description:ne.manifest.description||"",author:ne.manifest.author,license:ne.manifest.license||"Unknown",host_application:ne.manifest.host_application,homepage_url:ne.manifest.homepage_url,repository_url:ne.manifest.repository_url,keywords:ne.manifest.keywords||[],categories:ne.manifest.categories||[],default_locale:ne.manifest.default_locale||"zh-CN",locales_path:ne.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!0,installed_version:ne.manifest.version,published_at:new Date().toISOString(),updated_at:new Date().toISOString()});g(te),H(te)}}catch(z){if(!ie){const U=z instanceof Error?z.message:"加载插件列表失败";S(U),B({title:"加载失败",description:U,variant:"destructive"})}}finally{ie||y(!1)}})(),()=>{ie=!0,R&&R.close()}},[B]);const W=R=>{if(!R.installed&&E&&!ee(R))return o.jsxs(tn,{variant:"destructive",className:"gap-1",children:[o.jsx(Lo,{className:"h-3 w-3"}),"不兼容"]});if(R.installed){const ie=R.installed_version?.trim(),X=R.manifest.version?.trim();if(ie!==X){const z=ie?.split(".").map(Number)||[0,0,0],U=X?.split(".").map(Number)||[0,0,0];for(let te=0;te<3;te++){if((U[te]||0)>(z[te]||0))return o.jsxs(tn,{variant:"outline",className:"gap-1 text-orange-600 border-orange-600",children:[o.jsx(Lo,{className:"h-3 w-3"}),"可更新"]});if((U[te]||0)<(z[te]||0))break}}return o.jsxs(tn,{variant:"default",className:"gap-1",children:[o.jsx(Ya,{className:"h-3 w-3"}),"已安装"]})}return null},ee=R=>!E||!R.manifest?.host_application?!0:_Ae(R.manifest.host_application.min_version,R.manifest.host_application.max_version,E),I=R=>{if(!R.installed||!R.installed_version||!R.manifest?.version)return!1;const ie=R.installed_version.trim(),X=R.manifest.version.trim();if(ie===X)return!1;const z=ie.split(".").map(Number),U=X.split(".").map(Number);for(let te=0;te<3;te++){if((U[te]||0)>(z[te]||0))return!0;if((U[te]||0)<(z[te]||0))return!1}return!1},V=m.filter(R=>{if(!R.manifest)return console.warn("[过滤] 跳过无 manifest 的插件:",R.id),!1;const ie=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(te=>te.toLowerCase().includes(r.toLowerCase())),X=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i);let z=!0;l==="installed"?z=R.installed===!0:l==="updates"&&(z=R.installed===!0&&I(R));const U=!d||!E||ee(R);return ie&&X&&z&&U}),L=()=>{n(null)},$=async R=>{if(!k?.installed){B({title:"无法安装",description:"Git 未安装",variant:"destructive"});return}if(E&&!ee(R)){B({title:"无法安装",description:"插件与当前麦麦版本不兼容",variant:"destructive"});return}try{await MAe(R.id,R.manifest.repository_url||"","main"),HAe(R.id).catch(X=>{console.warn("Failed to record download:",X)}),B({title:"安装成功",description:`${R.manifest.name} 已成功安装`});const ie=await v0();A(ie),g(X=>X.map(z=>{if(z.id===R.id){const U=J1(z.id,ie),te=ev(z.id,ie);return{...z,installed:U,installed_version:te}}return z}))}catch(ie){B({title:"安装失败",description:ie instanceof Error?ie.message:"未知错误",variant:"destructive"})}},K=async R=>{try{await RAe(R.id),B({title:"卸载成功",description:`${R.manifest.name} 已成功卸载`});const ie=await v0();A(ie),g(X=>X.map(z=>{if(z.id===R.id){const U=J1(z.id,ie),te=ev(z.id,ie);return{...z,installed:U,installed_version:te}}return z}))}catch(ie){B({title:"卸载失败",description:ie instanceof Error?ie.message:"未知错误",variant:"destructive"})}},Y=async R=>{if(!k?.installed){B({title:"无法更新",description:"Git 未安装",variant:"destructive"});return}try{const ie=await DAe(R.id,R.manifest.repository_url||"","main");B({title:"更新成功",description:`${R.manifest.name} 已从 ${ie.old_version} 更新到 ${ie.new_version}`});const X=await v0();A(X),g(z=>z.map(U=>{if(U.id===R.id){const te=J1(U.id,X),ne=ev(U.id,X);return{...U,installed:te,installed_version:ne}}return U}))}catch(ie){B({title:"更新失败",description:ie instanceof Error?ie.message:"未知错误",variant:"destructive"})}};return o.jsx(pn,{className:"h-full",children:o.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件市场"}),o.jsx("p",{className:"text-muted-foreground mt-2",children:"浏览和管理麦麦的插件"})]}),o.jsxs(ue,{onClick:()=>t({to:"/plugin-mirrors"}),children:[o.jsx(ate,{className:"h-4 w-4 mr-2"}),"配置镜像源"]})]}),k&&!k.installed&&o.jsxs(Lt,{className:"border-orange-600 bg-orange-50 dark:bg-orange-950/20",children:[o.jsx(En,{children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Ga,{className:"h-5 w-5 text-orange-600"}),o.jsxs("div",{children:[o.jsx(_n,{className:"text-lg text-orange-900 dark:text-orange-100",children:"Git 未安装"}),o.jsx(Wr,{className:"text-orange-800 dark:text-orange-200",children:k.error||"请先安装 Git 才能使用插件安装功能"})]})]})}),o.jsx(Xn,{children:o.jsxs("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:["您可以从 ",o.jsx("a",{href:"https://git-scm.com/downloads",target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",children:"git-scm.com"})," 下载并安装 Git。 安装完成后,请重启麦麦应用。"]})})]}),o.jsx(Lt,{className:"p-4",children:o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(ii,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(Pe,{placeholder:"搜索插件...",value:r,onChange:R=>s(R.target.value),className:"pl-9"})]}),o.jsxs(Vt,{value:i,onValueChange:a,children:[o.jsx($t,{className:"w-full sm:w-[200px]",children:o.jsx(Ut,{placeholder:"选择分类"})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部分类"}),o.jsx(De,{value:"Group Management",children:"群组管理"}),o.jsx(De,{value:"Entertainment & Interaction",children:"娱乐互动"}),o.jsx(De,{value:"Utility Tools",children:"实用工具"}),o.jsx(De,{value:"Content Generation",children:"内容生成"}),o.jsx(De,{value:"Multimedia",children:"多媒体"}),o.jsx(De,{value:"External Integration",children:"外部集成"}),o.jsx(De,{value:"Data Analysis & Insights",children:"数据分析与洞察"}),o.jsx(De,{value:"Other",children:"其他"})]})]})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ci,{id:"compatible-only",checked:d,onCheckedChange:R=>h(R===!0)}),o.jsx("label",{htmlFor:"compatible-only",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:"只显示兼容当前版本的插件"})]})]})}),o.jsx(Yi,{value:l,onValueChange:c,className:"w-full",children:o.jsxs(ji,{className:"grid w-full grid-cols-3",children:[o.jsxs(Bt,{value:"all",children:["全部插件 (",m.filter(R=>{if(!R.manifest)return!1;const ie=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(U=>U.toLowerCase().includes(r.toLowerCase())),X=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i),z=!d||!E||ee(R);return ie&&X&&z}).length,")"]}),o.jsxs(Bt,{value:"installed",children:["已安装 (",m.filter(R=>{if(!R.manifest)return!1;const ie=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(U=>U.toLowerCase().includes(r.toLowerCase())),X=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i),z=!d||!E||ee(R);return R.installed&&ie&&X&&z}).length,")"]}),o.jsxs(Bt,{value:"updates",children:["可更新 (",m.filter(R=>{if(!R.manifest)return!1;const ie=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(U=>U.toLowerCase().includes(r.toLowerCase())),X=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i),z=!d||!E||ee(R);return R.installed&&I(R)&&ie&&X&&z}).length,")"]})]})}),N&&N.stage==="loading"&&o.jsx(Lt,{className:"p-4",children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Us,{className:"h-4 w-4 animate-spin"}),o.jsxs("span",{className:"text-sm font-medium",children:[N.operation==="fetch"&&"加载插件列表",N.operation==="install"&&`安装插件${N.plugin_id?`: ${N.plugin_id}`:""}`,N.operation==="uninstall"&&`卸载插件${N.plugin_id?`: ${N.plugin_id}`:""}`,N.operation==="update"&&`更新插件${N.plugin_id?`: ${N.plugin_id}`:""}`]})]}),o.jsxs("span",{className:"text-sm font-medium",children:[N.progress,"%"]})]}),o.jsx(Qp,{value:N.progress,className:"h-2"}),o.jsx("div",{className:"text-xs text-muted-foreground",children:N.message}),N.operation==="fetch"&&N.total_plugins>0&&o.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["已加载 ",N.loaded_plugins," / ",N.total_plugins," 个插件"]})]})}),N&&N.stage==="error"&&N.error&&o.jsx(Lt,{className:"border-destructive bg-destructive/10",children:o.jsx(En,{children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Ga,{className:"h-5 w-5 text-destructive"}),o.jsxs("div",{children:[o.jsx(_n,{className:"text-lg text-destructive",children:"加载失败"}),o.jsx(Wr,{className:"text-destructive/80",children:N.error})]})]})})}),x?o.jsxs("div",{className:"flex items-center justify-center py-12",children:[o.jsx(Us,{className:"h-8 w-8 animate-spin text-muted-foreground"}),o.jsx("span",{className:"ml-3 text-muted-foreground",children:"加载插件列表中..."})]}):w?o.jsx(Lt,{className:"p-6",children:o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[o.jsx(Ga,{className:"h-12 w-12 text-destructive mb-4"}),o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),o.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:w}),o.jsx(ue,{onClick:()=>window.location.reload(),children:"重新加载"})]})}):V.length===0?o.jsx(Lt,{className:"p-6",children:o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[o.jsx(ii,{className:"h-12 w-12 text-muted-foreground mb-4"}),o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"未找到插件"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:r||i!=="all"?"尝试调整搜索条件或筛选器":"暂无可用插件"})]})}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:V.map(R=>o.jsxs(Lt,{className:"flex flex-col hover:shadow-lg transition-shadow h-full",children:[o.jsxs(En,{children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsx(_n,{className:"text-xl",children:R.manifest?.name||R.id}),o.jsxs("div",{className:"flex flex-col gap-1",children:[R.manifest?.categories&&R.manifest.categories[0]&&o.jsx(tn,{variant:"secondary",className:"text-xs whitespace-nowrap",children:Lz[R.manifest.categories[0]]||R.manifest.categories[0]}),W(R)]})]}),o.jsx(Wr,{className:"line-clamp-2",children:R.manifest?.description||"无描述"})]}),o.jsx(Xn,{className:"flex-1",children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(td,{className:"h-4 w-4"}),o.jsx("span",{children:(D[R.id]?.downloads??R.downloads??0).toLocaleString()})]}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Dc,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),o.jsx("span",{children:(D[R.id]?.rating??R.rating??0).toFixed(1)})]})]}),o.jsxs("div",{className:"flex flex-wrap gap-2",children:[R.manifest?.keywords&&R.manifest.keywords.slice(0,3).map(ie=>o.jsx(tn,{variant:"outline",className:"text-xs",children:ie},ie)),R.manifest?.keywords&&R.manifest.keywords.length>3&&o.jsxs(tn,{variant:"outline",className:"text-xs",children:["+",R.manifest.keywords.length-3]})]}),o.jsxs("div",{className:"text-xs text-muted-foreground pt-2 border-t space-y-1",children:[o.jsxs("div",{children:["v",R.manifest?.version||"unknown"," · ",R.manifest?.author?.name||"Unknown"]}),R.manifest?.host_application&&o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{children:"支持:"}),o.jsxs("span",{className:"font-medium",children:[R.manifest.host_application.min_version,R.manifest.host_application.max_version?` - ${R.manifest.host_application.max_version}`:" - 最新版本"]})]})]})]})}),o.jsx(hL,{className:"pt-4",children:o.jsxs("div",{className:"flex items-center justify-end gap-2 w-full",children:[o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>n(R),children:"查看详情"}),R.installed?I(R)?o.jsxs(ue,{size:"sm",disabled:!k?.installed,title:k?.installed?void 0:"Git 未安装",onClick:()=>Y(R),children:[o.jsx(Qs,{className:"h-4 w-4 mr-1"}),"更新"]}):o.jsxs(ue,{variant:"destructive",size:"sm",disabled:!k?.installed,title:k?.installed?void 0:"Git 未安装",onClick:()=>K(R),children:[o.jsx(Cn,{className:"h-4 w-4 mr-1"}),"卸载"]}):o.jsxs(ue,{size:"sm",disabled:!k?.installed||N?.operation==="install"||E!==null&&!ee(R),title:k?.installed?E!==null&&!ee(R)?`不兼容当前版本 (需要 ${R.manifest?.host_application?.min_version||"未知"}${R.manifest?.host_application?.max_version?` - ${R.manifest.host_application.max_version}`:"+"},当前 ${E?.version})`:void 0:"Git 未安装",onClick:()=>$(R),children:[o.jsx(td,{className:"h-4 w-4 mr-1"}),N?.operation==="install"&&N?.plugin_id===R.id?"安装中...":"安装"]})]})})]},R.id))}),o.jsx(Er,{open:e!==null,onOpenChange:L,children:e&&e.manifest&&o.jsxs(wr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsx(Sr,{children:o.jsxs("div",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"space-y-2 flex-1",children:[o.jsx(kr,{className:"text-2xl",children:e.manifest.name}),o.jsxs(Xr,{children:["作者: ",e.manifest.author?.name||"Unknown",e.manifest.author?.url&&o.jsx("a",{href:e.manifest.author.url,target:"_blank",rel:"noopener noreferrer",className:"ml-2 text-primary hover:underline",children:o.jsx(w0,{className:"h-3 w-3 inline"})})]})]}),o.jsxs("div",{className:"flex flex-col gap-2",children:[e.manifest.categories&&e.manifest.categories[0]&&o.jsx(tn,{variant:"secondary",children:Lz[e.manifest.categories[0]]||e.manifest.categories[0]}),W(e)]})]})}),o.jsxs("div",{className:"space-y-6",children:[o.jsx(VAe,{pluginId:e.id}),o.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:"版本"}),o.jsxs("p",{className:"text-sm text-muted-foreground",children:["v",e.manifest?.version||"unknown"]}),e.installed&&e.installed_version&&o.jsxs("p",{className:"text-xs text-muted-foreground",children:["已安装: v",e.installed_version]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:"下载量"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:(D[e.id]?.downloads??e.downloads??0).toLocaleString()})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:"评分"}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Dc,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),o.jsxs("span",{className:"text-sm text-muted-foreground",children:[(D[e.id]?.rating??e.rating??0).toFixed(1)," (",D[e.id]?.rating_count??e.review_count??0,")"]})]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:"许可证"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e.manifest.license||"Unknown"})]}),o.jsxs("div",{className:"col-span-2",children:[o.jsx("p",{className:"text-sm font-medium",children:"支持版本"}),o.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.manifest.host_application?.min_version||"未知",e.manifest.host_application?.max_version?` - ${e.manifest.host_application.max_version}`:" - 最新版本"]})]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium mb-2",children:"关键词"}),o.jsx("div",{className:"flex flex-wrap gap-2",children:e.manifest.keywords&&e.manifest.keywords.map(R=>o.jsx(tn,{variant:"outline",children:R},R))})]}),e.detailed_description&&o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium mb-2",children:"详细说明"}),o.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:e.detailed_description})]}),!e.detailed_description&&o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium mb-2",children:"说明"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e.manifest.description||"无描述"})]}),o.jsxs("div",{className:"space-y-2",children:[e.manifest.homepage_url&&o.jsxs("div",{className:"text-sm",children:[o.jsx("span",{className:"font-medium",children:"主页: "}),o.jsx("a",{href:e.manifest.homepage_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:e.manifest.homepage_url})]}),e.manifest.repository_url&&o.jsxs("div",{className:"text-sm",children:[o.jsx("span",{className:"font-medium",children:"仓库: "}),o.jsx("a",{href:e.manifest.repository_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:e.manifest.repository_url})]})]})]}),o.jsxs(fs,{children:[e.manifest.homepage_url&&o.jsxs(ue,{onClick:()=>window.open(e.manifest.homepage_url,"_blank"),children:[o.jsx(w0,{className:"h-4 w-4 mr-2"}),"访问主页"]}),e.manifest.repository_url&&o.jsxs(ue,{variant:"outline",onClick:()=>window.open(e.manifest.repository_url,"_blank"),children:[o.jsx(w0,{className:"h-4 w-4 mr-2"}),"查看仓库"]})]})]})})]})})}var ow="Collapsible",[WAe]=Da(ow),[GAe,y7]=WAe(ow),gX=b.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:a,...l}=t,[c,d]=Kl({prop:r,defaultProp:s??!1,onChange:a,caller:ow});return o.jsx(GAe,{scope:n,disabled:i,contentId:Gi(),open:c,onOpenToggle:b.useCallback(()=>d(h=>!h),[d]),children:o.jsx(Sn.div,{"data-state":w7(c),"data-disabled":i?"":void 0,...l,ref:e})})});gX.displayName=ow;var xX="CollapsibleTrigger",vX=b.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,s=y7(xX,n);return o.jsx(Sn.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":w7(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:e,onClick:nt(t.onClick,s.onOpenToggle)})});vX.displayName=xX;var b7="CollapsibleContent",yX=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=y7(b7,t.__scopeCollapsible);return o.jsx(oi,{present:n||s.open,children:({present:i})=>o.jsx(XAe,{...r,ref:e,present:i})})});yX.displayName=b7;var XAe=b.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=t,a=y7(b7,n),[l,c]=b.useState(r),d=b.useRef(null),h=er(e,d),m=b.useRef(0),g=m.current,x=b.useRef(0),y=x.current,w=a.open||l,S=b.useRef(w),k=b.useRef(void 0);return b.useEffect(()=>{const j=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(j)},[]),Wh(()=>{const j=d.current;if(j){k.current=k.current||{transitionDuration:j.style.transitionDuration,animationName:j.style.animationName},j.style.transitionDuration="0s",j.style.animationName="none";const N=j.getBoundingClientRect();m.current=N.height,x.current=N.width,S.current||(j.style.transitionDuration=k.current.transitionDuration,j.style.animationName=k.current.animationName),c(r)}},[a.open,r]),o.jsx(Sn.div,{"data-state":w7(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!w,...i,ref:h,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...t.style},children:w&&s})});function w7(t){return t?"open":"closed"}var YAe=gX;const hj=YAe,fj=vX,mj=yX;function KAe({field:t,value:e,onChange:n}){const[r,s]=b.useState(!1);switch(t.ui_type){case"switch":return o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:t.label}),t.hint&&o.jsx("p",{className:"text-xs text-muted-foreground",children:t.hint})]}),o.jsx(Ft,{checked:!!e,onCheckedChange:n,disabled:t.disabled})]});case"number":return o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:t.label}),o.jsx(Pe,{type:"number",value:e??t.default,onChange:i=>n(parseFloat(i.target.value)||0),min:t.min,max:t.max,step:t.step??1,placeholder:t.placeholder,disabled:t.disabled}),t.hint&&o.jsx("p",{className:"text-xs text-muted-foreground",children:t.hint})]});case"slider":return o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{children:t.label}),o.jsx("span",{className:"text-sm text-muted-foreground",children:e??t.default})]}),o.jsx(Nf,{value:[e??t.default],onValueChange:i=>n(i[0]),min:t.min??0,max:t.max??100,step:t.step??1,disabled:t.disabled}),t.hint&&o.jsx("p",{className:"text-xs text-muted-foreground",children:t.hint})]});case"select":return o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:t.label}),o.jsxs(Vt,{value:String(e??t.default),onValueChange:n,disabled:t.disabled,children:[o.jsx($t,{children:o.jsx(Ut,{placeholder:t.placeholder??"请选择"})}),o.jsx(Ht,{children:t.choices?.map(i=>o.jsx(De,{value:String(i),children:String(i)},String(i)))})]}),t.hint&&o.jsx("p",{className:"text-xs text-muted-foreground",children:t.hint})]});case"textarea":return o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:t.label}),o.jsx(Nr,{value:e??t.default,onChange:i=>n(i.target.value),placeholder:t.placeholder,rows:t.rows??3,disabled:t.disabled}),t.hint&&o.jsx("p",{className:"text-xs text-muted-foreground",children:t.hint})]});case"password":return o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:t.label}),o.jsxs("div",{className:"relative",children:[o.jsx(Pe,{type:r?"text":"password",value:e??"",onChange:i=>n(i.target.value),placeholder:t.placeholder,disabled:t.disabled,className:"pr-10"}),o.jsx(ue,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3",onClick:()=>s(!r),children:r?o.jsx(I0,{className:"h-4 w-4"}):o.jsx(Ji,{className:"h-4 w-4"})})]}),t.hint&&o.jsx("p",{className:"text-xs text-muted-foreground",children:t.hint})]});case"text":default:return o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:t.label}),o.jsx(Pe,{type:"text",value:e??t.default??"",onChange:i=>n(i.target.value),placeholder:t.placeholder,maxLength:t.max_length,disabled:t.disabled}),t.hint&&o.jsx("p",{className:"text-xs text-muted-foreground",children:t.hint})]})}}function Bz({section:t,config:e,onChange:n}){const[r,s]=b.useState(!t.collapsed),i=Object.entries(t.fields).filter(([,a])=>!a.hidden).sort(([,a],[,l])=>a.order-l.order);return o.jsx(hj,{open:r,onOpenChange:s,children:o.jsxs(Lt,{children:[o.jsx(fj,{asChild:!0,children:o.jsxs(En,{className:"cursor-pointer hover:bg-muted/50 transition-colors",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[r?o.jsx(Xc,{className:"h-4 w-4 text-muted-foreground"}):o.jsx(Zl,{className:"h-4 w-4 text-muted-foreground"}),o.jsx(_n,{className:"text-lg",children:t.title})]}),o.jsxs(tn,{variant:"secondary",className:"text-xs",children:[i.length," 项"]})]}),t.description&&o.jsx(Wr,{className:"ml-6",children:t.description})]})}),o.jsx(mj,{children:o.jsx(Xn,{className:"space-y-4 pt-0",children:i.map(([a,l])=>o.jsx(KAe,{field:l,value:e[t.name]?.[a],onChange:c=>n(t.name,a,c),sectionName:t.name},a))})})]})})}function ZAe({plugin:t,onBack:e}){const{toast:n}=Lr(),[r,s]=b.useState(null),[i,a]=b.useState({}),[l,c]=b.useState({}),[d,h]=b.useState(!0),[m,g]=b.useState(!1),[x,y]=b.useState(!1),[w,S]=b.useState(!1),k=b.useCallback(async()=>{h(!0);try{const[D,q]=await Promise.all([PAe(t.id),zAe(t.id)]);s(D),a(q),c(JSON.parse(JSON.stringify(q)))}catch(D){n({title:"加载配置失败",description:D instanceof Error?D.message:"未知错误",variant:"destructive"})}finally{h(!1)}},[t.id,n]);b.useEffect(()=>{k()},[k]),b.useEffect(()=>{y(JSON.stringify(i)!==JSON.stringify(l))},[i,l]);const j=(D,q,B)=>{a(H=>({...H,[D]:{...H[D]||{},[q]:B}}))},N=async()=>{g(!0);try{await IAe(t.id,i),c(JSON.parse(JSON.stringify(i))),n({title:"配置已保存",description:"更改将在插件重新加载后生效"})}catch(D){n({title:"保存失败",description:D instanceof Error?D.message:"未知错误",variant:"destructive"})}finally{g(!1)}},T=async()=>{try{await LAe(t.id),n({title:"配置已重置",description:"下次加载插件时将使用默认配置"}),S(!1),k()}catch(D){n({title:"重置失败",description:D instanceof Error?D.message:"未知错误",variant:"destructive"})}},E=async()=>{try{const D=await BAe(t.id);n({title:D.message,description:D.note}),k()}catch(D){n({title:"切换状态失败",description:D instanceof Error?D.message:"未知错误",variant:"destructive"})}};if(d)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx(Us,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(!r)return o.jsxs("div",{className:"flex flex-col items-center justify-center h-64 space-y-4",children:[o.jsx(Lo,{className:"h-12 w-12 text-muted-foreground"}),o.jsx("p",{className:"text-muted-foreground",children:"无法加载配置"}),o.jsxs(ue,{onClick:e,variant:"outline",children:[o.jsx(Bv,{className:"h-4 w-4 mr-2"}),"返回"]})]});const _=Object.values(r.sections).sort((D,q)=>D.order-q.order),A=i.plugin?.enabled!==!1;return o.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(ue,{variant:"ghost",size:"icon",onClick:e,children:o.jsx(Bv,{className:"h-5 w-5"})}),o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:r.plugin_info.name||t.manifest.name}),o.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[o.jsx(tn,{variant:A?"default":"secondary",children:A?"已启用":"已禁用"}),o.jsxs("span",{className:"text-sm text-muted-foreground",children:["v",r.plugin_info.version||t.manifest.version]})]})]})]}),o.jsxs("div",{className:"flex gap-2 ml-10 sm:ml-0",children:[o.jsxs(ue,{variant:"outline",size:"sm",onClick:E,children:[o.jsx(Dp,{className:"h-4 w-4 mr-2"}),A?"禁用":"启用"]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>S(!0),children:[o.jsx(zj,{className:"h-4 w-4 mr-2"}),"重置"]}),o.jsxs(ue,{size:"sm",onClick:N,disabled:!x||m,children:[m?o.jsx(Us,{className:"h-4 w-4 mr-2 animate-spin"}):o.jsx(zp,{className:"h-4 w-4 mr-2"}),"保存"]})]})]}),x&&o.jsx(Lt,{className:"border-orange-200 bg-orange-50 dark:bg-orange-950/20 dark:border-orange-900",children:o.jsx(Xn,{className:"py-3",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Xi,{className:"h-4 w-4 text-orange-600"}),o.jsx("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:"有未保存的更改"})]})})}),r.layout.type==="tabs"&&r.layout.tabs.length>0?o.jsxs(Yi,{defaultValue:r.layout.tabs[0]?.id,children:[o.jsx(ji,{children:r.layout.tabs.map(D=>o.jsxs(Bt,{value:D.id,children:[D.title,D.badge&&o.jsx(tn,{variant:"secondary",className:"ml-2 text-xs",children:D.badge})]},D.id))}),r.layout.tabs.map(D=>o.jsx(ln,{value:D.id,className:"space-y-4 mt-4",children:D.sections.map(q=>{const B=r.sections[q];return B?o.jsx(Bz,{section:B,config:i,onChange:j},q):null})},D.id))]}):o.jsx("div",{className:"space-y-4",children:_.map(D=>o.jsx(Bz,{section:D,config:i,onChange:j},D.name))}),o.jsx(Er,{open:w,onOpenChange:S,children:o.jsxs(wr,{children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"确认重置配置"}),o.jsx(Xr,{children:"这将删除当前配置文件,下次加载插件时将使用默认配置。此操作不可撤销。"})]}),o.jsxs(fs,{children:[o.jsx(ue,{variant:"outline",onClick:()=>S(!1),children:"取消"}),o.jsx(ue,{variant:"destructive",onClick:T,children:"确认重置"})]})]})})]})}function JAe(){const{toast:t}=Lr(),[e,n]=b.useState([]),[r,s]=b.useState(!0),[i,a]=b.useState(""),[l,c]=b.useState(null),d=async()=>{s(!0);try{const x=await v0();n(x)}catch(x){t({title:"加载插件列表失败",description:x instanceof Error?x.message:"未知错误",variant:"destructive"})}finally{s(!1)}};b.useEffect(()=>{d()},[]);const h=e.filter(x=>{const y=i.toLowerCase();return x.id.toLowerCase().includes(y)||x.manifest.name.toLowerCase().includes(y)||x.manifest.description?.toLowerCase().includes(y)}),m=e.length,g=0;return l?o.jsx(pn,{className:"h-full",children:o.jsx("div",{className:"p-4 sm:p-6",children:o.jsx(ZAe,{plugin:l,onBack:()=>c(null)})})}):o.jsx(pn,{className:"h-full",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件配置"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理和配置已安装的插件"})]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:d,children:[o.jsx(Qs,{className:`h-4 w-4 mr-2 ${r?"animate-spin":""}`}),"刷新"]})]}),o.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-3",children:[o.jsxs(Lt,{children:[o.jsxs(En,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(_n,{className:"text-sm font-medium",children:"已安装插件"}),o.jsx(ed,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Xn,{children:[o.jsx("div",{className:"text-2xl font-bold",children:e.length}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:r?"正在加载...":"个插件"})]})]}),o.jsxs(Lt,{children:[o.jsxs(En,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(_n,{className:"text-sm font-medium",children:"已启用"}),o.jsx(Ya,{className:"h-4 w-4 text-green-600"})]}),o.jsxs(Xn,{children:[o.jsx("div",{className:"text-2xl font-bold",children:m}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"运行中的插件"})]})]}),o.jsxs(Lt,{children:[o.jsxs(En,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(_n,{className:"text-sm font-medium",children:"已禁用"}),o.jsx(Lo,{className:"h-4 w-4 text-orange-600"})]}),o.jsxs(Xn,{children:[o.jsx("div",{className:"text-2xl font-bold",children:g}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"未激活的插件"})]})]})]}),o.jsxs("div",{className:"relative",children:[o.jsx(ii,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(Pe,{placeholder:"搜索插件...",value:i,onChange:x=>a(x.target.value),className:"pl-9"})]}),o.jsxs(Lt,{children:[o.jsxs(En,{children:[o.jsx(_n,{children:"已安装的插件"}),o.jsx(Wr,{children:"点击插件查看和编辑配置"})]}),o.jsx(Xn,{children:r?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(Us,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):h.length===0?o.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[o.jsx(ed,{className:"h-16 w-16 text-muted-foreground/50"}),o.jsxs("div",{className:"text-center space-y-2",children:[o.jsx("p",{className:"text-lg font-medium text-muted-foreground",children:i?"没有找到匹配的插件":"暂无已安装的插件"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:i?"尝试其他搜索关键词":"前往插件市场安装插件"})]})]}):o.jsx("div",{className:"space-y-2",children:h.map(x=>o.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg border hover:bg-muted/50 cursor-pointer transition-colors",onClick:()=>c(x),children:[o.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[o.jsx("div",{className:"h-10 w-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:o.jsx(ed,{className:"h-5 w-5 text-primary"})}),o.jsxs("div",{className:"min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h3",{className:"font-medium truncate",children:x.manifest.name}),o.jsxs(tn,{variant:"secondary",className:"text-xs flex-shrink-0",children:["v",x.manifest.version]})]}),o.jsx("p",{className:"text-sm text-muted-foreground truncate",children:x.manifest.description||"暂无描述"})]})]}),o.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[o.jsx(ue,{variant:"ghost",size:"sm",children:o.jsx(Vc,{className:"h-4 w-4"})}),o.jsx(Zl,{className:"h-4 w-4 text-muted-foreground"})]})]},x.id))})})]})]})})}function eMe(){const t=na(),{toast:e}=Lr(),[n,r]=b.useState([]),[s,i]=b.useState(!0),[a,l]=b.useState(null),[c,d]=b.useState(null),[h,m]=b.useState(!1),[g,x]=b.useState(!1),[y,w]=b.useState({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),S=b.useCallback(async()=>{try{i(!0),l(null);const A=localStorage.getItem("access-token"),D=await fetch("/api/webui/plugins/mirrors",{headers:{Authorization:`Bearer ${A}`}});if(!D.ok)throw new Error("获取镜像源列表失败");const q=await D.json();r(q.mirrors||[])}catch(A){const D=A instanceof Error?A.message:"加载镜像源失败";l(D),e({title:"加载失败",description:D,variant:"destructive"})}finally{i(!1)}},[e]);b.useEffect(()=>{S()},[S]);const k=async()=>{try{const A=localStorage.getItem("access-token"),D=await fetch("/api/webui/plugins/mirrors",{method:"POST",headers:{Authorization:`Bearer ${A}`,"Content-Type":"application/json"},body:JSON.stringify(y)});if(!D.ok){const q=await D.json();throw new Error(q.detail||"添加镜像源失败")}e({title:"添加成功",description:"镜像源已添加"}),m(!1),w({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),S()}catch(A){e({title:"添加失败",description:A instanceof Error?A.message:"未知错误",variant:"destructive"})}},j=async()=>{if(c)try{const A=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${c.id}`,{method:"PUT",headers:{Authorization:`Bearer ${A}`,"Content-Type":"application/json"},body:JSON.stringify({name:y.name,raw_prefix:y.raw_prefix,clone_prefix:y.clone_prefix,enabled:y.enabled,priority:y.priority})})).ok)throw new Error("更新镜像源失败");e({title:"更新成功",description:"镜像源已更新"}),x(!1),d(null),S()}catch(A){e({title:"更新失败",description:A instanceof Error?A.message:"未知错误",variant:"destructive"})}},N=async A=>{if(confirm("确定要删除这个镜像源吗?"))try{const D=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${A}`,{method:"DELETE",headers:{Authorization:`Bearer ${D}`}})).ok)throw new Error("删除镜像源失败");e({title:"删除成功",description:"镜像源已删除"}),S()}catch(D){e({title:"删除失败",description:D instanceof Error?D.message:"未知错误",variant:"destructive"})}},T=async A=>{try{const D=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${A.id}`,{method:"PUT",headers:{Authorization:`Bearer ${D}`,"Content-Type":"application/json"},body:JSON.stringify({enabled:!A.enabled})})).ok)throw new Error("更新状态失败");S()}catch(D){e({title:"更新失败",description:D instanceof Error?D.message:"未知错误",variant:"destructive"})}},E=A=>{d(A),w({id:A.id,name:A.name,raw_prefix:A.raw_prefix,clone_prefix:A.clone_prefix,enabled:A.enabled,priority:A.priority}),x(!0)},_=async(A,D)=>{const q=D==="up"?A.priority-1:A.priority+1;if(!(q<1))try{const B=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${A.id}`,{method:"PUT",headers:{Authorization:`Bearer ${B}`,"Content-Type":"application/json"},body:JSON.stringify({priority:q})})).ok)throw new Error("更新优先级失败");S()}catch(B){e({title:"更新失败",description:B instanceof Error?B.message:"未知错误",variant:"destructive"})}};return o.jsx(pn,{className:"h-full",children:o.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(ue,{variant:"ghost",size:"icon",onClick:()=>t({to:"/plugins"}),children:o.jsx(Bv,{className:"h-5 w-5"})}),o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"镜像源配置"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理 Git 克隆和文件下载的镜像源"})]})]}),o.jsxs(ue,{onClick:()=>m(!0),children:[o.jsx(Is,{className:"h-4 w-4 mr-2"}),"添加镜像源"]})]}),s?o.jsx(Lt,{className:"p-6",children:o.jsx("div",{className:"flex items-center justify-center py-8",children:o.jsx(Us,{className:"h-8 w-8 animate-spin text-primary"})})}):a?o.jsx(Lt,{className:"p-6",children:o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[o.jsx(Ga,{className:"h-12 w-12 text-destructive mb-4"}),o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),o.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:a}),o.jsx(ue,{onClick:S,children:"重新加载"})]})}):o.jsxs(Lt,{children:[o.jsx("div",{className:"hidden md:block",children:o.jsxs(Af,{children:[o.jsx(Mf,{children:o.jsxs(zs,{children:[o.jsx(mn,{children:"状态"}),o.jsx(mn,{children:"名称"}),o.jsx(mn,{children:"ID"}),o.jsx(mn,{children:"优先级"}),o.jsx(mn,{className:"text-right",children:"操作"})]})}),o.jsx(Rf,{children:n.map(A=>o.jsxs(zs,{children:[o.jsx(Yt,{children:o.jsx(Ft,{checked:A.enabled,onCheckedChange:()=>T(A)})}),o.jsx(Yt,{children:o.jsxs("div",{children:[o.jsx("div",{className:"font-medium",children:A.name}),o.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Raw: ",A.raw_prefix]})]})}),o.jsx(Yt,{children:o.jsx(tn,{variant:"outline",children:A.id})}),o.jsx(Yt,{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"font-mono",children:A.priority}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(ue,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>_(A,"up"),disabled:A.priority===1,children:o.jsx(B0,{className:"h-3 w-3"})}),o.jsx(ue,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>_(A,"down"),children:o.jsx(Xc,{className:"h-3 w-3"})})]})]})}),o.jsx(Yt,{className:"text-right",children:o.jsxs("div",{className:"flex items-center justify-end gap-2",children:[o.jsx(ue,{variant:"ghost",size:"icon",onClick:()=>E(A),children:o.jsx(Ju,{className:"h-4 w-4"})}),o.jsx(ue,{variant:"ghost",size:"icon",onClick:()=>N(A.id),children:o.jsx(Cn,{className:"h-4 w-4 text-destructive"})})]})})]},A.id))})]})}),o.jsx("div",{className:"md:hidden p-4 space-y-4",children:n.map(A=>o.jsx(Lt,{className:"p-4",children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-start justify-between",children:[o.jsxs("div",{className:"flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h3",{className:"font-semibold",children:A.name}),A.enabled&&o.jsx(tn,{variant:"default",className:"text-xs",children:"启用"})]}),o.jsx(tn,{variant:"outline",className:"mt-1 text-xs",children:A.id})]}),o.jsx(Ft,{checked:A.enabled,onCheckedChange:()=>T(A)})]}),o.jsxs("div",{className:"text-sm space-y-1",children:[o.jsxs("div",{className:"text-muted-foreground",children:[o.jsx("span",{className:"font-medium",children:"Raw: "}),o.jsx("span",{className:"break-all",children:A.raw_prefix})]}),o.jsxs("div",{className:"text-muted-foreground",children:[o.jsx("span",{className:"font-medium",children:"优先级: "}),o.jsx("span",{className:"font-mono",children:A.priority})]})]}),o.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t",children:[o.jsxs(ue,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>E(A),children:[o.jsx(Ju,{className:"h-4 w-4 mr-1"}),"编辑"]}),o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>_(A,"up"),disabled:A.priority===1,children:o.jsx(B0,{className:"h-4 w-4"})}),o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>_(A,"down"),children:o.jsx(Xc,{className:"h-4 w-4"})}),o.jsx(ue,{variant:"destructive",size:"sm",onClick:()=>N(A.id),children:o.jsx(Cn,{className:"h-4 w-4"})})]})]})},A.id))})]}),o.jsx(Er,{open:h,onOpenChange:m,children:o.jsxs(wr,{className:"max-w-lg",children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"添加镜像源"}),o.jsx(Xr,{children:"添加新的 Git 镜像源配置"})]}),o.jsxs("div",{className:"space-y-4 py-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"add-id",children:"镜像源 ID *"}),o.jsx(Pe,{id:"add-id",placeholder:"例如: my-mirror",value:y.id,onChange:A=>w({...y,id:A.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"add-name",children:"名称 *"}),o.jsx(Pe,{id:"add-name",placeholder:"例如: 我的镜像源",value:y.name,onChange:A=>w({...y,name:A.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"add-raw",children:"Raw 文件前缀 *"}),o.jsx(Pe,{id:"add-raw",placeholder:"https://example.com/raw",value:y.raw_prefix,onChange:A=>w({...y,raw_prefix:A.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"add-clone",children:"克隆前缀 *"}),o.jsx(Pe,{id:"add-clone",placeholder:"https://example.com/clone",value:y.clone_prefix,onChange:A=>w({...y,clone_prefix:A.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"add-priority",children:"优先级"}),o.jsx(Pe,{id:"add-priority",type:"number",min:"1",value:y.priority,onChange:A=>w({...y,priority:parseInt(A.target.value)||1})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"add-enabled",checked:y.enabled,onCheckedChange:A=>w({...y,enabled:A})}),o.jsx(he,{htmlFor:"add-enabled",children:"启用此镜像源"})]})]}),o.jsxs(fs,{children:[o.jsx(ue,{variant:"outline",onClick:()=>m(!1),children:"取消"}),o.jsx(ue,{onClick:k,children:"添加"})]})]})}),o.jsx(Er,{open:g,onOpenChange:x,children:o.jsxs(wr,{className:"max-w-lg",children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"编辑镜像源"}),o.jsx(Xr,{children:"修改镜像源配置"})]}),o.jsxs("div",{className:"space-y-4 py-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:"镜像源 ID"}),o.jsx(Pe,{value:y.id,disabled:!0})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"edit-name",children:"名称 *"}),o.jsx(Pe,{id:"edit-name",value:y.name,onChange:A=>w({...y,name:A.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"edit-raw",children:"Raw 文件前缀 *"}),o.jsx(Pe,{id:"edit-raw",value:y.raw_prefix,onChange:A=>w({...y,raw_prefix:A.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"edit-clone",children:"克隆前缀 *"}),o.jsx(Pe,{id:"edit-clone",value:y.clone_prefix,onChange:A=>w({...y,clone_prefix:A.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"edit-priority",children:"优先级"}),o.jsx(Pe,{id:"edit-priority",type:"number",min:"1",value:y.priority,onChange:A=>w({...y,priority:parseInt(A.target.value)||1})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"edit-enabled",checked:y.enabled,onCheckedChange:A=>w({...y,enabled:A})}),o.jsx(he,{htmlFor:"edit-enabled",children:"启用此镜像源"})]})]}),o.jsxs(fs,{children:[o.jsx(ue,{variant:"outline",onClick:()=>x(!1),children:"取消"}),o.jsx(ue,{onClick:j,children:"保存"})]})]})})]})})}function tMe(t,e=[]){let n=[];function r(i,a){const l=b.createContext(a);l.displayName=i+"Context";const c=n.length;n=[...n,a];const d=m=>{const{scope:g,children:x,...y}=m,w=g?.[t]?.[c]||l,S=b.useMemo(()=>y,Object.values(y));return o.jsx(w.Provider,{value:S,children:x})};d.displayName=i+"Provider";function h(m,g){const x=g?.[t]?.[c]||l,y=b.useContext(x);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${m}\` must be used within \`${i}\``)}return[d,h]}const s=()=>{const i=n.map(a=>b.createContext(a));return function(l){const c=l?.[t]||i;return b.useMemo(()=>({[`__scope${t}`]:{...l,[t]:c}}),[l,c])}};return s.scopeName=t,[r,nMe(s,...e)]}function nMe(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=r.reduce((l,{useScope:c,scopeName:d})=>{const m=c(i)[`__scope${d}`];return{...l,...m}},{});return b.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var rMe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],S7=rMe.reduce((t,e)=>{const n=Vy(`Primitive.${e}`),r=b.forwardRef((s,i)=>{const{asChild:a,...l}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),sMe=bJ();function iMe(){return sMe.useSyncExternalStore(aMe,()=>!0,()=>!1)}function aMe(){return()=>{}}var k7="Avatar",[oMe]=tMe(k7),[lMe,bX]=oMe(k7),wX=b.forwardRef((t,e)=>{const{__scopeAvatar:n,...r}=t,[s,i]=b.useState("idle");return o.jsx(lMe,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:i,children:o.jsx(S7.span,{...r,ref:e})})});wX.displayName=k7;var SX="AvatarImage",kX=b.forwardRef((t,e)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...i}=t,a=bX(SX,n),l=cMe(r,i),c=Rs(d=>{s(d),a.onImageLoadingStatusChange(d)});return Wh(()=>{l!=="idle"&&c(l)},[l,c]),l==="loaded"?o.jsx(S7.img,{...i,ref:e,src:r}):null});kX.displayName=SX;var OX="AvatarFallback",jX=b.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:r,...s}=t,i=bX(OX,n),[a,l]=b.useState(r===void 0);return b.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>l(!0),r);return()=>window.clearTimeout(c)}},[r]),a&&i.imageLoadingStatus!=="loaded"?o.jsx(S7.span,{...s,ref:e}):null});jX.displayName=OX;function Fz(t,e){return t?e?(t.src!==e&&(t.src=e),t.complete&&t.naturalWidth>0?"loaded":"loading"):"error":"idle"}function cMe(t,{referrerPolicy:e,crossOrigin:n}){const r=iMe(),s=b.useRef(null),i=r?(s.current||(s.current=new window.Image),s.current):null,[a,l]=b.useState(()=>Fz(i,t));return Wh(()=>{l(Fz(i,t))},[i,t]),Wh(()=>{const c=m=>()=>{l(m)};if(!i)return;const d=c("loaded"),h=c("error");return i.addEventListener("load",d),i.addEventListener("error",h),e&&(i.referrerPolicy=e),typeof n=="string"&&(i.crossOrigin=n),()=>{i.removeEventListener("load",d),i.removeEventListener("error",h)}},[i,n,e]),a}var NX=wX,CX=kX,TX=jX;const Pv=b.forwardRef(({className:t,...e},n)=>o.jsx(NX,{ref:n,className:xe("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...e}));Pv.displayName=NX.displayName;const uMe=b.forwardRef(({className:t,...e},n)=>o.jsx(CX,{ref:n,className:xe("aspect-square h-full w-full",t),...e}));uMe.displayName=CX.displayName;const zv=b.forwardRef(({className:t,...e},n)=>o.jsx(TX,{ref:n,className:xe("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...e}));zv.displayName=TX.displayName;function dMe(){return"webui_"+Math.random().toString(36).substr(2,9)+"_"+Date.now().toString(36)}function hMe(){const t="maibot_webui_user_id";let e=localStorage.getItem(t);return e||(e=dMe(),localStorage.setItem(t,e)),e}function fMe(){return localStorage.getItem("maibot_webui_user_name")||"WebUI用户"}function mMe(t){localStorage.setItem("maibot_webui_user_name",t)}function pMe(){const[t,e]=b.useState([]),[n,r]=b.useState(""),[s,i]=b.useState(!1),[a,l]=b.useState(!1),[c,d]=b.useState(!1),[h,m]=b.useState(!0),[g,x]=b.useState(fMe()),[y,w]=b.useState(!1),[S,k]=b.useState(""),[j,N]=b.useState({}),T=b.useRef(hMe()),E=b.useRef(null),_=b.useRef(null),A=b.useRef(null),D=b.useRef(0),q=b.useRef(new Set),{toast:B}=Lr(),H=z=>(D.current+=1,`${z}-${Date.now()}-${D.current}-${Math.random().toString(36).substr(2,9)}`),W=b.useCallback(()=>{_.current?.scrollIntoView({behavior:"smooth"})},[]);b.useEffect(()=>{W()},[t,W]);const ee=b.useCallback(async()=>{m(!0);try{const z=`/api/chat/history?user_id=${T.current}&limit=50`;console.log("[Chat] 正在加载历史消息:",z);const U=await fetch(z);if(console.log("[Chat] 历史消息响应状态:",U.status,U.statusText),console.log("[Chat] 响应 Content-Type:",U.headers.get("content-type")),U.ok){const te=await U.text();console.log("[Chat] 响应内容前100字符:",te.substring(0,100));try{const ne=JSON.parse(te);if(console.log("[Chat] 解析后的数据:",ne),ne.messages&&ne.messages.length>0){const G=ne.messages.map(se=>({id:se.id,type:se.type,content:se.content,timestamp:se.timestamp,sender:{name:se.sender_name||(se.is_bot?"麦麦":"WebUI用户"),user_id:se.user_id,is_bot:se.is_bot}}));e(G),console.log("[Chat] 已加载历史消息数量:",G.length),G.forEach(se=>{if(se.type==="bot"){const re=`bot-${se.content}-${Math.floor(se.timestamp*1e3)}`;q.current.add(re)}})}else console.log("[Chat] 没有历史消息")}catch(ne){console.error("[Chat] JSON 解析失败:",ne),console.error("[Chat] 原始响应内容:",te)}}else{console.error("[Chat] 响应失败:",U.status);const te=await U.text();console.error("[Chat] 错误响应内容:",te.substring(0,200))}}catch(z){console.error("[Chat] 加载历史消息失败:",z)}finally{m(!1)}},[]),I=b.useCallback(()=>{if(E.current?.readyState===WebSocket.OPEN||E.current?.readyState===WebSocket.CONNECTING){console.log("WebSocket 已存在,跳过连接");return}l(!0);const U=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/chat/ws?user_id=${encodeURIComponent(T.current)}&user_name=${encodeURIComponent(g)}`;console.log("正在连接 WebSocket:",U);try{const te=new WebSocket(U);E.current=te,te.onopen=()=>{i(!0),l(!1),console.log("WebSocket 已连接")},te.onmessage=ne=>{try{const G=JSON.parse(ne.data);switch(G.type){case"session_info":N({session_id:G.session_id,user_id:G.user_id,user_name:G.user_name,bot_name:G.bot_name});break;case"system":e(se=>[...se,{id:H("sys"),type:"system",content:G.content||"",timestamp:G.timestamp||Date.now()/1e3}]);break;case"user_message":e(se=>[...se,{id:G.message_id||H("user"),type:"user",content:G.content||"",timestamp:G.timestamp||Date.now()/1e3,sender:G.sender}]);break;case"bot_message":{d(!1);const se=`bot-${G.content}-${Math.floor((G.timestamp||0)*1e3)}`;if(q.current.has(se)){console.log("跳过重复的机器人消息");break}if(q.current.add(se),q.current.size>100){const re=q.current.values().next().value;re&&q.current.delete(re)}e(re=>[...re,{id:H("bot"),type:"bot",content:G.content||"",timestamp:G.timestamp||Date.now()/1e3,sender:G.sender}]);break}case"typing":d(G.is_typing||!1);break;case"error":e(se=>[...se,{id:H("error"),type:"error",content:G.content||"发生错误",timestamp:G.timestamp||Date.now()/1e3}]),B({title:"错误",description:G.content,variant:"destructive"});break;case"pong":break;default:console.log("未知消息类型:",G.type)}}catch(G){console.error("解析消息失败:",G)}},te.onclose=()=>{i(!1),l(!1),E.current=null,console.log("WebSocket 已断开"),A.current&&clearTimeout(A.current),A.current=window.setTimeout(()=>{V.current||I()},5e3)},te.onerror=ne=>{console.error("WebSocket 错误:",ne),l(!1)}}catch(te){console.error("创建 WebSocket 失败:",te),l(!1)}},[B,g]),V=b.useRef(!1);b.useEffect(()=>{V.current=!1,ee();const z=setTimeout(()=>{V.current||I()},100),U=setInterval(()=>{E.current?.readyState===WebSocket.OPEN&&E.current.send(JSON.stringify({type:"ping"}))},3e4);return()=>{V.current=!0,clearTimeout(z),clearInterval(U),A.current&&(clearTimeout(A.current),A.current=null),E.current&&(E.current.close(),E.current=null)}},[I,ee]);const L=b.useCallback(()=>{!n.trim()||!E.current||E.current.readyState!==WebSocket.OPEN||(E.current.send(JSON.stringify({type:"message",content:n.trim(),user_name:g})),r(""))},[n,g]),$=z=>{z.key==="Enter"&&!z.shiftKey&&(z.preventDefault(),L())},K=()=>{k(g),w(!0)},Y=()=>{const z=S.trim()||"WebUI用户";x(z),mMe(z),w(!1),E.current?.readyState===WebSocket.OPEN&&E.current.send(JSON.stringify({type:"update_nickname",user_name:z}))},R=()=>{k(""),w(!1)},ie=z=>new Date(z*1e3).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}),X=()=>{E.current&&E.current.close(),I()};return o.jsxs("div",{className:"h-full flex flex-col",children:[o.jsx("div",{className:"shrink-0 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:o.jsxs("div",{className:"p-3 sm:p-4 max-w-4xl mx-auto",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0",children:[o.jsx(Pv,{className:"h-8 w-8 sm:h-10 sm:w-10 shrink-0",children:o.jsx(zv,{className:"bg-primary/10 text-primary",children:o.jsx(o0,{className:"h-4 w-4 sm:h-5 sm:w-5"})})}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("h1",{className:"text-base sm:text-lg font-semibold truncate",children:j.bot_name||"麦麦"}),o.jsx("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:s?o.jsxs(o.Fragment,{children:[o.jsx(ote,{className:"h-3 w-3 text-green-500"}),o.jsx("span",{className:"text-green-600 dark:text-green-400",children:"已连接"})]}):a?o.jsxs(o.Fragment,{children:[o.jsx(Us,{className:"h-3 w-3 animate-spin"}),o.jsx("span",{children:"连接中..."})]}):o.jsxs(o.Fragment,{children:[o.jsx(lte,{className:"h-3 w-3 text-red-500"}),o.jsx("span",{className:"text-red-600 dark:text-red-400",children:"未连接"})]})})]})]}),o.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[h&&o.jsx(Us,{className:"h-4 w-4 animate-spin text-muted-foreground"}),o.jsx(ue,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:X,disabled:a,title:"重新连接",children:o.jsx(Qs,{className:xe("h-4 w-4",a&&"animate-spin")})})]})]}),o.jsxs("div",{className:"hidden sm:flex items-center gap-2 mt-2 text-sm text-muted-foreground",children:[o.jsx(Lv,{className:"h-3 w-3"}),o.jsx("span",{children:"当前身份:"}),y?o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Pe,{value:S,onChange:z=>k(z.target.value),onKeyDown:z=>{z.key==="Enter"&&Y(),z.key==="Escape"&&R()},className:"h-7 w-32",placeholder:"输入昵称",autoFocus:!0}),o.jsx(ue,{size:"sm",variant:"ghost",className:"h-7 px-2",onClick:Y,children:"保存"}),o.jsx(ue,{size:"sm",variant:"ghost",className:"h-7 px-2",onClick:R,children:"取消"})]}):o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"font-medium text-foreground",children:g}),o.jsx(ue,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:K,title:"修改昵称",children:o.jsx(cte,{className:"h-3 w-3"})})]})]})]})}),o.jsx("div",{className:"flex-1 overflow-hidden",children:o.jsx(pn,{className:"h-full",children:o.jsxs("div",{className:"p-3 sm:p-4 max-w-4xl mx-auto space-y-3 sm:space-y-4",children:[t.length===0&&!h&&o.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[o.jsx(o0,{className:"h-12 w-12 mb-4 opacity-50"}),o.jsxs("p",{className:"text-sm",children:["开始与 ",j.bot_name||"麦麦"," 对话吧!"]})]}),t.map(z=>o.jsxs("div",{className:xe("flex gap-2 sm:gap-3",z.type==="user"&&"flex-row-reverse",z.type==="system"&&"justify-center",z.type==="error"&&"justify-center"),children:[z.type==="system"&&o.jsx("div",{className:"text-xs text-muted-foreground bg-muted/50 px-3 py-1 rounded-full max-w-[90%]",children:z.content}),z.type==="error"&&o.jsx("div",{className:"text-xs text-red-600 dark:text-red-400 bg-red-100 dark:bg-red-900/30 px-3 py-1 rounded-full max-w-[90%]",children:z.content}),(z.type==="user"||z.type==="bot")&&o.jsxs(o.Fragment,{children:[o.jsx(Pv,{className:"h-7 w-7 sm:h-8 sm:w-8 shrink-0",children:o.jsx(zv,{className:xe("text-xs",z.type==="bot"?"bg-primary/10 text-primary":"bg-secondary text-secondary-foreground"),children:z.type==="bot"?o.jsx(o0,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"}):o.jsx(Lv,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"})})}),o.jsxs("div",{className:xe("flex flex-col gap-1 max-w-[75%] sm:max-w-[70%]",z.type==="user"&&"items-end"),children:[o.jsxs("div",{className:"flex items-center gap-2 text-[10px] sm:text-xs text-muted-foreground",children:[o.jsx("span",{className:"hidden sm:inline",children:z.sender?.name||(z.type==="bot"?j.bot_name:g)}),o.jsx("span",{children:ie(z.timestamp)})]}),o.jsx("div",{className:xe("rounded-2xl px-3 py-2 text-sm whitespace-pre-wrap break-words",z.type==="bot"?"bg-muted rounded-tl-sm":"bg-primary text-primary-foreground rounded-tr-sm"),children:z.content})]})]})]},z.id)),c&&o.jsxs("div",{className:"flex gap-2 sm:gap-3",children:[o.jsx(Pv,{className:"h-7 w-7 sm:h-8 sm:w-8 shrink-0",children:o.jsx(zv,{className:"bg-primary/10 text-primary",children:o.jsx(o0,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"})})}),o.jsx("div",{className:"bg-muted rounded-2xl rounded-tl-sm px-4 py-3",children:o.jsxs("div",{className:"flex gap-1",children:[o.jsx("span",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),o.jsx("span",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),o.jsx("span",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})})]}),o.jsx("div",{ref:_})]})})}),o.jsx("div",{className:"shrink-0 border-t bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:o.jsx("div",{className:"p-3 sm:p-4 max-w-4xl mx-auto",children:o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Pe,{value:n,onChange:z=>r(z.target.value),onKeyDown:$,placeholder:s?"输入消息...":"等待连接...",disabled:!s,className:"flex-1 h-10 sm:h-10"}),o.jsx(ue,{onClick:L,disabled:!s||!n.trim(),size:"icon",className:"h-10 w-10 shrink-0",children:o.jsx(ute,{className:"h-4 w-4"})})]})})})]})}const gMe=kf("pointer-events-none inline-flex select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono font-medium opacity-100",{variants:{size:{sm:"h-5 text-[10px]",default:"h-6 text-xs",lg:"h-7 text-sm"}},defaultVariants:{size:"default"}}),EX=b.forwardRef(({className:t,size:e,abbrTitle:n,children:r,...s},i)=>o.jsx("kbd",{className:xe(gMe({size:e,className:t})),ref:i,...s,children:n?o.jsx("abbr",{title:n,children:r}):r}));EX.displayName="Kbd";const xMe=[{icon:L0,title:"首页",description:"查看仪表板概览",path:"/",category:"概览"},{icon:Po,title:"麦麦主程序配置",description:"配置麦麦的核心设置",path:"/config/bot",category:"配置"},{icon:CI,title:"麦麦模型提供商配置",description:"配置模型提供商",path:"/config/modelProvider",category:"配置"},{icon:TI,title:"麦麦模型配置",description:"配置模型参数",path:"/config/model",category:"配置"},{icon:Ij,title:"表情包管理",description:"管理麦麦的表情包",path:"/resource/emoji",category:"资源"},{icon:Gh,title:"表达方式管理",description:"管理麦麦的表达方式",path:"/resource/expression",category:"资源"},{icon:EI,title:"人物信息管理",description:"管理人物信息",path:"/resource/person",category:"资源"},{icon:dte,title:"统计信息",description:"查看使用统计",path:"/statistics",category:"监控"},{icon:ed,title:"插件市场",description:"浏览和安装插件",path:"/plugins",category:"扩展"},{icon:Fv,title:"日志查看器",description:"查看系统日志",path:"/logs",category:"监控"},{icon:Vc,title:"系统设置",description:"配置系统参数",path:"/settings",category:"系统"}];function vMe({open:t,onOpenChange:e}){const[n,r]=b.useState(""),[s,i]=b.useState(0),a=na(),l=xMe.filter(h=>h.title.toLowerCase().includes(n.toLowerCase())||h.description.toLowerCase().includes(n.toLowerCase())||h.category.toLowerCase().includes(n.toLowerCase()));b.useEffect(()=>{t&&(r(""),i(0))},[t]);const c=b.useCallback(h=>{a({to:h}),e(!1)},[a,e]),d=b.useCallback(h=>{h.key==="ArrowDown"?(h.preventDefault(),i(m=>(m+1)%l.length)):h.key==="ArrowUp"?(h.preventDefault(),i(m=>(m-1+l.length)%l.length)):h.key==="Enter"&&l[s]&&(h.preventDefault(),c(l[s].path))},[l,s,c]);return o.jsx(Er,{open:t,onOpenChange:e,children:o.jsxs(wr,{className:"max-w-2xl p-0 gap-0",children:[o.jsxs(Sr,{className:"px-4 pt-4 pb-0",children:[o.jsx(kr,{className:"sr-only",children:"搜索"}),o.jsxs("div",{className:"relative",children:[o.jsx(ii,{className:"absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground"}),o.jsx(Pe,{value:n,onChange:h=>{r(h.target.value),i(0)},onKeyDown:d,placeholder:"搜索页面...",className:"h-12 pl-11 text-base border-0 focus-visible:ring-0 shadow-none",autoFocus:!0})]})]}),o.jsx("div",{className:"border-t",children:o.jsx(pn,{className:"h-[400px]",children:l.length>0?o.jsx("div",{className:"p-2",children:l.map((h,m)=>{const g=h.icon;return o.jsxs("button",{onClick:()=>c(h.path),onMouseEnter:()=>i(m),className:xe("w-full flex items-center gap-3 px-3 py-2.5 rounded-md text-left transition-colors",m===s?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:[o.jsx(g,{className:"h-5 w-5 flex-shrink-0"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"font-medium text-sm",children:h.title}),o.jsx("div",{className:"text-xs text-muted-foreground truncate",children:h.description})]}),o.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1 bg-muted rounded",children:h.category})]},h.path)})}):o.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[o.jsx(ii,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:n?"未找到匹配的页面":"输入关键词开始搜索"})]})})}),o.jsx("div",{className:"border-t px-4 py-3 flex items-center justify-between text-xs text-muted-foreground",children:o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↑"}),o.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↓"}),"导航"]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Enter"}),"选择"]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Esc"}),"关闭"]})]})})]})})}function yMe(t){const e=bMe(t),n=b.forwardRef((r,s)=>{const{children:i,...a}=r,l=b.Children.toArray(i),c=l.find(SMe);if(c){const d=c.props.children,h=l.map(m=>m===c?b.Children.count(d)>1?b.Children.only(null):b.isValidElement(d)?d.props.children:null:m);return o.jsx(e,{...a,ref:s,children:b.isValidElement(d)?b.cloneElement(d,void 0,h):null})}return o.jsx(e,{...a,ref:s,children:i})});return n.displayName=`${t}.Slot`,n}function bMe(t){const e=b.forwardRef((n,r)=>{const{children:s,...i}=n;if(b.isValidElement(s)){const a=OMe(s),l=kMe(i,s.props);return s.type!==b.Fragment&&(l.ref=r?Gc(r,a):a),b.cloneElement(s,l)}return b.Children.count(s)>1?b.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var wMe=Symbol("radix.slottable");function SMe(t){return b.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===wMe}function kMe(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...l)=>{const c=i(...l);return s(...l),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function OMe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var pj=["Enter"," "],jMe=["ArrowDown","PageUp","Home"],_X=["ArrowUp","PageDown","End"],NMe=[...jMe,..._X],CMe={ltr:[...pj,"ArrowRight"],rtl:[...pj,"ArrowLeft"]},TMe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Tg="Menu",[_p,EMe,_Me]=Qy(Tg),[Cd,AX]=Da(Tg,[_Me,vf,sb]),Eg=vf(),MX=sb(),[RX,gu]=Cd(Tg),[AMe,_g]=Cd(Tg),DX=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:s,onOpenChange:i,modal:a=!0}=t,l=Eg(e),[c,d]=b.useState(null),h=b.useRef(!1),m=Rs(i),g=Rp(s);return b.useEffect(()=>{const x=()=>{h.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>h.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),o.jsx(Yy,{...l,children:o.jsx(RX,{scope:e,open:n,onOpenChange:m,content:c,onContentChange:d,children:o.jsx(AMe,{scope:e,onClose:b.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:h,dir:g,modal:a,children:r})})})};DX.displayName=Tg;var MMe="MenuAnchor",O7=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=Eg(n);return o.jsx(Ky,{...s,...r,ref:e})});O7.displayName=MMe;var j7="MenuPortal",[RMe,PX]=Cd(j7,{forceMount:void 0}),zX=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:s}=t,i=gu(j7,e);return o.jsx(RMe,{scope:e,forceMount:n,children:o.jsx(oi,{present:n||i.open,children:o.jsx(Xy,{asChild:!0,container:s,children:r})})})};zX.displayName=j7;var _a="MenuContent",[DMe,N7]=Cd(_a),IX=b.forwardRef((t,e)=>{const n=PX(_a,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=gu(_a,t.__scopeMenu),a=_g(_a,t.__scopeMenu);return o.jsx(_p.Provider,{scope:t.__scopeMenu,children:o.jsx(oi,{present:r||i.open,children:o.jsx(_p.Slot,{scope:t.__scopeMenu,children:a.modal?o.jsx(PMe,{...s,ref:e}):o.jsx(zMe,{...s,ref:e})})})})}),PMe=b.forwardRef((t,e)=>{const n=gu(_a,t.__scopeMenu),r=b.useRef(null),s=er(e,r);return b.useEffect(()=>{const i=r.current;if(i)return gI(i)},[]),o.jsx(C7,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:nt(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),zMe=b.forwardRef((t,e)=>{const n=gu(_a,t.__scopeMenu);return o.jsx(C7,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),IMe=yMe("MenuContent.ScrollLock"),C7=b.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:g,onDismiss:x,disableOutsideScroll:y,...w}=t,S=gu(_a,n),k=_g(_a,n),j=Eg(n),N=MX(n),T=EMe(n),[E,_]=b.useState(null),A=b.useRef(null),D=er(e,A,S.onContentChange),q=b.useRef(0),B=b.useRef(""),H=b.useRef(0),W=b.useRef(null),ee=b.useRef("right"),I=b.useRef(0),V=y?xI:b.Fragment,L=y?{as:IMe,allowPinchZoom:!0}:void 0,$=Y=>{const R=B.current+Y,ie=T().filter(G=>!G.disabled),X=document.activeElement,z=ie.find(G=>G.ref.current===X)?.textValue,U=ie.map(G=>G.textValue),te=XMe(U,R,z),ne=ie.find(G=>G.textValue===te)?.ref.current;(function G(se){B.current=se,window.clearTimeout(q.current),se!==""&&(q.current=window.setTimeout(()=>G(""),1e3))})(R),ne&&setTimeout(()=>ne.focus())};b.useEffect(()=>()=>window.clearTimeout(q.current),[]),vI();const K=b.useCallback(Y=>ee.current===W.current?.side&&KMe(Y,W.current?.area),[]);return o.jsx(DMe,{scope:n,searchRef:B,onItemEnter:b.useCallback(Y=>{K(Y)&&Y.preventDefault()},[K]),onItemLeave:b.useCallback(Y=>{K(Y)||(A.current?.focus(),_(null))},[K]),onTriggerLeave:b.useCallback(Y=>{K(Y)&&Y.preventDefault()},[K]),pointerGraceTimerRef:H,onPointerGraceIntentChange:b.useCallback(Y=>{W.current=Y},[]),children:o.jsx(V,{...L,children:o.jsx(yI,{asChild:!0,trapped:s,onMountAutoFocus:nt(i,Y=>{Y.preventDefault(),A.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:o.jsx(Rj,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:g,onDismiss:x,children:o.jsx(vL,{asChild:!0,...N,dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:_,onEntryFocus:nt(c,Y=>{k.isUsingKeyboardRef.current||Y.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(Dj,{role:"menu","aria-orientation":"vertical","data-state":eY(S.open),"data-radix-menu-content":"",dir:k.dir,...j,...w,ref:D,style:{outline:"none",...w.style},onKeyDown:nt(w.onKeyDown,Y=>{const ie=Y.target.closest("[data-radix-menu-content]")===Y.currentTarget,X=Y.ctrlKey||Y.altKey||Y.metaKey,z=Y.key.length===1;ie&&(Y.key==="Tab"&&Y.preventDefault(),!X&&z&&$(Y.key));const U=A.current;if(Y.target!==U||!NMe.includes(Y.key))return;Y.preventDefault();const ne=T().filter(G=>!G.disabled).map(G=>G.ref.current);_X.includes(Y.key)&&ne.reverse(),WMe(ne)}),onBlur:nt(t.onBlur,Y=>{Y.currentTarget.contains(Y.target)||(window.clearTimeout(q.current),B.current="")}),onPointerMove:nt(t.onPointerMove,Ap(Y=>{const R=Y.target,ie=I.current!==Y.clientX;if(Y.currentTarget.contains(R)&&ie){const X=Y.clientX>I.current?"right":"left";ee.current=X,I.current=Y.clientX}}))})})})})})})});IX.displayName=_a;var LMe="MenuGroup",T7=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return o.jsx(Sn.div,{role:"group",...r,ref:e})});T7.displayName=LMe;var BMe="MenuLabel",LX=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return o.jsx(Sn.div,{...r,ref:e})});LX.displayName=BMe;var Fy="MenuItem",qz="menu.itemSelect",lw=b.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...s}=t,i=b.useRef(null),a=_g(Fy,t.__scopeMenu),l=N7(Fy,t.__scopeMenu),c=er(e,i),d=b.useRef(!1),h=()=>{const m=i.current;if(!n&&m){const g=new CustomEvent(qz,{bubbles:!0,cancelable:!0});m.addEventListener(qz,x=>r?.(x),{once:!0}),wI(m,g),g.defaultPrevented?d.current=!1:a.onClose()}};return o.jsx(BX,{...s,ref:c,disabled:n,onClick:nt(t.onClick,h),onPointerDown:m=>{t.onPointerDown?.(m),d.current=!0},onPointerUp:nt(t.onPointerUp,m=>{d.current||m.currentTarget?.click()}),onKeyDown:nt(t.onKeyDown,m=>{const g=l.searchRef.current!=="";n||g&&m.key===" "||pj.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});lw.displayName=Fy;var BX=b.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=t,a=N7(Fy,n),l=MX(n),c=b.useRef(null),d=er(e,c),[h,m]=b.useState(!1),[g,x]=b.useState("");return b.useEffect(()=>{const y=c.current;y&&x((y.textContent??"").trim())},[i.children]),o.jsx(_p.ItemSlot,{scope:n,disabled:r,textValue:s??g,children:o.jsx(yL,{asChild:!0,...l,focusable:!r,children:o.jsx(Sn.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:d,onPointerMove:nt(t.onPointerMove,Ap(y=>{r?a.onItemLeave(y):(a.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:nt(t.onPointerLeave,Ap(y=>a.onItemLeave(y))),onFocus:nt(t.onFocus,()=>m(!0)),onBlur:nt(t.onBlur,()=>m(!1))})})})}),FMe="MenuCheckboxItem",FX=b.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...s}=t;return o.jsx(VX,{scope:t.__scopeMenu,checked:n,children:o.jsx(lw,{role:"menuitemcheckbox","aria-checked":qy(n)?"mixed":n,...s,ref:e,"data-state":A7(n),onSelect:nt(s.onSelect,()=>r?.(qy(n)?!0:!n),{checkForDefaultPrevented:!1})})})});FX.displayName=FMe;var qX="MenuRadioGroup",[qMe,$Me]=Cd(qX,{value:void 0,onValueChange:()=>{}}),$X=b.forwardRef((t,e)=>{const{value:n,onValueChange:r,...s}=t,i=Rs(r);return o.jsx(qMe,{scope:t.__scopeMenu,value:n,onValueChange:i,children:o.jsx(T7,{...s,ref:e})})});$X.displayName=qX;var HX="MenuRadioItem",QX=b.forwardRef((t,e)=>{const{value:n,...r}=t,s=$Me(HX,t.__scopeMenu),i=n===s.value;return o.jsx(VX,{scope:t.__scopeMenu,checked:i,children:o.jsx(lw,{role:"menuitemradio","aria-checked":i,...r,ref:e,"data-state":A7(i),onSelect:nt(r.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});QX.displayName=HX;var E7="MenuItemIndicator",[VX,HMe]=Cd(E7,{checked:!1}),UX=b.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...s}=t,i=HMe(E7,n);return o.jsx(oi,{present:r||qy(i.checked)||i.checked===!0,children:o.jsx(Sn.span,{...s,ref:e,"data-state":A7(i.checked)})})});UX.displayName=E7;var QMe="MenuSeparator",WX=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return o.jsx(Sn.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});WX.displayName=QMe;var VMe="MenuArrow",GX=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=Eg(n);return o.jsx(Pj,{...s,...r,ref:e})});GX.displayName=VMe;var _7="MenuSub",[UMe,XX]=Cd(_7),YX=t=>{const{__scopeMenu:e,children:n,open:r=!1,onOpenChange:s}=t,i=gu(_7,e),a=Eg(e),[l,c]=b.useState(null),[d,h]=b.useState(null),m=Rs(s);return b.useEffect(()=>(i.open===!1&&m(!1),()=>m(!1)),[i.open,m]),o.jsx(Yy,{...a,children:o.jsx(RX,{scope:e,open:r,onOpenChange:m,content:d,onContentChange:h,children:o.jsx(UMe,{scope:e,contentId:Gi(),triggerId:Gi(),trigger:l,onTriggerChange:c,children:n})})})};YX.displayName=_7;var y0="MenuSubTrigger",KX=b.forwardRef((t,e)=>{const n=gu(y0,t.__scopeMenu),r=_g(y0,t.__scopeMenu),s=XX(y0,t.__scopeMenu),i=N7(y0,t.__scopeMenu),a=b.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=i,d={__scopeMenu:t.__scopeMenu},h=b.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return b.useEffect(()=>h,[h]),b.useEffect(()=>{const m=l.current;return()=>{window.clearTimeout(m),c(null)}},[l,c]),o.jsx(O7,{asChild:!0,...d,children:o.jsx(BX,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":eY(n.open),...t,ref:Gc(e,s.onTriggerChange),onClick:m=>{t.onClick?.(m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:nt(t.onPointerMove,Ap(m=>{i.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:nt(t.onPointerLeave,Ap(m=>{h();const g=n.content?.getBoundingClientRect();if(g){const x=n.content?.dataset.side,y=x==="right",w=y?-5:5,S=g[y?"left":"right"],k=g[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:m.clientX+w,y:m.clientY},{x:S,y:g.top},{x:k,y:g.top},{x:k,y:g.bottom},{x:S,y:g.bottom}],side:x}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(m),m.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:nt(t.onKeyDown,m=>{const g=i.searchRef.current!=="";t.disabled||g&&m.key===" "||CMe[r.dir].includes(m.key)&&(n.onOpenChange(!0),n.content?.focus(),m.preventDefault())})})})});KX.displayName=y0;var ZX="MenuSubContent",JX=b.forwardRef((t,e)=>{const n=PX(_a,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=gu(_a,t.__scopeMenu),a=_g(_a,t.__scopeMenu),l=XX(ZX,t.__scopeMenu),c=b.useRef(null),d=er(e,c);return o.jsx(_p.Provider,{scope:t.__scopeMenu,children:o.jsx(oi,{present:r||i.open,children:o.jsx(_p.Slot,{scope:t.__scopeMenu,children:o.jsx(C7,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:d,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{a.isUsingKeyboardRef.current&&c.current?.focus(),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:nt(t.onFocusOutside,h=>{h.target!==l.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:nt(t.onEscapeKeyDown,h=>{a.onClose(),h.preventDefault()}),onKeyDown:nt(t.onKeyDown,h=>{const m=h.currentTarget.contains(h.target),g=TMe[a.dir].includes(h.key);m&&g&&(i.onOpenChange(!1),l.trigger?.focus(),h.preventDefault())})})})})})});JX.displayName=ZX;function eY(t){return t?"open":"closed"}function qy(t){return t==="indeterminate"}function A7(t){return qy(t)?"indeterminate":t?"checked":"unchecked"}function WMe(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function GMe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function XMe(t,e,n){const s=e.length>1&&Array.from(e).every(d=>d===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let a=GMe(t,Math.max(i,0));s.length===1&&(a=a.filter(d=>d!==n));const c=a.find(d=>d.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function YMe(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;ir!=g>r&&n<(m-d)*(r-h)/(g-h)+d&&(s=!s)}return s}function KMe(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return YMe(n,e)}function Ap(t){return e=>e.pointerType==="mouse"?t(e):void 0}var ZMe=DX,JMe=O7,eRe=zX,tRe=IX,nRe=T7,rRe=LX,sRe=lw,iRe=FX,aRe=$X,oRe=QX,lRe=UX,cRe=WX,uRe=GX,dRe=YX,hRe=KX,fRe=JX,M7="ContextMenu",[mRe]=Da(M7,[AX]),Xs=AX(),[pRe,tY]=mRe(M7),nY=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:s,modal:i=!0}=t,[a,l]=b.useState(!1),c=Xs(e),d=Rs(r),h=b.useCallback(m=>{l(m),d(m)},[d]);return o.jsx(pRe,{scope:e,open:a,onOpenChange:h,modal:i,children:o.jsx(ZMe,{...c,dir:s,open:a,onOpenChange:h,modal:i,children:n})})};nY.displayName=M7;var rY="ContextMenuTrigger",sY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=t,i=tY(rY,n),a=Xs(n),l=b.useRef({x:0,y:0}),c=b.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...l.current})}),d=b.useRef(0),h=b.useCallback(()=>window.clearTimeout(d.current),[]),m=g=>{l.current={x:g.clientX,y:g.clientY},i.onOpenChange(!0)};return b.useEffect(()=>h,[h]),b.useEffect(()=>void(r&&h()),[r,h]),o.jsxs(o.Fragment,{children:[o.jsx(JMe,{...a,virtualRef:c}),o.jsx(Sn.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:nt(t.onContextMenu,g=>{h(),m(g),g.preventDefault()}),onPointerDown:r?t.onPointerDown:nt(t.onPointerDown,tv(g=>{h(),d.current=window.setTimeout(()=>m(g),700)})),onPointerMove:r?t.onPointerMove:nt(t.onPointerMove,tv(h)),onPointerCancel:r?t.onPointerCancel:nt(t.onPointerCancel,tv(h)),onPointerUp:r?t.onPointerUp:nt(t.onPointerUp,tv(h))})]})});sY.displayName=rY;var gRe="ContextMenuPortal",iY=t=>{const{__scopeContextMenu:e,...n}=t,r=Xs(e);return o.jsx(eRe,{...r,...n})};iY.displayName=gRe;var aY="ContextMenuContent",oY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=tY(aY,n),i=Xs(n),a=b.useRef(!1);return o.jsx(tRe,{...i,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:l=>{t.onCloseAutoFocus?.(l),!l.defaultPrevented&&a.current&&l.preventDefault(),a.current=!1},onInteractOutside:l=>{t.onInteractOutside?.(l),!l.defaultPrevented&&!s.modal&&(a.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});oY.displayName=aY;var xRe="ContextMenuGroup",vRe=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Xs(n);return o.jsx(nRe,{...s,...r,ref:e})});vRe.displayName=xRe;var yRe="ContextMenuLabel",lY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Xs(n);return o.jsx(rRe,{...s,...r,ref:e})});lY.displayName=yRe;var bRe="ContextMenuItem",cY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Xs(n);return o.jsx(sRe,{...s,...r,ref:e})});cY.displayName=bRe;var wRe="ContextMenuCheckboxItem",uY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Xs(n);return o.jsx(iRe,{...s,...r,ref:e})});uY.displayName=wRe;var SRe="ContextMenuRadioGroup",kRe=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Xs(n);return o.jsx(aRe,{...s,...r,ref:e})});kRe.displayName=SRe;var ORe="ContextMenuRadioItem",dY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Xs(n);return o.jsx(oRe,{...s,...r,ref:e})});dY.displayName=ORe;var jRe="ContextMenuItemIndicator",hY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Xs(n);return o.jsx(lRe,{...s,...r,ref:e})});hY.displayName=jRe;var NRe="ContextMenuSeparator",fY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Xs(n);return o.jsx(cRe,{...s,...r,ref:e})});fY.displayName=NRe;var CRe="ContextMenuArrow",TRe=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Xs(n);return o.jsx(uRe,{...s,...r,ref:e})});TRe.displayName=CRe;var mY="ContextMenuSub",pY=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:s,defaultOpen:i}=t,a=Xs(e),[l,c]=Kl({prop:s,defaultProp:i??!1,onChange:r,caller:mY});return o.jsx(dRe,{...a,open:l,onOpenChange:c,children:n})};pY.displayName=mY;var ERe="ContextMenuSubTrigger",gY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Xs(n);return o.jsx(hRe,{...s,...r,ref:e})});gY.displayName=ERe;var _Re="ContextMenuSubContent",xY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Xs(n);return o.jsx(fRe,{...s,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xY.displayName=_Re;function tv(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var ARe=nY,MRe=sY,RRe=iY,vY=oY,yY=lY,bY=cY,wY=uY,SY=dY,kY=hY,OY=fY,DRe=pY,jY=gY,NY=xY;const PRe=ARe,zRe=MRe,IRe=DRe,CY=b.forwardRef(({className:t,inset:e,children:n,...r},s)=>o.jsxs(jY,{ref:s,className:xe("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e&&"pl-8",t),...r,children:[n,o.jsx(Zl,{className:"ml-auto h-4 w-4"})]}));CY.displayName=jY.displayName;const TY=b.forwardRef(({className:t,...e},n)=>o.jsx(NY,{ref:n,className:xe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",t),...e}));TY.displayName=NY.displayName;const EY=b.forwardRef(({className:t,...e},n)=>o.jsx(RRe,{children:o.jsx(vY,{ref:n,className:xe("z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",t),...e})}));EY.displayName=vY.displayName;const $a=b.forwardRef(({className:t,inset:e,...n},r)=>o.jsx(bY,{ref:r,className:xe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...n}));$a.displayName=bY.displayName;const LRe=b.forwardRef(({className:t,children:e,checked:n,...r},s)=>o.jsxs(wY,{ref:s,className:xe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(kY,{children:o.jsx(zo,{className:"h-4 w-4"})})}),e]}));LRe.displayName=wY.displayName;const BRe=b.forwardRef(({className:t,children:e,...n},r)=>o.jsxs(SY,{ref:r,className:xe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(kY,{children:o.jsx(hte,{className:"h-2 w-2 fill-current"})})}),e]}));BRe.displayName=SY.displayName;const FRe=b.forwardRef(({className:t,inset:e,...n},r)=>o.jsx(yY,{ref:r,className:xe("px-2 py-1.5 text-sm font-semibold text-foreground",e&&"pl-8",t),...n}));FRe.displayName=yY.displayName;const b0=b.forwardRef(({className:t,...e},n)=>o.jsx(OY,{ref:n,className:xe("-mx-1 my-1 h-px bg-border",t),...e}));b0.displayName=OY.displayName;const Ch=({className:t,...e})=>o.jsx("span",{className:xe("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});Ch.displayName="ContextMenuShortcut";var qRe=Symbol("radix.slottable");function $Re(t){const e=({children:n})=>o.jsx(o.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=qRe,e}var[cw]=Da("Tooltip",[vf]),uw=vf(),_Y="TooltipProvider",HRe=700,gj="tooltip.open",[QRe,R7]=cw(_Y),AY=t=>{const{__scopeTooltip:e,delayDuration:n=HRe,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,a=b.useRef(!0),l=b.useRef(!1),c=b.useRef(0);return b.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),o.jsx(QRe,{scope:e,isOpenDelayedRef:a,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:b.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:i})};AY.displayName=_Y;var Mp="Tooltip",[VRe,Ag]=cw(Mp),MY=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:a,delayDuration:l}=t,c=R7(Mp,t.__scopeTooltip),d=uw(e),[h,m]=b.useState(null),g=Gi(),x=b.useRef(0),y=a??c.disableHoverableContent,w=l??c.delayDuration,S=b.useRef(!1),[k,j]=Kl({prop:r,defaultProp:s??!1,onChange:A=>{A?(c.onOpen(),document.dispatchEvent(new CustomEvent(gj))):c.onClose(),i?.(A)},caller:Mp}),N=b.useMemo(()=>k?S.current?"delayed-open":"instant-open":"closed",[k]),T=b.useCallback(()=>{window.clearTimeout(x.current),x.current=0,S.current=!1,j(!0)},[j]),E=b.useCallback(()=>{window.clearTimeout(x.current),x.current=0,j(!1)},[j]),_=b.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{S.current=!0,j(!0),x.current=0},w)},[w,j]);return b.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),o.jsx(Yy,{...d,children:o.jsx(VRe,{scope:e,contentId:g,open:k,stateAttribute:N,trigger:h,onTriggerChange:m,onTriggerEnter:b.useCallback(()=>{c.isOpenDelayedRef.current?_():T()},[c.isOpenDelayedRef,_,T]),onTriggerLeave:b.useCallback(()=>{y?E():(window.clearTimeout(x.current),x.current=0)},[E,y]),onOpen:T,onClose:E,disableHoverableContent:y,children:n})})};MY.displayName=Mp;var xj="TooltipTrigger",RY=b.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=Ag(xj,n),i=R7(xj,n),a=uw(n),l=b.useRef(null),c=er(e,l,s.onTriggerChange),d=b.useRef(!1),h=b.useRef(!1),m=b.useCallback(()=>d.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),o.jsx(Ky,{asChild:!0,...a,children:o.jsx(Sn.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:nt(t.onPointerMove,g=>{g.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),h.current=!0)}),onPointerLeave:nt(t.onPointerLeave,()=>{s.onTriggerLeave(),h.current=!1}),onPointerDown:nt(t.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:nt(t.onFocus,()=>{d.current||s.onOpen()}),onBlur:nt(t.onBlur,s.onClose),onClick:nt(t.onClick,s.onClose)})})});RY.displayName=xj;var D7="TooltipPortal",[URe,WRe]=cw(D7,{forceMount:void 0}),DY=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=Ag(D7,e);return o.jsx(URe,{scope:e,forceMount:n,children:o.jsx(oi,{present:n||i.open,children:o.jsx(Xy,{asChild:!0,container:s,children:r})})})};DY.displayName=D7;var xf="TooltipContent",PY=b.forwardRef((t,e)=>{const n=WRe(xf,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,a=Ag(xf,t.__scopeTooltip);return o.jsx(oi,{present:r||a.open,children:a.disableHoverableContent?o.jsx(zY,{side:s,...i,ref:e}):o.jsx(GRe,{side:s,...i,ref:e})})}),GRe=b.forwardRef((t,e)=>{const n=Ag(xf,t.__scopeTooltip),r=R7(xf,t.__scopeTooltip),s=b.useRef(null),i=er(e,s),[a,l]=b.useState(null),{trigger:c,onClose:d}=n,h=s.current,{onPointerInTransitChange:m}=r,g=b.useCallback(()=>{l(null),m(!1)},[m]),x=b.useCallback((y,w)=>{const S=y.currentTarget,k={x:y.clientX,y:y.clientY},j=JRe(k,S.getBoundingClientRect()),N=eDe(k,j),T=tDe(w.getBoundingClientRect()),E=rDe([...N,...T]);l(E),m(!0)},[m]);return b.useEffect(()=>()=>g(),[g]),b.useEffect(()=>{if(c&&h){const y=S=>x(S,h),w=S=>x(S,c);return c.addEventListener("pointerleave",y),h.addEventListener("pointerleave",w),()=>{c.removeEventListener("pointerleave",y),h.removeEventListener("pointerleave",w)}}},[c,h,x,g]),b.useEffect(()=>{if(a){const y=w=>{const S=w.target,k={x:w.clientX,y:w.clientY},j=c?.contains(S)||h?.contains(S),N=!nDe(k,a);j?g():N&&(g(),d())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,h,a,d,g]),o.jsx(zY,{...t,ref:i})}),[XRe,YRe]=cw(Mp,{isInside:!1}),KRe=$Re("TooltipContent"),zY=b.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:a,...l}=t,c=Ag(xf,n),d=uw(n),{onClose:h}=c;return b.useEffect(()=>(document.addEventListener(gj,h),()=>document.removeEventListener(gj,h)),[h]),b.useEffect(()=>{if(c.trigger){const m=g=>{g.target?.contains(c.trigger)&&h()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[c.trigger,h]),o.jsx(Rj,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:m=>m.preventDefault(),onDismiss:h,children:o.jsxs(Dj,{"data-state":c.stateAttribute,...d,...l,ref:e,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(KRe,{children:r}),o.jsx(XRe,{scope:n,isInside:!0,children:o.jsx(Iee,{id:c.contentId,role:"tooltip",children:s||r})})]})})});PY.displayName=xf;var IY="TooltipArrow",ZRe=b.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=uw(n);return YRe(IY,n).isInside?null:o.jsx(Pj,{...s,...r,ref:e})});ZRe.displayName=IY;function JRe(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function eDe(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function tDe(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}function nDe(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;ir!=g>r&&n<(m-d)*(r-h)/(g-h)+d&&(s=!s)}return s}function rDe(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),sDe(e)}function sDe(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const i=e[e.length-1],a=e[e.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var iDe=AY,aDe=MY,oDe=RY,lDe=DY,LY=PY;const cDe=iDe,uDe=aDe,dDe=oDe,BY=b.forwardRef(({className:t,sideOffset:e=4,...n},r)=>o.jsx(lDe,{children:o.jsx(LY,{ref:r,sideOffset:e,className:xe("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",t),...n})}));BY.displayName=LY.displayName;function hDe({children:t}){mie();const[e,n]=b.useState(!0),[r,s]=b.useState(!1),[i,a]=b.useState(!1),{theme:l,setTheme:c}=Kj(),d=wJ(),h=na();b.useEffect(()=>{const w=S=>{(S.metaKey||S.ctrlKey)&&S.key==="k"&&(S.preventDefault(),a(!0))};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[]);const m=[{title:"概览",items:[{icon:L0,label:"首页",path:"/"}]},{title:"麦麦配置编辑",items:[{icon:Po,label:"麦麦主程序配置",path:"/config/bot"},{icon:CI,label:"AI模型厂商配置",path:"/config/modelProvider",tourId:"sidebar-model-provider"},{icon:TI,label:"模型管理与分配",path:"/config/model",tourId:"sidebar-model-management"},{icon:E9,label:"麦麦适配器配置",path:"/config/adapter"}]},{title:"麦麦资源管理",items:[{icon:Ij,label:"表情包管理",path:"/resource/emoji"},{icon:Gh,label:"表达方式管理",path:"/resource/expression"},{icon:EI,label:"人物信息管理",path:"/resource/person"},{icon:NI,label:"知识库图谱可视化",path:"/resource/knowledge-graph"}]},{title:"扩展与监控",items:[{icon:ed,label:"插件市场",path:"/plugins"},{icon:E9,label:"插件配置",path:"/plugin-config"},{icon:Fv,label:"日志查看器",path:"/logs"},{icon:Gh,label:"本地聊天室",path:"/chat"}]},{title:"系统",items:[{icon:Vc,label:"系统设置",path:"/settings"}]}],x=l==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":l,y=()=>{localStorage.removeItem("access-token"),h({to:"/auth"})};return o.jsx(cDe,{delayDuration:300,children:o.jsxs("div",{className:"flex h-screen overflow-hidden",children:[o.jsxs("aside",{className:xe("fixed inset-y-0 left-0 z-50 flex flex-col border-r bg-card transition-all duration-300 lg:relative lg:z-0","w-64 lg:w-auto",e?"lg:w-64":"lg:w-16",r?"translate-x-0":"-translate-x-full lg:translate-x-0"),children:[o.jsx("div",{className:"flex h-16 items-center border-b px-4",children:o.jsxs("div",{className:xe("relative flex items-center justify-center flex-1 transition-all overflow-hidden","lg:flex-1",!e&&"lg:flex-none lg:w-8"),children:[o.jsxs("div",{className:xe("flex items-baseline gap-2",!e&&"lg:hidden"),children:[o.jsx("span",{className:"font-bold text-xl text-primary-gradient whitespace-nowrap",children:"MaiBot WebUI"}),o.jsx("span",{className:"text-xs text-primary/60 whitespace-nowrap",children:Qse()})]}),!e&&o.jsx("span",{className:"hidden lg:block font-bold text-primary-gradient text-2xl",children:"M"})]})}),o.jsx(pn,{className:xe("flex-1 overflow-x-hidden",!e&&"lg:w-16"),children:o.jsx("nav",{className:xe("p-4",!e&&"lg:p-2 lg:w-16"),children:o.jsx("ul",{className:xe("space-y-6",!e&&"lg:space-y-3 lg:w-full"),children:m.map((w,S)=>o.jsxs("li",{children:[o.jsx("div",{className:xe("px-3 h-[1.25rem]","mb-2",!e&&"lg:mb-1 lg:invisible"),children:o.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/60 whitespace-nowrap",children:w.title})}),!e&&S>0&&o.jsx("div",{className:"hidden lg:block mb-2 border-t border-border"}),o.jsx("ul",{className:"space-y-1",children:w.items.map(k=>{const j=d({to:k.path}),N=k.icon,T=o.jsxs(o.Fragment,{children:[j&&o.jsx("div",{className:"absolute left-0 top-1/2 h-8 w-1 -translate-y-1/2 rounded-r-full bg-primary transition-opacity duration-300"}),o.jsxs("div",{className:xe("flex items-center transition-all duration-300",e?"gap-3":"gap-3 lg:gap-0"),children:[o.jsx(N,{className:xe("h-5 w-5 flex-shrink-0",j&&"text-primary"),strokeWidth:2,fill:"none"}),o.jsx("span",{className:xe("text-sm font-medium whitespace-nowrap transition-all duration-300",j&&"font-semibold",e?"opacity-100 max-w-[200px]":"opacity-100 max-w-[200px] lg:opacity-0 lg:max-w-0 lg:overflow-hidden"),children:k.label})]})]});return o.jsx("li",{className:"relative",children:o.jsxs(uDe,{children:[o.jsx(dDe,{asChild:!0,children:o.jsx(rv,{to:k.path,"data-tour":k.tourId,className:xe("relative flex items-center rounded-lg py-2 transition-all duration-300","hover:bg-accent hover:text-accent-foreground",j?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground",e?"px-3":"px-3 lg:px-0 lg:justify-center lg:w-12 lg:mx-auto"),onClick:()=>s(!1),children:T})}),!e&&o.jsx(BY,{side:"right",className:"hidden lg:block",children:o.jsx("p",{children:k.label})})]})},k.path)})})]},w.title))})})})]}),r&&o.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>s(!1)}),o.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[o.jsxs("header",{className:"flex h-16 items-center justify-between border-b bg-card/80 backdrop-blur-md px-4 sticky top-0 z-10",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("button",{onClick:()=>s(!r),className:"rounded-lg p-2 hover:bg-accent lg:hidden",children:o.jsx(fte,{className:"h-5 w-5"})}),o.jsx("button",{onClick:()=>n(!e),className:"hidden rounded-lg p-2 hover:bg-accent lg:block",title:e?"收起侧边栏":"展开侧边栏",children:o.jsx(wd,{className:xe("h-5 w-5 transition-transform",!e&&"rotate-180")})})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("button",{onClick:()=>a(!0),className:"relative hidden md:flex items-center w-64 h-9 pl-9 pr-16 bg-background/50 border rounded-md hover:bg-accent/50 transition-colors text-left",children:[o.jsx(ii,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),o.jsx("span",{className:"text-sm text-muted-foreground",children:"搜索..."}),o.jsxs(EX,{size:"sm",className:"absolute right-2 top-1/2 -translate-y-1/2",children:[o.jsx("span",{className:"text-xs",children:"⌘"}),"K"]})]}),o.jsx(vMe,{open:i,onOpenChange:a}),o.jsxs(ue,{variant:"ghost",size:"sm",onClick:()=>window.open("https://docs.mai-mai.org","_blank"),className:"gap-2",title:"查看麦麦文档",children:[o.jsx(mte,{className:"h-4 w-4"}),o.jsx("span",{className:"hidden sm:inline",children:"麦麦文档"})]}),o.jsx("button",{onClick:w=>{Dse(x==="dark"?"light":"dark",c,w)},className:"rounded-lg p-2 hover:bg-accent",title:x==="dark"?"切换到浅色模式":"切换到深色模式",children:x==="dark"?o.jsx(ik,{className:"h-5 w-5"}):o.jsx(ak,{className:"h-5 w-5"})}),o.jsx("div",{className:"h-6 w-px bg-border"}),o.jsxs(ue,{variant:"ghost",size:"sm",onClick:y,className:"gap-2",title:"登出系统",children:[o.jsx(_9,{className:"h-4 w-4"}),o.jsx("span",{className:"hidden sm:inline",children:"登出"})]})]})]}),o.jsxs(PRe,{children:[o.jsx(zRe,{asChild:!0,children:o.jsx("main",{className:"flex-1 overflow-hidden bg-background",children:t})}),o.jsxs(EY,{className:"w-64",children:[o.jsxs($a,{onClick:()=>h({to:"/"}),children:[o.jsx(L0,{className:"mr-2 h-4 w-4"}),"首页"]}),o.jsxs($a,{onClick:()=>h({to:"/settings"}),children:[o.jsx(Vc,{className:"mr-2 h-4 w-4"}),"系统设置"]}),o.jsxs($a,{onClick:()=>h({to:"/logs"}),children:[o.jsx(Fv,{className:"mr-2 h-4 w-4"}),"日志查看器"]}),o.jsx(b0,{}),o.jsxs(IRe,{children:[o.jsxs(CY,{children:[o.jsx(kI,{className:"mr-2 h-4 w-4"}),"切换主题"]}),o.jsxs(TY,{className:"w-48",children:[o.jsxs($a,{onClick:()=>c("light"),disabled:l==="light",children:[o.jsx(ik,{className:"mr-2 h-4 w-4"}),"浅色",l==="light"&&o.jsx(Ch,{children:"✓"})]}),o.jsxs($a,{onClick:()=>c("dark"),disabled:l==="dark",children:[o.jsx(ak,{className:"mr-2 h-4 w-4"}),"深色",l==="dark"&&o.jsx(Ch,{children:"✓"})]}),o.jsxs($a,{onClick:()=>c("system"),disabled:l==="system",children:[o.jsx(Vc,{className:"mr-2 h-4 w-4"}),"跟随系统",l==="system"&&o.jsx(Ch,{children:"✓"})]})]})]}),o.jsx(b0,{}),o.jsxs($a,{onClick:()=>window.location.reload(),children:[o.jsx(pte,{className:"mr-2 h-4 w-4"}),"刷新页面",o.jsx(Ch,{children:"⌘R"})]}),o.jsxs($a,{onClick:()=>a(!0),children:[o.jsx(ii,{className:"mr-2 h-4 w-4"}),"搜索",o.jsx(Ch,{children:"⌘K"})]}),o.jsx(b0,{}),o.jsxs($a,{onClick:()=>window.open("https://docs.mai-mai.org","_blank"),children:[o.jsx(w0,{className:"mr-2 h-4 w-4"}),"麦麦文档"]}),o.jsx(b0,{}),o.jsxs($a,{onClick:y,className:"text-destructive focus:text-destructive",children:[o.jsx(_9,{className:"mr-2 h-4 w-4"}),"登出系统"]})]})]})]})]})})}function fDe(t){const e=t.split(` -`).slice(1),n=[];for(const r of e){const s=r.trim();if(!s.startsWith("at "))continue;const i=s.match(/at\s+(?:(.+?)\s+\()?(.+?):(\d+):(\d+)\)?$/);i?n.push({functionName:i[1]||"",fileName:i[2],lineNumber:i[3],columnNumber:i[4],raw:s}):n.push({functionName:"",fileName:"",lineNumber:"",columnNumber:"",raw:s})}return n}function mDe({error:t,errorInfo:e}){const[n,r]=b.useState(!0),[s,i]=b.useState(!1),[a,l]=b.useState(!1),c=t.stack?fDe(t.stack):[],d=async()=>{const h=` -Error: ${t.name} -Message: ${t.message} - -Stack Trace: -${t.stack||"No stack trace available"} - -Component Stack: -${e?.componentStack||"No component stack available"} - -URL: ${window.location.href} -User Agent: ${navigator.userAgent} -Time: ${new Date().toISOString()} - `.trim();try{await navigator.clipboard.writeText(h),l(!0),setTimeout(()=>l(!1),2e3)}catch(m){console.error("Failed to copy:",m)}};return o.jsxs("div",{className:"space-y-4",children:[o.jsxs(ba,{variant:"destructive",className:"border-red-500/50 bg-red-500/10",children:[o.jsx(Ga,{className:"h-4 w-4"}),o.jsxs(wa,{className:"font-mono text-sm",children:[o.jsxs("span",{className:"font-semibold",children:[t.name,":"]})," ",t.message]})]}),c.length>0&&o.jsxs(hj,{open:n,onOpenChange:r,children:[o.jsx(fj,{asChild:!0,children:o.jsxs(ue,{variant:"ghost",className:"w-full justify-between p-3 h-auto",children:[o.jsxs("span",{className:"font-semibold text-sm flex items-center gap-2",children:[o.jsx(gte,{className:"h-4 w-4"}),"Stack Trace (",c.length," frames)"]}),n?o.jsx(B0,{className:"h-4 w-4"}):o.jsx(Xc,{className:"h-4 w-4"})]})}),o.jsx(mj,{children:o.jsx(pn,{className:"h-[280px] rounded-md border bg-muted/30",children:o.jsx("div",{className:"p-3 space-y-1",children:c.map((h,m)=>o.jsx("div",{className:"font-mono text-xs p-2 rounded hover:bg-muted/50 transition-colors",children:o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsxs("span",{className:"text-muted-foreground w-6 text-right flex-shrink-0",children:[m+1,"."]}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("span",{className:"text-primary font-medium",children:h.functionName}),h.fileName&&o.jsxs("div",{className:"text-muted-foreground mt-0.5 break-all",children:[h.fileName,h.lineNumber&&o.jsxs("span",{className:"text-yellow-600 dark:text-yellow-400",children:[":",h.lineNumber,":",h.columnNumber]})]})]})]})},m))})})})]}),e?.componentStack&&o.jsxs(hj,{open:s,onOpenChange:i,children:[o.jsx(fj,{asChild:!0,children:o.jsxs(ue,{variant:"ghost",className:"w-full justify-between p-3 h-auto",children:[o.jsxs("span",{className:"font-semibold text-sm flex items-center gap-2",children:[o.jsx(Ga,{className:"h-4 w-4"}),"Component Stack"]}),s?o.jsx(B0,{className:"h-4 w-4"}):o.jsx(Xc,{className:"h-4 w-4"})]})}),o.jsx(mj,{children:o.jsx(pn,{className:"h-[200px] rounded-md border bg-muted/30",children:o.jsx("pre",{className:"p-3 font-mono text-xs whitespace-pre-wrap text-muted-foreground",children:e.componentStack})})})]}),o.jsx(ue,{variant:"outline",size:"sm",onClick:d,className:"w-full",children:a?o.jsxs(o.Fragment,{children:[o.jsx(zo,{className:"mr-2 h-4 w-4 text-green-500"}),"已复制到剪贴板"]}):o.jsxs(o.Fragment,{children:[o.jsx(Iv,{className:"mr-2 h-4 w-4"}),"复制错误信息"]})})]})}function FY({error:t,errorInfo:e}){const n=()=>{window.location.href="/"},r=()=>{window.location.reload()};return o.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:o.jsxs(Lt,{className:"w-full max-w-2xl shadow-lg",children:[o.jsxs(En,{className:"text-center pb-2",children:[o.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30 mb-4",children:o.jsx(Ga,{className:"h-8 w-8 text-red-600 dark:text-red-400"})}),o.jsx(_n,{className:"text-2xl font-bold",children:"页面出现了问题"}),o.jsx(Wr,{className:"text-base mt-2",children:"应用程序遇到了意外错误。您可以尝试刷新页面或返回首页。"})]}),o.jsxs(Xn,{className:"space-y-4",children:[o.jsx(mDe,{error:t,errorInfo:e}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 pt-2",children:[o.jsxs(ue,{onClick:r,className:"flex-1",children:[o.jsx(Qs,{className:"mr-2 h-4 w-4"}),"刷新页面"]}),o.jsxs(ue,{onClick:n,variant:"outline",className:"flex-1",children:[o.jsx(L0,{className:"mr-2 h-4 w-4"}),"返回首页"]})]}),o.jsx("p",{className:"text-xs text-center text-muted-foreground pt-2",children:"如果问题持续存在,请将错误信息复制并反馈给开发者"})]})]})})}class pDe extends b.Component{constructor(e){super(e),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){console.error("ErrorBoundary caught an error:",e,n),this.setState({errorInfo:n})}handleReset=()=>{this.setState({hasError:!1,error:null,errorInfo:null})};render(){return this.state.hasError&&this.state.error?this.props.fallback?this.props.fallback:o.jsx(FY,{error:this.state.error,errorInfo:this.state.errorInfo}):this.props.children}}function qY({error:t}){return o.jsx(FY,{error:t,errorInfo:null})}const Mg=SJ({component:()=>o.jsxs(o.Fragment,{children:[o.jsx(Hz,{}),!1]}),beforeLoad:()=>{if(window.location.pathname==="/"&&!AB())throw OJ({to:"/auth"})}}),gDe=ps({getParentRoute:()=>Mg,path:"/auth",component:pie}),xDe=ps({getParentRoute:()=>Mg,path:"/setup",component:Iie}),Ys=ps({getParentRoute:()=>Mg,id:"protected",component:()=>o.jsx(hDe,{children:o.jsx(Hz,{})}),errorComponent:({error:t})=>o.jsx(qY,{error:t})}),vDe=ps({getParentRoute:()=>Ys,path:"/",component:Mse}),yDe=ps({getParentRoute:()=>Ys,path:"/config/bot",component:z0e}),bDe=ps({getParentRoute:()=>Ys,path:"/config/modelProvider",component:n1e}),wDe=ps({getParentRoute:()=>Ys,path:"/config/model",component:Wve}),SDe=ps({getParentRoute:()=>Ys,path:"/config/adapter",component:Xve}),kDe=ps({getParentRoute:()=>Ys,path:"/resource/emoji",component:yOe}),ODe=ps({getParentRoute:()=>Ys,path:"/resource/expression",component:_Oe}),jDe=ps({getParentRoute:()=>Ys,path:"/resource/person",component:qOe}),NDe=ps({getParentRoute:()=>Ys,path:"/resource/knowledge-graph",component:ATe}),CDe=ps({getParentRoute:()=>Ys,path:"/logs",component:SAe}),TDe=ps({getParentRoute:()=>Ys,path:"/chat",component:pMe}),EDe=ps({getParentRoute:()=>Ys,path:"/plugins",component:UAe}),_De=ps({getParentRoute:()=>Ys,path:"/plugin-config",component:JAe}),ADe=ps({getParentRoute:()=>Ys,path:"/plugin-mirrors",component:eMe}),MDe=ps({getParentRoute:()=>Ys,path:"/settings",component:oie}),RDe=ps({getParentRoute:()=>Mg,path:"*",component:DB}),DDe=Mg.addChildren([gDe,xDe,Ys.addChildren([vDe,yDe,bDe,wDe,SDe,kDe,ODe,jDe,NDe,EDe,_De,ADe,CDe,TDe,MDe]),RDe]),PDe=kJ({routeTree:DDe,defaultNotFoundComponent:DB,defaultErrorComponent:({error:t})=>o.jsx(qY,{error:t})});function zDe({children:t,defaultTheme:e="system",storageKey:n="ui-theme",...r}){const[s,i]=b.useState(()=>localStorage.getItem(n)||e);b.useEffect(()=>{const l=window.document.documentElement;if(l.classList.remove("light","dark"),s==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";l.classList.add(c);return}l.classList.add(s)},[s]),b.useEffect(()=>{const l=localStorage.getItem("accent-color");if(l){const c=document.documentElement,h={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%",gradient:null},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%",gradient:null},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%",gradient:null},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%",gradient:null},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%",gradient:null},red:{hsl:"0 84% 60%",darkHsl:"0 90% 70%",gradient:null},"gradient-sunset":{hsl:"15 95% 60%",darkHsl:"15 95% 65%",gradient:"linear-gradient(135deg, hsl(25 95% 53%) 0%, hsl(330 81% 60%) 100%)"},"gradient-ocean":{hsl:"200 90% 55%",darkHsl:"200 90% 60%",gradient:"linear-gradient(135deg, hsl(221.2 83.2% 53.3%) 0%, hsl(189 94% 43%) 100%)"},"gradient-forest":{hsl:"150 70% 45%",darkHsl:"150 75% 40%",gradient:"linear-gradient(135deg, hsl(142 71% 45%) 0%, hsl(158 64% 52%) 100%)"},"gradient-aurora":{hsl:"310 85% 65%",darkHsl:"310 90% 70%",gradient:"linear-gradient(135deg, hsl(271 91% 65%) 0%, hsl(330 81% 60%) 100%)"},"gradient-fire":{hsl:"15 95% 55%",darkHsl:"15 95% 60%",gradient:"linear-gradient(135deg, hsl(0 84% 60%) 0%, hsl(25 95% 53%) 100%)"},"gradient-twilight":{hsl:"250 90% 60%",darkHsl:"250 95% 65%",gradient:"linear-gradient(135deg, hsl(239 84% 67%) 0%, hsl(271 91% 65%) 100%)"}}[l];h&&(c.style.setProperty("--primary",h.hsl),h.gradient?(c.style.setProperty("--primary-gradient",h.gradient),c.classList.add("has-gradient")):(c.style.removeProperty("--primary-gradient"),c.classList.remove("has-gradient")))}},[]);const a={theme:s,setTheme:l=>{localStorage.setItem(n,l),i(l)}};return o.jsx(tB.Provider,{...r,value:a,children:t})}function IDe({children:t,defaultEnabled:e=!0,defaultWavesEnabled:n=!0,storageKey:r="enable-animations",wavesStorageKey:s="enable-waves-background"}){const[i,a]=b.useState(()=>{const h=localStorage.getItem(r);return h!==null?h==="true":e}),[l,c]=b.useState(()=>{const h=localStorage.getItem(s);return h!==null?h==="true":n});b.useEffect(()=>{const h=document.documentElement;i?h.classList.remove("no-animations"):h.classList.add("no-animations"),localStorage.setItem(r,String(i))},[i,r]),b.useEffect(()=>{localStorage.setItem(s,String(l))},[l,s]);const d={enableAnimations:i,setEnableAnimations:a,enableWavesBackground:l,setEnableWavesBackground:c};return o.jsx(nB.Provider,{value:d,children:t})}var P7="ToastProvider",[z7,LDe,BDe]=Qy("Toast"),[$Y]=Da("Toast",[BDe]),[FDe,dw]=$Y(P7),HY=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:a}=t,[l,c]=b.useState(null),[d,h]=b.useState(0),m=b.useRef(!1),g=b.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${P7}\`. Expected non-empty \`string\`.`),o.jsx(z7.Provider,{scope:e,children:o.jsx(FDe,{scope:e,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:d,viewport:l,onViewportChange:c,onToastAdd:b.useCallback(()=>h(x=>x+1),[]),onToastRemove:b.useCallback(()=>h(x=>x-1),[]),isFocusedToastEscapeKeyDownRef:m,isClosePausedRef:g,children:a})})};HY.displayName=P7;var QY="ToastViewport",qDe=["F8"],vj="toast.viewportPause",yj="toast.viewportResume",VY=b.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=qDe,label:s="Notifications ({hotkey})",...i}=t,a=dw(QY,n),l=LDe(n),c=b.useRef(null),d=b.useRef(null),h=b.useRef(null),m=b.useRef(null),g=er(e,m,a.onViewportChange),x=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=a.toastCount>0;b.useEffect(()=>{const S=k=>{r.length!==0&&r.every(N=>k[N]||k.code===N)&&m.current?.focus()};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[r]),b.useEffect(()=>{const S=c.current,k=m.current;if(y&&S&&k){const j=()=>{if(!a.isClosePausedRef.current){const _=new CustomEvent(vj);k.dispatchEvent(_),a.isClosePausedRef.current=!0}},N=()=>{if(a.isClosePausedRef.current){const _=new CustomEvent(yj);k.dispatchEvent(_),a.isClosePausedRef.current=!1}},T=_=>{!S.contains(_.relatedTarget)&&N()},E=()=>{S.contains(document.activeElement)||N()};return S.addEventListener("focusin",j),S.addEventListener("focusout",T),S.addEventListener("pointermove",j),S.addEventListener("pointerleave",E),window.addEventListener("blur",j),window.addEventListener("focus",N),()=>{S.removeEventListener("focusin",j),S.removeEventListener("focusout",T),S.removeEventListener("pointermove",j),S.removeEventListener("pointerleave",E),window.removeEventListener("blur",j),window.removeEventListener("focus",N)}}},[y,a.isClosePausedRef]);const w=b.useCallback(({tabbingDirection:S})=>{const j=l().map(N=>{const T=N.ref.current,E=[T,...ePe(T)];return S==="forwards"?E:E.reverse()});return(S==="forwards"?j.reverse():j).flat()},[l]);return b.useEffect(()=>{const S=m.current;if(S){const k=j=>{const N=j.altKey||j.ctrlKey||j.metaKey;if(j.key==="Tab"&&!N){const E=document.activeElement,_=j.shiftKey;if(j.target===S&&_){d.current?.focus();return}const q=w({tabbingDirection:_?"backwards":"forwards"}),B=q.findIndex(H=>H===E);rk(q.slice(B+1))?j.preventDefault():_?d.current?.focus():h.current?.focus()}};return S.addEventListener("keydown",k),()=>S.removeEventListener("keydown",k)}},[l,w]),o.jsxs(Lee,{ref:c,role:"region","aria-label":s.replace("{hotkey}",x),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&o.jsx(bj,{ref:d,onFocusFromOutsideViewport:()=>{const S=w({tabbingDirection:"forwards"});rk(S)}}),o.jsx(z7.Slot,{scope:n,children:o.jsx(Sn.ol,{tabIndex:-1,...i,ref:g})}),y&&o.jsx(bj,{ref:h,onFocusFromOutsideViewport:()=>{const S=w({tabbingDirection:"backwards"});rk(S)}})]})});VY.displayName=QY;var UY="ToastFocusProxy",bj=b.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,i=dw(UY,n);return o.jsx(SI,{tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:a=>{const l=a.relatedTarget;!i.viewport?.contains(l)&&r()}})});bj.displayName=UY;var Rg="Toast",$De="toast.swipeStart",HDe="toast.swipeMove",QDe="toast.swipeCancel",VDe="toast.swipeEnd",WY=b.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...a}=t,[l,c]=Kl({prop:r,defaultProp:s??!0,onChange:i,caller:Rg});return o.jsx(oi,{present:n||l,children:o.jsx(GDe,{open:l,...a,ref:e,onClose:()=>c(!1),onPause:Rs(t.onPause),onResume:Rs(t.onResume),onSwipeStart:nt(t.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:nt(t.onSwipeMove,d=>{const{x:h,y:m}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${h}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${m}px`)}),onSwipeCancel:nt(t.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:nt(t.onSwipeEnd,d=>{const{x:h,y:m}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${h}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${m}px`),c(!1)})})})});WY.displayName=Rg;var[UDe,WDe]=$Y(Rg,{onClose(){}}),GDe=b.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:a,onEscapeKeyDown:l,onPause:c,onResume:d,onSwipeStart:h,onSwipeMove:m,onSwipeCancel:g,onSwipeEnd:x,...y}=t,w=dw(Rg,n),[S,k]=b.useState(null),j=er(e,I=>k(I)),N=b.useRef(null),T=b.useRef(null),E=s||w.duration,_=b.useRef(0),A=b.useRef(E),D=b.useRef(0),{onToastAdd:q,onToastRemove:B}=w,H=Rs(()=>{S?.contains(document.activeElement)&&w.viewport?.focus(),a()}),W=b.useCallback(I=>{!I||I===1/0||(window.clearTimeout(D.current),_.current=new Date().getTime(),D.current=window.setTimeout(H,I))},[H]);b.useEffect(()=>{const I=w.viewport;if(I){const V=()=>{W(A.current),d?.()},L=()=>{const $=new Date().getTime()-_.current;A.current=A.current-$,window.clearTimeout(D.current),c?.()};return I.addEventListener(vj,L),I.addEventListener(yj,V),()=>{I.removeEventListener(vj,L),I.removeEventListener(yj,V)}}},[w.viewport,E,c,d,W]),b.useEffect(()=>{i&&!w.isClosePausedRef.current&&W(E)},[i,E,w.isClosePausedRef,W]),b.useEffect(()=>(q(),()=>B()),[q,B]);const ee=b.useMemo(()=>S?eK(S):null,[S]);return w.viewport?o.jsxs(o.Fragment,{children:[ee&&o.jsx(XDe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:ee}),o.jsx(UDe,{scope:n,onClose:H,children:ya.createPortal(o.jsx(z7.ItemSlot,{scope:n,children:o.jsx(Bee,{asChild:!0,onEscapeKeyDown:nt(l,()=>{w.isFocusedToastEscapeKeyDownRef.current||H(),w.isFocusedToastEscapeKeyDownRef.current=!1}),children:o.jsx(Sn.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":w.swipeDirection,...y,ref:j,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:nt(t.onKeyDown,I=>{I.key==="Escape"&&(l?.(I.nativeEvent),I.nativeEvent.defaultPrevented||(w.isFocusedToastEscapeKeyDownRef.current=!0,H()))}),onPointerDown:nt(t.onPointerDown,I=>{I.button===0&&(N.current={x:I.clientX,y:I.clientY})}),onPointerMove:nt(t.onPointerMove,I=>{if(!N.current)return;const V=I.clientX-N.current.x,L=I.clientY-N.current.y,$=!!T.current,K=["left","right"].includes(w.swipeDirection),Y=["left","up"].includes(w.swipeDirection)?Math.min:Math.max,R=K?Y(0,V):0,ie=K?0:Y(0,L),X=I.pointerType==="touch"?10:2,z={x:R,y:ie},U={originalEvent:I,delta:z};$?(T.current=z,nv(HDe,m,U,{discrete:!1})):$z(z,w.swipeDirection,X)?(T.current=z,nv($De,h,U,{discrete:!1}),I.target.setPointerCapture(I.pointerId)):(Math.abs(V)>X||Math.abs(L)>X)&&(N.current=null)}),onPointerUp:nt(t.onPointerUp,I=>{const V=T.current,L=I.target;if(L.hasPointerCapture(I.pointerId)&&L.releasePointerCapture(I.pointerId),T.current=null,N.current=null,V){const $=I.currentTarget,K={originalEvent:I,delta:V};$z(V,w.swipeDirection,w.swipeThreshold)?nv(VDe,x,K,{discrete:!0}):nv(QDe,g,K,{discrete:!0}),$.addEventListener("click",Y=>Y.preventDefault(),{once:!0})}})})})}),w.viewport)})]}):null}),XDe=t=>{const{__scopeToast:e,children:n,...r}=t,s=dw(Rg,e),[i,a]=b.useState(!1),[l,c]=b.useState(!1);return ZDe(()=>a(!0)),b.useEffect(()=>{const d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),l?null:o.jsx(Xy,{asChild:!0,children:o.jsx(SI,{...r,children:i&&o.jsxs(o.Fragment,{children:[s.label," ",n]})})})},YDe="ToastTitle",GY=b.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return o.jsx(Sn.div,{...r,ref:e})});GY.displayName=YDe;var KDe="ToastDescription",XY=b.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return o.jsx(Sn.div,{...r,ref:e})});XY.displayName=KDe;var YY="ToastAction",KY=b.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?o.jsx(JY,{altText:n,asChild:!0,children:o.jsx(I7,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${YY}\`. Expected non-empty \`string\`.`),null)});KY.displayName=YY;var ZY="ToastClose",I7=b.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=WDe(ZY,n);return o.jsx(JY,{asChild:!0,children:o.jsx(Sn.button,{type:"button",...r,ref:e,onClick:nt(t.onClick,s.onClose)})})});I7.displayName=ZY;var JY=b.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return o.jsx(Sn.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function eK(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),JDe(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const a=r.dataset.radixToastAnnounceAlt;a&&e.push(a)}else e.push(...eK(r))}}),e}function nv(t,e,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?wI(s,i):s.dispatchEvent(i)}var $z=(t,e,n=0)=>{const r=Math.abs(t.x),s=Math.abs(t.y),i=r>s;return e==="left"||e==="right"?i&&r>n:!i&&s>n};function ZDe(t=()=>{}){const e=Rs(t);Wh(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function JDe(t){return t.nodeType===t.ELEMENT_NODE}function ePe(t){const e=[],n=document.createTreeWalker(t,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();)e.push(n.currentNode);return e}function rk(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var tPe=HY,tK=VY,nK=WY,rK=GY,sK=XY,iK=KY,aK=I7;const nPe=tPe,oK=b.forwardRef(({className:t,...e},n)=>o.jsx(tK,{ref:n,className:xe("fixed bottom-0 right-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:max-w-[420px] gap-2",t),...e}));oK.displayName=tK.displayName;const rPe=kf("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-slide-in-from-right data-[state=open]:animate-fade-in data-[state=closed]:animate-slide-out-to-right data-[state=closed]:animate-fade-out data-[swipe=end]:animate-slide-out-to-right",{variants:{variant:{default:"border bg-primary/5 text-foreground backdrop-blur-sm",destructive:"destructive group border-destructive bg-destructive/10 text-destructive-foreground backdrop-blur-sm"}},defaultVariants:{variant:"default"}}),lK=b.forwardRef(({className:t,variant:e,...n},r)=>o.jsx(nK,{ref:r,className:xe(rPe({variant:e}),t),...n}));lK.displayName=nK.displayName;const sPe=b.forwardRef(({className:t,...e},n)=>o.jsx(iK,{ref:n,className:xe("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...e}));sPe.displayName=iK.displayName;const cK=b.forwardRef(({className:t,...e},n)=>o.jsx(aK,{ref:n,className:xe("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:o.jsx(Pp,{className:"h-4 w-4"})}));cK.displayName=aK.displayName;const uK=b.forwardRef(({className:t,...e},n)=>o.jsx(rK,{ref:n,className:xe("text-sm font-semibold [&+div]:text-xs",t),...e}));uK.displayName=rK.displayName;const dK=b.forwardRef(({className:t,...e},n)=>o.jsx(sK,{ref:n,className:xe("text-sm opacity-90",t),...e}));dK.displayName=sK.displayName;function iPe(){const{toasts:t}=Lr();return o.jsxs(nPe,{children:[t.map(function({id:e,title:n,description:r,action:s,...i}){return o.jsxs(lK,{...i,children:[o.jsxs("div",{className:"grid gap-1",children:[n&&o.jsx(uK,{children:n}),r&&o.jsx(dK,{children:r})]}),s,o.jsx(cK,{})]},e)}),o.jsx(oK,{})]})}wte.createRoot(document.getElementById("root")).render(o.jsx(b.StrictMode,{children:o.jsx(pDe,{children:o.jsx(zDe,{defaultTheme:"system",children:o.jsx(IDe,{children:o.jsxs(Npe,{children:[o.jsx(jJ,{router:PDe}),o.jsx(e1e,{}),o.jsx(iPe,{})]})})})})})); diff --git a/webui/dist/assets/index-DuV8F13p.js b/webui/dist/assets/index-DuV8F13p.js new file mode 100644 index 00000000..3dd4ef1e --- /dev/null +++ b/webui/dist/assets/index-DuV8F13p.js @@ -0,0 +1,52 @@ +import{r as u,j as e,L as Kc,e as It,b as xy,f as fy,g as py,h as gy,k as lt,l as jy,m as vy,O as vp,n as yy}from"./router-CWhjJi2n.js";import{a as Ny,b as by,g as wy}from"./react-vendor-Dtc2IqVY.js";import{I as _y,c as Sy,J as ai,K as qc,L as wu,M as Cy,N as er,O as sr,P as ky,n as _u}from"./utils-CCeOswSm.js";import{L as yp,T as Np,C as bp,R as Ty,a as wp,V as Ey,b as zy,S as _p,c as My,d as Sp,I as Ay,e as Cp,f as Dy,g as kp,h as Oy,i as Ry,j as Ly,O as Tp,P as Uy,k as Ep,l as zp,D as Mp,A as Ap,m as Dp,n as By,o as Hy,p as Op,q as qy,r as Rp,s as Gy,t as Vy,u as Fy,v as Qy,w as $y,x as Lp,y as Up,F as Bp,z as Hp,B as qp,E as Yy,G as Gp,H as Vp,J as Fp,K as Qp,M as $p,N as Yp,Q as Xp,U as Xy,W as Ky,X as Zy}from"./radix-extra-Cw1azsjZ.js";import{aj as Iy,ak as Jy,al as Py,am as Wy,an as Gc,ao as Vc,ap as tr,aq as eN,ar as Su,as as Fc,at as sN,au as tN,av as aN}from"./charts-Dhri-zxi.js";import{S as lN,H as Kp,O as Zp,o as nN,C as Ip,p as Jp,T as Pp,D as Wp,R as iN,q as rN,I as eg,J as cN,K as sg,L as tg,M as oN,N as ag,V as dN,Q as lg,U as ng,X as uN,Y as mN,Z as ig,_ as hN,$ as xN,a0 as rg,a1 as fN,a2 as pN,a3 as cg,a4 as gN,a5 as jN,a6 as vN,a7 as og,a8 as dg,a9 as ug,aa as mg,ab as hg,ac as xg,ad as yN}from"./radix-core-BlBHu_Lw.js";import{R as ft,P as Nr,C as xa,a as Aa,Z as ln,b as Wc,F as Ma,c as NN,S as Rl,A as bN,D as wN,d as eo,e as Wn,M as si,T as _N,X as li,f as fg,g as SN,I as Xt,h as ya,i as ha,j as so,E as mr,k as Zt,l as pg,H as CN,m as ns,n as nl,U as hr,o as Ou,p as Ru,L as $f,K as gg,q as ro,r as kN,s as dr,t as vt,u as TN,B as ir,v as to,w as Qu,x as EN,y as zN,z as St,G as xr,J as ti,N as Ll,O as fr,Q as MN,V as AN,W as br,Y as gt,_ as ao,$ as nn,a0 as wr,a1 as cn,a2 as il,a3 as _r,a4 as $u,a5 as DN,a6 as ON,a7 as RN,a8 as rn,a9 as LN,aa as Lu,ab as pr,ac as UN,ad as BN,ae as Uu,af as HN,ag as jg,ah as Yf,ai as qN,aj as GN,ak as VN,al as Ol,am as Cu,an as Xf,ao as FN,ap as QN,aq as $N,ar as YN,as as XN,at as vg,au as yg,av as Ng,aw as KN,ax as ZN,ay as Kf,az as IN,aA as JN,aB as Zf,aC as PN,aD as WN}from"./icons-Bw5y5Hqz.js";import{S as eb,p as sb,j as tb,a as ab,E as If,R as lb,o as nb}from"./codemirror-BHeANvwm.js";import{_ as Lt,c as ib,g as bg,D as rb}from"./misc-Ii-X5qWA.js";import{u as cb,a as Jf,D as ob,c as db,S as ub,h as mb,b as hb,s as xb,K as fb,P as pb,d as gb,C as jb}from"./dnd-Dyi3CnuX.js";import{D as vb,U as yb}from"./uppy-DSH7n_-V.js";import{M as Nb,r as bb,a as wb,b as _b}from"./markdown-A1ShuLvG.js";import{r as Sb,H as lo,P as no,u as Cb,a as kb,R as Tb,B as Eb,b as zb,C as Mb,M as Ab,c as Db}from"./reactflow-B3n3_Vkw.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const h of document.querySelectorAll('link[rel="modulepreload"]'))d(h);new MutationObserver(h=>{for(const x of h)if(x.type==="childList")for(const f of x.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&d(f)}).observe(document,{childList:!0,subtree:!0});function c(h){const x={};return h.integrity&&(x.integrity=h.integrity),h.referrerPolicy&&(x.referrerPolicy=h.referrerPolicy),h.crossOrigin==="use-credentials"?x.credentials="include":h.crossOrigin==="anonymous"?x.credentials="omit":x.credentials="same-origin",x}function d(h){if(h.ep)return;h.ep=!0;const x=c(h);fetch(h.href,x)}})();var ku={exports:{}},ar={},Tu={exports:{}},Eu={};var Pf;function Ob(){return Pf||(Pf=1,(function(n){function r(y,q){var H=y.length;y.push(q);e:for(;0>>1,S=y[ne];if(0>>1;neh(Q,H))oeh(ge,Q)?(y[ne]=ge,y[oe]=H,ne=oe):(y[ne]=Q,y[he]=H,ne=he);else if(oeh(ge,H))y[ne]=ge,y[oe]=H,ne=oe;else break e}}return q}function h(y,q){var H=y.sortIndex-q.sortIndex;return H!==0?H:y.id-q.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var x=performance;n.unstable_now=function(){return x.now()}}else{var f=Date,j=f.now();n.unstable_now=function(){return f.now()-j}}var g=[],_=[],v=1,k=null,z=3,T=!1,L=!1,K=!1,U=!1,R=typeof setTimeout=="function"?setTimeout:null,ee=typeof clearTimeout=="function"?clearTimeout:null,V=typeof setImmediate<"u"?setImmediate:null;function E(y){for(var q=c(_);q!==null;){if(q.callback===null)d(_);else if(q.startTime<=y)d(_),q.sortIndex=q.expirationTime,r(g,q);else break;q=c(_)}}function B(y){if(K=!1,E(y),!L)if(c(g)!==null)L=!0,X||(X=!0,ye());else{var q=c(_);q!==null&&Ne(B,q.startTime-y)}}var X=!1,w=-1,D=5,te=-1;function xe(){return U?!0:!(n.unstable_now()-tey&&xe());){var ne=k.callback;if(typeof ne=="function"){k.callback=null,z=k.priorityLevel;var S=ne(k.expirationTime<=y);if(y=n.unstable_now(),typeof S=="function"){k.callback=S,E(y),q=!0;break s}k===c(g)&&d(g),E(y)}else d(g);k=c(g)}if(k!==null)q=!0;else{var me=c(_);me!==null&&Ne(B,me.startTime-y),q=!1}}break e}finally{k=null,z=H,T=!1}q=void 0}}finally{q?ye():X=!1}}}var ye;if(typeof V=="function")ye=function(){V(be)};else if(typeof MessageChannel<"u"){var ve=new MessageChannel,pe=ve.port2;ve.port1.onmessage=be,ye=function(){pe.postMessage(null)}}else ye=function(){R(be,0)};function Ne(y,q){w=R(function(){y(n.unstable_now())},q)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(y){y.callback=null},n.unstable_forceFrameRate=function(y){0>y||125ne?(y.sortIndex=H,r(_,y),c(g)===null&&y===c(_)&&(K?(ee(w),w=-1):K=!0,Ne(B,H-ne))):(y.sortIndex=S,r(g,y),L||T||(L=!0,X||(X=!0,ye()))),y},n.unstable_shouldYield=xe,n.unstable_wrapCallback=function(y){var q=z;return function(){var H=z;z=q;try{return y.apply(this,arguments)}finally{z=H}}}})(Eu)),Eu}var Wf;function Rb(){return Wf||(Wf=1,Tu.exports=Ob()),Tu.exports}var ep;function Lb(){if(ep)return ar;ep=1;var n=Rb(),r=Ny(),c=by();function d(s){var t="https://react.dev/errors/"+s;if(1S||(s.current=ne[S],ne[S]=null,S--)}function Q(s,t){S++,ne[S]=s.current,s.current=t}var oe=me(null),ge=me(null),le=me(null),O=me(null);function F(s,t){switch(Q(le,t),Q(ge,s),Q(oe,null),t.nodeType){case 9:case 11:s=(s=t.documentElement)&&(s=s.namespaceURI)?xf(s):0;break;default:if(s=t.tagName,t=t.namespaceURI)t=xf(t),s=ff(t,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}he(oe),Q(oe,s)}function A(){he(oe),he(ge),he(le)}function W(s){s.memoizedState!==null&&Q(O,s);var t=oe.current,a=ff(t,s.type);t!==a&&(Q(ge,s),Q(oe,a))}function _e(s){ge.current===s&&(he(oe),he(ge)),O.current===s&&(he(O),Ii._currentValue=H)}var Me,ss;function Ie(s){if(Me===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Me=t&&t[1]||"",ss=-1)":-1i||C[l]!==I[i]){var ae=` +`+C[l].replace(" at new "," at ");return s.displayName&&ae.includes("")&&(ae=ae.replace("",s.displayName)),ae}while(1<=l&&0<=i);break}}}finally{Rs=!1,Error.prepareStackTrace=a}return(a=s?s.displayName||s.name:"")?Ie(a):""}function ie(s,t){switch(s.tag){case 26:case 27:case 5:return Ie(s.type);case 16:return Ie("Lazy");case 13:return s.child!==t&&t!==null?Ie("Suspense Fallback"):Ie("Suspense");case 19:return Ie("SuspenseList");case 0:case 15:return qs(s.type,!1);case 11:return qs(s.type.render,!1);case 1:return qs(s.type,!0);case 31:return Ie("Activity");default:return""}}function we(s){try{var t="",a=null;do t+=ie(s,a),a=s,s=s.return;while(s);return t}catch(l){return` +Error generating stack: `+l.message+` +`+l.stack}}var Ke=Object.prototype.hasOwnProperty,Le=n.unstable_scheduleCallback,st=n.unstable_cancelCallback,Jt=n.unstable_shouldYield,bt=n.unstable_requestPaint,Je=n.unstable_now,Ue=n.unstable_getCurrentPriorityLevel,jt=n.unstable_ImmediatePriority,nt=n.unstable_UserBlockingPriority,Ct=n.unstable_NormalPriority,kt=n.unstable_LowPriority,rl=n.unstable_IdlePriority,cl=n.log,ol=n.unstable_setDisableYieldValue,Se=null,Re=null;function it(s){if(typeof cl=="function"&&ol(s),Re&&typeof Re.setStrictMode=="function")try{Re.setStrictMode(Se,s)}catch{}}var ot=Math.clz32?Math.clz32:dt,di=Math.log,on=Math.LN2;function dt(s){return s>>>=0,s===0?32:31-(di(s)/on|0)|0}var Pt=256,Wt=262144,La=4194304;function Ut(s){var t=s&42;if(t!==0)return t;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Ua(s,t,a){var l=s.pendingLanes;if(l===0)return 0;var i=0,o=s.suspendedLanes,m=s.pingedLanes;s=s.warmLanes;var p=l&134217727;return p!==0?(l=p&~o,l!==0?i=Ut(l):(m&=p,m!==0?i=Ut(m):a||(a=p&~s,a!==0&&(i=Ut(a))))):(p=l&~o,p!==0?i=Ut(p):m!==0?i=Ut(m):a||(a=l&~s,a!==0&&(i=Ut(a)))),i===0?0:t!==0&&t!==i&&(t&o)===0&&(o=i&-i,a=t&-t,o>=a||o===32&&(a&4194048)!==0)?t:i}function ba(s,t){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&t)===0}function P(s,t){switch(s){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function je(){var s=La;return La<<=1,(La&62914560)===0&&(La=4194304),s}function Ae(s){for(var t=[],a=0;31>a;a++)t.push(s);return t}function tt(s,t){s.pendingLanes|=t,t!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function Bt(s,t,a,l,i,o){var m=s.pendingLanes;s.pendingLanes=a,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=a,s.entangledLanes&=a,s.errorRecoveryDisabledLanes&=a,s.shellSuspendCounter=0;var p=s.entanglements,C=s.expirationTimes,I=s.hiddenUpdates;for(a=m&~a;0"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var cj=/[\n"\\]/g;function sa(s){return s.replace(cj,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function go(s,t,a,l,i,o,m,p){s.name="",m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?s.type=m:s.removeAttribute("type"),t!=null?m==="number"?(t===0&&s.value===""||s.value!=t)&&(s.value=""+ea(t)):s.value!==""+ea(t)&&(s.value=""+ea(t)):m!=="submit"&&m!=="reset"||s.removeAttribute("value"),t!=null?jo(s,m,ea(t)):a!=null?jo(s,m,ea(a)):l!=null&&s.removeAttribute("value"),i==null&&o!=null&&(s.defaultChecked=!!o),i!=null&&(s.checked=i&&typeof i!="function"&&typeof i!="symbol"),p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?s.name=""+ea(p):s.removeAttribute("name")}function rm(s,t,a,l,i,o,m,p){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(s.type=o),t!=null||a!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){po(s);return}a=a!=null?""+ea(a):"",t=t!=null?""+ea(t):a,p||t===s.value||(s.value=t),s.defaultValue=t}l=l??i,l=typeof l!="function"&&typeof l!="symbol"&&!!l,s.checked=p?s.checked:!!l,s.defaultChecked=!!l,m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(s.name=m),po(s)}function jo(s,t,a){t==="number"&&zr(s.ownerDocument)===s||s.defaultValue===""+a||(s.defaultValue=""+a)}function pn(s,t,a,l){if(s=s.options,t){t={};for(var i=0;i"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wo=!1;if(Ga)try{var xi={};Object.defineProperty(xi,"passive",{get:function(){wo=!0}}),window.addEventListener("test",xi,xi),window.removeEventListener("test",xi,xi)}catch{wo=!1}var ul=null,_o=null,Ar=null;function xm(){if(Ar)return Ar;var s,t=_o,a=t.length,l,i="value"in ul?ul.value:ul.textContent,o=i.length;for(s=0;s=gi),ym=" ",Nm=!1;function bm(s,t){switch(s){case"keyup":return Lj.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wm(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var yn=!1;function Bj(s,t){switch(s){case"compositionend":return wm(t);case"keypress":return t.which!==32?null:(Nm=!0,ym);case"textInput":return s=t.data,s===ym&&Nm?null:s;default:return null}}function Hj(s,t){if(yn)return s==="compositionend"||!Eo&&bm(s,t)?(s=xm(),Ar=_o=ul=null,yn=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:a,offset:t-s};s=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Mm(a)}}function Dm(s,t){return s&&t?s===t?!0:s&&s.nodeType===3?!1:t&&t.nodeType===3?Dm(s,t.parentNode):"contains"in s?s.contains(t):s.compareDocumentPosition?!!(s.compareDocumentPosition(t)&16):!1:!1}function Om(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var t=zr(s.document);t instanceof s.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)s=t.contentWindow;else break;t=zr(s.document)}return t}function Ao(s){var t=s&&s.nodeName&&s.nodeName.toLowerCase();return t&&(t==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||t==="textarea"||s.contentEditable==="true")}var Xj=Ga&&"documentMode"in document&&11>=document.documentMode,Nn=null,Do=null,Ni=null,Oo=!1;function Rm(s,t,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Oo||Nn==null||Nn!==zr(l)||(l=Nn,"selectionStart"in l&&Ao(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ni&&yi(Ni,l)||(Ni=l,l=Sc(Do,"onSelect"),0>=m,i-=m,Sa=1<<32-ot(t)+i|a<Pe?(rs=Te,Te=null):rs=Te.sibling;var ys=J(G,Te,Z[Pe],re);if(ys===null){Te===null&&(Te=rs);break}s&&Te&&ys.alternate===null&&t(G,Te),M=o(ys,M,Pe),vs===null?Ee=ys:vs.sibling=ys,vs=ys,Te=rs}if(Pe===Z.length)return a(G,Te),fs&&Fa(G,Pe),Ee;if(Te===null){for(;PePe?(rs=Te,Te=null):rs=Te.sibling;var Dl=J(G,Te,ys.value,re);if(Dl===null){Te===null&&(Te=rs);break}s&&Te&&Dl.alternate===null&&t(G,Te),M=o(Dl,M,Pe),vs===null?Ee=Dl:vs.sibling=Dl,vs=Dl,Te=rs}if(ys.done)return a(G,Te),fs&&Fa(G,Pe),Ee;if(Te===null){for(;!ys.done;Pe++,ys=Z.next())ys=de(G,ys.value,re),ys!==null&&(M=o(ys,M,Pe),vs===null?Ee=ys:vs.sibling=ys,vs=ys);return fs&&Fa(G,Pe),Ee}for(Te=l(Te);!ys.done;Pe++,ys=Z.next())ys=se(Te,G,Pe,ys.value,re),ys!==null&&(s&&ys.alternate!==null&&Te.delete(ys.key===null?Pe:ys.key),M=o(ys,M,Pe),vs===null?Ee=ys:vs.sibling=ys,vs=ys);return s&&Te.forEach(function(hy){return t(G,hy)}),fs&&Fa(G,Pe),Ee}function ks(G,M,Z,re){if(typeof Z=="object"&&Z!==null&&Z.type===K&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case T:e:{for(var Ee=Z.key;M!==null;){if(M.key===Ee){if(Ee=Z.type,Ee===K){if(M.tag===7){a(G,M.sibling),re=i(M,Z.props.children),re.return=G,G=re;break e}}else if(M.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===D&&Il(Ee)===M.type){a(G,M.sibling),re=i(M,Z.props),ki(re,Z),re.return=G,G=re;break e}a(G,M);break}else t(G,M);M=M.sibling}Z.type===K?(re=$l(Z.props.children,G.mode,re,Z.key),re.return=G,G=re):(re=Vr(Z.type,Z.key,Z.props,null,G.mode,re),ki(re,Z),re.return=G,G=re)}return m(G);case L:e:{for(Ee=Z.key;M!==null;){if(M.key===Ee)if(M.tag===4&&M.stateNode.containerInfo===Z.containerInfo&&M.stateNode.implementation===Z.implementation){a(G,M.sibling),re=i(M,Z.children||[]),re.return=G,G=re;break e}else{a(G,M);break}else t(G,M);M=M.sibling}re=Go(Z,G.mode,re),re.return=G,G=re}return m(G);case D:return Z=Il(Z),ks(G,M,Z,re)}if(Ne(Z))return Ce(G,M,Z,re);if(ye(Z)){if(Ee=ye(Z),typeof Ee!="function")throw Error(d(150));return Z=Ee.call(Z),Oe(G,M,Z,re)}if(typeof Z.then=="function")return ks(G,M,Zr(Z),re);if(Z.$$typeof===V)return ks(G,M,$r(G,Z),re);Ir(G,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,M!==null&&M.tag===6?(a(G,M.sibling),re=i(M,Z),re.return=G,G=re):(a(G,M),re=qo(Z,G.mode,re),re.return=G,G=re),m(G)):a(G,M)}return function(G,M,Z,re){try{Ci=0;var Ee=ks(G,M,Z,re);return An=null,Ee}catch(Te){if(Te===Mn||Te===Xr)throw Te;var vs=qt(29,Te,null,G.mode);return vs.lanes=re,vs.return=G,vs}finally{}}}var Pl=lh(!0),nh=lh(!1),pl=!1;function Wo(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ed(s,t){s=s.updateQueue,t.updateQueue===s&&(t.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function gl(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function jl(s,t,a){var l=s.updateQueue;if(l===null)return null;if(l=l.shared,(Ns&2)!==0){var i=l.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),l.pending=t,t=Gr(s),Vm(s,null,a),t}return qr(s,l,t,a),Gr(s)}function Ti(s,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var l=t.lanes;l&=s.pendingLanes,a|=l,t.lanes=a,dl(s,a)}}function sd(s,t){var a=s.updateQueue,l=s.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var i=null,o=null;if(a=a.firstBaseUpdate,a!==null){do{var m={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};o===null?i=o=m:o=o.next=m,a=a.next}while(a!==null);o===null?i=o=t:o=o.next=t}else i=o=t;a={baseState:l.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:l.shared,callbacks:l.callbacks},s.updateQueue=a;return}s=a.lastBaseUpdate,s===null?a.firstBaseUpdate=t:s.next=t,a.lastBaseUpdate=t}var td=!1;function Ei(){if(td){var s=zn;if(s!==null)throw s}}function zi(s,t,a,l){td=!1;var i=s.updateQueue;pl=!1;var o=i.firstBaseUpdate,m=i.lastBaseUpdate,p=i.shared.pending;if(p!==null){i.shared.pending=null;var C=p,I=C.next;C.next=null,m===null?o=I:m.next=I,m=C;var ae=s.alternate;ae!==null&&(ae=ae.updateQueue,p=ae.lastBaseUpdate,p!==m&&(p===null?ae.firstBaseUpdate=I:p.next=I,ae.lastBaseUpdate=C))}if(o!==null){var de=i.baseState;m=0,ae=I=C=null,p=o;do{var J=p.lane&-536870913,se=J!==p.lane;if(se?(is&J)===J:(l&J)===J){J!==0&&J===En&&(td=!0),ae!==null&&(ae=ae.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});e:{var Ce=s,Oe=p;J=t;var ks=a;switch(Oe.tag){case 1:if(Ce=Oe.payload,typeof Ce=="function"){de=Ce.call(ks,de,J);break e}de=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Oe.payload,J=typeof Ce=="function"?Ce.call(ks,de,J):Ce,J==null)break e;de=k({},de,J);break e;case 2:pl=!0}}J=p.callback,J!==null&&(s.flags|=64,se&&(s.flags|=8192),se=i.callbacks,se===null?i.callbacks=[J]:se.push(J))}else se={lane:J,tag:p.tag,payload:p.payload,callback:p.callback,next:null},ae===null?(I=ae=se,C=de):ae=ae.next=se,m|=J;if(p=p.next,p===null){if(p=i.shared.pending,p===null)break;se=p,p=se.next,se.next=null,i.lastBaseUpdate=se,i.shared.pending=null}}while(!0);ae===null&&(C=de),i.baseState=C,i.firstBaseUpdate=I,i.lastBaseUpdate=ae,o===null&&(i.shared.lanes=0),wl|=m,s.lanes=m,s.memoizedState=de}}function ih(s,t){if(typeof s!="function")throw Error(d(191,s));s.call(t)}function rh(s,t){var a=s.callbacks;if(a!==null)for(s.callbacks=null,s=0;so?o:8;var m=y.T,p={};y.T=p,Nd(s,!1,t,a);try{var C=i(),I=y.S;if(I!==null&&I(p,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var ae=tv(C,l);Di(s,t,ae,$t(s))}else Di(s,t,l,$t(s))}catch(de){Di(s,t,{then:function(){},status:"rejected",reason:de},$t())}finally{q.p=o,m!==null&&p.types!==null&&(m.types=p.types),y.T=m}}function cv(){}function vd(s,t,a,l){if(s.tag!==5)throw Error(d(476));var i=Hh(s).queue;Bh(s,i,t,H,a===null?cv:function(){return qh(s),a(l)})}function Hh(s){var t=s.memoizedState;if(t!==null)return t;t={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xa,lastRenderedState:H},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xa,lastRenderedState:a},next:null},s.memoizedState=t,s=s.alternate,s!==null&&(s.memoizedState=t),t}function qh(s){var t=Hh(s);t.next===null&&(t=s.alternate.memoizedState),Di(s,t.next.queue,{},$t())}function yd(){return mt(Ii)}function Gh(){return Ks().memoizedState}function Vh(){return Ks().memoizedState}function ov(s){for(var t=s.return;t!==null;){switch(t.tag){case 24:case 3:var a=$t();s=gl(a);var l=jl(t,s,a);l!==null&&(Ot(l,t,a),Ti(l,t,a)),t={cache:Zo()},s.payload=t;return}t=t.return}}function dv(s,t,a){var l=$t();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ic(s)?Qh(t,a):(a=Bo(s,t,a,l),a!==null&&(Ot(a,s,l),$h(a,t,l)))}function Fh(s,t,a){var l=$t();Di(s,t,a,l)}function Di(s,t,a,l){var i={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(ic(s))Qh(t,i);else{var o=s.alternate;if(s.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var m=t.lastRenderedState,p=o(m,a);if(i.hasEagerState=!0,i.eagerState=p,Ht(p,m))return qr(s,t,i,0),Ts===null&&Hr(),!1}catch{}finally{}if(a=Bo(s,t,i,l),a!==null)return Ot(a,s,l),$h(a,t,l),!0}return!1}function Nd(s,t,a,l){if(l={lane:2,revertLane:Wd(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ic(s)){if(t)throw Error(d(479))}else t=Bo(s,a,l,2),t!==null&&Ot(t,s,2)}function ic(s){var t=s.alternate;return s===Ze||t!==null&&t===Ze}function Qh(s,t){On=Wr=!0;var a=s.pending;a===null?t.next=t:(t.next=a.next,a.next=t),s.pending=t}function $h(s,t,a){if((a&4194048)!==0){var l=t.lanes;l&=s.pendingLanes,a|=l,t.lanes=a,dl(s,a)}}var Oi={readContext:mt,use:tc,useCallback:Gs,useContext:Gs,useEffect:Gs,useImperativeHandle:Gs,useLayoutEffect:Gs,useInsertionEffect:Gs,useMemo:Gs,useReducer:Gs,useRef:Gs,useState:Gs,useDebugValue:Gs,useDeferredValue:Gs,useTransition:Gs,useSyncExternalStore:Gs,useId:Gs,useHostTransitionStatus:Gs,useFormState:Gs,useActionState:Gs,useOptimistic:Gs,useMemoCache:Gs,useCacheRefresh:Gs};Oi.useEffectEvent=Gs;var Yh={readContext:mt,use:tc,useCallback:function(s,t){return wt().memoizedState=[s,t===void 0?null:t],s},useContext:mt,useEffect:Eh,useImperativeHandle:function(s,t,a){a=a!=null?a.concat([s]):null,lc(4194308,4,Dh.bind(null,t,s),a)},useLayoutEffect:function(s,t){return lc(4194308,4,s,t)},useInsertionEffect:function(s,t){lc(4,2,s,t)},useMemo:function(s,t){var a=wt();t=t===void 0?null:t;var l=s();if(Wl){it(!0);try{s()}finally{it(!1)}}return a.memoizedState=[l,t],l},useReducer:function(s,t,a){var l=wt();if(a!==void 0){var i=a(t);if(Wl){it(!0);try{a(t)}finally{it(!1)}}}else i=t;return l.memoizedState=l.baseState=i,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:i},l.queue=s,s=s.dispatch=dv.bind(null,Ze,s),[l.memoizedState,s]},useRef:function(s){var t=wt();return s={current:s},t.memoizedState=s},useState:function(s){s=xd(s);var t=s.queue,a=Fh.bind(null,Ze,t);return t.dispatch=a,[s.memoizedState,a]},useDebugValue:gd,useDeferredValue:function(s,t){var a=wt();return jd(a,s,t)},useTransition:function(){var s=xd(!1);return s=Bh.bind(null,Ze,s.queue,!0,!1),wt().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,t,a){var l=Ze,i=wt();if(fs){if(a===void 0)throw Error(d(407));a=a()}else{if(a=t(),Ts===null)throw Error(d(349));(is&127)!==0||hh(l,t,a)}i.memoizedState=a;var o={value:a,getSnapshot:t};return i.queue=o,Eh(fh.bind(null,l,o,s),[s]),l.flags|=2048,Ln(9,{destroy:void 0},xh.bind(null,l,o,a,t),null),a},useId:function(){var s=wt(),t=Ts.identifierPrefix;if(fs){var a=Ca,l=Sa;a=(l&~(1<<32-ot(l)-1)).toString(32)+a,t="_"+t+"R_"+a,a=ec++,0<\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof l.is=="string"?m.createElement("select",{is:l.is}):m.createElement("select"),l.multiple?o.multiple=!0:l.size&&(o.size=l.size);break;default:o=typeof l.is=="string"?m.createElement(i,{is:l.is}):m.createElement(i)}}o[Fe]=t,o[Ys]=l;e:for(m=t.child;m!==null;){if(m.tag===5||m.tag===6)o.appendChild(m.stateNode);else if(m.tag!==4&&m.tag!==27&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===t)break e;for(;m.sibling===null;){if(m.return===null||m.return===t)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}t.stateNode=o;e:switch(xt(o,i,l),i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Za(t)}}return Ds(t),Rd(t,t.type,s===null?null:s.memoizedProps,t.pendingProps,a),null;case 6:if(s&&t.stateNode!=null)s.memoizedProps!==l&&Za(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(d(166));if(s=le.current,kn(t)){if(s=t.stateNode,a=t.memoizedProps,l=null,i=ut,i!==null)switch(i.tag){case 27:case 5:l=i.memoizedProps}s[Fe]=t,s=!!(s.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||mf(s.nodeValue,a)),s||xl(t,!0)}else s=Cc(s).createTextNode(l),s[Fe]=t,t.stateNode=s}return Ds(t),null;case 31:if(a=t.memoizedState,s===null||s.memoizedState!==null){if(l=kn(t),a!==null){if(s===null){if(!l)throw Error(d(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(d(557));s[Fe]=t}else Yl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ds(t),s=!1}else a=$o(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=a),s=!0;if(!s)return t.flags&256?(Vt(t),t):(Vt(t),null);if((t.flags&128)!==0)throw Error(d(558))}return Ds(t),null;case 13:if(l=t.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(i=kn(t),l!==null&&l.dehydrated!==null){if(s===null){if(!i)throw Error(d(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(d(317));i[Fe]=t}else Yl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ds(t),i=!1}else i=$o(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Vt(t),t):(Vt(t),null)}return Vt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=l!==null,s=s!==null&&s.memoizedState!==null,a&&(l=t.child,i=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(i=l.alternate.memoizedState.cachePool.pool),o=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(o=l.memoizedState.cachePool.pool),o!==i&&(l.flags|=2048)),a!==s&&a&&(t.child.flags|=8192),uc(t,t.updateQueue),Ds(t),null);case 4:return A(),s===null&&au(t.stateNode.containerInfo),Ds(t),null;case 10:return $a(t.type),Ds(t),null;case 19:if(he(Xs),l=t.memoizedState,l===null)return Ds(t),null;if(i=(t.flags&128)!==0,o=l.rendering,o===null)if(i)Li(l,!1);else{if(Vs!==0||s!==null&&(s.flags&128)!==0)for(s=t.child;s!==null;){if(o=Pr(s),o!==null){for(t.flags|=128,Li(l,!1),s=o.updateQueue,t.updateQueue=s,uc(t,s),t.subtreeFlags=0,s=a,a=t.child;a!==null;)Fm(a,s),a=a.sibling;return Q(Xs,Xs.current&1|2),fs&&Fa(t,l.treeForkCount),t.child}s=s.sibling}l.tail!==null&&Je()>pc&&(t.flags|=128,i=!0,Li(l,!1),t.lanes=4194304)}else{if(!i)if(s=Pr(o),s!==null){if(t.flags|=128,i=!0,s=s.updateQueue,t.updateQueue=s,uc(t,s),Li(l,!0),l.tail===null&&l.tailMode==="hidden"&&!o.alternate&&!fs)return Ds(t),null}else 2*Je()-l.renderingStartTime>pc&&a!==536870912&&(t.flags|=128,i=!0,Li(l,!1),t.lanes=4194304);l.isBackwards?(o.sibling=t.child,t.child=o):(s=l.last,s!==null?s.sibling=o:t.child=o,l.last=o)}return l.tail!==null?(s=l.tail,l.rendering=s,l.tail=s.sibling,l.renderingStartTime=Je(),s.sibling=null,a=Xs.current,Q(Xs,i?a&1|2:a&1),fs&&Fa(t,l.treeForkCount),s):(Ds(t),null);case 22:case 23:return Vt(t),ld(),l=t.memoizedState!==null,s!==null?s.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(a&536870912)!==0&&(t.flags&128)===0&&(Ds(t),t.subtreeFlags&6&&(t.flags|=8192)):Ds(t),a=t.updateQueue,a!==null&&uc(t,a.retryQueue),a=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(a=s.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==a&&(t.flags|=2048),s!==null&&he(Zl),null;case 24:return a=null,s!==null&&(a=s.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),$a(Js),Ds(t),null;case 25:return null;case 30:return null}throw Error(d(156,t.tag))}function fv(s,t){switch(Fo(t),t.tag){case 1:return s=t.flags,s&65536?(t.flags=s&-65537|128,t):null;case 3:return $a(Js),A(),s=t.flags,(s&65536)!==0&&(s&128)===0?(t.flags=s&-65537|128,t):null;case 26:case 27:case 5:return _e(t),null;case 31:if(t.memoizedState!==null){if(Vt(t),t.alternate===null)throw Error(d(340));Yl()}return s=t.flags,s&65536?(t.flags=s&-65537|128,t):null;case 13:if(Vt(t),s=t.memoizedState,s!==null&&s.dehydrated!==null){if(t.alternate===null)throw Error(d(340));Yl()}return s=t.flags,s&65536?(t.flags=s&-65537|128,t):null;case 19:return he(Xs),null;case 4:return A(),null;case 10:return $a(t.type),null;case 22:case 23:return Vt(t),ld(),s!==null&&he(Zl),s=t.flags,s&65536?(t.flags=s&-65537|128,t):null;case 24:return $a(Js),null;case 25:return null;default:return null}}function px(s,t){switch(Fo(t),t.tag){case 3:$a(Js),A();break;case 26:case 27:case 5:_e(t);break;case 4:A();break;case 31:t.memoizedState!==null&&Vt(t);break;case 13:Vt(t);break;case 19:he(Xs);break;case 10:$a(t.type);break;case 22:case 23:Vt(t),ld(),s!==null&&he(Zl);break;case 24:$a(Js)}}function Ui(s,t){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var i=l.next;a=i;do{if((a.tag&s)===s){l=void 0;var o=a.create,m=a.inst;l=o(),m.destroy=l}a=a.next}while(a!==i)}}catch(p){_s(t,t.return,p)}}function Nl(s,t,a){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var o=i.next;l=o;do{if((l.tag&s)===s){var m=l.inst,p=m.destroy;if(p!==void 0){m.destroy=void 0,i=t;var C=a,I=p;try{I()}catch(ae){_s(i,C,ae)}}}l=l.next}while(l!==o)}}catch(ae){_s(t,t.return,ae)}}function gx(s){var t=s.updateQueue;if(t!==null){var a=s.stateNode;try{rh(t,a)}catch(l){_s(s,s.return,l)}}}function jx(s,t,a){a.props=en(s.type,s.memoizedProps),a.state=s.memoizedState;try{a.componentWillUnmount()}catch(l){_s(s,t,l)}}function Bi(s,t){try{var a=s.ref;if(a!==null){switch(s.tag){case 26:case 27:case 5:var l=s.stateNode;break;case 30:l=s.stateNode;break;default:l=s.stateNode}typeof a=="function"?s.refCleanup=a(l):a.current=l}}catch(i){_s(s,t,i)}}function ka(s,t){var a=s.ref,l=s.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(i){_s(s,t,i)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(i){_s(s,t,i)}else a.current=null}function vx(s){var t=s.type,a=s.memoizedProps,l=s.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(i){_s(s,s.return,i)}}function Ld(s,t,a){try{var l=s.stateNode;Uv(l,s.type,a,t),l[Ys]=t}catch(i){_s(s,s.return,i)}}function yx(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Tl(s.type)||s.tag===4}function Ud(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||yx(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Tl(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Bd(s,t,a){var l=s.tag;if(l===5||l===6)s=s.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(s,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(s),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=qa));else if(l!==4&&(l===27&&Tl(s.type)&&(a=s.stateNode,t=null),s=s.child,s!==null))for(Bd(s,t,a),s=s.sibling;s!==null;)Bd(s,t,a),s=s.sibling}function mc(s,t,a){var l=s.tag;if(l===5||l===6)s=s.stateNode,t?a.insertBefore(s,t):a.appendChild(s);else if(l!==4&&(l===27&&Tl(s.type)&&(a=s.stateNode),s=s.child,s!==null))for(mc(s,t,a),s=s.sibling;s!==null;)mc(s,t,a),s=s.sibling}function Nx(s){var t=s.stateNode,a=s.memoizedProps;try{for(var l=s.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);xt(t,l,a),t[Fe]=s,t[Ys]=a}catch(o){_s(s,s.return,o)}}var Ia=!1,et=!1,Hd=!1,bx=typeof WeakSet=="function"?WeakSet:Set,ct=null;function pv(s,t){if(s=s.containerInfo,iu=Dc,s=Om(s),Ao(s)){if("selectionStart"in s)var a={start:s.selectionStart,end:s.selectionEnd};else e:{a=(a=s.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var i=l.anchorOffset,o=l.focusNode;l=l.focusOffset;try{a.nodeType,o.nodeType}catch{a=null;break e}var m=0,p=-1,C=-1,I=0,ae=0,de=s,J=null;s:for(;;){for(var se;de!==a||i!==0&&de.nodeType!==3||(p=m+i),de!==o||l!==0&&de.nodeType!==3||(C=m+l),de.nodeType===3&&(m+=de.nodeValue.length),(se=de.firstChild)!==null;)J=de,de=se;for(;;){if(de===s)break s;if(J===a&&++I===i&&(p=m),J===o&&++ae===l&&(C=m),(se=de.nextSibling)!==null)break;de=J,J=de.parentNode}de=se}a=p===-1||C===-1?null:{start:p,end:C}}else a=null}a=a||{start:0,end:0}}else a=null;for(ru={focusedElem:s,selectionRange:a},Dc=!1,ct=t;ct!==null;)if(t=ct,s=t.child,(t.subtreeFlags&1028)!==0&&s!==null)s.return=t,ct=s;else for(;ct!==null;){switch(t=ct,o=t.alternate,s=t.flags,t.tag){case 0:if((s&4)!==0&&(s=t.updateQueue,s=s!==null?s.events:null,s!==null))for(a=0;a title"))),xt(o,l,a),o[Fe]=s,rt(o),l=o;break e;case"link":var m=Ef("link","href",i).get(l+(a.href||""));if(m){for(var p=0;pks&&(m=ks,ks=Oe,Oe=m);var G=Am(p,Oe),M=Am(p,ks);if(G&&M&&(se.rangeCount!==1||se.anchorNode!==G.node||se.anchorOffset!==G.offset||se.focusNode!==M.node||se.focusOffset!==M.offset)){var Z=de.createRange();Z.setStart(G.node,G.offset),se.removeAllRanges(),Oe>ks?(se.addRange(Z),se.extend(M.node,M.offset)):(Z.setEnd(M.node,M.offset),se.addRange(Z))}}}}for(de=[],se=p;se=se.parentNode;)se.nodeType===1&&de.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;pa?32:a,y.T=null,a=Yd,Yd=null;var o=Sl,m=sl;if(at=0,Gn=Sl=null,sl=0,(Ns&6)!==0)throw Error(d(331));var p=Ns;if(Ns|=4,Dx(o.current),zx(o,o.current,m,a),Ns=p,Qi(0,!1),Re&&typeof Re.onPostCommitFiberRoot=="function")try{Re.onPostCommitFiberRoot(Se,o)}catch{}return!0}finally{q.p=i,y.T=l,Jx(s,t)}}function Wx(s,t,a){t=aa(a,t),t=Sd(s.stateNode,t,2),s=jl(s,t,2),s!==null&&(tt(s,2),Ta(s))}function _s(s,t,a){if(s.tag===3)Wx(s,s,a);else for(;t!==null;){if(t.tag===3){Wx(t,s,a);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(_l===null||!_l.has(l))){s=aa(a,s),a=ex(2),l=jl(t,a,2),l!==null&&(sx(a,l,t,s),tt(l,2),Ta(l));break}}t=t.return}}function Id(s,t,a){var l=s.pingCache;if(l===null){l=s.pingCache=new vv;var i=new Set;l.set(t,i)}else i=l.get(t),i===void 0&&(i=new Set,l.set(t,i));i.has(a)||(Vd=!0,i.add(a),s=_v.bind(null,s,t,a),t.then(s,s))}function _v(s,t,a){var l=s.pingCache;l!==null&&l.delete(t),s.pingedLanes|=s.suspendedLanes&a,s.warmLanes&=~a,Ts===s&&(is&a)===a&&(Vs===4||Vs===3&&(is&62914560)===is&&300>Je()-fc?(Ns&2)===0&&Vn(s,0):Fd|=a,qn===is&&(qn=0)),Ta(s)}function ef(s,t){t===0&&(t=je()),s=Ql(s,t),s!==null&&(tt(s,t),Ta(s))}function Sv(s){var t=s.memoizedState,a=0;t!==null&&(a=t.retryLane),ef(s,a)}function Cv(s,t){var a=0;switch(s.tag){case 31:case 13:var l=s.stateNode,i=s.memoizedState;i!==null&&(a=i.retryLane);break;case 19:l=s.stateNode;break;case 22:l=s.stateNode._retryCache;break;default:throw Error(d(314))}l!==null&&l.delete(t),ef(s,a)}function kv(s,t){return Le(s,t)}var bc=null,Qn=null,Jd=!1,wc=!1,Pd=!1,kl=0;function Ta(s){s!==Qn&&s.next===null&&(Qn===null?bc=Qn=s:Qn=Qn.next=s),wc=!0,Jd||(Jd=!0,Ev())}function Qi(s,t){if(!Pd&&wc){Pd=!0;do for(var a=!1,l=bc;l!==null;){if(s!==0){var i=l.pendingLanes;if(i===0)var o=0;else{var m=l.suspendedLanes,p=l.pingedLanes;o=(1<<31-ot(42|s)+1)-1,o&=i&~(m&~p),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,lf(l,o))}else o=is,o=Ua(l,l===Ts?o:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(o&3)===0||ba(l,o)||(a=!0,lf(l,o));l=l.next}while(a);Pd=!1}}function Tv(){sf()}function sf(){wc=Jd=!1;var s=0;kl!==0&&Hv()&&(s=kl);for(var t=Je(),a=null,l=bc;l!==null;){var i=l.next,o=tf(l,t);o===0?(l.next=null,a===null?bc=i:a.next=i,i===null&&(Qn=a)):(a=l,(s!==0||(o&3)!==0)&&(wc=!0)),l=i}at!==0&&at!==5||Qi(s),kl!==0&&(kl=0)}function tf(s,t){for(var a=s.suspendedLanes,l=s.pingedLanes,i=s.expirationTimes,o=s.pendingLanes&-62914561;0p)break;var ae=C.transferSize,de=C.initiatorType;ae&&hf(de)&&(C=C.responseEnd,m+=ae*(C"u"?null:document;function Sf(s,t,a){var l=$n;if(l&&typeof t=="string"&&t){var i=sa(t);i='link[rel="'+s+'"][href="'+i+'"]',typeof a=="string"&&(i+='[crossorigin="'+a+'"]'),_f.has(i)||(_f.add(i),s={rel:s,crossOrigin:a,href:t},l.querySelector(i)===null&&(t=l.createElement("link"),xt(t,"link",s),rt(t),l.head.appendChild(t)))}}function Kv(s){tl.D(s),Sf("dns-prefetch",s,null)}function Zv(s,t){tl.C(s,t),Sf("preconnect",s,t)}function Iv(s,t,a){tl.L(s,t,a);var l=$n;if(l&&s&&t){var i='link[rel="preload"][as="'+sa(t)+'"]';t==="image"&&a&&a.imageSrcSet?(i+='[imagesrcset="'+sa(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(i+='[imagesizes="'+sa(a.imageSizes)+'"]')):i+='[href="'+sa(s)+'"]';var o=i;switch(t){case"style":o=Yn(s);break;case"script":o=Xn(s)}oa.has(o)||(s=k({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:s,as:t},a),oa.set(o,s),l.querySelector(i)!==null||t==="style"&&l.querySelector(Ki(o))||t==="script"&&l.querySelector(Zi(o))||(t=l.createElement("link"),xt(t,"link",s),rt(t),l.head.appendChild(t)))}}function Jv(s,t){tl.m(s,t);var a=$n;if(a&&s){var l=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+sa(l)+'"][href="'+sa(s)+'"]',o=i;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Xn(s)}if(!oa.has(o)&&(s=k({rel:"modulepreload",href:s},t),oa.set(o,s),a.querySelector(i)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Zi(o)))return}l=a.createElement("link"),xt(l,"link",s),rt(l),a.head.appendChild(l)}}}function Pv(s,t,a){tl.S(s,t,a);var l=$n;if(l&&s){var i=xn(l).hoistableStyles,o=Yn(s);t=t||"default";var m=i.get(o);if(!m){var p={loading:0,preload:null};if(m=l.querySelector(Ki(o)))p.loading=5;else{s=k({rel:"stylesheet",href:s,"data-precedence":t},a),(a=oa.get(o))&&xu(s,a);var C=m=l.createElement("link");rt(C),xt(C,"link",s),C._p=new Promise(function(I,ae){C.onload=I,C.onerror=ae}),C.addEventListener("load",function(){p.loading|=1}),C.addEventListener("error",function(){p.loading|=2}),p.loading|=4,Tc(m,t,l)}m={type:"stylesheet",instance:m,count:1,state:p},i.set(o,m)}}}function Wv(s,t){tl.X(s,t);var a=$n;if(a&&s){var l=xn(a).hoistableScripts,i=Xn(s),o=l.get(i);o||(o=a.querySelector(Zi(i)),o||(s=k({src:s,async:!0},t),(t=oa.get(i))&&fu(s,t),o=a.createElement("script"),rt(o),xt(o,"link",s),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},l.set(i,o))}}function ey(s,t){tl.M(s,t);var a=$n;if(a&&s){var l=xn(a).hoistableScripts,i=Xn(s),o=l.get(i);o||(o=a.querySelector(Zi(i)),o||(s=k({src:s,async:!0,type:"module"},t),(t=oa.get(i))&&fu(s,t),o=a.createElement("script"),rt(o),xt(o,"link",s),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},l.set(i,o))}}function Cf(s,t,a,l){var i=(i=le.current)?kc(i):null;if(!i)throw Error(d(446));switch(s){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Yn(a.href),a=xn(i).hoistableStyles,l=a.get(t),l||(l={type:"style",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){s=Yn(a.href);var o=xn(i).hoistableStyles,m=o.get(s);if(m||(i=i.ownerDocument||i,m={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(s,m),(o=i.querySelector(Ki(s)))&&!o._p&&(m.instance=o,m.state.loading=5),oa.has(s)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},oa.set(s,a),o||sy(i,s,a,m.state))),t&&l===null)throw Error(d(528,""));return m}if(t&&l!==null)throw Error(d(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Xn(a),a=xn(i).hoistableScripts,l=a.get(t),l||(l={type:"script",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(d(444,s))}}function Yn(s){return'href="'+sa(s)+'"'}function Ki(s){return'link[rel="stylesheet"]['+s+"]"}function kf(s){return k({},s,{"data-precedence":s.precedence,precedence:null})}function sy(s,t,a,l){s.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=s.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),xt(t,"link",a),rt(t),s.head.appendChild(t))}function Xn(s){return'[src="'+sa(s)+'"]'}function Zi(s){return"script[async]"+s}function Tf(s,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var l=s.querySelector('style[data-href~="'+sa(a.href)+'"]');if(l)return t.instance=l,rt(l),l;var i=k({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(s.ownerDocument||s).createElement("style"),rt(l),xt(l,"style",i),Tc(l,a.precedence,s),t.instance=l;case"stylesheet":i=Yn(a.href);var o=s.querySelector(Ki(i));if(o)return t.state.loading|=4,t.instance=o,rt(o),o;l=kf(a),(i=oa.get(i))&&xu(l,i),o=(s.ownerDocument||s).createElement("link"),rt(o);var m=o;return m._p=new Promise(function(p,C){m.onload=p,m.onerror=C}),xt(o,"link",l),t.state.loading|=4,Tc(o,a.precedence,s),t.instance=o;case"script":return o=Xn(a.src),(i=s.querySelector(Zi(o)))?(t.instance=i,rt(i),i):(l=a,(i=oa.get(o))&&(l=k({},a),fu(l,i)),s=s.ownerDocument||s,i=s.createElement("script"),rt(i),xt(i,"link",l),s.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(d(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Tc(l,a.precedence,s));return t.instance}function Tc(s,t,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=l.length?l[l.length-1]:null,o=i,m=0;m title"):null)}function ty(s,t,a){if(a===1||t.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return s=t.disabled,typeof t.precedence=="string"&&s==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Mf(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function ay(s,t,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var i=Yn(l.href),o=t.querySelector(Ki(i));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(s.count++,s=zc.bind(s),t.then(s,s)),a.state.loading|=4,a.instance=o,rt(o);return}o=t.ownerDocument||t,l=kf(l),(i=oa.get(i))&&xu(l,i),o=o.createElement("link"),rt(o);var m=o;m._p=new Promise(function(p,C){m.onload=p,m.onerror=C}),xt(o,"link",l),a.instance=o}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(s.count++,a=zc.bind(s),t.addEventListener("load",a),t.addEventListener("error",a))}}var pu=0;function ly(s,t){return s.stylesheets&&s.count===0&&Ac(s,s.stylesheets),0pu?50:800)+t);return s.unsuspend=a,function(){s.unsuspend=null,clearTimeout(l),clearTimeout(i)}}:null}function zc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ac(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Mc=null;function Ac(s,t){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Mc=new Map,t.forEach(ny,s),Mc=null,zc.call(s))}function ny(s,t){if(!(t.state.loading&4)){var a=Mc.get(s);if(a)var l=a.get(null);else{a=new Map,Mc.set(s,a);for(var i=s.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),ku.exports=Lb(),ku.exports}var Bb=Ub();function $(...n){return _y(Sy(n))}const Be=u.forwardRef(({className:n,...r},c)=>e.jsx("div",{ref:c,className:$("rounded-xl border bg-card text-card-foreground shadow",n),...r}));Be.displayName="Card";const gs=u.forwardRef(({className:n,...r},c)=>e.jsx("div",{ref:c,className:$("flex flex-col space-y-1.5 p-6",n),...r}));gs.displayName="CardHeader";const js=u.forwardRef(({className:n,...r},c)=>e.jsx("div",{ref:c,className:$("font-semibold leading-none tracking-tight",n),...r}));js.displayName="CardTitle";const Zs=u.forwardRef(({className:n,...r},c)=>e.jsx("div",{ref:c,className:$("text-sm text-muted-foreground",n),...r}));Zs.displayName="CardDescription";const bs=u.forwardRef(({className:n,...r},c)=>e.jsx("div",{ref:c,className:$("p-6 pt-0",n),...r}));bs.displayName="CardContent";const wg=u.forwardRef(({className:n,...r},c)=>e.jsx("div",{ref:c,className:$("flex items-center p-6 pt-0",n),...r}));wg.displayName="CardFooter";const Kt=Ty,Rt=u.forwardRef(({className:n,...r},c)=>e.jsx(yp,{ref:c,className:$("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",n),...r}));Rt.displayName=yp.displayName;const He=u.forwardRef(({className:n,...r},c)=>e.jsx(Np,{ref:c,className:$("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all duration-300 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",n),...r}));He.displayName=Np.displayName;const We=u.forwardRef(({className:n,...r},c)=>e.jsx(bp,{ref:c,className:$("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=active]:animate-in data-[state=active]:fade-in data-[state=active]:duration-300",n),...r}));We.displayName=bp.displayName;const es=u.forwardRef(({className:n,children:r,viewportRef:c,...d},h)=>e.jsxs(wp,{ref:h,className:$("relative overflow-hidden",n),...d,children:[e.jsx(Ey,{ref:c,className:"h-full w-full rounded-[inherit]",children:r}),e.jsx(Bu,{}),e.jsx(Bu,{orientation:"horizontal"}),e.jsx(zy,{})]}));es.displayName=wp.displayName;const Bu=u.forwardRef(({className:n,orientation:r="vertical",...c},d)=>e.jsx(_p,{ref:d,orientation:r,className:$("flex touch-none select-none transition-colors",r==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",r==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",n),...c,children:e.jsx(My,{className:"relative flex-1 rounded-full bg-border"})}));Bu.displayName=_p.displayName;function Hb({className:n,...r}){return e.jsx("div",{className:$("animate-pulse rounded-md bg-primary/10",n),...r})}const Sr=u.forwardRef(({className:n,value:r,...c},d)=>e.jsx(Sp,{ref:d,className:$("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",n),...c,children:e.jsx(Ay,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(r||0)}%)`}})}));Sr.displayName=Sp.displayName;const qb={light:"",dark:".dark"},_g=u.createContext(null);function Sg(){const n=u.useContext(_g);if(!n)throw new Error("useChart must be used within a ");return n}const Zn=u.forwardRef(({id:n,className:r,children:c,config:d,...h},x)=>{const f=u.useId(),j=`chart-${n||f.replace(/:/g,"")}`;return e.jsx(_g.Provider,{value:{config:d},children:e.jsxs("div",{"data-chart":j,ref:x,className:$("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",r),...h,children:[e.jsx(Gb,{id:j,config:d}),e.jsx(Iy,{children:c})]})})});Zn.displayName="Chart";const Gb=({id:n,config:r})=>{const c=Object.entries(r).filter(([,d])=>d.theme||d.color);return c.length?e.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(qb).map(([d,h])=>` +${h} [data-chart=${n}] { +${c.map(([x,f])=>{const j=f.theme?.[d]||f.color;return j?` --color-${x}: ${j};`:null}).join(` +`)} +} +`).join(` +`)}}):null},lr=Jy,In=u.forwardRef(({active:n,payload:r,className:c,indicator:d="dot",hideLabel:h=!1,hideIndicator:x=!1,label:f,labelFormatter:j,labelClassName:g,formatter:_,color:v,nameKey:k,labelKey:z},T)=>{const{config:L}=Sg(),K=u.useMemo(()=>{if(h||!r?.length)return null;const[R]=r,ee=`${z||R?.dataKey||R?.name||"value"}`,V=Hu(L,R,ee),E=!z&&typeof f=="string"?L[f]?.label||f:V?.label;return j?e.jsx("div",{className:$("font-medium",g),children:j(E,r)}):E?e.jsx("div",{className:$("font-medium",g),children:E}):null},[f,j,r,h,g,L,z]);if(!n||!r?.length)return null;const U=r.length===1&&d!=="dot";return e.jsxs("div",{ref:T,className:$("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",c),children:[U?null:K,e.jsx("div",{className:"grid gap-1.5",children:r.filter(R=>R.type!=="none").map((R,ee)=>{const V=`${k||R.name||R.dataKey||"value"}`,E=Hu(L,R,V),B=v||R.payload.fill||R.color;return e.jsx("div",{className:$("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",d==="dot"&&"items-center"),children:_&&R?.value!==void 0&&R.name?_(R.value,R.name,R,ee,R.payload):e.jsxs(e.Fragment,{children:[E?.icon?e.jsx(E.icon,{}):!x&&e.jsx("div",{className:$("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":d==="dot","w-1":d==="line","w-0 border-[1.5px] border-dashed bg-transparent":d==="dashed","my-0.5":U&&d==="dashed"}),style:{"--color-bg":B,"--color-border":B}}),e.jsxs("div",{className:$("flex flex-1 justify-between leading-none",U?"items-end":"items-center"),children:[e.jsxs("div",{className:"grid gap-1.5",children:[U?K:null,e.jsx("span",{className:"text-muted-foreground",children:E?.label||R.name})]}),R.value&&e.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:R.value.toLocaleString()})]})]})},R.dataKey)})})]})});In.displayName="ChartTooltip";const Vb=Py,Cg=u.forwardRef(({className:n,hideIcon:r=!1,payload:c,verticalAlign:d="bottom",nameKey:h},x)=>{const{config:f}=Sg();return c?.length?e.jsx("div",{ref:x,className:$("flex items-center justify-center gap-4",d==="top"?"pb-3":"pt-3",n),children:c.filter(j=>j.type!=="none").map(j=>{const g=`${h||j.dataKey||"value"}`,_=Hu(f,j,g);return e.jsxs("div",{className:$("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[_?.icon&&!r?e.jsx(_.icon,{}):e.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:j.color}}),_?.label]},j.value)})}):null});Cg.displayName="ChartLegend";function Hu(n,r,c){if(typeof r!="object"||r===null)return;const d="payload"in r&&typeof r.payload=="object"&&r.payload!==null?r.payload:void 0;let h=c;return c in r&&typeof r[c]=="string"?h=r[c]:d&&c in d&&typeof d[c]=="string"&&(h=d[c]),h in n?n[h]:n[c]}const gr=ai("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring 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 hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),N=u.forwardRef(({className:n,variant:r,size:c,asChild:d=!1,...h},x)=>{const f=d?lN:"button";return e.jsx(f,{className:$(gr({variant:r,size:c,className:n})),ref:x,...h})});N.displayName="Button";const Fb=ai("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Xe({className:n,variant:r,...c}){return e.jsx("div",{className:$(Fb({variant:r}),n),...c})}const Qb=5,$b=5e3;let zu=0;function Yb(){return zu=(zu+1)%Number.MAX_SAFE_INTEGER,zu.toString()}const Mu=new Map,tp=n=>{if(Mu.has(n))return;const r=setTimeout(()=>{Mu.delete(n),ur({type:"REMOVE_TOAST",toastId:n})},$b);Mu.set(n,r)},Xb=(n,r)=>{switch(r.type){case"ADD_TOAST":return{...n,toasts:[r.toast,...n.toasts].slice(0,Qb)};case"UPDATE_TOAST":return{...n,toasts:n.toasts.map(c=>c.id===r.toast.id?{...c,...r.toast}:c)};case"DISMISS_TOAST":{const{toastId:c}=r;return c?tp(c):n.toasts.forEach(d=>{tp(d.id)}),{...n,toasts:n.toasts.map(d=>d.id===c||c===void 0?{...d,open:!1}:d)}}case"REMOVE_TOAST":return r.toastId===void 0?{...n,toasts:[]}:{...n,toasts:n.toasts.filter(c=>c.id!==r.toastId)}}},Zc=[];let Ic={toasts:[]};function ur(n){Ic=Xb(Ic,n),Zc.forEach(r=>{r(Ic)})}function Kb({...n}){const r=Yb(),c=h=>ur({type:"UPDATE_TOAST",toast:{...h,id:r}}),d=()=>ur({type:"DISMISS_TOAST",toastId:r});return ur({type:"ADD_TOAST",toast:{...n,id:r,open:!0,onOpenChange:h=>{h||d()}}}),{id:r,dismiss:d,update:c}}function Bs(){const[n,r]=u.useState(Ic);return u.useEffect(()=>(Zc.push(r),()=>{const c=Zc.indexOf(r);c>-1&&Zc.splice(c,1)}),[n]),{...n,toast:Kb,dismiss:c=>ur({type:"DISMISS_TOAST",toastId:c})}}const Zb=n=>{const r=[];for(let c=0;c{try{T(!0);const H=await qc.get("https://v1.hitokoto.cn/?c=a&c=b&c=c&c=d&c=h&c=i&c=k");k({hitokoto:H.data.hitokoto,from:H.data.from||H.data.from_who||"未知"})}catch(H){console.error("获取一言失败:",H),k({hitokoto:"人生就像一盒巧克力,你永远不知道下一颗是什么味道。",from:"阿甘正传"})}finally{T(!1)}},[]),E=u.useCallback(async()=>{try{const H=localStorage.getItem("access-token"),ne=await qc.get("/api/webui/system/status",{headers:{Authorization:`Bearer ${H}`}});K(ne.data)}catch(H){console.error("获取机器人状态失败:",H),K(null)}},[]),B=async()=>{if(!U)try{R(!0);const H=localStorage.getItem("access-token");await qc.post("/api/webui/system/restart",{},{headers:{Authorization:`Bearer ${H}`}}),ee({title:"重启中",description:"麦麦正在重启,请稍候..."}),setTimeout(()=>{E(),R(!1)},3e3)}catch(H){console.error("重启失败:",H),ee({title:"重启失败",description:"无法重启麦麦,请检查控制台",variant:"destructive"}),R(!1)}},X=u.useCallback(async()=>{try{const H=localStorage.getItem("access-token"),ne=await qc.get(`/api/webui/statistics/dashboard?hours=${f}`,{headers:{Authorization:`Bearer ${H}`}});r(ne.data),d(!1),x(100)}catch(H){console.error("Failed to fetch dashboard data:",H),d(!1),x(100)}},[f]);if(u.useEffect(()=>{if(!c)return;x(0);const H=setTimeout(()=>x(15),200),ne=setTimeout(()=>x(30),800),S=setTimeout(()=>x(45),2e3),me=setTimeout(()=>x(60),4e3),he=setTimeout(()=>x(75),6500),Q=setTimeout(()=>x(85),9e3),oe=setTimeout(()=>x(92),11e3);return()=>{clearTimeout(H),clearTimeout(ne),clearTimeout(S),clearTimeout(me),clearTimeout(he),clearTimeout(Q),clearTimeout(oe)}},[c]),u.useEffect(()=>{X(),V(),E()},[X,V,E]),u.useEffect(()=>{if(!g)return;const H=setInterval(()=>{X(),E()},3e4);return()=>clearInterval(H)},[g,X,E]),c||!n)return e.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:e.jsxs("div",{className:"text-center space-y-6 w-full max-w-md px-4",children:[e.jsx(ft,{className:"h-12 w-12 animate-spin mx-auto text-primary"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-lg font-medium",children:"加载统计数据中..."}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"正在获取麦麦运行数据"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Sr,{value:h,className:"h-2"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[h,"%"]})]})]})});const{summary:w,model_stats:D=[],hourly_data:te=[],daily_data:xe=[],recent_activity:be=[]}=n,ye=w??{total_requests:0,total_cost:0,total_tokens:0,online_time:0,total_messages:0,total_replies:0,avg_response_time:0,cost_per_hour:0,tokens_per_hour:0},ve=H=>{const ne=Math.floor(H/3600),S=Math.floor(H%3600/60);return`${ne}小时${S}分钟`},pe=H=>new Date(H).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),Ne=Zb(D.length),y=D.map((H,ne)=>({name:H.model_name,value:H.request_count,fill:Ne[ne]})),q={requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"},tokens:{label:"Tokens",color:"hsl(var(--chart-3))"}};return e.jsx(es,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"实时监控面板"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"麦麦运行状态和统计数据一览"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Kt,{value:f.toString(),onValueChange:H=>j(Number(H)),children:e.jsxs(Rt,{className:"grid grid-cols-3 w-full sm:w-auto",children:[e.jsx(He,{value:"24",children:"24小时"}),e.jsx(He,{value:"168",children:"7天"}),e.jsx(He,{value:"720",children:"30天"})]})}),e.jsxs(N,{variant:g?"default":"outline",size:"sm",onClick:()=>_(!g),className:"gap-2",children:[e.jsx(ft,{className:`h-4 w-4 ${g?"animate-spin":""}`}),e.jsx("span",{className:"hidden sm:inline",children:"自动刷新"})]}),e.jsx(N,{variant:"outline",size:"sm",onClick:X,children:e.jsx(ft,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 rounded-lg border border-dashed border-muted-foreground/30 bg-muted/20",children:[z?e.jsx(Hb,{className:"h-5 flex-1"}):v?e.jsxs("p",{className:"flex-1 text-sm text-muted-foreground italic truncate",children:['"',v.hitokoto,'" —— ',v.from]}):null,e.jsx(N,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",onClick:V,disabled:z,children:e.jsx(ft,{className:`h-3.5 w-3.5 ${z?"animate-spin":""}`})})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-3",children:[e.jsxs(Be,{className:"lg:col-span-1",children:[e.jsx(gs,{className:"pb-3",children:e.jsxs(js,{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(Nr,{className:"h-4 w-4"}),"麦麦状态"]})}),e.jsx(bs,{children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"flex items-center gap-2",children:L?.running?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-3 w-3 rounded-full bg-green-500 animate-pulse"}),e.jsxs(Xe,{variant:"outline",className:"text-green-600 border-green-300 bg-green-50",children:[e.jsx(xa,{className:"h-3 w-3 mr-1"}),"运行中"]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-3 w-3 rounded-full bg-red-500"}),e.jsxs(Xe,{variant:"outline",className:"text-red-600 border-red-300 bg-red-50",children:[e.jsx(Aa,{className:"h-3 w-3 mr-1"}),"已停止"]})]})}),L&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.jsxs("span",{children:["v",L.version]}),e.jsx("span",{className:"mx-2",children:"|"}),e.jsxs("span",{children:["运行 ",ve(L.uptime)]})]})]})})]}),e.jsxs(Be,{className:"lg:col-span-2",children:[e.jsx(gs,{className:"pb-3",children:e.jsxs(js,{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(ln,{className:"h-4 w-4"}),"快速操作"]})}),e.jsx(bs,{children:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(N,{variant:"outline",size:"sm",onClick:B,disabled:U,className:"gap-2",children:[e.jsx(Wc,{className:`h-4 w-4 ${U?"animate-spin":""}`}),U?"重启中...":"重启麦麦"]}),e.jsx(N,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:e.jsxs(Kc,{to:"/logs",children:[e.jsx(Ma,{className:"h-4 w-4"}),"查看日志"]})}),e.jsx(N,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:e.jsxs(Kc,{to:"/plugins",children:[e.jsx(NN,{className:"h-4 w-4"}),"插件管理"]})}),e.jsx(N,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:e.jsxs(Kc,{to:"/settings",children:[e.jsx(Rl,{className:"h-4 w-4"}),"系统设置"]})})]})})]})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[e.jsxs(Be,{children:[e.jsxs(gs,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(js,{className:"text-sm font-medium",children:"总请求数"}),e.jsx(bN,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(bs,{children:[e.jsx("div",{className:"text-2xl font-bold",children:ye.total_requests.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["最近",f<48?f+"小时":Math.floor(f/24)+"天"]})]})]}),e.jsxs(Be,{children:[e.jsxs(gs,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(js,{className:"text-sm font-medium",children:"总花费"}),e.jsx(wN,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(bs,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:["¥",ye.total_cost.toFixed(2)]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:ye.cost_per_hour>0?`¥${ye.cost_per_hour.toFixed(2)}/小时`:"暂无数据"})]})]}),e.jsxs(Be,{children:[e.jsxs(gs,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(js,{className:"text-sm font-medium",children:"Token消耗"}),e.jsx(eo,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(bs,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:[(ye.total_tokens/1e3).toFixed(1),"K"]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:ye.tokens_per_hour>0?`${(ye.tokens_per_hour/1e3).toFixed(1)}K/小时`:"暂无数据"})]})]}),e.jsxs(Be,{children:[e.jsxs(gs,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(js,{className:"text-sm font-medium",children:"平均响应"}),e.jsx(ln,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(bs,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:[ye.avg_response_time.toFixed(2),"s"]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"API平均耗时"})]})]})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-3",children:[e.jsxs(Be,{children:[e.jsxs(gs,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(js,{className:"text-sm font-medium",children:"在线时长"}),e.jsx(Wn,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx(bs,{children:e.jsx("div",{className:"text-xl font-bold",children:ve(ye.online_time)})})]}),e.jsxs(Be,{children:[e.jsxs(gs,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(js,{className:"text-sm font-medium",children:"消息处理"}),e.jsx(si,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(bs,{children:[e.jsx("div",{className:"text-xl font-bold",children:ye.total_messages.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["回复 ",ye.total_replies.toLocaleString()," 条"]})]})]}),e.jsxs(Be,{children:[e.jsxs(gs,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(js,{className:"text-sm font-medium",children:"成本效率"}),e.jsx(_N,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(bs,{children:[e.jsx("div",{className:"text-xl font-bold",children:ye.total_messages>0?`¥${(ye.total_cost/ye.total_messages*100).toFixed(2)}`:"¥0.00"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"每100条消息"})]})]})]}),e.jsxs(Kt,{defaultValue:"trends",className:"space-y-4",children:[e.jsxs(Rt,{className:"grid w-full grid-cols-2 sm:grid-cols-4",children:[e.jsx(He,{value:"trends",children:"趋势"}),e.jsx(He,{value:"models",children:"模型"}),e.jsx(He,{value:"activity",children:"活动"}),e.jsx(He,{value:"daily",children:"日统计"})]}),e.jsxs(We,{value:"trends",className:"space-y-4",children:[e.jsxs(Be,{children:[e.jsxs(gs,{children:[e.jsx(js,{children:"请求趋势"}),e.jsxs(Zs,{children:["最近",f,"小时的请求量变化"]})]}),e.jsx(bs,{children:e.jsx(Zn,{config:q,className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:e.jsxs(Wy,{data:te,children:[e.jsx(Gc,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),e.jsx(Vc,{dataKey:"timestamp",tickFormatter:H=>pe(H),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(tr,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(lr,{content:e.jsx(In,{labelFormatter:H=>pe(H)})}),e.jsx(eN,{type:"monotone",dataKey:"requests",stroke:"var(--color-requests)",strokeWidth:2})]})})})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[e.jsxs(Be,{children:[e.jsxs(gs,{children:[e.jsx(js,{children:"花费趋势"}),e.jsx(Zs,{children:"API调用成本变化"})]}),e.jsx(bs,{children:e.jsx(Zn,{config:q,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:e.jsxs(Su,{data:te,children:[e.jsx(Gc,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),e.jsx(Vc,{dataKey:"timestamp",tickFormatter:H=>pe(H),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(tr,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(lr,{content:e.jsx(In,{labelFormatter:H=>pe(H)})}),e.jsx(Fc,{dataKey:"cost",fill:"var(--color-cost)"})]})})})]}),e.jsxs(Be,{children:[e.jsxs(gs,{children:[e.jsx(js,{children:"Token消耗"}),e.jsx(Zs,{children:"Token使用量变化"})]}),e.jsx(bs,{children:e.jsx(Zn,{config:q,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:e.jsxs(Su,{data:te,children:[e.jsx(Gc,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),e.jsx(Vc,{dataKey:"timestamp",tickFormatter:H=>pe(H),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(tr,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(lr,{content:e.jsx(In,{labelFormatter:H=>pe(H)})}),e.jsx(Fc,{dataKey:"tokens",fill:"var(--color-tokens)"})]})})})]})]})]}),e.jsx(We,{value:"models",className:"space-y-4",children:e.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[e.jsxs(Be,{children:[e.jsxs(gs,{children:[e.jsx(js,{children:"模型请求分布"}),e.jsxs(Zs,{children:["各模型使用占比 (共 ",D.length," 个模型)"]})]}),e.jsx(bs,{children:e.jsx(Zn,{config:Object.fromEntries(D.map((H,ne)=>[H.model_name,{label:H.model_name,color:Ne[ne]}])),className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:e.jsxs(sN,{children:[e.jsx(lr,{content:e.jsx(In,{})}),e.jsx(tN,{data:y,cx:"50%",cy:"50%",labelLine:!1,label:({name:H,percent:ne})=>ne&&ne<.05?"":`${H} ${ne?(ne*100).toFixed(0):0}%`,outerRadius:100,dataKey:"value",children:y.map((H,ne)=>e.jsx(aN,{fill:H.fill},`cell-${ne}`))})]})})})]}),e.jsxs(Be,{children:[e.jsxs(gs,{children:[e.jsx(js,{children:"模型详细统计"}),e.jsx(Zs,{children:"请求数、花费和性能"})]}),e.jsx(bs,{children:e.jsx(es,{className:"h-[300px] sm:h-[400px]",children:e.jsx("div",{className:"space-y-3",children:D.map((H,ne)=>e.jsxs("div",{className:"p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h4",{className:"font-semibold text-sm truncate flex-1 min-w-0",children:H.model_name}),e.jsx("div",{className:"w-3 h-3 rounded-full ml-2 flex-shrink-0",style:{backgroundColor:`hsl(var(--chart-${ne%5+1}))`}})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"请求数:"}),e.jsx("span",{className:"ml-1 font-medium",children:H.request_count.toLocaleString()})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"花费:"}),e.jsxs("span",{className:"ml-1 font-medium",children:["¥",H.total_cost.toFixed(2)]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),e.jsxs("span",{className:"ml-1 font-medium",children:[(H.total_tokens/1e3).toFixed(1),"K"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"平均耗时:"}),e.jsxs("span",{className:"ml-1 font-medium",children:[H.avg_response_time.toFixed(2),"s"]})]})]})]},ne))})})})]})]})}),e.jsx(We,{value:"activity",children:e.jsxs(Be,{children:[e.jsxs(gs,{children:[e.jsx(js,{children:"最近活动"}),e.jsx(Zs,{children:"最新的API调用记录"})]}),e.jsx(bs,{children:e.jsx(es,{className:"h-[400px] sm:h-[500px]",children:e.jsx("div",{className:"space-y-2",children:be.map((H,ne)=>e.jsxs("div",{className:"p-3 sm:p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium text-sm truncate",children:H.model}),e.jsx("div",{className:"text-xs text-muted-foreground",children:H.request_type})]}),e.jsx("div",{className:"text-xs text-muted-foreground flex-shrink-0",children:pe(H.timestamp)})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-xs",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),e.jsx("span",{className:"ml-1",children:H.tokens})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"花费:"}),e.jsxs("span",{className:"ml-1",children:["¥",H.cost.toFixed(4)]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"耗时:"}),e.jsxs("span",{className:"ml-1",children:[H.time_cost.toFixed(2),"s"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"状态:"}),e.jsx("span",{className:`ml-1 ${H.status==="success"?"text-green-600":"text-red-600"}`,children:H.status})]})]})]},ne))})})})]})}),e.jsx(We,{value:"daily",children:e.jsxs(Be,{children:[e.jsxs(gs,{children:[e.jsx(js,{children:"每日统计"}),e.jsx(Zs,{children:"最近7天的数据汇总"})]}),e.jsx(bs,{children:e.jsx(Zn,{config:{requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"}},className:"h-[400px] sm:h-[500px] w-full aspect-auto",children:e.jsxs(Su,{data:xe,children:[e.jsx(Gc,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),e.jsx(Vc,{dataKey:"timestamp",tickFormatter:H=>{const ne=new Date(H);return`${ne.getMonth()+1}/${ne.getDate()}`},stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(tr,{yAxisId:"left",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(tr,{yAxisId:"right",orientation:"right",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(lr,{content:e.jsx(In,{labelFormatter:H=>new Date(H).toLocaleDateString("zh-CN")})}),e.jsx(Vb,{content:e.jsx(Cg,{})}),e.jsx(Fc,{yAxisId:"left",dataKey:"requests",fill:"var(--color-requests)"}),e.jsx(Fc,{yAxisId:"right",dataKey:"cost",fill:"var(--color-cost)"})]})})})]})})]})]})})}const Jb={theme:"system",setTheme:()=>null},kg=u.createContext(Jb),Yu=()=>{const n=u.useContext(kg);if(n===void 0)throw new Error("useTheme must be used within a ThemeProvider");return n},Pb=(n,r,c)=>{const d=document.documentElement.classList.contains("no-animations");if(!document.startViewTransition||d){r(n);return}const h=c.clientX,x=c.clientY,f=Math.hypot(Math.max(h,innerWidth-h),Math.max(x,innerHeight-x));document.startViewTransition(()=>{r(n)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${h}px ${x}px)`,`circle(${f}px at ${h}px ${x}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},Tg=u.createContext(void 0),Eg=()=>{const n=u.useContext(Tg);if(n===void 0)throw new Error("useAnimation must be used within an AnimationProvider");return n},qe=u.forwardRef(({className:n,...r},c)=>e.jsx(Cp,{className:$("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",n),...r,ref:c,children:e.jsx(Dy,{className:$("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));qe.displayName=Cp.displayName;const Wb=ai("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),b=u.forwardRef(({className:n,...r},c)=>e.jsx(Kp,{ref:c,className:$(Wb(),n),...r}));b.displayName=Kp.displayName;const ce=u.forwardRef(({className:n,type:r,...c},d)=>e.jsx("input",{type:r,className:$("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",n),ref:d,...c}));ce.displayName="Input";const e0=[{id:"minLength",label:"长度至少 10 位",description:"Token 长度必须大于等于 10 个字符",validate:n=>n.length>=10},{id:"hasUppercase",label:"包含大写字母",description:"至少包含一个大写字母 (A-Z)",validate:n=>/[A-Z]/.test(n)},{id:"hasLowercase",label:"包含小写字母",description:"至少包含一个小写字母 (a-z)",validate:n=>/[a-z]/.test(n)},{id:"hasSpecialChar",label:"包含特殊符号",description:"至少包含一个特殊符号 (!@#$%^&*()_+-=[]{}|;:,.<>?/)",validate:n=>/[!@#$%^&*()_+\-=[\]{}|;:,.<>?/]/.test(n)}];function s0(n){const r=e0.map(d=>({id:d.id,label:d.label,description:d.description,passed:d.validate(n)}));return{isValid:r.every(d=>d.passed),rules:r}}const Xu="0.11.6 Beta",Ku="MaiBot Dashboard",t0=`${Ku} v${Xu}`,a0=(n="v")=>`${n}${Xu}`,_t={THEME:"maibot-ui-theme",ACCENT_COLOR:"accent-color",ENABLE_ANIMATIONS:"maibot-animations",ENABLE_WAVES_BACKGROUND:"maibot-waves-background",LOG_CACHE_SIZE:"maibot-log-cache-size",LOG_AUTO_SCROLL:"maibot-log-auto-scroll",LOG_FONT_SIZE:"maibot-log-font-size",LOG_LINE_SPACING:"maibot-log-line-spacing",DATA_SYNC_INTERVAL:"maibot-data-sync-interval",WS_RECONNECT_INTERVAL:"maibot-ws-reconnect-interval",WS_MAX_RECONNECT_ATTEMPTS:"maibot-ws-max-reconnect-attempts",ACCESS_TOKEN:"access-token",COMPLETED_TOURS:"maibot-completed-tours"},Ea={theme:"system",accentColor:"blue",enableAnimations:!0,enableWavesBackground:!0,logCacheSize:1e3,logAutoScroll:!0,logFontSize:"xs",logLineSpacing:4,dataSyncInterval:30,wsReconnectInterval:3e3,wsMaxReconnectAttempts:10};function Fs(n){const r=zg(n),c=localStorage.getItem(r);if(c===null)return Ea[n];const d=Ea[n];if(typeof d=="boolean")return c==="true";if(typeof d=="number"){const h=parseFloat(c);return isNaN(h)?d:h}return c}function Pn(n,r){const c=zg(n);localStorage.setItem(c,String(r)),window.dispatchEvent(new CustomEvent("maibot-settings-change",{detail:{key:n,value:r}}))}function l0(){return{theme:Fs("theme"),accentColor:Fs("accentColor"),enableAnimations:Fs("enableAnimations"),enableWavesBackground:Fs("enableWavesBackground"),logCacheSize:Fs("logCacheSize"),logAutoScroll:Fs("logAutoScroll"),logFontSize:Fs("logFontSize"),logLineSpacing:Fs("logLineSpacing"),dataSyncInterval:Fs("dataSyncInterval"),wsReconnectInterval:Fs("wsReconnectInterval"),wsMaxReconnectAttempts:Fs("wsMaxReconnectAttempts")}}function n0(){const n=l0(),r=localStorage.getItem(_t.COMPLETED_TOURS),c=r?JSON.parse(r):[];return{...n,completedTours:c}}function i0(n){const r=[],c=[];for(const[d,h]of Object.entries(n)){if(d==="completedTours"){Array.isArray(h)?(localStorage.setItem(_t.COMPLETED_TOURS,JSON.stringify(h)),r.push("completedTours")):c.push("completedTours");continue}if(d in Ea){const x=d,f=Ea[x];if(typeof h==typeof f){if(x==="theme"&&!["light","dark","system"].includes(h)){c.push(d);continue}if(x==="logFontSize"&&!["xs","sm","base"].includes(h)){c.push(d);continue}Pn(x,h),r.push(d)}else c.push(d)}else c.push(d)}return{success:r.length>0,imported:r,skipped:c}}function r0(){for(const n of Object.keys(Ea))Pn(n,Ea[n]);localStorage.removeItem(_t.COMPLETED_TOURS),window.dispatchEvent(new CustomEvent("maibot-settings-reset"))}function c0(){const n=[],r=[],c=new Set([_t.ACCESS_TOKEN]),d=[];for(let h=0;hd.size-c.size),{used:n,items:localStorage.length,details:r}}function o0(n){if(n===0)return"0 B";const r=1024,c=["B","KB","MB"],d=Math.floor(Math.log(n)/Math.log(r));return parseFloat((n/Math.pow(r,d)).toFixed(2))+" "+c[d]}function zg(n){return{theme:_t.THEME,accentColor:_t.ACCENT_COLOR,enableAnimations:_t.ENABLE_ANIMATIONS,enableWavesBackground:_t.ENABLE_WAVES_BACKGROUND,logCacheSize:_t.LOG_CACHE_SIZE,logAutoScroll:_t.LOG_AUTO_SCROLL,logFontSize:_t.LOG_FONT_SIZE,logLineSpacing:_t.LOG_LINE_SPACING,dataSyncInterval:_t.DATA_SYNC_INTERVAL,wsReconnectInterval:_t.WS_RECONNECT_INTERVAL,wsMaxReconnectAttempts:_t.WS_MAX_RECONNECT_ATTEMPTS}[n]}const za=u.forwardRef(({className:n,...r},c)=>e.jsxs(kp,{ref:c,className:$("relative flex w-full touch-none select-none items-center",n),...r,children:[e.jsx(Oy,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:e.jsx(Ry,{className:"absolute h-full bg-primary"})}),e.jsx(Ly,{className:"block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"})]}));za.displayName=kp.displayName;class d0{ws=null;reconnectTimeout=null;reconnectAttempts=0;heartbeatInterval=null;logCallbacks=new Set;connectionCallbacks=new Set;isConnected=!1;logCache=[];getMaxCacheSize(){return Fs("logCacheSize")}getMaxReconnectAttempts(){return Fs("wsMaxReconnectAttempts")}getReconnectInterval(){return Fs("wsReconnectInterval")}getWebSocketUrl(){{const r=window.location.protocol==="https:"?"wss:":"ws:",c=window.location.host;return`${r}//${c}/ws/logs`}}connect(){if(this.ws?.readyState===WebSocket.OPEN||this.ws?.readyState===WebSocket.CONNECTING)return;const r=this.getWebSocketUrl();try{this.ws=new WebSocket(r),this.ws.onopen=()=>{this.isConnected=!0,this.reconnectAttempts=0,this.notifyConnection(!0),this.startHeartbeat()},this.ws.onmessage=c=>{try{if(c.data==="pong")return;const d=JSON.parse(c.data);this.notifyLog(d)}catch(d){console.error("解析日志消息失败:",d)}},this.ws.onerror=c=>{console.error("❌ WebSocket 错误:",c),this.isConnected=!1,this.notifyConnection(!1)},this.ws.onclose=()=>{this.isConnected=!1,this.notifyConnection(!1),this.stopHeartbeat(),this.attemptReconnect()}}catch(c){console.error("创建 WebSocket 连接失败:",c),this.attemptReconnect()}}attemptReconnect(){const r=this.getMaxReconnectAttempts();if(this.reconnectAttempts>=r)return;this.reconnectAttempts+=1;const c=this.getReconnectInterval(),d=Math.min(c*this.reconnectAttempts,3e4);this.reconnectTimeout=window.setTimeout(()=>{this.connect()},d)}startHeartbeat(){this.heartbeatInterval=window.setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send("ping")},3e4)}stopHeartbeat(){this.heartbeatInterval!==null&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null)}disconnect(){this.reconnectTimeout!==null&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.stopHeartbeat(),this.ws&&(this.ws.close(),this.ws=null),this.isConnected=!1,this.reconnectAttempts=0}onLog(r){return this.logCallbacks.add(r),()=>this.logCallbacks.delete(r)}onConnectionChange(r){return this.connectionCallbacks.add(r),r(this.isConnected),()=>this.connectionCallbacks.delete(r)}notifyLog(r){if(!this.logCache.some(d=>d.id===r.id)){this.logCache.push(r);const d=this.getMaxCacheSize();this.logCache.length>d&&(this.logCache=this.logCache.slice(-d)),this.logCallbacks.forEach(h=>{try{h(r)}catch(x){console.error("日志回调执行失败:",x)}})}}notifyConnection(r){this.connectionCallbacks.forEach(c=>{try{c(r)}catch(d){console.error("连接状态回调执行失败:",d)}})}getAllLogs(){return[...this.logCache]}clearLogs(){this.logCache=[]}getConnectionStatus(){return this.isConnected}}const an=new d0;typeof window<"u"&&an.connect();const Os=iN,ni=rN,u0=nN,Zu=Jp,Mg=u.forwardRef(({className:n,...r},c)=>e.jsx(Zp,{ref:c,className:$("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n),...r}));Mg.displayName=Zp.displayName;const Es=u.forwardRef(({className:n,children:r,preventOutsideClose:c=!1,...d},h)=>e.jsxs(u0,{children:[e.jsx(Mg,{}),e.jsxs(Ip,{ref:h,className:$("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n),onPointerDownOutside:c?x=>x.preventDefault():void 0,onInteractOutside:c?x=>x.preventDefault():void 0,...d,children:[r,e.jsxs(Jp,{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 data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(li,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Es.displayName=Ip.displayName;const zs=({className:n,...r})=>e.jsx("div",{className:$("flex flex-col space-y-1.5 text-center sm:text-left",n),...r});zs.displayName="DialogHeader";const Is=({className:n,...r})=>e.jsx("div",{className:$("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...r});Is.displayName="DialogFooter";const Ms=u.forwardRef(({className:n,...r},c)=>e.jsx(Pp,{ref:c,className:$("text-lg font-semibold leading-none tracking-tight",n),...r}));Ms.displayName=Pp.displayName;const $s=u.forwardRef(({className:n,...r},c)=>e.jsx(Wp,{ref:c,className:$("text-sm text-muted-foreground",n),...r}));$s.displayName=Wp.displayName;const ps=By,Qs=Hy,m0=Uy,Ag=u.forwardRef(({className:n,...r},c)=>e.jsx(Tp,{className:$("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n),...r,ref:c}));Ag.displayName=Tp.displayName;const cs=u.forwardRef(({className:n,...r},c)=>e.jsxs(m0,{children:[e.jsx(Ag,{}),e.jsx(Ep,{ref:c,className:$("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n),...r})]}));cs.displayName=Ep.displayName;const os=({className:n,...r})=>e.jsx("div",{className:$("flex flex-col space-y-2 text-center sm:text-left",n),...r});os.displayName="AlertDialogHeader";const ds=({className:n,...r})=>e.jsx("div",{className:$("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...r});ds.displayName="AlertDialogFooter";const us=u.forwardRef(({className:n,...r},c)=>e.jsx(zp,{ref:c,className:$("text-lg font-semibold",n),...r}));us.displayName=zp.displayName;const ms=u.forwardRef(({className:n,...r},c)=>e.jsx(Mp,{ref:c,className:$("text-sm text-muted-foreground",n),...r}));ms.displayName=Mp.displayName;const hs=u.forwardRef(({className:n,...r},c)=>e.jsx(Ap,{ref:c,className:$(gr(),n),...r}));hs.displayName=Ap.displayName;const xs=u.forwardRef(({className:n,...r},c)=>e.jsx(Dp,{ref:c,className:$(gr({variant:"outline"}),"mt-2 sm:mt-0",n),...r}));xs.displayName=Dp.displayName;function h0(){return e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"系统设置"}),e.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理您的应用偏好设置"})]})}),e.jsxs(Kt,{defaultValue:"appearance",className:"w-full",children:[e.jsxs(Rt,{className:"grid w-full grid-cols-2 sm:grid-cols-4 gap-0.5 sm:gap-1 h-auto p-1",children:[e.jsxs(He,{value:"appearance",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(fg,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"外观"})]}),e.jsxs(He,{value:"security",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(SN,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"安全"})]}),e.jsxs(He,{value:"other",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(Rl,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"其他"})]}),e.jsxs(He,{value:"about",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(Xt,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"关于"})]})]}),e.jsxs(es,{className:"h-[calc(100vh-240px)] sm:h-[calc(100vh-280px)] mt-4 sm:mt-6",children:[e.jsx(We,{value:"appearance",className:"mt-0",children:e.jsx(x0,{})}),e.jsx(We,{value:"security",className:"mt-0",children:e.jsx(f0,{})}),e.jsx(We,{value:"other",className:"mt-0",children:e.jsx(p0,{})}),e.jsx(We,{value:"about",className:"mt-0",children:e.jsx(g0,{})})]})]})]})}function lp(n){const r=document.documentElement,d={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%",gradient:null},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%",gradient:null},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%",gradient:null},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%",gradient:null},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%",gradient:null},red:{hsl:"0 84% 60%",darkHsl:"0 90% 70%",gradient:null},"gradient-sunset":{hsl:"15 95% 60%",darkHsl:"15 95% 65%",gradient:"linear-gradient(135deg, hsl(25 95% 53%) 0%, hsl(330 81% 60%) 100%)"},"gradient-ocean":{hsl:"200 90% 55%",darkHsl:"200 90% 60%",gradient:"linear-gradient(135deg, hsl(221.2 83.2% 53.3%) 0%, hsl(189 94% 43%) 100%)"},"gradient-forest":{hsl:"150 70% 45%",darkHsl:"150 75% 40%",gradient:"linear-gradient(135deg, hsl(142 71% 45%) 0%, hsl(158 64% 52%) 100%)"},"gradient-aurora":{hsl:"310 85% 65%",darkHsl:"310 90% 70%",gradient:"linear-gradient(135deg, hsl(271 91% 65%) 0%, hsl(330 81% 60%) 100%)"},"gradient-fire":{hsl:"15 95% 55%",darkHsl:"15 95% 60%",gradient:"linear-gradient(135deg, hsl(0 84% 60%) 0%, hsl(25 95% 53%) 100%)"},"gradient-twilight":{hsl:"250 90% 60%",darkHsl:"250 95% 65%",gradient:"linear-gradient(135deg, hsl(239 84% 67%) 0%, hsl(271 91% 65%) 100%)"}}[n];if(d)r.style.setProperty("--primary",d.hsl),d.gradient?(r.style.setProperty("--primary-gradient",d.gradient),r.classList.add("has-gradient")):(r.style.removeProperty("--primary-gradient"),r.classList.remove("has-gradient"));else if(n.startsWith("#")){const h=x=>{x=x.replace("#","");const f=parseInt(x.substring(0,2),16)/255,j=parseInt(x.substring(2,4),16)/255,g=parseInt(x.substring(4,6),16)/255,_=Math.max(f,j,g),v=Math.min(f,j,g);let k=0,z=0;const T=(_+v)/2;if(_!==v){const L=_-v;switch(z=T>.5?L/(2-_-v):L/(_+v),_){case f:k=((j-g)/L+(jlocalStorage.getItem("accent-color")||"blue");u.useEffect(()=>{const _=localStorage.getItem("accent-color")||"blue";lp(_)},[]);const g=_=>{j(_),localStorage.setItem("accent-color",_),lp(_)};return e.jsxs("div",{className:"space-y-6 sm:space-y-8",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题模式"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-4",children:[e.jsx(Au,{value:"light",current:n,onChange:r,label:"浅色",description:"始终使用浅色主题"}),e.jsx(Au,{value:"dark",current:n,onChange:r,label:"深色",description:"始终使用深色主题"}),e.jsx(Au,{value:"system",current:n,onChange:r,label:"跟随系统",description:"根据系统设置自动切换"})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题色"}),e.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"单色"}),e.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[e.jsx(da,{value:"blue",current:f,onChange:g,label:"蓝色",colorClass:"bg-blue-500"}),e.jsx(da,{value:"purple",current:f,onChange:g,label:"紫色",colorClass:"bg-purple-500"}),e.jsx(da,{value:"green",current:f,onChange:g,label:"绿色",colorClass:"bg-green-500"}),e.jsx(da,{value:"orange",current:f,onChange:g,label:"橙色",colorClass:"bg-orange-500"}),e.jsx(da,{value:"pink",current:f,onChange:g,label:"粉色",colorClass:"bg-pink-500"}),e.jsx(da,{value:"red",current:f,onChange:g,label:"红色",colorClass:"bg-red-500"})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"渐变色"}),e.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[e.jsx(da,{value:"gradient-sunset",current:f,onChange:g,label:"日落",colorClass:"bg-gradient-to-r from-orange-500 to-pink-500"}),e.jsx(da,{value:"gradient-ocean",current:f,onChange:g,label:"海洋",colorClass:"bg-gradient-to-r from-blue-500 to-cyan-500"}),e.jsx(da,{value:"gradient-forest",current:f,onChange:g,label:"森林",colorClass:"bg-gradient-to-r from-green-500 to-emerald-500"}),e.jsx(da,{value:"gradient-aurora",current:f,onChange:g,label:"极光",colorClass:"bg-gradient-to-r from-purple-500 to-pink-500"}),e.jsx(da,{value:"gradient-fire",current:f,onChange:g,label:"烈焰",colorClass:"bg-gradient-to-r from-red-500 to-orange-500"}),e.jsx(da,{value:"gradient-twilight",current:f,onChange:g,label:"暮光",colorClass:"bg-gradient-to-r from-indigo-500 to-purple-500"})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"自定义颜色"}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[e.jsx("div",{className:"flex-1",children:e.jsx("input",{type:"color",value:f.startsWith("#")?f:"#3b82f6",onChange:_=>g(_.target.value),className:"h-10 sm:h-12 w-full rounded-lg border-2 border-border cursor-pointer",title:"选择自定义颜色"})}),e.jsx("div",{className:"flex-1",children:e.jsx(ce,{type:"text",value:f,onChange:_=>g(_.target.value),placeholder:"#3b82f6",className:"font-mono text-sm"})})]}),e.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground mt-2",children:"点击色块选择颜色,或手动输入 HEX 颜色代码"})]})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"动画效果"}),e.jsxs("div",{className:"space-y-2 sm:space-y-3",children:[e.jsx("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5 flex-1",children:[e.jsx(b,{htmlFor:"animations",className:"text-base font-medium cursor-pointer",children:"启用动画效果"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后将禁用所有过渡动画和特效,提升性能"})]}),e.jsx(qe,{id:"animations",checked:c,onCheckedChange:d})]})}),e.jsx("div",{className:"rounded-lg border bg-card p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5 flex-1",children:[e.jsx(b,{htmlFor:"waves-background",className:"text-base font-medium cursor-pointer",children:"登录页波浪背景"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后登录页将使用纯色背景,适合低性能设备"})]}),e.jsx(qe,{id:"waves-background",checked:h,onCheckedChange:x})]})})]})]})]})}function f0(){const n=It(),[r,c]=u.useState(""),[d,h]=u.useState(""),[x,f]=u.useState(!1),[j,g]=u.useState(!1),[_,v]=u.useState(!1),[k,z]=u.useState(!1),[T,L]=u.useState(!1),[K,U]=u.useState(!1),[R,ee]=u.useState(""),[V,E]=u.useState(!1),{toast:B}=Bs(),X=u.useMemo(()=>s0(d),[d]),w=()=>localStorage.getItem("access-token")||"",D=async pe=>{try{await navigator.clipboard.writeText(pe),L(!0),B({title:"复制成功",description:"Token 已复制到剪贴板"}),setTimeout(()=>L(!1),2e3)}catch{B({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},te=async()=>{if(!d.trim()){B({title:"输入错误",description:"请输入新的 Token",variant:"destructive"});return}if(!X.isValid){const pe=X.rules.filter(Ne=>!Ne.passed).map(Ne=>Ne.label).join(", ");B({title:"格式错误",description:`Token 不符合要求: ${pe}`,variant:"destructive"});return}v(!0);try{const pe=w(),Ne=await fetch("/api/webui/auth/update",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${pe}`},body:JSON.stringify({new_token:d.trim()})}),y=await Ne.json();Ne.ok&&y.success?(localStorage.setItem("access-token",d.trim()),h(""),r&&c(d.trim()),B({title:"更新成功",description:"Access Token 已更新,即将跳转到登录页"}),setTimeout(()=>{localStorage.removeItem("access-token"),n({to:"/auth"})},1500)):B({title:"更新失败",description:y.message||"无法更新 Token",variant:"destructive"})}catch(pe){console.error("更新 Token 错误:",pe),B({title:"更新失败",description:"连接服务器失败",variant:"destructive"})}finally{v(!1)}},xe=async()=>{z(!0);try{const pe=w(),Ne=await fetch("/api/webui/auth/regenerate",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${pe}`}}),y=await Ne.json();Ne.ok&&y.success?(localStorage.setItem("access-token",y.token),c(y.token),ee(y.token),U(!0),E(!1),B({title:"生成成功",description:"新的 Access Token 已生成,请及时保存"})):B({title:"生成失败",description:y.message||"无法生成新 Token",variant:"destructive"})}catch(pe){console.error("生成 Token 错误:",pe),B({title:"生成失败",description:"连接服务器失败",variant:"destructive"})}finally{z(!1)}},be=async()=>{try{await navigator.clipboard.writeText(R),E(!0),B({title:"复制成功",description:"Token 已复制到剪贴板"})}catch{B({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},ye=()=>{U(!1),setTimeout(()=>{ee(""),E(!1)},300),setTimeout(()=>{localStorage.removeItem("access-token"),n({to:"/auth"})},500)},ve=pe=>{pe||ye()};return e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsx(Os,{open:K,onOpenChange:ve,children:e.jsxs(Es,{className:"sm:max-w-md",children:[e.jsxs(zs,{children:[e.jsxs(Ms,{className:"flex items-center gap-2",children:[e.jsx(ya,{className:"h-5 w-5 text-yellow-500"}),"新的 Access Token"]}),e.jsx($s,{children:"这是您的新 Token,请立即保存。关闭此窗口后将跳转到登录页面。"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-lg border-2 border-primary/20 bg-primary/5 p-4",children:[e.jsx(b,{className:"text-xs text-muted-foreground mb-2 block",children:"您的新 Token (64位安全令牌)"}),e.jsx("div",{className:"font-mono text-sm break-all select-all bg-background p-3 rounded border",children:R})]}),e.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ya,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[e.jsx("p",{className:"font-semibold",children:"重要提示"}),e.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[e.jsx("li",{children:"此 Token 仅显示一次,关闭后无法再查看"}),e.jsx("li",{children:"请立即复制并保存到安全的位置"}),e.jsx("li",{children:"关闭窗口后将自动跳转到登录页面"}),e.jsx("li",{children:"请使用新 Token 重新登录系统"})]})]})]})})]}),e.jsxs(Is,{className:"gap-2 sm:gap-0",children:[e.jsx(N,{variant:"outline",onClick:be,className:"gap-2",children:V?e.jsxs(e.Fragment,{children:[e.jsx(ha,{className:"h-4 w-4 text-green-500"}),"已复制"]}):e.jsxs(e.Fragment,{children:[e.jsx(so,{className:"h-4 w-4"}),"复制 Token"]})}),e.jsx(N,{onClick:ye,children:"我已保存,关闭"})]})]})}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"当前 Access Token"}),e.jsx("div",{className:"space-y-3 sm:space-y-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"current-token",className:"text-sm",children:"您的访问令牌"}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(ce,{id:"current-token",type:x?"text":"password",value:r||w(),readOnly:!0,className:"pr-10 font-mono text-sm",placeholder:"点击查看按钮显示 Token"}),e.jsx("button",{onClick:()=>{r||c(w()),f(!x)},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:x?"隐藏":"显示",children:x?e.jsx(mr,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(Zt,{className:"h-4 w-4 text-muted-foreground"})})]}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[e.jsx(N,{variant:"outline",size:"icon",onClick:()=>D(w()),title:"复制到剪贴板",className:"flex-shrink-0",children:T?e.jsx(ha,{className:"h-4 w-4 text-green-500"}):e.jsx(so,{className:"h-4 w-4"})}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsxs(N,{variant:"outline",disabled:k,className:"gap-2 flex-1 sm:flex-none",children:[e.jsx(ft,{className:$("h-4 w-4",k&&"animate-spin")}),e.jsx("span",{className:"hidden sm:inline",children:"重新生成"}),e.jsx("span",{className:"sm:hidden",children:"生成"})]})}),e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认重新生成 Token"}),e.jsx(ms,{children:"这将生成一个新的 64 位安全令牌,并使当前 Token 立即失效。 您需要使用新 Token 重新登录系统。此操作不可撤销,确定要继续吗?"})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:xe,children:"确认生成"})]})]})]})]})]}),e.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground",children:"请妥善保管您的 Access Token,不要泄露给他人"})]})})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"自定义 Access Token"}),e.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"new-token",className:"text-sm",children:"新的访问令牌"}),e.jsxs("div",{className:"relative",children:[e.jsx(ce,{id:"new-token",type:j?"text":"password",value:d,onChange:pe=>h(pe.target.value),className:"pr-10 font-mono text-sm",placeholder:"输入自定义 Token"}),e.jsx("button",{onClick:()=>g(!j),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:j?"隐藏":"显示",children:j?e.jsx(mr,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(Zt,{className:"h-4 w-4 text-muted-foreground"})})]}),d&&e.jsxs("div",{className:"mt-3 space-y-2 p-3 rounded-lg bg-muted/50",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Token 安全要求:"}),e.jsx("div",{className:"space-y-1.5",children:X.rules.map(pe=>e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[pe.passed?e.jsx(xa,{className:"h-4 w-4 text-green-500 flex-shrink-0"}):e.jsx(pg,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:$(pe.passed?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:pe.label})]},pe.id))}),X.isValid&&e.jsx("div",{className:"mt-2 pt-2 border-t border-border",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[e.jsx(ha,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:"Token 格式正确,可以使用"})]})})]})]}),e.jsx(N,{onClick:te,disabled:_||!X.isValid||!d,className:"w-full sm:w-auto",children:_?"更新中...":"更新自定义 Token"})]})]}),e.jsxs("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3 sm:p-4",children:[e.jsx("h4",{className:"text-sm sm:text-base font-semibold text-yellow-900 dark:text-yellow-200 mb-2",children:"安全提示"}),e.jsxs("ul",{className:"text-xs sm:text-sm text-yellow-800 dark:text-yellow-300 space-y-1 list-disc list-inside",children:[e.jsx("li",{children:"重新生成 Token 会创建系统随机生成的 64 位安全令牌"}),e.jsx("li",{children:"自定义 Token 必须满足所有安全要求才能使用"}),e.jsx("li",{children:"更新 Token 后,旧的 Token 将立即失效"}),e.jsx("li",{children:"请在安全的环境下查看和复制 Token"}),e.jsx("li",{children:"如果怀疑 Token 泄露,请立即重新生成或更新"}),e.jsx("li",{children:"建议使用系统生成的 Token 以获得最高安全性"})]})]})]})}function p0(){const n=It(),{toast:r}=Bs(),[c,d]=u.useState(!1),[h,x]=u.useState(!1),[f,j]=u.useState(()=>Fs("logCacheSize")),[g,_]=u.useState(()=>Fs("wsReconnectInterval")),[v,k]=u.useState(()=>Fs("wsMaxReconnectAttempts")),[z,T]=u.useState(()=>Fs("dataSyncInterval")),[L,K]=u.useState(()=>ap()),[U,R]=u.useState(!1),[ee,V]=u.useState(!1),E=u.useRef(null);if(h)throw new Error("这是一个手动触发的测试错误,用于验证错误边界组件是否正常工作。");const B=()=>{K(ap())},X=y=>{const q=y[0];j(q),Pn("logCacheSize",q)},w=y=>{const q=y[0];_(q),Pn("wsReconnectInterval",q)},D=y=>{const q=y[0];k(q),Pn("wsMaxReconnectAttempts",q)},te=y=>{const q=y[0];T(q),Pn("dataSyncInterval",q)},xe=()=>{an.clearLogs(),r({title:"日志已清除",description:"日志缓存已清空"})},be=()=>{const y=c0();B(),r({title:"缓存已清除",description:`已清除 ${y.clearedKeys.length} 项缓存数据`})},ye=()=>{R(!0);try{const y=n0(),q=JSON.stringify(y,null,2),H=new Blob([q],{type:"application/json"}),ne=URL.createObjectURL(H),S=document.createElement("a");S.href=ne,S.download=`maibot-webui-settings-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(S),S.click(),document.body.removeChild(S),URL.revokeObjectURL(ne),r({title:"导出成功",description:"设置已导出为 JSON 文件"})}catch(y){console.error("导出设置失败:",y),r({title:"导出失败",description:"无法导出设置",variant:"destructive"})}finally{R(!1)}},ve=y=>{const q=y.target.files?.[0];if(!q)return;V(!0);const H=new FileReader;H.onload=ne=>{try{const S=ne.target?.result,me=JSON.parse(S),he=i0(me);he.success?(j(Fs("logCacheSize")),_(Fs("wsReconnectInterval")),k(Fs("wsMaxReconnectAttempts")),T(Fs("dataSyncInterval")),B(),r({title:"导入成功",description:`成功导入 ${he.imported.length} 项设置${he.skipped.length>0?`,跳过 ${he.skipped.length} 项`:""}`}),(he.imported.includes("theme")||he.imported.includes("accentColor"))&&r({title:"提示",description:"部分设置需要刷新页面才能完全生效"})):r({title:"导入失败",description:"没有有效的设置项可导入",variant:"destructive"})}catch(S){console.error("导入设置失败:",S),r({title:"导入失败",description:"文件格式无效",variant:"destructive"})}finally{V(!1),E.current&&(E.current.value="")}},H.readAsText(q)},pe=()=>{r0(),j(Ea.logCacheSize),_(Ea.wsReconnectInterval),k(Ea.wsMaxReconnectAttempts),T(Ea.dataSyncInterval),B(),r({title:"已重置",description:"所有设置已恢复为默认值,刷新页面以应用更改"})},Ne=async()=>{d(!0);try{const y=localStorage.getItem("access-token"),q=await fetch("/api/webui/setup/reset",{method:"POST",headers:{Authorization:`Bearer ${y}`}}),H=await q.json();q.ok&&H.success?(r({title:"重置成功",description:"即将进入初次配置向导"}),setTimeout(()=>{n({to:"/setup"})},1e3)):r({title:"重置失败",description:H.message||"无法重置配置状态",variant:"destructive"})}catch(y){console.error("重置配置状态错误:",y),r({title:"重置失败",description:"连接服务器失败",variant:"destructive"})}finally{d(!1)}};return e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4 flex items-center gap-2",children:[e.jsx(eo,{className:"h-5 w-5"}),"性能与存储"]}),e.jsxs("div",{className:"space-y-4 sm:space-y-5",children:[e.jsxs("div",{className:"rounded-lg bg-muted/50 p-3 sm:p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("span",{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(CN,{className:"h-4 w-4"}),"本地存储使用"]}),e.jsx(N,{variant:"ghost",size:"sm",onClick:B,className:"h-7 px-2",children:e.jsx(ft,{className:"h-3 w-3"})})]}),e.jsx("div",{className:"text-2xl font-bold text-primary",children:o0(L.used)}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[L.items," 个存储项"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{className:"text-sm font-medium",children:"日志缓存大小"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[f," 条"]})]}),e.jsx(za,{value:[f],onValueChange:X,min:100,max:5e3,step:100,className:"w-full"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"控制日志查看器最多缓存的日志条数,较大的值会占用更多内存"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{className:"text-sm font-medium",children:"首页数据刷新间隔"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[z," 秒"]})]}),e.jsx(za,{value:[z],onValueChange:te,min:10,max:120,step:5,className:"w-full"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"控制首页统计数据的自动刷新间隔"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{className:"text-sm font-medium",children:"WebSocket 重连间隔"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[g/1e3," 秒"]})]}),e.jsx(za,{value:[g],onValueChange:w,min:1e3,max:1e4,step:500,className:"w-full"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"日志 WebSocket 连接断开后的重连基础间隔"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{className:"text-sm font-medium",children:"WebSocket 最大重连次数"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[v," 次"]})]}),e.jsx(za,{value:[v],onValueChange:D,min:3,max:30,step:1,className:"w-full"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"连接失败后的最大重连尝试次数"})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 pt-2",children:[e.jsxs(N,{variant:"outline",size:"sm",onClick:xe,className:"gap-2",children:[e.jsx(ns,{className:"h-4 w-4"}),"清除日志缓存"]}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsxs(N,{variant:"outline",size:"sm",className:"gap-2",children:[e.jsx(ns,{className:"h-4 w-4"}),"清除本地缓存"]})}),e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认清除本地缓存"}),e.jsx(ms,{children:"这将清除所有本地缓存的设置和数据(不包括登录凭证)。 您可能需要重新配置部分偏好设置。确定要继续吗?"})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:be,children:"确认清除"})]})]})]})]})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4 flex items-center gap-2",children:[e.jsx(nl,{className:"h-5 w-5"}),"导入/导出设置"]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"导出当前的界面设置以便备份,或从之前导出的文件中恢复设置。"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(N,{variant:"outline",onClick:ye,disabled:U,className:"gap-2",children:[e.jsx(nl,{className:"h-4 w-4"}),U?"导出中...":"导出设置"]}),e.jsx("input",{ref:E,type:"file",accept:".json",onChange:ve,className:"hidden"}),e.jsxs(N,{variant:"outline",onClick:()=>E.current?.click(),disabled:ee,className:"gap-2",children:[e.jsx(hr,{className:"h-4 w-4"}),ee?"导入中...":"导入设置"]})]}),e.jsx("div",{className:"pt-2 border-t",children:e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsxs(N,{variant:"outline",size:"sm",className:"gap-2 text-destructive hover:text-destructive",children:[e.jsx(Wc,{className:"h-4 w-4"}),"重置所有设置为默认值"]})}),e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认重置所有设置"}),e.jsx(ms,{children:"这将把所有界面设置恢复为默认值,包括主题、颜色、动画等偏好设置。 此操作不会影响您的登录状态。确定要继续吗?"})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:pe,children:"确认重置"})]})]})]})})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"配置向导"}),e.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[e.jsx("div",{className:"space-y-2",children:e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"重新进行初次配置向导,可以帮助您重新设置系统的基础配置。"})}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsxs(N,{variant:"outline",disabled:c,className:"gap-2",children:[e.jsx(Wc,{className:$("h-4 w-4",c&&"animate-spin")}),"重新进行初次配置"]})}),e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认重新配置"}),e.jsx(ms,{children:"这将带您重新进入初次配置向导。您可以重新设置系统的基础配置项。确定要继续吗?"})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:Ne,children:"确认重置"})]})]})]})]})]}),e.jsxs("div",{className:"rounded-lg border border-dashed border-yellow-500/50 bg-yellow-500/5 p-4 sm:p-6",children:[e.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4 flex items-center gap-2",children:[e.jsx(ya,{className:"h-5 w-5 text-yellow-500"}),"开发者工具"]}),e.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[e.jsx("div",{className:"space-y-2",children:e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"以下功能仅供开发调试使用,可能会导致页面崩溃或异常。"})}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsxs(N,{variant:"destructive",className:"gap-2",children:[e.jsx(ya,{className:"h-4 w-4"}),"触发测试错误"]})}),e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认触发错误"}),e.jsx(ms,{children:"这将手动触发一个 React 错误,用于测试错误边界组件的显示效果。 页面将显示错误界面,您可以通过刷新页面或点击返回首页来恢复。"})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:()=>x(!0),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"确认触发"})]})]})]})]})]})]})}function g0(){return e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsx("div",{className:"rounded-lg border-2 border-primary/30 bg-gradient-to-r from-primary/5 to-primary/10 p-4 sm:p-6",children:e.jsxs("div",{className:"flex items-start gap-3 sm:gap-4",children:[e.jsx("div",{className:"flex-shrink-0 rounded-lg bg-primary/10 p-2 sm:p-3",children:e.jsx("svg",{className:"h-6 w-6 sm:h-8 sm:w-8 text-primary",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-lg sm:text-xl font-bold text-foreground mb-2",children:"开源项目"}),e.jsx("p",{className:"text-sm sm:text-base text-muted-foreground mb-3",children:"本项目在 GitHub 开源,欢迎 Star ⭐ 支持!"}),e.jsxs("a",{href:"https://github.com/Mai-with-u/MaiBot-Dashboard",target:"_blank",rel:"noopener noreferrer",className:$("inline-flex items-center gap-2 px-4 py-2 rounded-lg","bg-primary text-primary-foreground font-medium text-sm","hover:bg-primary/90 transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),children:[e.jsx("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})}),"前往 GitHub",e.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]})]})}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:["关于 ",Ku]}),e.jsxs("div",{className:"space-y-2 text-xs sm:text-sm text-muted-foreground",children:[e.jsxs("p",{children:["版本: ",Xu]}),e.jsx("p",{children:"麦麦(MaiBot)的现代化 Web 管理界面"})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"作者"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"MaiBot 核心"}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Mai-with-u"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"WebUI"}),e.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground",children:["Mai-with-u ",e.jsx("a",{href:"https://github.com/DrSmoothl",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"@MotricSeven"})]})]})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"技术栈"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs sm:text-sm text-muted-foreground",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"font-medium text-foreground",children:"前端框架"}),e.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[e.jsx("li",{children:"React 19.2.0"}),e.jsx("li",{children:"TypeScript 5.7.2"}),e.jsx("li",{children:"Vite 6.0.7"}),e.jsx("li",{children:"TanStack Router 1.94.2"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"font-medium text-foreground",children:"UI 组件"}),e.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[e.jsx("li",{children:"shadcn/ui"}),e.jsx("li",{children:"Radix UI"}),e.jsx("li",{children:"Tailwind CSS 3.4.17"}),e.jsx("li",{children:"Lucide Icons"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"font-medium text-foreground",children:"后端"}),e.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[e.jsx("li",{children:"Python 3.12+"}),e.jsx("li",{children:"FastAPI"}),e.jsx("li",{children:"Uvicorn"}),e.jsx("li",{children:"WebSocket"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"font-medium text-foreground",children:"构建工具"}),e.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[e.jsx("li",{children:"Bun / npm"}),e.jsx("li",{children:"ESLint 9.17.0"}),e.jsx("li",{children:"PostCSS"})]})]})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源库感谢"}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mb-3",children:"本项目使用了以下优秀的开源库,感谢他们的贡献:"}),e.jsx(es,{className:"h-[300px] sm:h-[400px]",children:e.jsxs("div",{className:"space-y-4 pr-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"UI 框架与组件"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(Hs,{name:"React",description:"用户界面构建库",license:"MIT"}),e.jsx(Hs,{name:"shadcn/ui",description:"优雅的 React 组件库",license:"MIT"}),e.jsx(Hs,{name:"Radix UI",description:"无样式的可访问组件库",license:"MIT"}),e.jsx(Hs,{name:"Tailwind CSS",description:"实用优先的 CSS 框架",license:"MIT"}),e.jsx(Hs,{name:"Lucide React",description:"精美的图标库",license:"ISC"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"路由与状态管理"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(Hs,{name:"TanStack Router",description:"类型安全的路由库",license:"MIT"}),e.jsx(Hs,{name:"Zustand",description:"轻量级状态管理",license:"MIT"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"表单处理"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(Hs,{name:"React Hook Form",description:"高性能表单库",license:"MIT"}),e.jsx(Hs,{name:"Zod",description:"TypeScript 优先的 schema 验证",license:"MIT"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"工具库"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(Hs,{name:"clsx",description:"条件 className 构建工具",license:"MIT"}),e.jsx(Hs,{name:"tailwind-merge",description:"Tailwind 类名合并工具",license:"MIT"}),e.jsx(Hs,{name:"class-variance-authority",description:"组件变体管理",license:"Apache-2.0"}),e.jsx(Hs,{name:"date-fns",description:"现代化日期处理库",license:"MIT"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"动画效果"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(Hs,{name:"Framer Motion",description:"React 动画库",license:"MIT"}),e.jsx(Hs,{name:"vaul",description:"抽屉组件动画",license:"MIT"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"后端框架"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(Hs,{name:"FastAPI",description:"现代化 Python Web 框架",license:"MIT"}),e.jsx(Hs,{name:"Uvicorn",description:"ASGI 服务器",license:"BSD-3-Clause"}),e.jsx(Hs,{name:"Pydantic",description:"数据验证库",license:"MIT"}),e.jsx(Hs,{name:"python-multipart",description:"文件上传支持",license:"Apache-2.0"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"开发工具"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(Hs,{name:"TypeScript",description:"JavaScript 的超集",license:"Apache-2.0"}),e.jsx(Hs,{name:"Vite",description:"下一代前端构建工具",license:"MIT"}),e.jsx(Hs,{name:"ESLint",description:"JavaScript 代码检查工具",license:"MIT"}),e.jsx(Hs,{name:"PostCSS",description:"CSS 转换工具",license:"MIT"})]})]})]})})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源许可"}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"rounded-lg bg-primary/5 border border-primary/20 p-3 sm:p-4",children:e.jsxs("div",{className:"flex items-start gap-2 sm:gap-3",children:[e.jsx("div",{className:"flex-shrink-0 mt-0.5",children:e.jsx("div",{className:"rounded-md bg-primary/10 px-2 py-1",children:e.jsx("span",{className:"text-xs sm:text-sm font-bold text-primary",children:"GPLv3"})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm sm:text-base font-semibold text-foreground mb-1",children:"MaiBot WebUI"}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目采用 GNU General Public License v3.0 开源许可证。 您可以自由地使用、修改和分发本软件,但必须保持相同的开源许可。"})]})]})}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目依赖的所有开源库均遵循各自的开源许可证(MIT、Apache-2.0、BSD 等)。 感谢所有开源贡献者的无私奉献。"})]})]})]})}function Hs({name:n,description:r,license:c}){return e.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-lg border bg-muted/30 p-2.5 sm:p-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium text-foreground truncate",children:n}),e.jsx("p",{className:"text-muted-foreground text-xs mt-0.5",children:r})]}),e.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-medium text-primary flex-shrink-0",children:c})]})}function Au({value:n,current:r,onChange:c,label:d,description:h}){const x=r===n;return e.jsxs("button",{onClick:()=>c(n),className:$("relative rounded-lg border-2 p-3 sm:p-4 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",x?"border-primary bg-accent":"border-border"),children:[x&&e.jsx("div",{className:"absolute top-2 right-2 sm:top-3 sm:right-3 h-2 w-2 rounded-full bg-primary"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-sm sm:text-base font-medium",children:d}),e.jsx("div",{className:"text-[10px] sm:text-xs text-muted-foreground",children:h})]}),e.jsxs("div",{className:"mt-2 sm:mt-3 flex gap-1",children:[n==="light"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-200"}),e.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-300"}),e.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-400"})]}),n==="dark"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-700"}),e.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-800"}),e.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-900"})]}),n==="system"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-200 to-slate-700"}),e.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-300 to-slate-800"}),e.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-400 to-slate-900"})]})]})]})}function da({value:n,current:r,onChange:c,label:d,colorClass:h}){const x=r===n;return e.jsxs("button",{onClick:()=>c(n),className:$("relative rounded-lg border-2 p-2 sm:p-3 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",x?"border-primary bg-accent":"border-border"),children:[x&&e.jsx("div",{className:"absolute top-1.5 right-1.5 sm:top-2 sm:right-2 h-1.5 w-1.5 sm:h-2 sm:w-2 rounded-full bg-primary"}),e.jsxs("div",{className:"flex flex-col items-center gap-1.5 sm:gap-2",children:[e.jsx("div",{className:$("h-8 w-8 sm:h-10 sm:w-10 rounded-full",h)}),e.jsx("div",{className:"text-[10px] sm:text-xs font-medium text-center",children:d})]})]})}class j0{grad3;p;perm;constructor(r=0){this.grad3=[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]],this.p=[];for(let c=0;c<256;c++)this.p[c]=Math.floor(Math.random()*256);this.perm=[];for(let c=0;c<512;c++)this.perm[c]=this.p[c&255]}dot(r,c,d){return r[0]*c+r[1]*d}mix(r,c,d){return(1-d)*r+d*c}fade(r){return r*r*r*(r*(r*6-15)+10)}perlin2(r,c){const d=Math.floor(r)&255,h=Math.floor(c)&255;r-=Math.floor(r),c-=Math.floor(c);const x=this.fade(r),f=this.fade(c),j=this.perm[d]+h,g=this.perm[j],_=this.perm[j+1],v=this.perm[d+1]+h,k=this.perm[v],z=this.perm[v+1];return this.mix(this.mix(this.dot(this.grad3[g%12],r,c),this.dot(this.grad3[k%12],r-1,c),x),this.mix(this.dot(this.grad3[_%12],r,c-1),this.dot(this.grad3[z%12],r-1,c-1),x),f)}}function v0(){const n=u.useRef(null),r=u.useRef(null),c=u.useRef(void 0),d=u.useRef({mouse:{x:-10,y:0,lx:0,ly:0,sx:0,sy:0,v:0,vs:0,a:0,set:!1},lines:[],paths:[],noise:new j0(Math.random()),bounding:null});return u.useEffect(()=>{const h=r.current,x=n.current;if(!h||!x)return;const f=d.current,j=()=>{const K=h.getBoundingClientRect();f.bounding=K,x.style.width=`${K.width}px`,x.style.height=`${K.height}px`},g=()=>{if(!f.bounding)return;const{width:K,height:U}=f.bounding;f.lines=[],f.paths.forEach(te=>te.remove()),f.paths=[];const R=10,ee=32,V=K+200,E=U+30,B=Math.ceil(V/R),X=Math.ceil(E/ee),w=(K-R*B)/2,D=(U-ee*X)/2;for(let te=0;te<=B;te++){const xe=[];for(let ye=0;ye<=X;ye++){const ve={x:w+R*te,y:D+ee*ye,wave:{x:0,y:0},cursor:{x:0,y:0,vx:0,vy:0}};xe.push(ve)}const be=document.createElementNS("http://www.w3.org/2000/svg","path");x.appendChild(be),f.paths.push(be),f.lines.push(xe)}},_=K=>{const{lines:U,mouse:R,noise:ee}=f;U.forEach(V=>{V.forEach(E=>{const B=ee.perlin2((E.x+K*.0125)*.002,(E.y+K*.005)*.0015)*12;E.wave.x=Math.cos(B)*32,E.wave.y=Math.sin(B)*16;const X=E.x-R.sx,w=E.y-R.sy,D=Math.hypot(X,w),te=Math.max(175,R.vs);if(D{const R={x:K.x+K.wave.x+(U?K.cursor.x:0),y:K.y+K.wave.y+(U?K.cursor.y:0)};return R.x=Math.round(R.x*10)/10,R.y=Math.round(R.y*10)/10,R},k=()=>{const{lines:K,paths:U}=f;K.forEach((R,ee)=>{let V=v(R[0],!1),E=`M ${V.x} ${V.y}`;R.forEach((B,X)=>{const w=X===R.length-1;V=v(B,!w),E+=`L ${V.x} ${V.y}`}),U[ee].setAttribute("d",E)})},z=K=>{const{mouse:U}=f;U.sx+=(U.x-U.sx)*.1,U.sy+=(U.y-U.sy)*.1;const R=U.x-U.lx,ee=U.y-U.ly,V=Math.hypot(R,ee);U.v=V,U.vs+=(V-U.vs)*.1,U.vs=Math.min(100,U.vs),U.lx=U.x,U.ly=U.y,U.a=Math.atan2(ee,R),h&&(h.style.setProperty("--x",`${U.sx}px`),h.style.setProperty("--y",`${U.sy}px`)),_(K),k(),c.current=requestAnimationFrame(z)},T=K=>{if(!f.bounding)return;const{mouse:U}=f;U.x=K.pageX-f.bounding.left,U.y=K.pageY-f.bounding.top+window.scrollY,U.set||(U.sx=U.x,U.sy=U.y,U.lx=U.x,U.ly=U.y,U.set=!0)},L=()=>{j(),g()};return j(),g(),window.addEventListener("resize",L),window.addEventListener("mousemove",T),c.current=requestAnimationFrame(z),()=>{window.removeEventListener("resize",L),window.removeEventListener("mousemove",T),c.current&&cancelAnimationFrame(c.current)}},[]),e.jsxs("div",{ref:r,className:"waves-background",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",pointerEvents:"none"},children:[e.jsx("div",{className:"waves-cursor",style:{position:"absolute",top:0,left:0,width:"0.5rem",height:"0.5rem",background:"hsl(var(--primary) / 0.3)",borderRadius:"50%",transform:"translate3d(calc(var(--x, -0.5rem) - 50%), calc(var(--y, 50%) - 50%), 0)",willChange:"transform",pointerEvents:"none"}}),e.jsx("svg",{ref:n,style:{display:"block",width:"100%",height:"100%"},children:e.jsx("style",{children:` + path { + fill: none; + stroke: hsl(var(--primary) / 0.20); + stroke-width: 1px; + } + `})})]})}function y0(){const n=It();u.useEffect(()=>{localStorage.getItem("access-token")||n({to:"/auth"})},[n])}function Dg(){return!!localStorage.getItem("access-token")}function N0(){const[n,r]=u.useState(""),[c,d]=u.useState(!1),[h,x]=u.useState(""),f=It(),{enableWavesBackground:j,setEnableWavesBackground:g}=Eg(),{theme:_,setTheme:v}=Yu();u.useEffect(()=>{Dg()&&f({to:"/"})},[f]);const z=_==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":_,T=()=>{v(z==="dark"?"light":"dark")},L=async K=>{if(K.preventDefault(),x(""),!n.trim()){x("请输入 Access Token");return}d(!0);try{const U=await fetch("/api/webui/auth/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:n.trim()})}),R=await U.json();if(U.ok&&R.valid){localStorage.setItem("access-token",n.trim());const ee=await fetch("/api/webui/setup/status",{method:"GET",headers:{Authorization:`Bearer ${n.trim()}`}}),V=await ee.json();ee.ok&&V.is_first_setup?f({to:"/setup"}):f({to:"/"})}else x(R.message||"Token 验证失败,请检查后重试")}catch(U){console.error("Token 验证错误:",U),x("连接服务器失败,请检查网络连接")}finally{d(!1)}};return e.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[j&&e.jsx(v0,{}),e.jsxs(Be,{className:"relative z-10 w-full max-w-md shadow-2xl backdrop-blur-xl bg-card/80 border-border/50",children:[e.jsx("button",{onClick:T,className:"absolute right-4 top-4 rounded-lg p-2 hover:bg-accent transition-colors z-10 text-foreground",title:z==="dark"?"切换到浅色模式":"切换到深色模式",children:z==="dark"?e.jsx(Ou,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"}):e.jsx(Ru,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"})}),e.jsxs(gs,{className:"space-y-4 text-center",children:[e.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10",children:e.jsx($f,{className:"h-8 w-8 text-primary",strokeWidth:2,fill:"none"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(js,{className:"text-2xl font-bold",children:"欢迎使用 MaiBot"}),e.jsx(Zs,{className:"text-base",children:"请输入您的 Access Token 以继续访问系统"})]})]}),e.jsx(bs,{children:e.jsxs("form",{onSubmit:L,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"token",className:"text-sm font-medium",children:"Access Token"}),e.jsxs("div",{className:"relative",children:[e.jsx(gg,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",strokeWidth:2,fill:"none"}),e.jsx(ce,{id:"token",type:"password",placeholder:"请输入您的 Access Token",value:n,onChange:K=>r(K.target.value),className:$("pl-10",h&&"border-red-500 focus-visible:ring-red-500"),disabled:c,autoFocus:!0,autoComplete:"off"})]})]}),h&&e.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-red-50 p-3 text-sm text-red-600 dark:bg-red-950/50 dark:text-red-400",children:[e.jsx(Aa,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2,fill:"none"}),e.jsx("span",{children:h})]}),e.jsx(N,{type:"submit",className:"w-full",disabled:c,children:c?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"验证中..."]}):"验证并进入"}),e.jsxs(Os,{children:[e.jsx(ni,{asChild:!0,children:e.jsxs("button",{className:"w-full text-center text-sm text-primary hover:text-primary/80 transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[e.jsx(ro,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我没有 Token,我该去哪里获得 Token?"]})}),e.jsxs(Es,{className:"sm:max-w-md",children:[e.jsxs(zs,{children:[e.jsxs(Ms,{className:"flex items-center gap-2",children:[e.jsx($f,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"如何获取 Access Token"]}),e.jsx($s,{children:"Access Token 是访问 MaiBot WebUI 的唯一凭证,请按以下方式获取"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(kN,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx("h4",{className:"font-semibold text-sm",children:"方式一:查看启动日志"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"在 MaiBot 启动时,控制台会显示 WebUI Access Token。"}),e.jsxs("div",{className:"rounded bg-background p-2 font-mono text-xs",children:[e.jsx("p",{className:"text-muted-foreground",children:"🔑 WebUI Access Token: abc123..."}),e.jsx("p",{className:"text-muted-foreground",children:"💡 请使用此 Token 登录 WebUI"})]})]})]})}),e.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Ma,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx("h4",{className:"font-semibold text-sm",children:"方式二:查看配置文件"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Token 保存在项目根目录的配置文件中:"}),e.jsx("div",{className:"rounded bg-background p-2 font-mono text-xs break-all",children:e.jsx("code",{className:"text-primary",children:"data/webui.json"})}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["打开此文件,复制 ",e.jsx("code",{className:"px-1 py-0.5 bg-background rounded",children:"access_token"})," 字段的值"]})]})]})}),e.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Aa,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),e.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[e.jsx("p",{className:"font-semibold",children:"安全提示"}),e.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[e.jsx("li",{children:"请妥善保管您的 Token,不要泄露给他人"}),e.jsx("li",{children:"如需重置 Token,请在登录后前往系统设置"})]})]})]})})]})]})]}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsxs("button",{className:"w-full text-center text-sm text-muted-foreground hover:text-foreground transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[e.jsx(ln,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我觉得这个界面很卡怎么办?"]})}),e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsxs(us,{className:"flex items-center gap-2",children:[e.jsx(ln,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"关闭背景动画"]}),e.jsx(ms,{children:"背景动画可能会在低性能设备上造成卡顿。关闭动画可以显著提升界面流畅度。"})]}),e.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭动画后,背景将变为纯色,但不影响任何功能的使用。您可以随时在系统设置中重新开启动画。"})}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:()=>g(!1),children:"关闭动画"})]})]})]})]})})]}),e.jsx("div",{className:"absolute bottom-4 left-0 right-0 text-center text-xs text-muted-foreground",children:e.jsx("p",{children:t0})})]})}const Us=u.forwardRef(({className:n,...r},c)=>e.jsx("textarea",{className:$("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",n),ref:c,...r}));Us.displayName="Textarea";const jr=u.forwardRef(({className:n,orientation:r="horizontal",decorative:c=!0,...d},h)=>e.jsx(Op,{ref:h,decorative:c,orientation:r,className:$("shrink-0 bg-border",r==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",n),...d}));jr.displayName=Op.displayName;function b0({config:n,onChange:r}){const c=h=>{h.trim()&&!n.alias_names.includes(h.trim())&&r({...n,alias_names:[...n.alias_names,h.trim()]})},d=h=>{r({...n,alias_names:n.alias_names.filter((x,f)=>f!==h)})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"qq_account",children:"QQ账号 *"}),e.jsx(ce,{id:"qq_account",type:"number",placeholder:"请输入机器人的QQ账号",value:n.qq_account||"",onChange:h=>r({...n,qq_account:Number(h.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人登录使用的QQ账号"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"nickname",children:"昵称 *"}),e.jsx(ce,{id:"nickname",placeholder:"请输入机器人的昵称",value:n.nickname,onChange:h=>r({...n,nickname:h.target.value})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的主要称呼名称"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{children:"别名"}),e.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:n.alias_names.map((h,x)=>e.jsxs(Xe,{variant:"secondary",className:"gap-1",children:[h,e.jsx("button",{type:"button",onClick:()=>d(x),className:"ml-1 hover:text-destructive",children:e.jsx(li,{className:"h-3 w-3"})})]},x))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{id:"alias_input",placeholder:"输入别名后按回车添加",onKeyPress:h=>{h.key==="Enter"&&(c(h.target.value),h.target.value="")}}),e.jsx(N,{type:"button",variant:"outline",onClick:()=>{const h=document.getElementById("alias_input");h&&(c(h.value),h.value="")},children:"添加"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的其他称呼,可以添加多个"})]})]})}function w0({config:n,onChange:r}){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"personality",children:"人格特征 *"}),e.jsx(Us,{id:"personality",placeholder:"描述机器人的人格特质和身份特征(建议120字以内)",value:n.personality,onChange:c=>r({...n,personality:c.target.value}),rows:3}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:是一个女大学生,现在在读大二,会刷贴吧"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"reply_style",children:"表达风格 *"}),e.jsx(Us,{id:"reply_style",placeholder:"描述机器人说话的表达风格、表达习惯",value:n.reply_style,onChange:c=>r({...n,reply_style:c.target.value}),rows:3}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:回复平淡一些,简短一些,说中文,参考贴吧、知乎和微博的回复风格"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"interest",children:"兴趣 *"}),e.jsx(Us,{id:"interest",placeholder:"描述机器人感兴趣的话题",value:n.interest,onChange:c=>r({...n,interest:c.target.value}),rows:2}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"会影响机器人对什么话题进行回复"})]}),e.jsx(jr,{}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"plan_style",children:"群聊说话规则 *"}),e.jsx(Us,{id:"plan_style",placeholder:"机器人在群聊中的行为风格和规则",value:n.plan_style,onChange:c=>r({...n,plan_style:c.target.value}),rows:4}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在群聊中如何行动,例如回复频率、条件等"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"private_plan_style",children:"私聊说话规则 *"}),e.jsx(Us,{id:"private_plan_style",placeholder:"机器人在私聊中的行为风格和规则",value:n.private_plan_style,onChange:c=>r({...n,private_plan_style:c.target.value}),rows:3}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在私聊中的行为方式"})]})]})}function _0({config:n,onChange:r}){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{htmlFor:"emoji_chance",children:"表情包激活概率"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[(n.emoji_chance*100).toFixed(0),"%"]})]}),e.jsx(ce,{id:"emoji_chance",type:"range",min:"0",max:"1",step:"0.1",value:n.emoji_chance,onChange:c=>r({...n,emoji_chance:Number(c.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人发送表情包的概率"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"max_reg_num",children:"最大表情包数量"}),e.jsx(ce,{id:"max_reg_num",type:"number",min:"1",max:"200",value:n.max_reg_num,onChange:c=>r({...n,max_reg_num:Number(c.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人最多保存的表情包数量"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{htmlFor:"do_replace",children:"达到最大数量时替换"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"开启后会删除旧表情包,关闭则不再收集新表情包"})]}),e.jsx(qe,{id:"do_replace",checked:n.do_replace,onCheckedChange:c=>r({...n,do_replace:c})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),e.jsx(ce,{id:"check_interval",type:"number",min:"1",max:"120",value:n.check_interval,onChange:c=>r({...n,check_interval:Number(c.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包注册、破损、删除的时间间隔"})]}),e.jsx(jr,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{htmlFor:"steal_emoji",children:"偷取表情包"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人将一些表情包据为己有"})]}),e.jsx(qe,{id:"steal_emoji",checked:n.steal_emoji,onCheckedChange:c=>r({...n,steal_emoji:c})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{htmlFor:"content_filtration",children:"启用表情包过滤"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"只保存符合要求的表情包"})]}),e.jsx(qe,{id:"content_filtration",checked:n.content_filtration,onCheckedChange:c=>r({...n,content_filtration:c})})]}),n.content_filtration&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"filtration_prompt",children:"过滤要求"}),e.jsx(ce,{id:"filtration_prompt",placeholder:"例如:符合公序良俗",value:n.filtration_prompt,onChange:c=>r({...n,filtration_prompt:c.target.value})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"描述表情包应该符合的要求"})]})]})}function S0({config:n,onChange:r}){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{htmlFor:"enable_tool",children:"启用工具系统"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人使用各种工具增强功能"})]}),e.jsx(qe,{id:"enable_tool",checked:n.enable_tool,onCheckedChange:c=>r({...n,enable_tool:c})})]}),e.jsx(jr,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{htmlFor:"enable_mood",children:"启用情绪系统"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"让机器人具有情绪变化能力"})]}),e.jsx(qe,{id:"enable_mood",checked:n.enable_mood,onCheckedChange:c=>r({...n,enable_mood:c})})]}),n.enable_mood&&e.jsxs("div",{className:"ml-6 space-y-6 border-l-2 border-primary/20 pl-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"mood_update_threshold",children:"情绪更新阈值"}),e.jsx(ce,{id:"mood_update_threshold",type:"number",min:"0.1",max:"10",step:"0.1",value:n.mood_update_threshold||1,onChange:c=>r({...n,mood_update_threshold:Number(c.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"值越高,情绪更新越慢"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"emotion_style",children:"情感特征"}),e.jsx(Us,{id:"emotion_style",placeholder:"描述情绪的变化情况,例如:情绪较为稳定,但遭遇特定事件时起伏较大",value:n.emotion_style||"",onChange:c=>r({...n,emotion_style:c.target.value}),rows:2}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"影响机器人的情绪变化方式"})]})]}),e.jsx(jr,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{htmlFor:"all_global",children:"启用全局黑话模式"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人学习和使用群组黑话"})]}),e.jsx(qe,{id:"all_global",checked:n.all_global,onCheckedChange:c=>r({...n,all_global:c})})]})]})}function C0({config:n,onChange:r}){const[c,d]=u.useState(!1);return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"rounded-lg bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5",children:e.jsx("svg",{className:"h-5 w-5 text-blue-600 dark:text-blue-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsxs("div",{className:"flex-1 text-sm",children:[e.jsx("p",{className:"font-medium text-blue-900 dark:text-blue-100 mb-1",children:"关于硅基流动 (SiliconFlow)"}),e.jsx("p",{className:"text-blue-700 dark:text-blue-300 mb-2",children:"硅基流动提供了完整的模型覆盖,包括 DeepSeek V3、Qwen、视觉模型、语音识别和嵌入模型。 只需一个 API Key 即可使用麦麦的所有功能!"}),e.jsxs("a",{href:"https://cloud.siliconflow.cn",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-blue-600 dark:text-blue-400 hover:underline font-medium",children:["前往硅基流动获取 API Key",e.jsx(dr,{className:"h-3 w-3"})]})]})]})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"siliconflow_api_key",children:"SiliconFlow API Key *"}),e.jsxs("div",{className:"relative",children:[e.jsx(ce,{id:"siliconflow_api_key",type:c?"text":"password",placeholder:"sk-...",value:n.api_key,onChange:h=>r({api_key:h.target.value}),className:"font-mono pr-10"}),e.jsx(N,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 hover:bg-transparent",onClick:()=>d(!c),children:c?e.jsx(mr,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(Zt,{className:"h-4 w-4 text-muted-foreground"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"请输入您的硅基流动 API 密钥。获取后,麦麦将自动配置所有必需的模型。"})]}),e.jsxs("div",{className:"rounded-lg bg-muted/50 p-4 text-sm space-y-2",children:[e.jsx("p",{className:"font-medium",children:"将自动配置以下模型:"}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 text-muted-foreground ml-2",children:[e.jsx("li",{children:"DeepSeek V3 - 主要对话和工具模型"}),e.jsx("li",{children:"Qwen3 30B - 高频小任务和工具调用"}),e.jsx("li",{children:"Qwen3 VL 30B - 图像识别"}),e.jsx("li",{children:"SenseVoice - 语音识别"}),e.jsx("li",{children:"BGE-M3 - 文本嵌入"}),e.jsx("li",{children:"知识库相关模型 (LPMM)"})]})]}),e.jsx("div",{className:"rounded-lg border border-amber-200 dark:border-amber-800 bg-amber-50 dark:bg-amber-950/30 p-4",children:e.jsxs("p",{className:"text-sm text-amber-900 dark:text-amber-100",children:[e.jsx("span",{className:"font-medium",children:"💡 提示:"}),'完成向导后,您可以在"系统设置 → 模型配置"中添加更多 API 提供商和模型。']})})]})}async function ke(n,r){const c=await fetch(n,r);if(c.status===401)throw localStorage.removeItem("access-token"),window.location.href="/auth",new Error("认证失败,请重新登录");return c}function ze(){return{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("access-token")}`}}async function k0(){const n=await ke("/api/webui/config/bot",{method:"GET",headers:ze()});if(!n.ok)throw new Error("读取Bot配置失败");const c=(await n.json()).config.bot||{};return{qq_account:c.qq_account||0,nickname:c.nickname||"",alias_names:c.alias_names||[]}}async function T0(){const n=await ke("/api/webui/config/bot",{method:"GET",headers:ze()});if(!n.ok)throw new Error("读取人格配置失败");const c=(await n.json()).config.personality||{};return{personality:c.personality||"",reply_style:c.reply_style||"",interest:c.interest||"",plan_style:c.plan_style||"",private_plan_style:c.private_plan_style||""}}async function E0(){const n=await ke("/api/webui/config/bot",{method:"GET",headers:ze()});if(!n.ok)throw new Error("读取表情包配置失败");const c=(await n.json()).config.emoji||{};return{emoji_chance:c.emoji_chance??.4,max_reg_num:c.max_reg_num??40,do_replace:c.do_replace??!0,check_interval:c.check_interval??10,steal_emoji:c.steal_emoji??!0,content_filtration:c.content_filtration??!1,filtration_prompt:c.filtration_prompt||""}}async function z0(){const n=await ke("/api/webui/config/bot",{method:"GET",headers:ze()});if(!n.ok)throw new Error("读取其他配置失败");const c=(await n.json()).config,d=c.tool||{},h=c.mood||{},x=c.jargon||{};return{enable_tool:d.enable_tool??!0,enable_mood:h.enable_mood??!1,mood_update_threshold:h.mood_update_threshold,emotion_style:h.emotion_style,all_global:x.all_global??!0}}async function M0(){const n=await ke("/api/webui/config/model",{method:"GET",headers:ze()});if(!n.ok)throw new Error("读取模型配置失败");return{api_key:((await n.json()).config.api_providers||[]).find(x=>x.name==="SiliconFlow")?.api_key||""}}async function A0(n){const r=await ke("/api/webui/config/bot/section/bot",{method:"POST",headers:ze(),body:JSON.stringify(n)});if(!r.ok){const c=await r.json();throw new Error(c.detail||"保存Bot基础配置失败")}return await r.json()}async function D0(n){const r=await ke("/api/webui/config/bot/section/personality",{method:"POST",headers:ze(),body:JSON.stringify(n)});if(!r.ok){const c=await r.json();throw new Error(c.detail||"保存人格配置失败")}return await r.json()}async function O0(n){const r=await ke("/api/webui/config/bot/section/emoji",{method:"POST",headers:ze(),body:JSON.stringify(n)});if(!r.ok){const c=await r.json();throw new Error(c.detail||"保存表情包配置失败")}return await r.json()}async function R0(n){const r=[];r.push(ke("/api/webui/config/bot/section/tool",{method:"POST",headers:ze(),body:JSON.stringify({enable_tool:n.enable_tool})})),r.push(ke("/api/webui/config/bot/section/jargon",{method:"POST",headers:ze(),body:JSON.stringify({all_global:n.all_global})}));const c={enable_mood:n.enable_mood};n.enable_mood&&(c.mood_update_threshold=n.mood_update_threshold||1,c.emotion_style=n.emotion_style||""),r.push(ke("/api/webui/config/bot/section/mood",{method:"POST",headers:ze(),body:JSON.stringify(c)}));const d=await Promise.all(r);for(const h of d)if(!h.ok){const x=await h.json();throw new Error(x.detail||"保存其他配置失败")}return{success:!0}}async function L0(n){const r=await ke("/api/webui/config/model",{method:"GET",headers:ze()});if(!r.ok)throw new Error("读取模型配置失败");const d=(await r.json()).config,h=d.api_providers||[],x=h.findIndex(g=>g.name==="SiliconFlow");x>=0?h[x]={...h[x],api_key:n.api_key}:h.push({name:"SiliconFlow",base_url:"https://api.siliconflow.cn/v1",api_key:n.api_key,client_type:"openai",max_retry:3,timeout:120,retry_interval:5});const f={...d,api_providers:h},j=await ke("/api/webui/config/model",{method:"POST",headers:ze(),body:JSON.stringify(f)});if(!j.ok){const g=await j.json();throw new Error(g.detail||"保存模型配置失败")}return await j.json()}async function np(){const n=localStorage.getItem("access-token"),r=await ke("/api/webui/setup/complete",{method:"POST",headers:{Authorization:`Bearer ${n}`}});if(!r.ok){const c=await r.json();throw new Error(c.message||"标记配置完成失败")}return await r.json()}async function co(){const n=await ke("/api/webui/system/restart",{method:"POST",headers:ze()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"重启失败")}return await n.json()}async function U0(){const n=await ke("/api/webui/system/status",{method:"GET",headers:ze()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取状态失败")}return await n.json()}function B0(){const n=It(),{toast:r}=Bs(),[c,d]=u.useState(0),[h,x]=u.useState(!1),[f,j]=u.useState(!1),[g,_]=u.useState(!0),[v,k]=u.useState({qq_account:0,nickname:"",alias_names:[]}),[z,T]=u.useState({personality:"是一个女大学生,现在在读大二,会刷贴吧。",reply_style:"请回复的平淡一些,简短一些,说中文,不要刻意突出自身学科背景。可以参考贴吧,知乎和微博的回复风格。",interest:"对技术相关话题,游戏和动漫相关话题感兴趣,也对日常话题感兴趣,不喜欢太过沉重严肃的话题",plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用 +2.如果相同的内容已经被执行,请不要重复执行 +3.请控制你的发言频率,不要太过频繁的发言 +4.如果有人对你感到厌烦,请减少回复 +5.如果有人对你进行攻击,或者情绪激动,请你以合适的方法应对`,private_plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用 +2.如果相同的内容已经被执行,请不要重复执行 +3.某句话如果已经被回复过,不要重复回复`}),[L,K]=u.useState({emoji_chance:.4,max_reg_num:40,do_replace:!0,check_interval:10,steal_emoji:!0,content_filtration:!1,filtration_prompt:"符合公序良俗"}),[U,R]=u.useState({enable_tool:!0,enable_mood:!1,mood_update_threshold:1,emotion_style:"情绪较为稳定,但遇遇特定事件的时候起伏较大",all_global:!0}),[ee,V]=u.useState({api_key:""}),[E,B]=u.useState(!1),[X,w]=u.useState(""),D=[{id:"bot-basic",title:"Bot基础",description:"配置机器人的基本信息",icon:ir},{id:"personality",title:"人格配置",description:"定义机器人的性格和说话风格",icon:to},{id:"emoji",title:"表情包",description:"配置表情包相关设置",icon:Qu},{id:"other",title:"其他设置",description:"工具、情绪系统等配置",icon:Rl},{id:"siliconflow",title:"API配置",description:"配置硅基流动API密钥",icon:gg}],te=(c+1)/D.length*100;u.useEffect(()=>{(async()=>{try{_(!0);const[q,H,ne,S,me]=await Promise.all([k0(),T0(),E0(),z0(),M0()]);k(q),T(H),K(ne),R(S),V(me)}catch(q){r({title:"加载配置失败",description:q instanceof Error?q.message:"无法加载现有配置,将使用默认值",variant:"destructive"})}finally{_(!1)}})()},[r]);const xe=async()=>{j(!0);try{switch(c){case 0:await A0(v);break;case 1:await D0(z);break;case 2:await O0(L);break;case 3:await R0(U);break;case 4:await L0(ee);break}return r({title:"保存成功",description:`${D[c].title}配置已保存`}),!0}catch(y){return r({title:"保存失败",description:y instanceof Error?y.message:"未知错误",variant:"destructive"}),!1}finally{j(!1)}},be=async()=>{await xe()&&c{c>0&&d(c-1)},ve=async()=>{x(!0),B(!0);try{if(w("正在保存API配置..."),!await xe()){x(!1),B(!1);return}w("正在完成初始化..."),await np(),w("正在重启麦麦..."),await co(),r({title:"配置完成",description:"麦麦正在重启以应用新配置..."}),w("等待麦麦重启完成...");const q=60;let H=0,ne=!1;for(;HsetTimeout(S,1e3));try{(await U0()).running&&(ne=!0,w("重启成功!正在跳转..."))}catch{H++}}if(!ne)throw new Error("重启超时,请手动检查麦麦状态");setTimeout(()=>{n({to:"/"})},1e3)}catch(y){B(!1),r({title:"配置失败",description:y instanceof Error?y.message:"未知错误",variant:"destructive"})}finally{x(!1)}},pe=async()=>{try{await np(),n({to:"/"})}catch(y){r({title:"跳过失败",description:y instanceof Error?y.message:"未知错误",variant:"destructive"})}},Ne=()=>{switch(c){case 0:return e.jsx(b0,{config:v,onChange:k});case 1:return e.jsx(w0,{config:z,onChange:T});case 2:return e.jsx(_0,{config:L,onChange:K});case 3:return e.jsx(S0,{config:U,onChange:R});case 4:return e.jsx(C0,{config:ee,onChange:V});default:return null}};return e.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-gradient-to-br from-primary/5 via-background to-secondary/5 p-4 md:p-6",children:[E&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:e.jsxs("div",{className:"mx-auto flex max-w-md flex-col items-center space-y-6 rounded-lg border bg-card p-8 text-center shadow-lg",children:[e.jsx("div",{className:"flex h-20 w-20 items-center justify-center rounded-full bg-primary/10",children:e.jsx(vt,{className:"h-10 w-10 animate-spin text-primary"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h2",{className:"text-2xl font-bold",children:"正在重启麦麦"}),e.jsx("p",{className:"text-muted-foreground",children:X})]}),e.jsx("div",{className:"w-full",children:e.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-secondary",children:e.jsx("div",{className:"h-full w-full animate-pulse bg-primary",style:{animation:"pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite"}})})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"请稍候,这可能需要一分钟..."})]})}),e.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[e.jsx("div",{className:"absolute left-1/4 top-1/4 h-64 w-64 md:h-96 md:w-96 rounded-full bg-primary/5 blur-3xl"}),e.jsx("div",{className:"absolute right-1/4 bottom-1/4 h-64 w-64 md:h-96 md:w-96 rounded-full bg-secondary/5 blur-3xl"})]}),g?e.jsxs("div",{className:"relative z-10 text-center",children:[e.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center",children:e.jsx("div",{className:"h-12 w-12 animate-spin rounded-full border-4 border-primary border-t-transparent"})}),e.jsx("p",{className:"text-lg font-medium",children:"加载配置中..."}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"正在读取现有配置"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative z-10 w-full max-w-4xl",children:[e.jsxs("div",{className:"mb-6 md:mb-8 text-center",children:[e.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 md:h-16 md:w-16 items-center justify-center rounded-2xl bg-primary/10",children:e.jsx(TN,{className:"h-6 w-6 md:h-8 md:w-8 text-primary",strokeWidth:2,fill:"none"})}),e.jsx("h1",{className:"mb-2 text-2xl md:text-3xl font-bold",children:"首次配置向导"}),e.jsxs("p",{className:"text-sm md:text-base text-muted-foreground",children:["让我们一起完成 ",Ku," 的初始配置"]})]}),e.jsxs("div",{className:"mb-6 md:mb-8",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between text-xs md:text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:["步骤 ",c+1," / ",D.length]}),e.jsxs("span",{className:"font-medium text-primary",children:[Math.round(te),"%"]})]}),e.jsx(Sr,{value:te,className:"h-2"})]}),e.jsx("div",{className:"mb-6 md:mb-8 flex justify-between",children:D.map((y,q)=>{const H=y.icon;return e.jsxs("div",{className:$("flex flex-1 flex-col items-center gap-1 md:gap-2",qn({to:"/"}),className:"gap-2 w-full sm:w-auto",children:[e.jsx(xr,{className:"h-4 w-4"}),"返回首页"]}),e.jsxs(N,{size:"lg",variant:"outline",onClick:()=>window.history.back(),className:"gap-2 w-full sm:w-auto",children:[e.jsx(ti,{className:"h-4 w-4"}),"返回上一页"]})]}),e.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"如果您认为这是一个错误,请联系系统管理员"})})]})})}const Qe=hN,$e=xN,Ge=u.forwardRef(({className:n,children:r,...c},d)=>e.jsxs(eg,{ref:d,className:$("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",n),...c,children:[r,e.jsx(cN,{asChild:!0,children:e.jsx(Ll,{className:"h-4 w-4 opacity-50"})})]}));Ge.displayName=eg.displayName;const Rg=u.forwardRef(({className:n,...r},c)=>e.jsx(sg,{ref:c,className:$("flex cursor-default items-center justify-center py-1",n),...r,children:e.jsx(fr,{className:"h-4 w-4"})}));Rg.displayName=sg.displayName;const Lg=u.forwardRef(({className:n,...r},c)=>e.jsx(tg,{ref:c,className:$("flex cursor-default items-center justify-center py-1",n),...r,children:e.jsx(Ll,{className:"h-4 w-4"})}));Lg.displayName=tg.displayName;const Ve=u.forwardRef(({className:n,children:r,position:c="popper",...d},h)=>e.jsx(oN,{children:e.jsxs(ag,{ref:h,className:$("relative z-[100] max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-hidden rounded-md border border-border bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",c==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:c,...d,children:[e.jsx(Rg,{}),e.jsx(dN,{className:$("p-1",c==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),e.jsx(Lg,{})]})}));Ve.displayName=ag.displayName;const H0=u.forwardRef(({className:n,...r},c)=>e.jsx(lg,{ref:c,className:$("px-2 py-1.5 text-sm font-semibold",n),...r}));H0.displayName=lg.displayName;const ue=u.forwardRef(({className:n,children:r,...c},d)=>e.jsxs(ng,{ref:d,className:$("relative flex w-full cursor-default select-none items-center rounded-sm py-2 pl-2 pr-8 text-sm outline-none bg-white dark:bg-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800 focus:bg-gray-100 dark:focus:bg-gray-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),...c,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(uN,{children:e.jsx(ha,{className:"h-4 w-4"})})}),e.jsx(mN,{children:r})]}));ue.displayName=ng.displayName;const q0=u.forwardRef(({className:n,...r},c)=>e.jsx(ig,{ref:c,className:$("-mx-1 my-1 h-px bg-muted",n),...r}));q0.displayName=ig.displayName;const Da=Gy,Oa=Vy,Na=u.forwardRef(({className:n,align:r="center",sideOffset:c=4,...d},h)=>e.jsx(qy,{children:e.jsx(Rp,{ref:h,align:r,sideOffset:c,className:$("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",n),...d})}));Na.displayName=Rp.displayName;const Ul="/api/webui/config";async function ip(){const r=await(await ke(`${Ul}/bot`)).json();if(!r.success)throw new Error("获取配置数据失败");return r.config}async function ei(){const r=await(await ke(`${Ul}/model`)).json();if(!r.success)throw new Error("获取模型配置数据失败");return r.config}async function rp(n){const c=await(await ke(`${Ul}/bot`,{method:"POST",headers:ze(),body:JSON.stringify(n)})).json();if(!c.success)throw new Error(c.message||"保存配置失败")}async function G0(){const r=await(await ke(`${Ul}/bot/raw`)).json();if(!r.success)throw new Error("获取配置源代码失败");return r.content}async function V0(n){const c=await(await ke(`${Ul}/bot/raw`,{method:"POST",headers:ze(),body:JSON.stringify({raw_content:n})})).json();if(!c.success)throw new Error(c.message||"保存配置失败")}async function io(n){const c=await(await ke(`${Ul}/model`,{method:"POST",headers:ze(),body:JSON.stringify(n)})).json();if(!c.success)throw new Error(c.message||"保存配置失败")}async function F0(n,r){const d=await(await ke(`${Ul}/bot/section/${n}`,{method:"POST",headers:ze(),body:JSON.stringify(r)})).json();if(!d.success)throw new Error(d.message||`保存配置节 ${n} 失败`)}async function qu(n,r){const d=await(await ke(`${Ul}/model/section/${n}`,{method:"POST",headers:ze(),body:JSON.stringify(r)})).json();if(!d.success)throw new Error(d.message||`保存配置节 ${n} 失败`)}async function Q0(n,r="openai",c="/models"){const d=new URLSearchParams({provider_name:n,parser:r,endpoint:c}),h=await ke(`/api/webui/models/list?${d}`);if(!h.ok){const f=await h.json().catch(()=>({}));throw new Error(f.detail||`获取模型列表失败 (${h.status})`)}const x=await h.json();if(!x.success)throw new Error("获取模型列表失败");return x.models}async function $0(n){const r=new URLSearchParams({provider_name:n}),c=await ke(`/api/webui/models/test-connection-by-name?${r}`,{method:"POST"});if(!c.ok){const d=await c.json().catch(()=>({}));throw new Error(d.detail||`测试连接失败 (${c.status})`)}return await c.json()}const Y0=ai("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),ua=u.forwardRef(({className:n,variant:r,...c},d)=>e.jsx("div",{ref:d,role:"alert",className:$(Y0({variant:r}),n),...c}));ua.displayName="Alert";const X0=u.forwardRef(({className:n,...r},c)=>e.jsx("h5",{ref:c,className:$("mb-1 font-medium leading-none tracking-tight",n),...r}));X0.displayName="AlertTitle";const ma=u.forwardRef(({className:n,...r},c)=>e.jsx("div",{ref:c,className:$("text-sm [&_p]:leading-relaxed",n),...r}));ma.displayName="AlertDescription";function Iu({onRestartComplete:n,onRestartFailed:r}){const[c,d]=u.useState(0),[h,x]=u.useState("restarting"),[f,j]=u.useState(0),[g,_]=u.useState(0);u.useEffect(()=>{const z=setInterval(()=>{d(K=>K>=90?K:K+1)},200),T=setInterval(()=>{j(K=>K+1)},1e3),L=setTimeout(()=>{x("checking"),v()},3e3);return()=>{clearInterval(z),clearInterval(T),clearTimeout(L)}},[]);const v=()=>{const T=async()=>{try{if(_(K=>K+1),(await fetch("/api/webui/system/status",{method:"GET",headers:{"Content-Type":"application/json"},signal:AbortSignal.timeout(3e3)})).ok)d(100),x("success"),setTimeout(()=>{n?.()},1500);else throw new Error("Status check failed")}catch{g<60?setTimeout(T,2e3):(x("failed"),r?.())}};T()},k=z=>{const T=Math.floor(z/60),L=z%60;return`${T}:${L.toString().padStart(2,"0")}`};return e.jsx("div",{className:"fixed inset-0 bg-background/95 backdrop-blur-sm z-50 flex items-center justify-center",children:e.jsxs("div",{className:"max-w-md w-full mx-4 space-y-8",children:[e.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[h==="restarting"&&e.jsxs(e.Fragment,{children:[e.jsx(vt,{className:"h-16 w-16 text-primary animate-spin"}),e.jsx("h2",{className:"text-2xl font-bold",children:"正在重启麦麦"}),e.jsx("p",{className:"text-muted-foreground text-center",children:"请稍候,麦麦正在重启中..."})]}),h==="checking"&&e.jsxs(e.Fragment,{children:[e.jsx(vt,{className:"h-16 w-16 text-primary animate-spin"}),e.jsx("h2",{className:"text-2xl font-bold",children:"检查服务状态"}),e.jsxs("p",{className:"text-muted-foreground text-center",children:["等待服务恢复... (尝试 ",g,"/60)"]})]}),h==="success"&&e.jsxs(e.Fragment,{children:[e.jsx(xa,{className:"h-16 w-16 text-green-500"}),e.jsx("h2",{className:"text-2xl font-bold",children:"重启成功"}),e.jsx("p",{className:"text-muted-foreground text-center",children:"正在跳转到登录页面..."})]}),h==="failed"&&e.jsxs(e.Fragment,{children:[e.jsx(Aa,{className:"h-16 w-16 text-destructive"}),e.jsx("h2",{className:"text-2xl font-bold",children:"重启超时"}),e.jsx("p",{className:"text-muted-foreground text-center",children:"服务未能在预期时间内恢复,请手动检查或刷新页面"})]})]}),h!=="failed"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(Sr,{value:c,className:"h-2"}),e.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[e.jsxs("span",{children:[c,"%"]}),e.jsxs("span",{children:["已用时: ",k(f)]})]})]}),e.jsx("div",{className:"bg-muted/50 rounded-lg p-4 space-y-2",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:[h==="restarting"&&"🔄 配置已保存,正在重启主程序...",h==="checking"&&"⏳ 正在等待服务恢复,请勿关闭页面...",h==="success"&&"✅ 配置已生效,服务运行正常",h==="failed"&&"⚠️ 如果长时间无响应,请尝试手动重启"]})}),e.jsx("div",{className:"bg-yellow-500/10 border border-yellow-500/50 rounded-lg p-4",children:e.jsxs("p",{className:"text-sm text-yellow-900 dark:text-yellow-100",children:[e.jsx("strong",{children:"⚠️ 重要提示:"})," 由于技术原因,使用重启功能后,将无法再使用 ",e.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。如需结束程序,请使用脚本目录下的进程管理脚本。"]})}),h==="failed"&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:()=>window.location.reload(),className:"flex-1 px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90",children:"刷新页面"}),e.jsx("button",{onClick:()=>{x("checking"),_(0),v()},className:"flex-1 px-4 py-2 bg-secondary text-secondary-foreground rounded-md hover:bg-secondary/90",children:"重试检测"})]})]})})}const K0={name:"toml",startState:function(){return{inString:!1,stringType:"",lhs:!0,inArray:0}},token:function(n,r){let c;if(!r.inString&&(c=n.match(/^('''|"""|'|")/))&&(r.stringType=c[0],r.inString=!0),n.sol()&&!r.inString&&r.inArray===0&&(r.lhs=!0),r.inString){for(;r.inString;)if(n.match(r.stringType))r.inString=!1;else if(n.peek()==="\\")n.next(),n.next();else{if(n.eol())break;n.match(/^.[^\\\"\']*/)}return r.lhs?"property":"string"}else{if(r.inArray&&n.peek()==="]")return n.next(),r.inArray--,"bracket";if(r.lhs&&n.peek()==="["&&n.skipTo("]"))return n.next(),n.peek()==="]"&&n.next(),"atom";if(n.peek()==="#")return n.skipToEnd(),"comment";if(n.eatSpace())return null;if(r.lhs&&n.eatWhile(function(d){return d!="="&&d!=" "}))return"property";if(r.lhs&&n.peek()==="=")return n.next(),r.lhs=!1,null;if(!r.lhs&&n.match(/^\d\d\d\d[\d\-\:\.T]*Z/))return"atom";if(!r.lhs&&(n.match("true")||n.match("false")))return"atom";if(!r.lhs&&n.peek()==="[")return r.inArray++,n.next(),"bracket";if(!r.lhs&&n.match(/^\-?\d+(?:\.\d+)?/))return"number";n.eatSpace()||n.next()}return null},languageData:{commentTokens:{line:"#"}}},Z0={python:[sb()],json:[tb(),ab()],toml:[eb.define(K0)],text:[]};function I0({value:n,onChange:r,language:c="text",readOnly:d=!1,height:h="400px",minHeight:x,maxHeight:f,placeholder:j,theme:g="dark",className:_=""}){const[v,k]=u.useState(!1);if(u.useEffect(()=>{k(!0)},[]),!v)return e.jsx("div",{className:`rounded-md border bg-muted animate-pulse ${_}`,style:{height:h,minHeight:x,maxHeight:f}});const z=[...Z0[c]||[],If.lineWrapping];return d&&z.push(If.editable.of(!1)),e.jsx("div",{className:`rounded-md overflow-hidden border ${_}`,children:e.jsx(lb,{value:n,height:h,minHeight:x,maxHeight:f,theme:g==="dark"?nb:void 0,extensions:z,onChange:r,placeholder:j,basicSetup:{lineNumbers:!0,highlightActiveLineGutter:!0,highlightSpecialChars:!0,history:!0,foldGutter:!0,drawSelection:!0,dropCursor:!0,allowMultipleSelections:!0,indentOnInput:!0,syntaxHighlighting:!0,bracketMatching:!0,closeBrackets:!0,autocompletion:!0,rectangularSelection:!0,crosshairCursor:!0,highlightActiveLine:!0,highlightSelectionMatches:!0,closeBracketsKeymap:!0,defaultKeymap:!0,searchKeymap:!0,historyKeymap:!0,foldKeymap:!0,completionKeymap:!0,lintKeymap:!0}})})}function J0(){const[n,r]=u.useState(!0),[c,d]=u.useState(!1),[h,x]=u.useState(!1),[f,j]=u.useState(!1),[g,_]=u.useState(!1),[v,k]=u.useState(!1),[z,T]=u.useState("visual"),[L,K]=u.useState(""),[U,R]=u.useState(!1),{toast:ee}=Bs(),[V,E]=u.useState(null),[B,X]=u.useState(null),[w,D]=u.useState(null),[te,xe]=u.useState(null),[be,ye]=u.useState(null),[ve,pe]=u.useState(null),[Ne,y]=u.useState(null),[q,H]=u.useState(null),[ne,S]=u.useState(null),[me,he]=u.useState(null),[Q,oe]=u.useState(null),[ge,le]=u.useState(null),[O,F]=u.useState(null),[A,W]=u.useState(null),[_e,Me]=u.useState(null),[ss,Ie]=u.useState(null),[Rs,qs]=u.useState(null),[ie,we]=u.useState(null),Ke=u.useRef(null),Le=u.useRef(!0),st=u.useRef({}),Jt=u.useCallback(async()=>{try{const Se=await G0();K(Se),R(!1)}catch(Se){ee({variant:"destructive",title:"加载失败",description:Se instanceof Error?Se.message:"加载源代码失败"})}},[ee]),bt=u.useCallback(async()=>{try{r(!0);const Se=await ip();st.current=Se,E(Se.bot),X(Se.personality);const Re=Se.chat;Re.talk_value_rules||(Re.talk_value_rules=[]),D(Re),xe(Se.expression),ye(Se.emoji),pe(Se.memory),y(Se.tool),H(Se.mood),S(Se.voice),he(Se.lpmm_knowledge),oe(Se.keyword_reaction),le(Se.response_post_process),F(Se.chinese_typo),W(Se.response_splitter),Me(Se.log),Ie(Se.debug),qs(Se.maim_message),we(Se.telemetry),j(!1),Le.current=!1,await Jt()}catch(Se){console.error("加载配置失败:",Se),ee({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}finally{r(!1)}},[ee,Jt]);u.useEffect(()=>{bt()},[bt]);const Je=u.useCallback(async(Se,Re)=>{if(!Le.current)try{x(!0),await F0(Se,Re),j(!1)}catch(it){console.error(`自动保存 ${Se} 失败:`,it),j(!0)}finally{x(!1)}},[]),Ue=u.useCallback((Se,Re)=>{Le.current||(j(!0),Ke.current&&clearTimeout(Ke.current),Ke.current=setTimeout(()=>{Je(Se,Re)},2e3))},[Je]);u.useEffect(()=>{V&&!Le.current&&Ue("bot",V)},[V,Ue]),u.useEffect(()=>{B&&!Le.current&&Ue("personality",B)},[B,Ue]),u.useEffect(()=>{w&&!Le.current&&Ue("chat",w)},[w,Ue]),u.useEffect(()=>{te&&!Le.current&&Ue("expression",te)},[te,Ue]),u.useEffect(()=>{be&&!Le.current&&Ue("emoji",be)},[be,Ue]),u.useEffect(()=>{ve&&!Le.current&&Ue("memory",ve)},[ve,Ue]),u.useEffect(()=>{Ne&&!Le.current&&Ue("tool",Ne)},[Ne,Ue]),u.useEffect(()=>{q&&!Le.current&&Ue("mood",q)},[q,Ue]),u.useEffect(()=>{ne&&!Le.current&&Ue("voice",ne)},[ne,Ue]),u.useEffect(()=>{me&&!Le.current&&Ue("lpmm_knowledge",me)},[me,Ue]),u.useEffect(()=>{Q&&!Le.current&&Ue("keyword_reaction",Q)},[Q,Ue]),u.useEffect(()=>{ge&&!Le.current&&Ue("response_post_process",ge)},[ge,Ue]),u.useEffect(()=>{O&&!Le.current&&Ue("chinese_typo",O)},[O,Ue]),u.useEffect(()=>{A&&!Le.current&&Ue("response_splitter",A)},[A,Ue]),u.useEffect(()=>{_e&&!Le.current&&Ue("log",_e)},[_e,Ue]),u.useEffect(()=>{ss&&!Le.current&&Ue("debug",ss)},[ss,Ue]),u.useEffect(()=>{Rs&&!Le.current&&Ue("maim_message",Rs)},[Rs,Ue]),u.useEffect(()=>{ie&&!Le.current&&Ue("telemetry",ie)},[ie,Ue]);const jt=async()=>{try{d(!0),await V0(L),j(!1),R(!1),ee({title:"保存成功",description:"配置已保存"}),await bt()}catch(Se){R(!0),ee({variant:"destructive",title:"保存失败",description:Se instanceof Error?Se.message:"保存配置失败"})}finally{d(!1)}},nt=async Se=>{if(f){ee({variant:"destructive",title:"切换失败",description:"请先保存当前更改"});return}if(T(Se),Se==="source")await Jt();else try{const Re=await ip();st.current=Re,E(Re.bot),X(Re.personality);const it=Re.chat;it.talk_value_rules||(it.talk_value_rules=[]),D(it),xe(Re.expression),ye(Re.emoji),pe(Re.memory),y(Re.tool),H(Re.mood),S(Re.voice),he(Re.lpmm_knowledge),oe(Re.keyword_reaction),le(Re.response_post_process),F(Re.chinese_typo),W(Re.response_splitter),Me(Re.log),Ie(Re.debug),qs(Re.maim_message),we(Re.telemetry),j(!1)}catch(Re){console.error("加载配置失败:",Re),ee({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}},Ct=async()=>{try{d(!0),Ke.current&&clearTimeout(Ke.current);const Se={...st.current,bot:V,personality:B,chat:w,expression:te,emoji:be,memory:ve,tool:Ne,mood:q,voice:ne,lpmm_knowledge:me,keyword_reaction:Q,response_post_process:ge,chinese_typo:O,response_splitter:A,log:_e,debug:ss,maim_message:Rs,telemetry:ie};await rp(Se),j(!1),ee({title:"保存成功",description:"麦麦主程序配置已保存"})}catch(Se){console.error("保存配置失败:",Se),ee({title:"保存失败",description:Se.message,variant:"destructive"})}finally{d(!1)}},kt=async()=>{try{_(!0),co().catch(()=>{}),k(!0)}catch(Se){console.error("重启失败:",Se),k(!1),ee({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),_(!1)}},rl=async()=>{try{d(!0),Ke.current&&clearTimeout(Ke.current);const Se={...st.current,bot:V,personality:B,chat:w,expression:te,emoji:be,memory:ve,tool:Ne,mood:q,voice:ne,lpmm_knowledge:me,keyword_reaction:Q,response_post_process:ge,chinese_typo:O,response_splitter:A,log:_e,debug:ss,maim_message:Rs,telemetry:ie};await rp(Se),j(!1),ee({title:"保存成功",description:"配置已保存,即将重启麦麦..."}),await new Promise(Re=>setTimeout(Re,500)),await kt()}catch(Se){console.error("保存失败:",Se),ee({title:"保存失败",description:Se.message,variant:"destructive"})}finally{d(!1)}},cl=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},ol=()=>{k(!1),_(!1),ee({title:"重启失败",description:"服务器未能在预期时间内恢复,请手动检查",variant:"destructive"})};return n?e.jsx(es,{className:"h-full",children:e.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):e.jsx(es,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦主程序配置"}),e.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的核心功能和行为设置"})]}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto items-center",children:[e.jsx(Kt,{value:z,onValueChange:Se=>nt(Se),className:"w-auto",children:e.jsxs(Rt,{className:"h-9",children:[e.jsxs(He,{value:"visual",className:"text-xs sm:text-sm px-2 sm:px-3",children:[e.jsx(MN,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1"}),"可视化"]}),e.jsxs(He,{value:"source",className:"text-xs sm:text-sm px-2 sm:px-3",children:[e.jsx(AN,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1"}),"源代码"]})]})}),e.jsxs(N,{onClick:z==="visual"?Ct:jt,disabled:c||h||!f||g,size:"sm",variant:"outline",className:"flex-1 sm:flex-none",children:[e.jsx(br,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),c?"保存中...":h?"自动保存中...":f?"保存配置":"已保存"]}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsxs(N,{disabled:c||h||g,size:"sm",className:"flex-1 sm:flex-none",children:[e.jsx(Nr,{className:"mr-2 h-4 w-4"}),g?"重启中...":f?"保存并重启":"重启麦麦"]})}),e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认重启麦麦?"}),e.jsx(ms,{className:"space-y-3",asChild:!0,children:e.jsxs("div",{children:[e.jsx("p",{children:f?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"}),e.jsxs(ua,{className:"border-yellow-500/50 bg-yellow-500/10",children:[e.jsx(Xt,{className:"h-4 w-4 text-yellow-600"}),e.jsxs(ma,{className:"text-yellow-900 dark:text-yellow-100",children:[e.jsx("strong",{children:"重要提示:"}),"由于技术原因,使用重启功能后,将无法再使用 ",e.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。",e.jsxs(Os,{children:[e.jsx(ni,{asChild:!0,children:e.jsxs("button",{className:"ml-1 text-yellow-700 dark:text-yellow-300 underline hover:text-yellow-800 dark:hover:text-yellow-200 inline-flex items-center gap-1",children:[e.jsx(ro,{className:"h-3 w-3"}),"如何结束程序?"]})}),e.jsxs(Es,{className:"max-w-2xl",children:[e.jsxs(zs,{children:[e.jsx(Ms,{children:"如何结束使用重启功能后的麦麦程序"}),e.jsx($s,{children:"由于重启功能会使程序脱离终端控制,需要通过系统命令来结束进程"})]}),e.jsxs(Kt,{defaultValue:"windows",className:"w-full",children:[e.jsxs(Rt,{className:"grid w-full grid-cols-3",children:[e.jsx(He,{value:"windows",children:"Windows"}),e.jsx(He,{value:"macos",children:"macOS"}),e.jsx(He,{value:"linux",children:"Linux"})]}),e.jsxs(We,{value:"windows",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"方法一:使用任务管理器"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[e.jsxs("li",{children:["按 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Ctrl + Shift + Esc"})," 打开任务管理器"]}),e.jsxs("li",{children:['在"进程"或"详细信息"标签页中找到 ',e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"python.exe"})]}),e.jsx("li",{children:'右键点击并选择"结束任务"'})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"方法二:使用命令行"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"打开 PowerShell 或命令提示符,执行以下命令:"}),e.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[e.jsx("p",{children:"# 查找麦麦进程"}),e.jsx("p",{children:'Get-Process python | Where-Object {$_.MainWindowTitle -eq ""}'}),e.jsx("p",{className:"mt-2",children:"# 结束所有 Python 进程(谨慎使用)"}),e.jsx("p",{children:"Stop-Process -Name python -Force"})]})]})]}),e.jsxs(We,{value:"macos",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"方法一:使用活动监视器"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[e.jsxs("li",{children:["按 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Cmd + Space"}),' 打开 Spotlight,搜索"活动监视器"']}),e.jsxs("li",{children:["在进程列表中找到 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Python"})]}),e.jsx("li",{children:"选中后点击左上角的 X 按钮结束进程"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"方法二:使用终端"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),e.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[e.jsx("p",{children:"# 查找麦麦进程"}),e.jsx("p",{children:"ps aux | grep python | grep -v grep"}),e.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),e.jsx("p",{children:"kill -9 "}),e.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),e.jsx("p",{children:"pkill -9 python"})]})]})]}),e.jsxs(We,{value:"linux",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"使用终端命令"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),e.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[e.jsx("p",{children:"# 查找麦麦进程"}),e.jsx("p",{children:"ps aux | grep python | grep -v grep"}),e.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),e.jsx("p",{children:"kill -9 "}),e.jsx("p",{className:"mt-2",children:"# 或使用 pkill 按名称结束"}),e.jsx("p",{children:'pkill -9 -f "bot.py"'}),e.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),e.jsx("p",{children:"pkill -9 python"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"使用 htop(如已安装)"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[e.jsxs("li",{children:["在终端输入 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"htop"})]}),e.jsxs("li",{children:["按 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F3"})," 搜索 python"]}),e.jsxs("li",{children:["按 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F9"})," 发送信号,选择 SIGKILL"]})]})]})]})]}),e.jsx(Is,{children:e.jsx(Zu,{asChild:!0,children:e.jsx(N,{variant:"outline",children:"关闭"})})})]})]})]})]})]})})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:f?rl:kt,children:f?"保存并重启":"确认重启"})]})]})]})]})]}),e.jsxs(ua,{children:[e.jsx(Xt,{className:"h-4 w-4"}),e.jsxs(ma,{children:["配置更新后需要",e.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),z==="source"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs(ua,{children:[e.jsx(Xt,{className:"h-4 w-4"}),e.jsxs(ma,{children:[e.jsx("strong",{children:"源代码模式(高级功能):"}),"直接编辑 TOML 配置文件。此功能仅适用于熟悉 TOML 语法的高级用户。保存时会在后端验证格式,只有格式完全正确才能保存。",U&&e.jsx("span",{className:"text-destructive font-semibold ml-2",children:"⚠️ 上次保存失败,请检查 TOML 格式"})]})]}),e.jsx(I0,{value:L,onChange:Se=>{K(Se),j(!0),U&&R(!1)},language:"toml",theme:"dark",height:"calc(100vh - 280px)",minHeight:"500px",placeholder:"TOML 配置内容"})]}),z==="visual"&&e.jsx(e.Fragment,{children:e.jsxs(Kt,{defaultValue:"bot",className:"w-full",children:[e.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:e.jsxs(Rt,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5 lg:grid-cols-10",children:[e.jsx(He,{value:"bot",className:"flex-shrink-0",children:"基本信息"}),e.jsx(He,{value:"personality",className:"flex-shrink-0",children:"人格"}),e.jsx(He,{value:"chat",className:"flex-shrink-0",children:"聊天"}),e.jsx(He,{value:"expression",className:"flex-shrink-0",children:"表达"}),e.jsx(He,{value:"features",className:"flex-shrink-0",children:"功能"}),e.jsx(He,{value:"processing",className:"flex-shrink-0",children:"处理"}),e.jsx(He,{value:"mood",className:"flex-shrink-0",children:"情绪"}),e.jsx(He,{value:"voice",className:"flex-shrink-0",children:"语音"}),e.jsx(He,{value:"lpmm",className:"flex-shrink-0",children:"知识库"}),e.jsx(He,{value:"other",className:"flex-shrink-0",children:"其他"})]})}),e.jsx(We,{value:"bot",className:"space-y-4",children:V&&e.jsx(P0,{config:V,onChange:E})}),e.jsx(We,{value:"personality",className:"space-y-4",children:B&&e.jsx(W0,{config:B,onChange:X})}),e.jsx(We,{value:"chat",className:"space-y-4",children:w&&e.jsx(ew,{config:w,onChange:D})}),e.jsx(We,{value:"expression",className:"space-y-4",children:te&&e.jsx(tw,{config:te,onChange:xe})}),e.jsx(We,{value:"features",className:"space-y-4",children:be&&ve&&Ne&&e.jsx(aw,{emojiConfig:be,memoryConfig:ve,toolConfig:Ne,onEmojiChange:ye,onMemoryChange:pe,onToolChange:y})}),e.jsx(We,{value:"processing",className:"space-y-4",children:Q&&ge&&O&&A&&e.jsx(lw,{keywordReactionConfig:Q,responsePostProcessConfig:ge,chineseTypoConfig:O,responseSplitterConfig:A,onKeywordReactionChange:oe,onResponsePostProcessChange:le,onChineseTypoChange:F,onResponseSplitterChange:W})}),e.jsx(We,{value:"mood",className:"space-y-4",children:q&&e.jsx(nw,{config:q,onChange:H})}),e.jsx(We,{value:"voice",className:"space-y-4",children:ne&&e.jsx(iw,{config:ne,onChange:S})}),e.jsx(We,{value:"lpmm",className:"space-y-4",children:me&&e.jsx(rw,{config:me,onChange:he})}),e.jsxs(We,{value:"other",className:"space-y-4",children:[_e&&e.jsx(cw,{config:_e,onChange:Me}),ss&&e.jsx(ow,{config:ss,onChange:Ie}),Rs&&e.jsx(dw,{config:Rs,onChange:qs}),ie&&e.jsx(uw,{config:ie,onChange:we})]})]})}),v&&e.jsx(Iu,{onRestartComplete:cl,onRestartFailed:ol})]})})}function P0({config:n,onChange:r}){const c=()=>{r({...n,platforms:[...n.platforms,""]})},d=g=>{r({...n,platforms:n.platforms.filter((_,v)=>v!==g)})},h=(g,_)=>{const v=[...n.platforms];v[g]=_,r({...n,platforms:v})},x=()=>{r({...n,alias_names:[...n.alias_names,""]})},f=g=>{r({...n,alias_names:n.alias_names.filter((_,v)=>v!==g)})},j=(g,_)=>{const v=[...n.alias_names];v[g]=_,r({...n,alias_names:v})};return e.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"基本信息"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"platform",children:"平台"}),e.jsx(ce,{id:"platform",value:n.platform,onChange:g=>r({...n,platform:g.target.value}),placeholder:"qq"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"qq_account",children:"QQ账号"}),e.jsx(ce,{id:"qq_account",value:n.qq_account,onChange:g=>r({...n,qq_account:g.target.value}),placeholder:"123456789"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"nickname",children:"昵称"}),e.jsx(ce,{id:"nickname",value:n.nickname,onChange:g=>r({...n,nickname:g.target.value}),placeholder:"麦麦"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{children:"其他平台账号"}),e.jsxs(N,{onClick:c,size:"sm",variant:"outline",children:[e.jsx(gt,{className:"h-4 w-4 mr-1"}),"添加"]})]}),e.jsxs("div",{className:"space-y-2",children:[n.platforms.map((g,_)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{value:g,onChange:v=>h(_,v.target.value),placeholder:"wx:114514"}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(N,{size:"icon",variant:"outline",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认删除"}),e.jsxs(ms,{children:['确定要删除平台账号 "',g||"(空)",'" 吗?此操作无法撤销。']})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:()=>d(_),children:"删除"})]})]})]})]},_)),n.platforms.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无其他平台账号"})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{children:"别名"}),e.jsxs(N,{onClick:x,size:"sm",variant:"outline",children:[e.jsx(gt,{className:"h-4 w-4 mr-1"}),"添加"]})]}),e.jsxs("div",{className:"space-y-2",children:[n.alias_names.map((g,_)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{value:g,onChange:v=>j(_,v.target.value),placeholder:"小麦"}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(N,{size:"icon",variant:"outline",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认删除"}),e.jsxs(ms,{children:['确定要删除别名 "',g||"(空)",'" 吗?此操作无法撤销。']})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:()=>f(_),children:"删除"})]})]})]})]},_)),n.alias_names.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无别名"})]})]})]})]})})}function W0({config:n,onChange:r}){const c=()=>{r({...n,states:[...n.states,""]})},d=x=>{r({...n,states:n.states.filter((f,j)=>j!==x)})},h=(x,f)=>{const j=[...n.states];j[x]=f,r({...n,states:j})};return e.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"人格设置"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"personality",children:"人格特质"}),e.jsx(Us,{id:"personality",value:n.personality,onChange:x=>r({...n,personality:x.target.value}),placeholder:"描述人格特质和身份特征(建议120字以内)",rows:3}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"建议120字以内,描述人格特质和身份特征"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"reply_style",children:"表达风格"}),e.jsx(Us,{id:"reply_style",value:n.reply_style,onChange:x=>r({...n,reply_style:x.target.value}),placeholder:"描述说话的表达风格和习惯",rows:3})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"interest",children:"兴趣"}),e.jsx(Us,{id:"interest",value:n.interest,onChange:x=>r({...n,interest:x.target.value}),placeholder:"会影响麦麦对什么话题进行回复",rows:2})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"plan_style",children:"说话规则与行为风格"}),e.jsx(Us,{id:"plan_style",value:n.plan_style,onChange:x=>r({...n,plan_style:x.target.value}),placeholder:"麦麦的说话规则和行为风格",rows:5})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"visual_style",children:"识图规则"}),e.jsx(Us,{id:"visual_style",value:n.visual_style,onChange:x=>r({...n,visual_style:x.target.value}),placeholder:"识图时的处理规则",rows:3})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"private_plan_style",children:"私聊规则"}),e.jsx(Us,{id:"private_plan_style",value:n.private_plan_style,onChange:x=>r({...n,private_plan_style:x.target.value}),placeholder:"私聊的说话规则和行为风格",rows:4})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{children:"状态列表(人格多样性)"}),e.jsxs(N,{onClick:c,size:"sm",variant:"outline",children:[e.jsx(gt,{className:"h-4 w-4 mr-1"}),"添加状态"]})]}),e.jsx("div",{className:"space-y-2",children:n.states.map((x,f)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Us,{value:x,onChange:j=>h(f,j.target.value),placeholder:"描述一个人格状态",rows:2}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(N,{size:"icon",variant:"outline",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认删除"}),e.jsx(ms,{children:"确定要删除这个人格状态吗?此操作无法撤销。"})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:()=>d(f),children:"删除"})]})]})]})]},f))})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"state_probability",children:"状态替换概率"}),e.jsx(ce,{id:"state_probability",type:"number",step:"0.1",min:"0",max:"1",value:n.state_probability,onChange:x=>r({...n,state_probability:parseFloat(x.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"每次构建人格时替换 personality 的概率(0.0-1.0)"})]})]})]})})}function ew({config:n,onChange:r}){const c=()=>{r({...n,talk_value_rules:[...n.talk_value_rules,{target:"",time:"00:00-23:59",value:1}]})},d=j=>{r({...n,talk_value_rules:n.talk_value_rules.filter((g,_)=>_!==j)})},h=(j,g,_)=>{const v=[...n.talk_value_rules];v[j]={...v[j],[g]:_},r({...n,talk_value_rules:v})},x=({value:j,onChange:g})=>{const[_,v]=u.useState("00"),[k,z]=u.useState("00"),[T,L]=u.useState("23"),[K,U]=u.useState("59");u.useEffect(()=>{const ee=j.split("-");if(ee.length===2){const[V,E]=ee,[B,X]=V.split(":"),[w,D]=E.split(":");B&&v(B.padStart(2,"0")),X&&z(X.padStart(2,"0")),w&&L(w.padStart(2,"0")),D&&U(D.padStart(2,"0"))}},[j]);const R=(ee,V,E,B)=>{const X=`${ee}:${V}-${E}:${B}`;g(X)};return e.jsxs(Da,{children:[e.jsx(Oa,{asChild:!0,children:e.jsxs(N,{variant:"outline",className:"w-full justify-start font-mono text-sm",children:[e.jsx(Wn,{className:"h-4 w-4 mr-2"}),j||"选择时间段"]})}),e.jsx(Na,{className:"w-80",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-sm mb-3",children:"开始时间"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-xs",children:"小时"}),e.jsxs(Qe,{value:_,onValueChange:ee=>{v(ee),R(ee,k,T,K)},children:[e.jsx(Ge,{children:e.jsx($e,{})}),e.jsx(Ve,{children:Array.from({length:24},(ee,V)=>V).map(ee=>e.jsx(ue,{value:ee.toString().padStart(2,"0"),children:ee.toString().padStart(2,"0")},ee))})]})]}),e.jsxs("div",{children:[e.jsx(b,{className:"text-xs",children:"分钟"}),e.jsxs(Qe,{value:k,onValueChange:ee=>{z(ee),R(_,ee,T,K)},children:[e.jsx(Ge,{children:e.jsx($e,{})}),e.jsx(Ve,{children:Array.from({length:60},(ee,V)=>V).map(ee=>e.jsx(ue,{value:ee.toString().padStart(2,"0"),children:ee.toString().padStart(2,"0")},ee))})]})]})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-sm mb-3",children:"结束时间"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-xs",children:"小时"}),e.jsxs(Qe,{value:T,onValueChange:ee=>{L(ee),R(_,k,ee,K)},children:[e.jsx(Ge,{children:e.jsx($e,{})}),e.jsx(Ve,{children:Array.from({length:24},(ee,V)=>V).map(ee=>e.jsx(ue,{value:ee.toString().padStart(2,"0"),children:ee.toString().padStart(2,"0")},ee))})]})]}),e.jsxs("div",{children:[e.jsx(b,{className:"text-xs",children:"分钟"}),e.jsxs(Qe,{value:K,onValueChange:ee=>{U(ee),R(_,k,T,ee)},children:[e.jsx(Ge,{children:e.jsx($e,{})}),e.jsx(Ve,{children:Array.from({length:60},(ee,V)=>V).map(ee=>e.jsx(ue,{value:ee.toString().padStart(2,"0"),children:ee.toString().padStart(2,"0")},ee))})]})]})]})]})]})})]})},f=({rule:j})=>{const g=`{ target = "${j.target}", time = "${j.time}", value = ${j.value.toFixed(1)} }`;return e.jsxs(Da,{children:[e.jsx(Oa,{asChild:!0,children:e.jsxs(N,{variant:"outline",size:"sm",children:[e.jsx(Zt,{className:"h-4 w-4 mr-1"}),"预览"]})}),e.jsx(Na,{className:"w-96",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),e.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:g}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"聊天设置"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"talk_value",children:"聊天频率(基础值)"}),e.jsx(ce,{id:"talk_value",type:"number",step:"0.1",min:"0",max:"1",value:n.talk_value,onChange:j=>r({...n,talk_value:parseFloat(j.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"越小越沉默,范围 0-1"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(qe,{id:"mentioned_bot_reply",checked:n.mentioned_bot_reply,onCheckedChange:j=>r({...n,mentioned_bot_reply:j})}),e.jsx(b,{htmlFor:"mentioned_bot_reply",className:"cursor-pointer",children:"启用提及必回复"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"max_context_size",children:"上下文长度"}),e.jsx(ce,{id:"max_context_size",type:"number",min:"1",value:n.max_context_size,onChange:j=>r({...n,max_context_size:parseInt(j.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"planner_smooth",children:"规划器平滑"}),e.jsx(ce,{id:"planner_smooth",type:"number",step:"1",min:"0",value:n.planner_smooth,onChange:j=>r({...n,planner_smooth:parseFloat(j.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"增大数值会减小 planner 负荷,推荐 1-5,0 为关闭"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(qe,{id:"enable_talk_value_rules",checked:n.enable_talk_value_rules,onCheckedChange:j=>r({...n,enable_talk_value_rules:j})}),e.jsx(b,{htmlFor:"enable_talk_value_rules",className:"cursor-pointer",children:"启用动态发言频率规则"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(qe,{id:"include_planner_reasoning",checked:n.include_planner_reasoning,onCheckedChange:j=>r({...n,include_planner_reasoning:j})}),e.jsx(b,{htmlFor:"include_planner_reasoning",className:"cursor-pointer",children:"将 planner 推理加入 replyer"})]})]})]}),n.enable_talk_value_rules&&e.jsxs("div",{className:"border-t pt-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-base font-semibold",children:"动态发言频率规则"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"按时段或聊天流ID调整发言频率,优先匹配具体聊天,再匹配全局规则"})]}),e.jsxs(N,{onClick:c,size:"sm",children:[e.jsx(gt,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),n.talk_value_rules&&n.talk_value_rules.length>0?e.jsx("div",{className:"space-y-4",children:n.talk_value_rules.map((j,g)=>e.jsxs("div",{className:"rounded-lg border p-4 bg-muted/50 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["规则 #",g+1]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(f,{rule:j}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(N,{variant:"ghost",size:"sm",children:e.jsx(ns,{className:"h-4 w-4 text-destructive"})})}),e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认删除"}),e.jsxs(ms,{children:["确定要删除规则 #",g+1," 吗?此操作无法撤销。"]})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:()=>d(g),children:"删除"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"配置类型"}),e.jsxs(Qe,{value:j.target===""?"global":"specific",onValueChange:_=>{_==="global"?h(g,"target",""):h(g,"target","qq::group")},children:[e.jsx(Ge,{children:e.jsx($e,{})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"global",children:"全局配置"}),e.jsx(ue,{value:"specific",children:"详细配置"})]})]})]}),j.target!==""&&(()=>{const _=j.target.split(":"),v=_[0]||"qq",k=_[1]||"",z=_[2]||"group";return e.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"平台"}),e.jsxs(Qe,{value:v,onValueChange:T=>{h(g,"target",`${T}:${k}:${z}`)},children:[e.jsx(Ge,{children:e.jsx($e,{})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"qq",children:"QQ"}),e.jsx(ue,{value:"wx",children:"微信"})]})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"群 ID"}),e.jsx(ce,{value:k,onChange:T=>{h(g,"target",`${v}:${T.target.value}:${z}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"类型"}),e.jsxs(Qe,{value:z,onValueChange:T=>{h(g,"target",`${v}:${k}:${T}`)},children:[e.jsx(Ge,{children:e.jsx($e,{})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"group",children:"群组(group)"}),e.jsx(ue,{value:"private",children:"私聊(private)"})]})]})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",j.target||"(未设置)"]})]})})(),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"时间段 (Time)"}),e.jsx(x,{value:j.time,onChange:_=>h(g,"time",_)}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"支持跨夜区间,例如 23:00-02:00"})]}),e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{htmlFor:`rule-value-${g}`,className:"text-xs font-medium",children:"发言频率值 (Value)"}),e.jsx(ce,{id:`rule-value-${g}`,type:"number",step:"0.01",min:"0.01",max:"1",value:j.value,onChange:_=>{const v=parseFloat(_.target.value);isNaN(v)||h(g,"value",Math.max(.01,Math.min(1,v)))},className:"w-20 h-8 text-xs"})]}),e.jsx(za,{value:[j.value],onValueChange:_=>h(g,"value",_[0]),min:.01,max:1,step:.01,className:"w-full"}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[e.jsx("span",{children:"0.01 (极少发言)"}),e.jsx("span",{children:"0.5"}),e.jsx("span",{children:"1.0 (正常)"})]})]})]})]},g))}):e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:e.jsx("p",{className:"text-sm",children:'暂无规则,点击"添加规则"按钮创建'})}),e.jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg",children:[e.jsx("h5",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"📝 规则说明"}),e.jsxs("ul",{className:"text-xs text-blue-800 dark:text-blue-200 space-y-1",children:[e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Target 为空"}),":全局规则,对所有聊天生效"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Target 指定"}),":仅对特定聊天流生效(格式:platform:id:type)"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"优先级"}),":先匹配具体聊天流规则,再匹配全局规则"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"时间支持跨夜"}),":例如 23:00-02:00 表示晚上11点到次日凌晨2点"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"数值范围"}),":建议 0-1,0 表示完全沉默,1 表示正常发言"]})]})]})]})]})}function sw({member:n,groupIndex:r,memberIndex:c,availableChatIds:d,onUpdate:h,onRemove:x}){const f=d.includes(n)||n==="*",[j,g]=u.useState(!f);return e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"flex-1 flex gap-2",children:j?e.jsxs(e.Fragment,{children:[e.jsx(ce,{value:n,onChange:_=>h(r,c,_.target.value),placeholder:'输入 "*" 或 "qq:123456:group"',className:"flex-1"}),d.length>0&&e.jsx(N,{size:"sm",variant:"outline",onClick:()=>g(!1),title:"切换到下拉选择",children:"下拉"})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Qe,{value:n,onValueChange:_=>h(r,c,_),children:[e.jsx(Ge,{className:"flex-1",children:e.jsx($e,{placeholder:"选择聊天流"})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"*",children:"* (全局共享)"}),d.map((_,v)=>e.jsx(ue,{value:_,children:_},v))]})]}),e.jsx(N,{size:"sm",variant:"outline",onClick:()=>g(!0),title:"切换到手动输入",children:"输入"})]})}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(N,{size:"icon",variant:"outline",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认删除"}),e.jsxs(ms,{children:['确定要删除组成员 "',n||"(空)",'" 吗?此操作无法撤销。']})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:()=>x(r,c),children:"删除"})]})]})]})]})}function tw({config:n,onChange:r}){const c=()=>{r({...n,learning_list:[...n.learning_list,["","enable","enable","1.0"]]})},d=k=>{r({...n,learning_list:n.learning_list.filter((z,T)=>T!==k)})},h=(k,z,T)=>{const L=[...n.learning_list];L[k][z]=T,r({...n,learning_list:L})},x=({rule:k})=>{const z=`["${k[0]}", "${k[1]}", "${k[2]}", "${k[3]}"]`;return e.jsxs(Da,{children:[e.jsx(Oa,{asChild:!0,children:e.jsxs(N,{variant:"outline",size:"sm",children:[e.jsx(Zt,{className:"h-4 w-4 mr-1"}),"预览"]})}),e.jsx(Na,{className:"w-96",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),e.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:z}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},f=()=>{r({...n,expression_groups:[...n.expression_groups,[]]})},j=k=>{r({...n,expression_groups:n.expression_groups.filter((z,T)=>T!==k)})},g=k=>{const z=[...n.expression_groups];z[k]=[...z[k],""],r({...n,expression_groups:z})},_=(k,z)=>{const T=[...n.expression_groups];T[k]=T[k].filter((L,K)=>K!==z),r({...n,expression_groups:T})},v=(k,z,T)=>{const L=[...n.expression_groups];L[k][z]=T,r({...n,expression_groups:L})};return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold",children:"表达学习配置"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置麦麦如何学习和使用表达方式"})]}),e.jsxs(N,{onClick:c,size:"sm",variant:"outline",children:[e.jsx(gt,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),e.jsxs("div",{className:"space-y-4",children:[n.learning_list.map((k,z)=>{const T=n.learning_list.some((V,E)=>E!==z&&V[0]===""),L=k[0]==="",K=k[0].split(":"),U=K[0]||"qq",R=K[1]||"",ee=K[2]||"group";return e.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium",children:["规则 ",z+1," ",L&&"(全局配置)"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(x,{rule:k}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(N,{size:"sm",variant:"ghost",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认删除"}),e.jsxs(ms,{children:["确定要删除学习规则 ",z+1," 吗?此操作无法撤销。"]})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:()=>d(z),children:"删除"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"配置类型"}),e.jsxs(Qe,{value:L?"global":"specific",onValueChange:V=>{V==="global"?h(z,0,""):h(z,0,"qq::group")},disabled:T&&!L,children:[e.jsx(Ge,{children:e.jsx($e,{})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"global",children:"全局配置"}),e.jsx(ue,{value:"specific",disabled:T&&!L,children:"详细配置"})]})]}),T&&!L&&e.jsx("p",{className:"text-xs text-amber-600",children:"已存在全局配置,无法创建新的全局配置"})]}),!L&&e.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"平台"}),e.jsxs(Qe,{value:U,onValueChange:V=>{h(z,0,`${V}:${R}:${ee}`)},children:[e.jsx(Ge,{children:e.jsx($e,{})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"qq",children:"QQ"}),e.jsx(ue,{value:"wx",children:"微信"})]})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"群 ID"}),e.jsx(ce,{value:R,onChange:V=>{h(z,0,`${U}:${V.target.value}:${ee}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"类型"}),e.jsxs(Qe,{value:ee,onValueChange:V=>{h(z,0,`${U}:${R}:${V}`)},children:[e.jsx(Ge,{children:e.jsx($e,{})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"group",children:"群组(group)"}),e.jsx(ue,{value:"private",children:"私聊(private)"})]})]})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",k[0]||"(未设置)"]})]}),e.jsx("div",{className:"grid gap-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-xs font-medium",children:"使用学到的表达"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦使用从聊天中学到的表达方式"})]}),e.jsx(qe,{checked:k[1]==="enable",onCheckedChange:V=>h(z,1,V?"enable":"disable")})]})}),e.jsx("div",{className:"grid gap-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-xs font-medium",children:"学习表达"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦从聊天中学习新的表达方式"})]}),e.jsx(qe,{checked:k[2]==="enable",onCheckedChange:V=>h(z,2,V?"enable":"disable")})]})}),e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{className:"text-xs font-medium",children:"学习强度"}),e.jsx(ce,{type:"number",step:"0.1",min:"0",max:"5",value:k[3],onChange:V=>{const E=parseFloat(V.target.value);isNaN(E)||h(z,3,Math.max(0,Math.min(5,E)).toFixed(1))},className:"w-20 h-8 text-xs"})]}),e.jsx(za,{value:[parseFloat(k[3])||1],onValueChange:V=>h(z,3,V[0].toFixed(1)),min:0,max:5,step:.1,className:"w-full"}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[e.jsx("span",{children:"0 (不学习)"}),e.jsx("span",{children:"2.5"}),e.jsx("span",{children:"5.0 (快速学习)"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"影响学习频率,最短学习间隔 = 300/学习强度(秒)"})]})]})]},z)}),n.learning_list.length===0&&e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无学习规则,点击"添加规则"开始配置'})]})]})}),e.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold",children:"表达共享组配置"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置不同聊天流之间如何共享学到的表达方式"})]}),e.jsxs(N,{onClick:f,size:"sm",variant:"outline",children:[e.jsx(gt,{className:"h-4 w-4 mr-1"}),"添加共享组"]})]}),e.jsxs("div",{className:"space-y-4",children:[n.expression_groups.map((k,z)=>{const T=n.learning_list.map(L=>L[0]).filter(L=>L!=="");return e.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium",children:["共享组 ",z+1,k.length===1&&k[0]==="*"&&"(全局共享)"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(N,{onClick:()=>g(z),size:"sm",variant:"outline",children:e.jsx(gt,{className:"h-4 w-4"})}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(N,{size:"sm",variant:"ghost",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认删除"}),e.jsxs(ms,{children:["确定要删除共享组 ",z+1," 吗?此操作无法撤销。"]})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:()=>j(z),children:"删除"})]})]})]})]})]}),e.jsx("div",{className:"space-y-2",children:k.map((L,K)=>e.jsx(sw,{member:L,groupIndex:z,memberIndex:K,availableChatIds:T,onUpdate:v,onRemove:_},`${z}-${K}`))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:'提示:可以从下拉框选择已配置的聊天流,或手动输入。输入 "*" 启用全局共享'})]},z)}),n.expression_groups.length===0&&e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无共享组,点击"添加共享组"开始配置'})]})]})})]})}function aw({emojiConfig:n,memoryConfig:r,toolConfig:c,onEmojiChange:d,onMemoryChange:h,onToolChange:x}){return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"工具设置"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(qe,{id:"enable_tool",checked:c.enable_tool,onCheckedChange:f=>x({...c,enable_tool:f})}),e.jsx(b,{htmlFor:"enable_tool",className:"cursor-pointer",children:"启用工具系统"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"允许麦麦使用各种工具来增强功能"})]})}),e.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"记忆设置"}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"max_agent_iterations",children:"记忆思考深度"}),e.jsx(ce,{id:"max_agent_iterations",type:"number",min:"1",value:r.max_agent_iterations,onChange:f=>h({...r,max_agent_iterations:parseInt(f.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"最低为 1(不深入思考)"})]})]})}),e.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"表情包设置"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"emoji_chance",children:"表情包激活概率"}),e.jsx(ce,{id:"emoji_chance",type:"number",step:"0.1",min:"0",max:"1",value:n.emoji_chance,onChange:f=>d({...n,emoji_chance:parseFloat(f.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"范围 0-1,越大越容易发送表情包"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"max_reg_num",children:"最大注册数量"}),e.jsx(ce,{id:"max_reg_num",type:"number",min:"1",value:n.max_reg_num,onChange:f=>d({...n,max_reg_num:parseInt(f.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦最多可以注册的表情包数量"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),e.jsx(ce,{id:"check_interval",type:"number",min:"1",value:n.check_interval,onChange:f=>d({...n,check_interval:parseInt(f.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包(注册、破损、删除)的时间间隔"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(qe,{id:"do_replace",checked:n.do_replace,onCheckedChange:f=>d({...n,do_replace:f})}),e.jsx(b,{htmlFor:"do_replace",className:"cursor-pointer",children:"达到最大数量时替换表情包"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(qe,{id:"steal_emoji",checked:n.steal_emoji,onCheckedChange:f=>d({...n,steal_emoji:f})}),e.jsx(b,{htmlFor:"steal_emoji",className:"cursor-pointer",children:"偷取表情包"})]}),e.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"允许麦麦将看到的表情包据为己有"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(qe,{id:"content_filtration",checked:n.content_filtration,onCheckedChange:f=>d({...n,content_filtration:f})}),e.jsx(b,{htmlFor:"content_filtration",className:"cursor-pointer",children:"启用表情包过滤"})]}),n.content_filtration&&e.jsxs("div",{className:"grid gap-2 pl-6 border-l-2 border-primary/20",children:[e.jsx(b,{htmlFor:"filtration_prompt",children:"过滤要求"}),e.jsx(ce,{id:"filtration_prompt",value:n.filtration_prompt,onChange:f=>d({...n,filtration_prompt:f.target.value}),placeholder:"符合公序良俗"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"只有符合此要求的表情包才会被保存"})]})]})]})})]})}function lw({keywordReactionConfig:n,responsePostProcessConfig:r,chineseTypoConfig:c,responseSplitterConfig:d,onKeywordReactionChange:h,onResponsePostProcessChange:x,onChineseTypoChange:f,onResponseSplitterChange:j}){const g=()=>{h({...n,regex_rules:[...n.regex_rules,{regex:[""],reaction:""}]})},_=E=>{h({...n,regex_rules:n.regex_rules.filter((B,X)=>X!==E)})},v=(E,B,X)=>{const w=[...n.regex_rules];B==="regex"&&typeof X=="string"?w[E]={...w[E],regex:[X]}:B==="reaction"&&typeof X=="string"&&(w[E]={...w[E],reaction:X}),h({...n,regex_rules:w})},k=({regex:E,reaction:B,onRegexChange:X,onReactionChange:w})=>{const[D,te]=u.useState(!1),[xe,be]=u.useState(""),[ye,ve]=u.useState(null),[pe,Ne]=u.useState(""),[y,q]=u.useState({}),[H,ne]=u.useState(""),S=u.useRef(null),[me,he]=u.useState("build"),Q=O=>O.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),oe=(O,F=0)=>{const A=S.current;if(!A)return;const W=A.selectionStart||0,_e=A.selectionEnd||0,Me=E.substring(0,W)+O+E.substring(_e);X(Me),setTimeout(()=>{const ss=W+O.length+F;A.setSelectionRange(ss,ss),A.focus()},0)};u.useEffect(()=>{if(!E||!xe){ve(null),q({}),ne(B),Ne("");return}try{const O=Q(E),F=new RegExp(O,"g"),A=xe.match(F);ve(A),Ne("");const _e=new RegExp(O).exec(xe);if(_e&&_e.groups){q(_e.groups);let Me=B;Object.entries(_e.groups).forEach(([ss,Ie])=>{Me=Me.replace(new RegExp(`\\[${ss}\\]`,"g"),Ie||"")}),ne(Me)}else q({}),ne(B)}catch(O){Ne(O.message),ve(null),q({}),ne(B)}},[E,xe,B]);const ge=()=>{if(!xe||!ye||ye.length===0)return e.jsx("span",{className:"text-muted-foreground",children:xe||"请输入测试文本"});try{const O=Q(E),F=new RegExp(O,"g");let A=0;const W=[];let _e;for(;(_e=F.exec(xe))!==null;)_e.index>A&&W.push(e.jsx("span",{children:xe.substring(A,_e.index)},`text-${A}`)),W.push(e.jsx("span",{className:"bg-yellow-200 dark:bg-yellow-900 font-semibold",children:_e[0]},`match-${_e.index}`)),A=_e.index+_e[0].length;return A)",desc:"Python风格命名捕获组",moveCursor:-1},{label:"非捕获组",pattern:"(?:)",desc:"分组但不保存匹配结果",moveCursor:-1}]},{category:"字符类",items:[{label:"字符集",pattern:"[]",desc:"匹配括号内的任意字符",moveCursor:-1},{label:"排除字符",pattern:"[^]",desc:"匹配不在括号内的字符",moveCursor:-1},{label:"范围",pattern:"[a-z]",desc:"匹配a到z的字符"},{label:"中文字符",pattern:"[\\u4e00-\\u9fa5]",desc:"匹配中文汉字"}]},{category:"常用模板",items:[{label:"捕获词语",pattern:"(?P\\S+)",desc:"捕获一个词语"},{label:"捕获句子",pattern:"(?P.+)",desc:"捕获整个句子"},{label:"捕获数字",pattern:"(?P\\d+)",desc:"捕获一个或多个数字"},{label:"可选词语",pattern:"(?:词语1|词语2)",desc:"匹配多个可选项之一"}]}];return e.jsxs(Os,{open:D,onOpenChange:te,children:[e.jsx(ni,{asChild:!0,children:e.jsxs(N,{variant:"outline",size:"sm",children:[e.jsx(ao,{className:"h-4 w-4 mr-1"}),"正则编辑器"]})}),e.jsxs(Es,{className:"max-w-[95vw] sm:max-w-[900px] max-h-[90vh]",children:[e.jsxs(zs,{children:[e.jsx(Ms,{children:"正则表达式编辑器"}),e.jsx($s,{className:"text-sm",children:"使用可视化工具构建正则表达式,并实时测试效果"})]}),e.jsx(es,{className:"max-h-[calc(90vh-120px)]",children:e.jsxs(Kt,{value:me,onValueChange:O=>he(O),className:"w-full",children:[e.jsxs(Rt,{className:"grid w-full grid-cols-2",children:[e.jsx(He,{value:"build",children:"🔧 构建器"}),e.jsx(He,{value:"test",children:"🧪 测试器"})]}),e.jsxs(We,{value:"build",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{className:"text-sm font-medium",children:"正则表达式"}),e.jsx(ce,{ref:S,value:E,onChange:O=>X(O.target.value),className:"font-mono text-sm",placeholder:"点击下方按钮构建正则表达式..."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{className:"text-sm font-medium",children:"Reaction 内容"}),e.jsx(Us,{value:B,onChange:O=>w(O.target.value),placeholder:"使用 [捕获组名] 引用捕获的内容...",rows:3,className:"text-sm"})]}),e.jsxs("div",{className:"space-y-4 border-t pt-4",children:[le.map(O=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("h5",{className:"text-xs font-semibold text-primary",children:O.category}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:O.items.map(F=>e.jsx(N,{variant:"outline",size:"sm",className:"justify-start h-auto py-2 px-3",onClick:()=>oe(F.pattern,F.moveCursor||0),children:e.jsxs("div",{className:"flex flex-col items-start w-full",children:[e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsx("span",{className:"text-xs font-medium",children:F.label}),e.jsx("code",{className:"ml-auto text-xs bg-muted px-1.5 py-0.5 rounded font-mono",children:F.pattern})]}),e.jsx("span",{className:"text-xs text-muted-foreground mt-0.5",children:F.desc})]})},F.label))})]},O.category)),e.jsxs("div",{className:"space-y-2 border-t pt-4",children:[e.jsx("h5",{className:"text-xs font-semibold text-primary",children:"完整示例模板"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>X("^(?P\\S{1,20})是这样的$"),children:e.jsxs("div",{className:"flex flex-col items-start w-full",children:[e.jsxs("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:["^(?P\\S","{1,20}",")是这样的$"]}),e.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「某事物是这样的」并捕获事物名称"})]})}),e.jsx(N,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>X("(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"),children:e.jsxs("div",{className:"flex flex-col items-start w-full",children:[e.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"}),e.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「我没要求你做某事」并捕获具体行为"})]})}),e.jsx(N,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>X("(?P.+?)(?:是|为什么|怎么)"),children:e.jsxs("div",{className:"flex flex-col items-start w-full",children:[e.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?P.+?)(?:是|为什么|怎么)"}),e.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"捕获问题主题词"})]})})]})]})]}),e.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3 space-y-1",children:[e.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 使用提示"}),e.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[e.jsx("li",{children:"点击输入框设置光标位置,然后点击按钮插入模式"}),e.jsxs("li",{children:["命名捕获组格式:",e.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"(?P<名称>模式)"})]}),e.jsxs("li",{children:["在 reaction 中使用 ",e.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"[名称]"})," 引用捕获的内容"]}),e.jsx("li",{children:"切换到测试器标签页验证正则表达式效果"})]})]})]}),e.jsxs(We,{value:"test",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{className:"text-sm font-medium",children:"当前正则表达式"}),e.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:E||"(未设置)"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"test-text",className:"text-sm font-medium",children:"测试文本"}),e.jsx(Us,{id:"test-text",value:xe,onChange:O=>be(O.target.value),placeholder:`在此输入要测试的文本... +例如:打游戏是这样的`,className:"min-h-[100px] text-sm"})]}),pe&&e.jsxs("div",{className:"rounded-md bg-destructive/10 border border-destructive/20 p-3",children:[e.jsx("p",{className:"text-sm text-destructive font-medium",children:"正则表达式错误"}),e.jsx("p",{className:"text-xs text-destructive/80 mt-1",children:pe})]}),!pe&&xe&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex items-center gap-2",children:ye&&ye.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),e.jsxs("span",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:["匹配成功 (",ye.length," 处)"]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-gray-400"}),e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"无匹配"})]})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{className:"text-sm font-medium",children:"匹配高亮"}),e.jsx(es,{className:"h-40 rounded-md bg-muted p-3",children:e.jsx("div",{className:"text-sm break-words",children:ge()})})]}),Object.keys(y).length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{className:"text-sm font-medium",children:"命名捕获组"}),e.jsx(es,{className:"h-32 rounded-md border p-3",children:e.jsx("div",{className:"space-y-2",children:Object.entries(y).map(([O,F])=>e.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[e.jsxs("span",{className:"font-mono font-semibold text-primary min-w-[80px]",children:["[",O,"]"]}),e.jsx("span",{className:"text-muted-foreground",children:"="}),e.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded",children:F})]},O))})})]}),Object.keys(y).length>0&&B&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{className:"text-sm font-medium",children:"Reaction 替换预览"}),e.jsx(es,{className:"h-48 rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3",children:e.jsx("div",{className:"text-sm break-words",children:H})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"reaction 中的 [name] 已被替换为对应的捕获组值"})]})]}),e.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3 space-y-1",children:[e.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 测试说明"}),e.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[e.jsx("li",{children:"匹配的文本会以黄色背景高亮显示"}),e.jsx("li",{children:"命名捕获组的值会显示在下方列表中"}),e.jsx("li",{children:"Reaction 替换预览显示最终生成的反应内容"}),e.jsx("li",{children:"如需修改正则,切换回构建器标签页"})]})]})]})]})})]})]})},z=()=>{h({...n,keyword_rules:[...n.keyword_rules,{keywords:[],reaction:""}]})},T=E=>{h({...n,keyword_rules:n.keyword_rules.filter((B,X)=>X!==E)})},L=(E,B,X)=>{const w=[...n.keyword_rules];typeof X=="string"&&(w[E]={...w[E],reaction:X}),h({...n,keyword_rules:w})},K=E=>{const B=[...n.keyword_rules];B[E]={...B[E],keywords:[...B[E].keywords||[],""]},h({...n,keyword_rules:B})},U=(E,B)=>{const X=[...n.keyword_rules];X[E]={...X[E],keywords:(X[E].keywords||[]).filter((w,D)=>D!==B)},h({...n,keyword_rules:X})},R=(E,B,X)=>{const w=[...n.keyword_rules],D=[...w[E].keywords||[]];D[B]=X,w[E]={...w[E],keywords:D},h({...n,keyword_rules:w})},ee=({rule:E})=>{const B=`{ regex = [${(E.regex||[]).map(X=>`"${X}"`).join(", ")}], reaction = "${E.reaction}" }`;return e.jsxs(Da,{children:[e.jsx(Oa,{asChild:!0,children:e.jsxs(N,{variant:"outline",size:"sm",children:[e.jsx(Zt,{className:"h-4 w-4 mr-1"}),"预览"]})}),e.jsx(Na,{className:"w-[95vw] sm:w-[500px]",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),e.jsx(es,{className:"h-60 rounded-md bg-muted p-3",children:e.jsx("pre",{className:"font-mono text-xs break-all",children:B})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},V=({rule:E})=>{const B=`[[keyword_reaction.keyword_rules]] +keywords = [${(E.keywords||[]).map(X=>`"${X}"`).join(", ")}] +reaction = "${E.reaction}"`;return e.jsxs(Da,{children:[e.jsx(Oa,{asChild:!0,children:e.jsxs(N,{variant:"outline",size:"sm",children:[e.jsx(Zt,{className:"h-4 w-4 mr-1"}),"预览"]})}),e.jsx(Na,{className:"w-[95vw] sm:w-[500px]",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),e.jsx(es,{className:"h-60 rounded-md bg-muted p-3",children:e.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-all",children:B})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"关键词反应配置"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"配置触发特定反应的关键词和正则表达式规则"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-base font-semibold",children:"正则表达式规则"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用正则表达式匹配消息内容"})]}),e.jsxs(N,{onClick:g,size:"sm",variant:"outline",children:[e.jsx(gt,{className:"h-4 w-4 mr-1"}),"添加正则规则"]})]}),e.jsxs("div",{className:"space-y-3",children:[n.regex_rules.map((E,B)=>e.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium",children:["正则规则 ",B+1]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(k,{regex:E.regex&&E.regex[0]||"",reaction:E.reaction,onRegexChange:X=>v(B,"regex",X),onReactionChange:X=>v(B,"reaction",X)}),e.jsx(ee,{rule:E}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(N,{size:"sm",variant:"ghost",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认删除"}),e.jsxs(ms,{children:["确定要删除正则规则 ",B+1," 吗?此操作无法撤销。"]})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:()=>_(B),children:"删除"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"正则表达式(Python 语法)"}),e.jsx(ce,{value:E.regex&&E.regex[0]||"",onChange:X=>v(B,"regex",X.target.value),placeholder:"例如:^(?P\\\\S{1,20})是这样的$ (点击正则编辑器按钮可视化构建)",className:"font-mono text-sm"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:'支持命名捕获组 (?Ppattern),可在 reaction 中使用 [name] 引用。点击"正则编辑器"可视化构建和测试!'})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"反应内容"}),e.jsx(Us,{value:E.reaction,onChange:X=>v(B,"reaction",X.target.value),placeholder:`触发后麦麦的反应... +可以使用 [捕获组名] 来引用正则表达式中的内容`,rows:3,className:"text-sm"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"使用 [捕获组名] 引用正则表达式中的命名捕获组,例如 [n] 会被替换为捕获的内容"})]})]})]},B)),n.regex_rules.length===0&&e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无正则规则,点击"添加正则规则"开始配置'})]})]}),e.jsxs("div",{className:"space-y-4 border-t pt-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-base font-semibold",children:"关键词规则"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用关键词列表匹配消息内容"})]}),e.jsxs(N,{onClick:z,size:"sm",variant:"outline",children:[e.jsx(gt,{className:"h-4 w-4 mr-1"}),"添加关键词规则"]})]}),e.jsxs("div",{className:"space-y-3",children:[n.keyword_rules.map((E,B)=>e.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium",children:["关键词规则 ",B+1]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(V,{rule:E}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(N,{size:"sm",variant:"ghost",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认删除"}),e.jsxs(ms,{children:["确定要删除关键词规则 ",B+1," 吗?此操作无法撤销。"]})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:()=>T(B),children:"删除"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{className:"text-xs font-medium",children:"关键词列表"}),e.jsxs(N,{onClick:()=>K(B),size:"sm",variant:"ghost",children:[e.jsx(gt,{className:"h-3 w-3 mr-1"}),"添加关键词"]})]}),e.jsxs("div",{className:"space-y-2",children:[(E.keywords||[]).map((X,w)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{value:X,onChange:D=>R(B,w,D.target.value),placeholder:"关键词",className:"flex-1"}),e.jsx(N,{onClick:()=>U(B,w),size:"sm",variant:"ghost",children:e.jsx(ns,{className:"h-4 w-4"})})]},w)),(!E.keywords||E.keywords.length===0)&&e.jsx("p",{className:"text-xs text-muted-foreground text-center py-2",children:'暂无关键词,点击"添加关键词"开始配置'})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"反应内容"}),e.jsx(Us,{value:E.reaction,onChange:X=>L(B,"reaction",X.target.value),placeholder:"触发后麦麦的反应...",rows:3,className:"text-sm"})]})]})]},B)),n.keyword_rules.length===0&&e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无关键词规则,点击"添加关键词规则"开始配置'})]})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"回复后处理配置"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(qe,{id:"enable_response_post_process",checked:r.enable_response_post_process,onCheckedChange:E=>x({...r,enable_response_post_process:E})}),e.jsx(b,{htmlFor:"enable_response_post_process",className:"cursor-pointer",children:"启用回复后处理"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"包括错别字生成器和回复分割器"})]}),r.enable_response_post_process&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t pt-6 space-y-4",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[e.jsx(qe,{id:"enable_chinese_typo",checked:c.enable,onCheckedChange:E=>f({...c,enable:E})}),e.jsx(b,{htmlFor:"enable_chinese_typo",className:"cursor-pointer font-semibold",children:"中文错别字生成器"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"为回复添加随机错别字,让麦麦的回复更自然"}),c.enable&&e.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"error_rate",className:"text-xs font-medium",children:"单字替换概率"}),e.jsx(ce,{id:"error_rate",type:"number",step:"0.001",min:"0",max:"1",value:c.error_rate,onChange:E=>f({...c,error_rate:parseFloat(E.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"min_freq",className:"text-xs font-medium",children:"最小字频阈值"}),e.jsx(ce,{id:"min_freq",type:"number",min:"0",value:c.min_freq,onChange:E=>f({...c,min_freq:parseInt(E.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"tone_error_rate",className:"text-xs font-medium",children:"声调错误概率"}),e.jsx(ce,{id:"tone_error_rate",type:"number",step:"0.01",min:"0",max:"1",value:c.tone_error_rate,onChange:E=>f({...c,tone_error_rate:parseFloat(E.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"word_replace_rate",className:"text-xs font-medium",children:"整词替换概率"}),e.jsx(ce,{id:"word_replace_rate",type:"number",step:"0.001",min:"0",max:"1",value:c.word_replace_rate,onChange:E=>f({...c,word_replace_rate:parseFloat(E.target.value)})})]})]})]})}),e.jsx("div",{className:"border-t pt-6 space-y-4",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[e.jsx(qe,{id:"enable_response_splitter",checked:d.enable,onCheckedChange:E=>j({...d,enable:E})}),e.jsx(b,{htmlFor:"enable_response_splitter",className:"cursor-pointer font-semibold",children:"回复分割器"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"控制回复的长度和句子数量"}),d.enable&&e.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"max_length",className:"text-xs font-medium",children:"最大长度"}),e.jsx(ce,{id:"max_length",type:"number",min:"1",value:d.max_length,onChange:E=>j({...d,max_length:parseInt(E.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大字符数"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"max_sentence_num",className:"text-xs font-medium",children:"最大句子数"}),e.jsx(ce,{id:"max_sentence_num",type:"number",min:"1",value:d.max_sentence_num,onChange:E=>j({...d,max_sentence_num:parseInt(E.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大句子数量"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(qe,{id:"enable_kaomoji_protection",checked:d.enable_kaomoji_protection,onCheckedChange:E=>j({...d,enable_kaomoji_protection:E})}),e.jsx(b,{htmlFor:"enable_kaomoji_protection",className:"cursor-pointer",children:"启用颜文字保护"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(qe,{id:"enable_overflow_return_all",checked:d.enable_overflow_return_all,onCheckedChange:E=>j({...d,enable_overflow_return_all:E})}),e.jsx(b,{htmlFor:"enable_overflow_return_all",className:"cursor-pointer",children:"超出时一次性返回全部"})]}),e.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"当句子数量超出限制时,合并后一次性返回所有内容"})]})]})})]})]})]})}function nw({config:n,onChange:r}){return e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"情绪设置"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(qe,{checked:n.enable_mood,onCheckedChange:c=>r({...n,enable_mood:c})}),e.jsx(b,{className:"cursor-pointer",children:"启用情绪系统"})]}),n.enable_mood&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"情绪更新阈值"}),e.jsx(ce,{type:"number",min:"1",value:n.mood_update_threshold,onChange:c=>r({...n,mood_update_threshold:parseInt(c.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"越高,更新越慢"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"情感特征"}),e.jsx(Us,{value:n.emotion_style,onChange:c=>r({...n,emotion_style:c.target.value}),placeholder:"影响情绪的变化情况",rows:2})]})]})]})]})}function iw({config:n,onChange:r}){return e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"语音设置"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(qe,{checked:n.enable_asr,onCheckedChange:c=>r({...n,enable_asr:c})}),e.jsx(b,{className:"cursor-pointer",children:"启用语音识别"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"启用后麦麦可以识别语音消息,需要配置语音识别模型"})]})}function rw({config:n,onChange:r}){return e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库设置"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(qe,{checked:n.enable,onCheckedChange:c=>r({...n,enable:c})}),e.jsx(b,{className:"cursor-pointer",children:"启用 LPMM 知识库"})]}),n.enable&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"LPMM 模式"}),e.jsxs(Qe,{value:n.lpmm_mode,onValueChange:c=>r({...n,lpmm_mode:c}),children:[e.jsx(Ge,{children:e.jsx($e,{placeholder:"选择 LPMM 模式"})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"classic",children:"经典模式"}),e.jsx(ue,{value:"agent",children:"Agent 模式"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"同义词搜索 TopK"}),e.jsx(ce,{type:"number",min:"1",value:n.rag_synonym_search_top_k,onChange:c=>r({...n,rag_synonym_search_top_k:parseInt(c.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"同义词阈值"}),e.jsx(ce,{type:"number",step:"0.1",min:"0",max:"1",value:n.rag_synonym_threshold,onChange:c=>r({...n,rag_synonym_threshold:parseFloat(c.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"实体提取线程数"}),e.jsx(ce,{type:"number",min:"1",value:n.info_extraction_workers,onChange:c=>r({...n,info_extraction_workers:parseInt(c.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"嵌入向量维度"}),e.jsx(ce,{type:"number",min:"1",value:n.embedding_dimension,onChange:c=>r({...n,embedding_dimension:parseInt(c.target.value)})})]})]})]})]})]})}function cw({config:n,onChange:r}){const[c,d]=u.useState(""),[h,x]=u.useState("WARNING"),f=()=>{c&&!n.suppress_libraries.includes(c)&&(r({...n,suppress_libraries:[...n.suppress_libraries,c]}),d(""))},j=T=>{r({...n,suppress_libraries:n.suppress_libraries.filter(L=>L!==T)})},g=()=>{c&&!n.library_log_levels[c]&&(r({...n,library_log_levels:{...n.library_log_levels,[c]:h}}),d(""),x("WARNING"))},_=T=>{const L={...n.library_log_levels};delete L[T],r({...n,library_log_levels:L})},v=["DEBUG","INFO","WARNING","ERROR","CRITICAL"],k=["FULL","compact","lite"],z=["none","title","full"];return e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"日志配置"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"日期格式"}),e.jsx(ce,{value:n.date_style,onChange:T=>r({...n,date_style:T.target.value}),placeholder:"例如: m-d H:i:s"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"m=月, d=日, H=时, i=分, s=秒"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"日志级别样式"}),e.jsxs(Qe,{value:n.log_level_style,onValueChange:T=>r({...n,log_level_style:T}),children:[e.jsx(Ge,{children:e.jsx($e,{})}),e.jsx(Ve,{children:k.map(T=>e.jsx(ue,{value:T,children:T},T))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"日志文本颜色"}),e.jsxs(Qe,{value:n.color_text,onValueChange:T=>r({...n,color_text:T}),children:[e.jsx(Ge,{children:e.jsx($e,{})}),e.jsx(Ve,{children:z.map(T=>e.jsx(ue,{value:T,children:T},T))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"全局日志级别"}),e.jsxs(Qe,{value:n.log_level,onValueChange:T=>r({...n,log_level:T}),children:[e.jsx(Ge,{children:e.jsx($e,{})}),e.jsx(Ve,{children:v.map(T=>e.jsx(ue,{value:T,children:T},T))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"控制台日志级别"}),e.jsxs(Qe,{value:n.console_log_level,onValueChange:T=>r({...n,console_log_level:T}),children:[e.jsx(Ge,{children:e.jsx($e,{})}),e.jsx(Ve,{children:v.map(T=>e.jsx(ue,{value:T,children:T},T))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"文件日志级别"}),e.jsxs(Qe,{value:n.file_log_level,onValueChange:T=>r({...n,file_log_level:T}),children:[e.jsx(Ge,{children:e.jsx($e,{})}),e.jsx(Ve,{children:v.map(T=>e.jsx(ue,{value:T,children:T},T))})]})]})]})]}),e.jsxs("div",{children:[e.jsx(b,{className:"mb-2 block",children:"完全屏蔽的库"}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx(ce,{value:c,onChange:T=>d(T.target.value),placeholder:"输入库名",className:"flex-1",onKeyDown:T=>{T.key==="Enter"&&(T.preventDefault(),f())}}),e.jsx(N,{onClick:f,size:"sm",className:"flex-shrink-0",children:e.jsx(gt,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:n.suppress_libraries.map(T=>e.jsxs("div",{className:"flex items-center gap-1 bg-secondary px-3 py-1 rounded-md",children:[e.jsx("span",{className:"text-sm",children:T}),e.jsx(N,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>j(T),children:e.jsx(ns,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},T))})]}),e.jsxs("div",{children:[e.jsx(b,{className:"mb-2 block",children:"特定库的日志级别"}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx(ce,{value:c,onChange:T=>d(T.target.value),placeholder:"输入库名",className:"flex-1"}),e.jsxs(Qe,{value:h,onValueChange:x,children:[e.jsx(Ge,{className:"w-32",children:e.jsx($e,{})}),e.jsx(Ve,{children:v.map(T=>e.jsx(ue,{value:T,children:T},T))})]}),e.jsx(N,{onClick:g,size:"sm",children:e.jsx(gt,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),e.jsx("div",{className:"space-y-2",children:Object.entries(n.library_log_levels).map(([T,L])=>e.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[e.jsx("span",{className:"text-sm font-medium",children:T}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:L}),e.jsx(N,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>_(T),children:e.jsx(ns,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]})]},T))})]})]})}function ow({config:n,onChange:r}){return e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"调试配置"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(b,{children:"显示 Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否在日志中显示提示词"})]}),e.jsx(qe,{checked:n.show_prompt,onCheckedChange:c=>r({...n,show_prompt:c})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(b,{children:"显示回复器 Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的提示词"})]}),e.jsx(qe,{checked:n.show_replyer_prompt,onCheckedChange:c=>r({...n,show_replyer_prompt:c})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(b,{children:"显示回复器推理"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的推理过程"})]}),e.jsx(qe,{checked:n.show_replyer_reasoning,onCheckedChange:c=>r({...n,show_replyer_reasoning:c})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(b,{children:"显示 Jargon Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示术语相关的提示词"})]}),e.jsx(qe,{checked:n.show_jargon_prompt,onCheckedChange:c=>r({...n,show_jargon_prompt:c})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(b,{children:"显示记忆检索 Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示记忆检索相关的提示词"})]}),e.jsx(qe,{checked:n.show_memory_prompt,onCheckedChange:c=>r({...n,show_memory_prompt:c})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(b,{children:"显示 Planner Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示 Planner 的提示词和原始返回结果"})]}),e.jsx(qe,{checked:n.show_planner_prompt,onCheckedChange:c=>r({...n,show_planner_prompt:c})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(b,{children:"显示 LPMM 相关文段"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示 LPMM 知识库找到的相关文段日志"})]}),e.jsx(qe,{checked:n.show_lpmm_paragraph,onCheckedChange:c=>r({...n,show_lpmm_paragraph:c})})]})]})]})}function dw({config:n,onChange:r}){const[c,d]=u.useState(""),h=()=>{c&&!n.auth_token.includes(c)&&(r({...n,auth_token:[...n.auth_token,c]}),d(""))},x=f=>{r({...n,auth_token:n.auth_token.filter((j,g)=>g!==f)})};return e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"MaimMessage 服务配置"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(b,{children:"启用自定义服务器"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否使用自定义的 MaimMessage 服务器"})]}),e.jsx(qe,{checked:n.use_custom,onCheckedChange:f=>r({...n,use_custom:f})})]}),n.use_custom&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"主机地址"}),e.jsx(ce,{value:n.host,onChange:f=>r({...n,host:f.target.value}),placeholder:"127.0.0.1"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"端口号"}),e.jsx(ce,{type:"number",value:n.port,onChange:f=>r({...n,port:parseInt(f.target.value)}),placeholder:"8090"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"连接模式"}),e.jsxs(Qe,{value:n.mode,onValueChange:f=>r({...n,mode:f}),children:[e.jsx(Ge,{children:e.jsx($e,{})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"ws",children:"WebSocket (ws)"}),e.jsx(ue,{value:"tcp",children:"TCP"})]})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(qe,{checked:n.use_wss,onCheckedChange:f=>r({...n,use_wss:f}),disabled:n.mode!=="ws"}),e.jsx(b,{children:"使用 WSS 安全连接"})]})]}),n.use_wss&&n.mode==="ws"&&e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"SSL 证书文件路径"}),e.jsx(ce,{value:n.cert_file,onChange:f=>r({...n,cert_file:f.target.value}),placeholder:"cert.pem"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"SSL 密钥文件路径"}),e.jsx(ce,{value:n.key_file,onChange:f=>r({...n,key_file:f.target.value}),placeholder:"key.pem"})]})]})]})]})]}),e.jsxs("div",{children:[e.jsx(b,{className:"mb-2 block",children:"认证令牌"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"用于 API 验证,为空则不启用验证"}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx(ce,{value:c,onChange:f=>d(f.target.value),placeholder:"输入认证令牌",onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),h())}}),e.jsx(N,{onClick:h,size:"sm",children:e.jsx(gt,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),e.jsx("div",{className:"space-y-2",children:n.auth_token.map((f,j)=>e.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[e.jsx("span",{className:"text-sm font-mono",children:f}),e.jsx(N,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>x(j),children:e.jsx(ns,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},j))})]})]})}function uw({config:n,onChange:r}){return e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"统计信息"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(b,{children:"启用统计信息发送"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"发送匿名统计信息,帮助我们了解全球有多少只麦麦在运行"})]}),e.jsx(qe,{checked:n.enable,onCheckedChange:c=>r({...n,enable:c})})]})]})}const ii=u.forwardRef(({className:n,...r},c)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:c,className:$("w-full caption-bottom text-sm",n),...r})}));ii.displayName="Table";const ri=u.forwardRef(({className:n,...r},c)=>e.jsx("thead",{ref:c,className:$("[&_tr]:border-b",n),...r}));ri.displayName="TableHeader";const ci=u.forwardRef(({className:n,...r},c)=>e.jsx("tbody",{ref:c,className:$("[&_tr:last-child]:border-0",n),...r}));ci.displayName="TableBody";const mw=u.forwardRef(({className:n,...r},c)=>e.jsx("tfoot",{ref:c,className:$("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",n),...r}));mw.displayName="TableFooter";const pt=u.forwardRef(({className:n,...r},c)=>e.jsx("tr",{ref:c,className:$("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",n),...r}));pt.displayName="TableRow";const ls=u.forwardRef(({className:n,...r},c)=>e.jsx("th",{ref:c,className:$("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",n),...r}));ls.displayName="TableHead";const Ye=u.forwardRef(({className:n,...r},c)=>e.jsx("td",{ref:c,className:$("px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",n),...r}));Ye.displayName="TableCell";const hw=u.forwardRef(({className:n,...r},c)=>e.jsx("caption",{ref:c,className:$("mt-4 text-sm text-muted-foreground",n),...r}));hw.displayName="TableCaption";const oo=u.forwardRef(({className:n,...r},c)=>e.jsx(Lt,{ref:c,className:$("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",n),...r}));oo.displayName=Lt.displayName;const uo=u.forwardRef(({className:n,...r},c)=>e.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[e.jsx(St,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(Lt.Input,{ref:c,className:$("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",n),...r})]}));uo.displayName=Lt.Input.displayName;const mo=u.forwardRef(({className:n,...r},c)=>e.jsx(Lt.List,{ref:c,className:$("max-h-[300px] overflow-y-auto overflow-x-hidden",n),...r}));mo.displayName=Lt.List.displayName;const ho=u.forwardRef((n,r)=>e.jsx(Lt.Empty,{ref:r,className:"py-6 text-center text-sm",...n}));ho.displayName=Lt.Empty.displayName;const vr=u.forwardRef(({className:n,...r},c)=>e.jsx(Lt.Group,{ref:c,className:$("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",n),...r}));vr.displayName=Lt.Group.displayName;const xw=u.forwardRef(({className:n,...r},c)=>e.jsx(Lt.Separator,{ref:c,className:$("-mx-1 h-px bg-border",n),...r}));xw.displayName=Lt.Separator.displayName;const yr=u.forwardRef(({className:n,...r},c)=>e.jsx(Lt.Item,{ref:c,className:$("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n),...r}));yr.displayName=Lt.Item.displayName;const yt=u.forwardRef(({className:n,...r},c)=>e.jsx(rg,{ref:c,className:$("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",n),...r,children:e.jsx(fN,{className:$("grid place-content-center text-current"),children:e.jsx(ha,{className:"h-4 w-4"})})}));yt.displayName=rg.displayName;const Ug=u.createContext(null),Bg="maibot-completed-tours";function fw(){try{const n=localStorage.getItem(Bg);return n?new Set(JSON.parse(n)):new Set}catch{return new Set}}function cp(n){localStorage.setItem(Bg,JSON.stringify([...n]))}function pw({children:n}){const[r,c]=u.useState({activeTourId:null,stepIndex:0,isRunning:!1}),d=u.useRef(new Map),[,h]=u.useState(0),[x,f]=u.useState(fw),j=u.useCallback((V,E)=>{d.current.set(V,E),h(B=>B+1)},[]),g=u.useCallback(V=>{d.current.delete(V),c(E=>E.activeTourId===V?{...E,activeTourId:null,isRunning:!1,stepIndex:0}:E)},[]),_=u.useCallback((V,E=0)=>{d.current.has(V)&&c({activeTourId:V,stepIndex:E,isRunning:!0})},[]),v=u.useCallback(()=>{c(V=>({...V,isRunning:!1}))},[]),k=u.useCallback(V=>{c(E=>({...E,stepIndex:V}))},[]),z=u.useCallback(()=>{c(V=>({...V,stepIndex:V.stepIndex+1}))},[]),T=u.useCallback(()=>{c(V=>({...V,stepIndex:Math.max(0,V.stepIndex-1)}))},[]),L=u.useCallback(()=>r.activeTourId?d.current.get(r.activeTourId)||[]:[],[r.activeTourId]),K=u.useCallback(V=>{f(E=>{const B=new Set(E);return B.add(V),cp(B),B})},[]),U=u.useCallback(V=>{const{action:E,index:B,status:X,type:w}=V,D=["finished","skipped"];if(E==="close"){c(te=>({...te,isRunning:!1,stepIndex:0}));return}D.includes(X)?c(te=>(X==="finished"&&te.activeTourId&&setTimeout(()=>K(te.activeTourId),0),{...te,isRunning:!1,stepIndex:0})):w==="step:after"&&(E==="next"?c(te=>({...te,stepIndex:B+1})):E==="prev"&&c(te=>({...te,stepIndex:B-1})))},[K]),R=u.useCallback(V=>x.has(V),[x]),ee=u.useCallback(V=>{f(E=>{const B=new Set(E);return B.delete(V),cp(B),B})},[]);return e.jsx(Ug.Provider,{value:{state:r,tours:d.current,registerTour:j,unregisterTour:g,startTour:_,stopTour:v,goToStep:k,nextStep:z,prevStep:T,getCurrentSteps:L,handleJoyrideCallback:U,isTourCompleted:R,markTourCompleted:K,resetTourCompleted:ee},children:n})}function Ju(){const n=u.useContext(Ug);if(!n)throw new Error("useTour must be used within a TourProvider");return n}const gw={options:{zIndex:1e4,primaryColor:"hsl(var(--primary))",textColor:"hsl(var(--foreground))",backgroundColor:"hsl(var(--background))",arrowColor:"hsl(var(--background))",overlayColor:"rgba(0, 0, 0, 0.5)"},tooltip:{borderRadius:"var(--radius)",padding:"1rem"},tooltipContainer:{textAlign:"left"},tooltipTitle:{fontSize:"1rem",fontWeight:600,marginBottom:"0.5rem"},tooltipContent:{fontSize:"0.875rem",padding:"0.5rem 0"},buttonNext:{backgroundColor:"hsl(var(--primary))",color:"hsl(var(--primary-foreground))",borderRadius:"calc(var(--radius) - 2px)",fontSize:"0.875rem",padding:"0.5rem 1rem"},buttonBack:{color:"hsl(var(--muted-foreground))",fontSize:"0.875rem",marginRight:"0.5rem"},buttonSkip:{color:"hsl(var(--muted-foreground))",fontSize:"0.875rem"},buttonClose:{color:"hsl(var(--muted-foreground))"},spotlight:{borderRadius:"var(--radius)"}},jw={back:"上一步",close:"关闭",last:"完成",next:"下一步",nextLabelWithProgress:"下一步 ({step}/{steps})",open:"打开对话框",skip:"跳过"};function vw(){const{state:n,getCurrentSteps:r,handleJoyrideCallback:c}=Ju(),d=r(),[h,x]=u.useState(!1),f=u.useRef(n.stepIndex),j=u.useRef(null);u.useEffect(()=>{f.current!==n.stepIndex&&(x(!1),f.current=n.stepIndex)},[n.stepIndex]),u.useEffect(()=>{if(!n.isRunning||d.length===0){x(!1);return}const v=d[n.stepIndex];if(!v){x(!1);return}const k=v.target;if(k==="body"){x(!0);return}x(!1);const z=setTimeout(()=>{const T=()=>{const R=document.querySelector(k);if(R){const ee=R.getBoundingClientRect();if(ee.width>0&&ee.height>0)return!0}return!1};if(T()){setTimeout(()=>x(!0),100);return}const L=setInterval(()=>{T()&&(clearInterval(L),setTimeout(()=>x(!0),100))},100),K=setTimeout(()=>{clearInterval(L),x(!0)},5e3),U=()=>{clearInterval(L),clearTimeout(K)};j.current=U},150);return()=>{clearTimeout(z),j.current&&(j.current(),j.current=null)}},[n.isRunning,n.stepIndex,d]);const g=u.useRef(null);if(u.useEffect(()=>{let v=document.getElementById("tour-portal-container");return v||(v=document.createElement("div"),v.id="tour-portal-container",v.style.cssText="position: fixed; top: 0; left: 0; z-index: 99999; pointer-events: none;",document.body.appendChild(v)),g.current=v,()=>{}},[]),!n.isRunning||d.length===0||!h)return null;const _=e.jsx(ib,{steps:d,stepIndex:n.stepIndex,run:n.isRunning,continuous:!0,showSkipButton:!0,showProgress:!0,disableOverlayClose:!0,disableScrolling:!1,disableScrollParentFix:!1,callback:c,styles:gw,locale:jw,scrollOffset:80,scrollToFirstStep:!0,floaterProps:{styles:{floater:{zIndex:99999}},disableAnimation:!0}},`tour-step-${n.stepIndex}`);return g.current?xy.createPortal(_,g.current):_}const ll="model-assignment-tour",Hg=[{target:"body",content:"本引导旨在帮助你配置模型提供商和对应的模型,并为麦麦的各个组件分配合适的模型。",placement:"center",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="sidebar-model-provider"]',content:'第一步,你需要配置模型提供商。模型提供商决定了你要使用谁家的模型,无论是单一厂商(如 DeepSeek),还是模型平台(如 Siliconflow),都可以在这里进行配置。点击"下一步"进入配置页面。',placement:"right",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="add-provider-button"]',content:'点击"添加提供商"按钮,开始配置你的模型提供商。',placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="provider-dialog"]',content:"在这里,你可以选择你想要配置的模型提供商,填写相关信息后保存即可。",placement:"left",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-name-input"]',content:"这里的名称是你为这个模型提供商起的一个名字,方便你在后续使用时识别它。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-apikey-input"]',content:"这里需要填写你从模型提供商那里获取的 API 密钥,用于验证和调用模型服务。对于不同的提供商,获取 API 密钥的方式可能有所不同,请参考对应提供商的文档。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-url-input"]',content:"这里需要填写模型提供商的 API 访问地址,确保填写正确以便系统能够连接到模型服务。对于不同的提供商,API 地址可能有所不同,请参考对应提供商的文档。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-template-select"]',content:"当然,如果你不知道如何填写这些信息,很多模型提供商在这里都提供了预设的模板供你选择,选择对应的模板后,相关信息会自动填充。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-save-button"]',content:"填写完所有信息后,点击保存按钮,模型提供商就配置完成了。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-cancel-button"]',content:"因为这次咱们什么都没有填写,所以点击取消按钮退出吧。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="sidebar-model-management"]',content:'配置好模型提供商后,接下来我们需要为麦麦添加模型并分配功能。点击"下一步"进入模型管理页面。',placement:"right",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="add-model-button"]',content:'在为麦麦的组件分配模型之前,首先需要添加你想要分配的模型,点击"添加模型"按钮开始添加。',placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="model-dialog"]',content:"在这里,你可以选择你之前配置好的模型提供商,然后选择对应的模型来添加。",placement:"left",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-name-input"]',content:"这里的模型名称是你为这个模型起的一个名字,方便你在后续使用时识别它。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-provider-select"]',content:"在这里选择你之前配置好的模型提供商,这样系统才能知道你要添加哪个提供商的模型。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-identifier-input"]',content:"这里需要填写你想要添加的模型的标识符,不同的模型提供商可能有不同的标识符格式,请参考对应提供商的文档。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-save-button"]',content:"填写完所有信息后,点击保存按钮,模型就添加完成了。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-cancel-button"]',content:"当然,因为这次咱们什么都没有填写,所以直接点击取消按钮退出吧,等你准备好了再来添加模型。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="tasks-tab-trigger"]',content:'最后一步,添加好模型后,切换到"为模型分配功能"标签页,为麦麦的各个组件分配合适的模型。',placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="task-model-select"]',content:"在这里,你可以为每个组件选择一个或多个合适的模型,选择完成后配置会自动保存。恭喜你完成了模型配置的学习!",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1}],qg={0:"/config/model",1:"/config/model",2:"/config/modelProvider",3:"/config/modelProvider",4:"/config/modelProvider",5:"/config/modelProvider",6:"/config/modelProvider",7:"/config/modelProvider",8:"/config/modelProvider",9:"/config/modelProvider",10:"/config/modelProvider",11:"/config/model",12:"/config/model",13:"/config/model",14:"/config/model",15:"/config/model",16:"/config/model",17:"/config/model",18:"/config/model",19:"/config/model"},rr=[{id:"siliconflow",name:"SiliconFlow",base_url:"https://api.siliconflow.cn/v1",client_type:"openai",display_name:"硅基流动 (SiliconFlow)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"deepseek",name:"DeepSeek",base_url:"https://api.deepseek.com",client_type:"openai",display_name:"DeepSeek",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"rinkoai",name:"RinkoAI",base_url:"https://rinkoai.com/v1",client_type:"openai",display_name:"RinkoAI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"zhipu",name:"ZhipuAI",base_url:"https://open.bigmodel.cn/api/paas/v4",client_type:"openai",display_name:"智谱 AI (ZhipuAI / GLM)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"moonshot",name:"Moonshot",base_url:"https://api.moonshot.cn/v1",client_type:"openai",display_name:"月之暗面 (Moonshot / Kimi)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"doubao",name:"Doubao",base_url:"https://ark.cn-beijing.volces.com/api/v3",client_type:"openai",display_name:"字节豆包 (Doubao)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"alibaba",name:"Alibaba",base_url:"https://dashscope.aliyuncs.com/compatible-mode/v1",client_type:"openai",display_name:"阿里云百炼 (Alibaba Qwen)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"baichuan",name:"Baichuan",base_url:"https://api.baichuan-ai.com/v1",client_type:"openai",display_name:"百川智能 (Baichuan)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"minimax",name:"MiniMax",base_url:"https://api.minimax.chat/v1",client_type:"openai",display_name:"MiniMax (海螺 AI)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"stepfun",name:"StepFun",base_url:"https://api.stepfun.com/v1",client_type:"openai",display_name:"阶跃星辰 (StepFun)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"lingyi",name:"Lingyi",base_url:"https://api.lingyiwanwu.com/v1",client_type:"openai",display_name:"零一万物 (Lingyi / Yi)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"openai",name:"OpenAI",base_url:"https://api.openai.com/v1",client_type:"openai",display_name:"OpenAI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"xai",name:"xAI",base_url:"https://api.x.ai/v1",client_type:"openai",display_name:"xAI (Grok)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"anthropic",name:"Anthropic",base_url:"https://api.anthropic.com/v1",client_type:"openai",display_name:"Anthropic (Claude)"},{id:"gemini",name:"Gemini",base_url:"https://generativelanguage.googleapis.com/v1beta",client_type:"gemini",display_name:"Google Gemini",modelFetcher:{endpoint:"/models",parser:"gemini"}},{id:"cohere",name:"Cohere",base_url:"https://api.cohere.ai/v1",client_type:"openai",display_name:"Cohere"},{id:"groq",name:"Groq",base_url:"https://api.groq.com/openai/v1",client_type:"openai",display_name:"Groq",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"together",name:"Together AI",base_url:"https://api.together.xyz/v1",client_type:"openai",display_name:"Together AI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"fireworks",name:"Fireworks",base_url:"https://api.fireworks.ai/inference/v1",client_type:"openai",display_name:"Fireworks AI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"mistral",name:"Mistral",base_url:"https://api.mistral.ai/v1",client_type:"openai",display_name:"Mistral AI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"perplexity",name:"Perplexity",base_url:"https://api.perplexity.ai",client_type:"openai",display_name:"Perplexity AI"},{id:"custom",name:"",base_url:"",client_type:"openai",display_name:"自定义"}];function op(n){return n?n.replace(/\/+$/,"").toLowerCase():""}function yw(n){if(!n)return null;const r=op(n);return rr.find(c=>c.id!=="custom"&&op(c.base_url)===r)||null}function Nw(){const[n,r]=u.useState([]),[c,d]=u.useState(!0),[h,x]=u.useState(!1),[f,j]=u.useState(!1),[g,_]=u.useState(!1),[v,k]=u.useState(!1),[z,T]=u.useState(!1),[L,K]=u.useState(!1),[U,R]=u.useState(null),[ee,V]=u.useState(null),[E,B]=u.useState("custom"),[X,w]=u.useState(!1),[D,te]=u.useState(!1),[xe,be]=u.useState(null),[ye,ve]=u.useState(!1),[pe,Ne]=u.useState(""),[y,q]=u.useState(new Set),[H,ne]=u.useState(!1),[S,me]=u.useState(1),[he,Q]=u.useState(20),[oe,ge]=u.useState(""),[le,O]=u.useState({}),[F,A]=u.useState(new Set),[W,_e]=u.useState(new Map),{toast:Me}=Bs(),ss=It(),{state:Ie,goToStep:Rs,registerTour:qs}=Ju(),ie=u.useRef(null),we=u.useRef(!0);u.useEffect(()=>{qs(ll,Hg)},[qs]),u.useEffect(()=>{if(Ie.activeTourId===ll&&Ie.isRunning){const P=qg[Ie.stepIndex];P&&!window.location.pathname.endsWith(P.replace("/config/",""))&&ss({to:P})}},[Ie.stepIndex,Ie.activeTourId,Ie.isRunning,ss]);const Ke=u.useRef(Ie.stepIndex);u.useEffect(()=>{if(Ie.activeTourId===ll&&Ie.isRunning){const P=Ke.current,je=Ie.stepIndex;P>=3&&P<=9&&je<3&&K(!1),P>=10&&je>=3&&je<=9&&(O({}),B("custom"),R({name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10}),V(null),ve(!1),K(!0)),Ke.current=je}},[Ie.stepIndex,Ie.activeTourId,Ie.isRunning]),u.useEffect(()=>{if(Ie.activeTourId!==ll||!Ie.isRunning)return;const P=je=>{const Ae=je.target,tt=Ie.stepIndex;tt===2&&Ae.closest('[data-tour="add-provider-button"]')?setTimeout(()=>Rs(3),300):tt===9&&Ae.closest('[data-tour="provider-cancel-button"]')&&setTimeout(()=>Rs(10),300)};return document.addEventListener("click",P,!0),()=>document.removeEventListener("click",P,!0)},[Ie,Rs]),u.useEffect(()=>{Le()},[]);const Le=async()=>{try{d(!0);const P=await ei();r(P.api_providers||[]),_(!1),we.current=!1}catch(P){console.error("加载配置失败:",P)}finally{d(!1)}},st=async()=>{try{k(!0),co().catch(()=>{}),T(!0)}catch(P){console.error("重启失败:",P),T(!1),Me({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),k(!1)}},Jt=async()=>{try{x(!0),ie.current&&clearTimeout(ie.current);const P=await ei();P.api_providers=n,await io(P),_(!1),Me({title:"保存成功",description:"正在重启麦麦..."}),await st()}catch(P){console.error("保存配置失败:",P),Me({title:"保存失败",description:P.message,variant:"destructive"}),x(!1)}},bt=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},Je=()=>{T(!1),k(!1),Me({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},Ue=u.useCallback(async P=>{if(!we.current)try{j(!0),await qu("api_providers",P),_(!1)}catch(je){console.error("自动保存失败:",je),_(!0)}finally{j(!1)}},[]);u.useEffect(()=>{if(!we.current)return _(!0),ie.current&&clearTimeout(ie.current),ie.current=setTimeout(()=>{Ue(n)},2e3),()=>{ie.current&&clearTimeout(ie.current)}},[n,Ue]);const jt=async()=>{try{x(!0),ie.current&&clearTimeout(ie.current);const P=await ei();P.api_providers=n,await io(P),_(!1),Me({title:"保存成功",description:"模型提供商配置已保存"})}catch(P){console.error("保存配置失败:",P),Me({title:"保存失败",description:P.message,variant:"destructive"})}finally{x(!1)}},nt=(P,je)=>{if(O({}),P){const Ae=rr.find(tt=>tt.base_url===P.base_url&&tt.client_type===P.client_type);B(Ae?.id||"custom"),R(P)}else B("custom"),R({name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10});V(je),ve(!1),K(!0)},Ct=P=>{B(P),w(!1);const je=rr.find(Ae=>Ae.id===P);je&&je.id!=="custom"?R(Ae=>({...Ae,name:je.name,base_url:je.base_url,client_type:je.client_type})):je?.id==="custom"&&R(Ae=>({...Ae,name:"",base_url:"",client_type:"openai"}))},kt=u.useMemo(()=>E!=="custom",[E]),rl=async()=>{if(U?.api_key)try{await navigator.clipboard.writeText(U.api_key),Me({title:"复制成功",description:"API Key 已复制到剪贴板"})}catch{Me({title:"复制失败",description:"无法访问剪贴板",variant:"destructive"})}},cl=()=>{if(!U)return;const P={};if(U.name?.trim()||(P.name="请输入提供商名称"),U.base_url?.trim()||(P.base_url="请输入基础 URL"),U.api_key?.trim()||(P.api_key="请输入 API Key"),Object.keys(P).length>0){O(P);return}O({});const je={...U,max_retry:U.max_retry??2,timeout:U.timeout??30,retry_interval:U.retry_interval??10};if(ee!==null){const Ae=[...n];Ae[ee]=je,r(Ae)}else r([...n,je]);K(!1),R(null),V(null)},ol=P=>{if(!P&&U){const je={...U,max_retry:U.max_retry??2,timeout:U.timeout??30,retry_interval:U.retry_interval??10};R(je)}K(P)},Se=P=>{be(P),te(!0)},Re=()=>{if(xe!==null){const P=n.filter((je,Ae)=>Ae!==xe);r(P),Me({title:"删除成功",description:"提供商已从列表中移除"})}te(!1),be(null)},it=P=>{const je=new Set(y);je.has(P)?je.delete(P):je.add(P),q(je)},ot=()=>{if(y.size===dt.length)q(new Set);else{const P=dt.map((je,Ae)=>n.findIndex(tt=>tt===dt[Ae]));q(new Set(P))}},di=()=>{if(y.size===0){Me({title:"提示",description:"请先选择要删除的提供商",variant:"default"});return}ne(!0)},on=()=>{const P=n.filter((je,Ae)=>!y.has(Ae));r(P),q(new Set),ne(!1),Me({title:"批量删除成功",description:`已删除 ${y.size} 个提供商`})},dt=n.filter(P=>{if(!pe)return!0;const je=pe.toLowerCase();return P.name.toLowerCase().includes(je)||P.base_url.toLowerCase().includes(je)||P.client_type.toLowerCase().includes(je)}),Pt=Math.ceil(dt.length/he),Wt=dt.slice((S-1)*he,S*he),La=()=>{const P=parseInt(oe);P>=1&&P<=Pt&&(me(P),ge(""))},Ut=async P=>{A(je=>new Set(je).add(P));try{const je=await $0(P);_e(Ae=>new Map(Ae).set(P,je)),je.network_ok?je.api_key_valid===!0?Me({title:"连接正常",description:`${P} 网络连接正常,API Key 有效 (${je.latency_ms}ms)`}):je.api_key_valid===!1?Me({title:"连接正常但 Key 无效",description:`${P} 网络连接正常,但 API Key 无效或已过期`,variant:"destructive"}):Me({title:"网络连接正常",description:`${P} 可以访问 (${je.latency_ms}ms)`}):Me({title:"连接失败",description:je.error||"无法连接到提供商",variant:"destructive"})}catch(je){Me({title:"测试失败",description:je.message,variant:"destructive"})}finally{A(je=>{const Ae=new Set(je);return Ae.delete(P),Ae})}},Ua=async()=>{for(const P of n)await Ut(P.name)},ba=P=>{const je=F.has(P),Ae=W.get(P);return je?e.jsxs(Xe,{variant:"secondary",className:"gap-1",children:[e.jsx(vt,{className:"h-3 w-3 animate-spin"}),"测试中"]}):Ae?Ae.network_ok?Ae.api_key_valid===!0?e.jsxs(Xe,{className:"gap-1 bg-green-600 hover:bg-green-700",children:[e.jsx(xa,{className:"h-3 w-3"}),"正常"]}):Ae.api_key_valid===!1?e.jsxs(Xe,{variant:"destructive",className:"gap-1",children:[e.jsx(Aa,{className:"h-3 w-3"}),"Key无效"]}):e.jsxs(Xe,{className:"gap-1 bg-blue-600 hover:bg-blue-700",children:[e.jsx(xa,{className:"h-3 w-3"}),"可访问"]}):e.jsxs(Xe,{variant:"destructive",className:"gap-1",children:[e.jsx(pg,{className:"h-3 w-3"}),"离线"]}):null};return c?e.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})}):e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"AI模型厂商配置"}),e.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理 AI 模型厂商的 API 配置"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[y.size>0&&e.jsxs(N,{onClick:di,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[e.jsx(ns,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",y.size,")"]}),e.jsxs(N,{onClick:Ua,size:"sm",variant:"outline",className:"w-full sm:w-auto",disabled:n.length===0||F.size>0,children:[e.jsx(ln,{className:"mr-2 h-4 w-4"}),F.size>0?`测试中 (${F.size})`:"测试全部"]}),e.jsxs(N,{onClick:()=>nt(null,null),size:"sm",className:"w-full sm:w-auto","data-tour":"add-provider-button",children:[e.jsx(gt,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加提供商"]}),e.jsxs(N,{onClick:jt,disabled:h||f||!g||v,size:"sm",variant:"outline",className:"w-full sm:w-auto sm:min-w-[120px]",children:[e.jsx(br,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),h?"保存中...":f?"自动保存中...":g?"保存配置":"已保存"]}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsxs(N,{disabled:h||f||v,size:"sm",className:"w-full sm:w-auto sm:min-w-[120px]",children:[e.jsx(Nr,{className:"mr-2 h-4 w-4"}),v?"重启中...":g?"保存并重启":"重启麦麦"]})}),e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认重启麦麦?"}),e.jsx(ms,{className:"space-y-3",asChild:!0,children:e.jsxs("div",{children:[e.jsx("p",{children:g?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"}),e.jsxs(ua,{className:"border-yellow-500/50 bg-yellow-500/10",children:[e.jsx(Xt,{className:"h-4 w-4 text-yellow-600"}),e.jsxs(ma,{className:"text-yellow-900 dark:text-yellow-100",children:[e.jsx("strong",{children:"重要提示:"}),"由于技术原因,使用重启功能后,将无法再使用 ",e.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。",e.jsxs(Os,{children:[e.jsx(ni,{asChild:!0,children:e.jsxs("button",{className:"ml-1 text-yellow-700 dark:text-yellow-300 underline hover:text-yellow-800 dark:hover:text-yellow-200 inline-flex items-center gap-1",children:[e.jsx(ro,{className:"h-3 w-3"}),"如何结束程序?"]})}),e.jsxs(Es,{className:"max-w-2xl",children:[e.jsxs(zs,{children:[e.jsx(Ms,{children:"如何结束使用重启功能后的麦麦程序"}),e.jsx($s,{children:"由于重启功能会使程序脱离终端控制,需要通过系统命令来结束进程"})]}),e.jsxs(Kt,{defaultValue:"windows",className:"w-full",children:[e.jsxs(Rt,{className:"grid w-full grid-cols-3",children:[e.jsx(He,{value:"windows",children:"Windows"}),e.jsx(He,{value:"macos",children:"macOS"}),e.jsx(He,{value:"linux",children:"Linux"})]}),e.jsxs(We,{value:"windows",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"方法一:使用任务管理器"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[e.jsxs("li",{children:["按 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Ctrl + Shift + Esc"})," 打开任务管理器"]}),e.jsxs("li",{children:["在“进程”或“详细信息”标签页中找到 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"python.exe"})]}),e.jsx("li",{children:"右键点击并选择“结束任务”"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"方法二:使用命令行"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"打开 PowerShell 或命令提示符,执行以下命令:"}),e.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[e.jsx("p",{children:"# 查找麦麦进程"}),e.jsx("p",{children:'Get-Process python | Where-Object {$_.MainWindowTitle -eq ""}'}),e.jsx("p",{className:"mt-2",children:"# 结束所有 Python 进程(谨慎使用)"}),e.jsx("p",{children:"Stop-Process -Name python -Force"})]})]})]}),e.jsxs(We,{value:"macos",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"方法一:使用活动监视器"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[e.jsxs("li",{children:["按 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Cmd + Space"})," 打开 Spotlight,搜索“活动监视器”"]}),e.jsxs("li",{children:["在进程列表中找到 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Python"})]}),e.jsx("li",{children:"选中后点击左上角的 X 按钮结束进程"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"方法二:使用终端"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),e.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[e.jsx("p",{children:"# 查找麦麦进程"}),e.jsx("p",{children:"ps aux | grep python | grep -v grep"}),e.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),e.jsx("p",{children:"kill -9 "}),e.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),e.jsx("p",{children:"pkill -9 python"})]})]})]}),e.jsxs(We,{value:"linux",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"使用终端命令"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),e.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[e.jsx("p",{children:"# 查找麦麦进程"}),e.jsx("p",{children:"ps aux | grep python | grep -v grep"}),e.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),e.jsx("p",{children:"kill -9 "}),e.jsx("p",{className:"mt-2",children:"# 或使用 pkill 按名称结束"}),e.jsx("p",{children:'pkill -9 -f "bot.py"'}),e.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),e.jsx("p",{children:"pkill -9 python"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"使用 htop(如已安装)"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[e.jsxs("li",{children:["在终端输入 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"htop"})]}),e.jsxs("li",{children:["按 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F3"})," 搜索 python"]}),e.jsxs("li",{children:["按 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F9"})," 发送信号,选择 SIGKILL"]})]})]})]})]}),e.jsx(Is,{children:e.jsx(Zu,{asChild:!0,children:e.jsx(N,{variant:"outline",children:"关闭"})})})]})]})]})]})]})})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:g?Jt:st,children:g?"保存并重启":"确认重启"})]})]})]})]})]}),e.jsxs(ua,{children:[e.jsx(Xt,{className:"h-4 w-4"}),e.jsxs(ma,{children:["配置更新后需要",e.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),e.jsxs(es,{className:"h-[calc(100vh-260px)]",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 mb-4",children:[e.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[e.jsx(St,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ce,{placeholder:"搜索提供商名称、URL 或类型...",value:pe,onChange:P=>Ne(P.target.value),className:"pl-9"})]}),pe&&e.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",dt.length," 个结果"]})]}),e.jsx("div",{className:"md:hidden space-y-3",children:dt.length===0?e.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:pe?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'}):Wt.map((P,je)=>{const Ae=n.findIndex(tt=>tt===P);return e.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h3",{className:"font-semibold text-base truncate",children:P.name}),ba(P.name)]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:P.base_url})]}),e.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[e.jsx(N,{variant:"outline",size:"sm",onClick:()=>Ut(P.name),disabled:F.has(P.name),title:"测试连接",children:F.has(P.name)?e.jsx(vt,{className:"h-4 w-4 animate-spin"}):e.jsx(ln,{className:"h-4 w-4"})}),e.jsx(N,{variant:"default",size:"sm",onClick:()=>nt(P,Ae),children:e.jsx(nn,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),e.jsx(N,{size:"sm",onClick:()=>Se(Ae),className:"bg-red-600 hover:bg-red-700 text-white",children:e.jsx(ns,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"客户端类型"}),e.jsx("p",{className:"font-medium",children:P.client_type})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"最大重试"}),e.jsx("p",{className:"font-medium",children:P.max_retry})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"超时(秒)"}),e.jsx("p",{className:"font-medium",children:P.timeout})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"重试间隔(秒)"}),e.jsx("p",{className:"font-medium",children:P.retry_interval})]})]})]},je)})}),e.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs(ii,{children:[e.jsx(ri,{children:e.jsxs(pt,{children:[e.jsx(ls,{className:"w-12",children:e.jsx(yt,{checked:y.size===dt.length&&dt.length>0,onCheckedChange:ot})}),e.jsx(ls,{children:"状态"}),e.jsx(ls,{children:"名称"}),e.jsx(ls,{children:"基础URL"}),e.jsx(ls,{children:"客户端类型"}),e.jsx(ls,{className:"text-right",children:"最大重试"}),e.jsx(ls,{className:"text-right",children:"超时(秒)"}),e.jsx(ls,{className:"text-right",children:"重试间隔(秒)"}),e.jsx(ls,{className:"text-right",children:"操作"})]})}),e.jsx(ci,{children:Wt.length===0?e.jsx(pt,{children:e.jsx(Ye,{colSpan:9,className:"text-center text-muted-foreground py-8",children:pe?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'})}):Wt.map((P,je)=>{const Ae=n.findIndex(tt=>tt===P);return e.jsxs(pt,{children:[e.jsx(Ye,{children:e.jsx(yt,{checked:y.has(Ae),onCheckedChange:()=>it(Ae)})}),e.jsx(Ye,{children:ba(P.name)||e.jsx(Xe,{variant:"outline",className:"text-muted-foreground",children:"未测试"})}),e.jsx(Ye,{className:"font-medium",children:P.name}),e.jsx(Ye,{className:"max-w-xs truncate",title:P.base_url,children:P.base_url}),e.jsx(Ye,{children:P.client_type}),e.jsx(Ye,{className:"text-right",children:P.max_retry}),e.jsx(Ye,{className:"text-right",children:P.timeout}),e.jsx(Ye,{className:"text-right",children:P.retry_interval}),e.jsx(Ye,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(N,{variant:"outline",size:"sm",onClick:()=>Ut(P.name),disabled:F.has(P.name),title:"测试连接",children:F.has(P.name)?e.jsx(vt,{className:"h-4 w-4 animate-spin"}):e.jsx(ln,{className:"h-4 w-4"})}),e.jsxs(N,{variant:"default",size:"sm",onClick:()=>nt(P,Ae),children:[e.jsx(nn,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),e.jsxs(N,{size:"sm",onClick:()=>Se(Ae),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ns,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},je)})})]})})}),dt.length>0&&e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{htmlFor:"page-size-provider",className:"text-sm whitespace-nowrap",children:"每页显示"}),e.jsxs(Qe,{value:he.toString(),onValueChange:P=>{Q(parseInt(P)),me(1),q(new Set)},children:[e.jsx(Ge,{id:"page-size-provider",className:"w-20",children:e.jsx($e,{})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"10",children:"10"}),e.jsx(ue,{value:"20",children:"20"}),e.jsx(ue,{value:"50",children:"50"}),e.jsx(ue,{value:"100",children:"100"})]})]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(S-1)*he+1," 到"," ",Math.min(S*he,dt.length)," 条,共 ",dt.length," 条"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{variant:"outline",size:"sm",onClick:()=>me(1),disabled:S===1,className:"hidden sm:flex",children:e.jsx(wr,{className:"h-4 w-4"})}),e.jsxs(N,{variant:"outline",size:"sm",onClick:()=>me(P=>Math.max(1,P-1)),disabled:S===1,children:[e.jsx(cn,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{type:"number",value:oe,onChange:P=>ge(P.target.value),onKeyDown:P=>P.key==="Enter"&&La(),placeholder:S.toString(),className:"w-16 h-8 text-center",min:1,max:Pt}),e.jsx(N,{variant:"outline",size:"sm",onClick:La,disabled:!oe,className:"h-8",children:"跳转"})]}),e.jsxs(N,{variant:"outline",size:"sm",onClick:()=>me(P=>P+1),disabled:S>=Pt,children:[e.jsx("span",{className:"hidden sm:inline",children:"下一页"}),e.jsx(il,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(N,{variant:"outline",size:"sm",onClick:()=>me(Pt),disabled:S>=Pt,className:"hidden sm:flex",children:e.jsx(_r,{className:"h-4 w-4"})})]})]})]}),e.jsx(Os,{open:L,onOpenChange:ol,children:e.jsxs(Es,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto","data-tour":"provider-dialog",preventOutsideClose:Ie.isRunning,children:[e.jsxs(zs,{children:[e.jsx(Ms,{children:ee!==null?"编辑提供商":"添加提供商"}),e.jsx($s,{children:"配置 API 提供商的连接信息和参数"})]}),e.jsxs("form",{onSubmit:P=>{P.preventDefault(),cl()},autoComplete:"off",children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid gap-2","data-tour":"provider-template-select",children:[e.jsx(b,{htmlFor:"template",children:"提供商模板"}),e.jsxs(Da,{open:X,onOpenChange:w,children:[e.jsx(Oa,{asChild:!0,children:e.jsxs(N,{variant:"outline",role:"combobox","aria-expanded":X,className:"w-full justify-between",children:[E?rr.find(P=>P.id===E)?.display_name:"选择提供商模板...",e.jsx($u,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(Na,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:e.jsxs(oo,{children:[e.jsx(uo,{placeholder:"搜索提供商模板..."}),e.jsx(es,{className:"h-[300px]",children:e.jsxs(mo,{className:"max-h-none overflow-visible",children:[e.jsx(ho,{children:"未找到匹配的模板"}),e.jsx(vr,{children:rr.map(P=>e.jsxs(yr,{value:P.display_name,onSelect:()=>Ct(P.id),children:[e.jsx(ha,{className:`mr-2 h-4 w-4 ${E===P.id?"opacity-100":"opacity-0"}`}),P.display_name]},P.id))})]})})]})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"选择预设模板可自动填充 URL 和客户端类型,支持搜索"})]}),e.jsxs("div",{className:"grid gap-2","data-tour":"provider-name-input",children:[e.jsx(b,{htmlFor:"name",className:le.name?"text-destructive":"",children:"名称 *"}),e.jsx(ce,{id:"name",value:U?.name||"",onChange:P=>{R(je=>je?{...je,name:P.target.value}:null),le.name&&O(je=>({...je,name:void 0}))},placeholder:"例如: DeepSeek, SiliconFlow",className:le.name?"border-destructive focus-visible:ring-destructive":""}),le.name&&e.jsx("p",{className:"text-xs text-destructive",children:le.name})]}),e.jsxs("div",{className:"grid gap-2","data-tour":"provider-url-input",children:[e.jsx(b,{htmlFor:"base_url",className:le.base_url?"text-destructive":"",children:"基础 URL *"}),e.jsx(ce,{id:"base_url",value:U?.base_url||"",onChange:P=>{R(je=>je?{...je,base_url:P.target.value}:null),le.base_url&&O(je=>({...je,base_url:void 0}))},placeholder:"https://api.example.com/v1",disabled:kt,className:`${kt?"bg-muted cursor-not-allowed":""} ${le.base_url?"border-destructive focus-visible:ring-destructive":""}`}),le.base_url&&e.jsx("p",{className:"text-xs text-destructive",children:le.base_url}),kt&&!le.base_url&&e.jsx("p",{className:"text-xs text-muted-foreground",children:'使用模板时 URL 不可编辑,切换到"自定义"以手动配置'})]}),e.jsxs("div",{className:"grid gap-2","data-tour":"provider-apikey-input",children:[e.jsx(b,{htmlFor:"api_key",className:le.api_key?"text-destructive":"",children:"API Key *"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{id:"api_key",type:ye?"text":"password",value:U?.api_key||"",onChange:P=>{R(je=>je?{...je,api_key:P.target.value}:null),le.api_key&&O(je=>({...je,api_key:void 0}))},placeholder:"sk-...",className:`flex-1 ${le.api_key?"border-destructive focus-visible:ring-destructive":""}`}),e.jsx(N,{type:"button",variant:"outline",size:"icon",onClick:()=>ve(!ye),title:ye?"隐藏密钥":"显示密钥",children:ye?e.jsx(mr,{className:"h-4 w-4"}):e.jsx(Zt,{className:"h-4 w-4"})}),e.jsx(N,{type:"button",variant:"outline",size:"icon",onClick:rl,title:"复制密钥",children:e.jsx(so,{className:"h-4 w-4"})})]}),le.api_key&&e.jsx("p",{className:"text-xs text-destructive",children:le.api_key})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"client_type",children:"客户端类型"}),e.jsxs(Qe,{value:U?.client_type||"openai",onValueChange:P=>R(je=>je?{...je,client_type:P}:null),disabled:kt,children:[e.jsx(Ge,{id:"client_type",className:kt?"bg-muted cursor-not-allowed":"",children:e.jsx($e,{placeholder:"选择客户端类型"})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"openai",children:"OpenAI"}),e.jsx(ue,{value:"gemini",children:"Gemini"})]})]}),kt&&e.jsx("p",{className:"text-xs text-muted-foreground",children:'使用模板时客户端类型不可编辑,切换到"自定义"以手动配置'})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"max_retry",children:"最大重试"}),e.jsx(ce,{id:"max_retry",type:"number",min:"0",value:U?.max_retry??"",onChange:P=>{const je=P.target.value===""?null:parseInt(P.target.value);R(Ae=>Ae?{...Ae,max_retry:je}:null)},placeholder:"默认: 2"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"timeout",children:"超时(秒)"}),e.jsx(ce,{id:"timeout",type:"number",min:"1",value:U?.timeout??"",onChange:P=>{const je=P.target.value===""?null:parseInt(P.target.value);R(Ae=>Ae?{...Ae,timeout:je}:null)},placeholder:"默认: 30"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"retry_interval",children:"重试间隔(秒)"}),e.jsx(ce,{id:"retry_interval",type:"number",min:"1",value:U?.retry_interval??"",onChange:P=>{const je=P.target.value===""?null:parseInt(P.target.value);R(Ae=>Ae?{...Ae,retry_interval:je}:null)},placeholder:"默认: 10"})]})]})]}),e.jsxs(Is,{children:[e.jsx(N,{type:"button",variant:"outline",onClick:()=>K(!1),"data-tour":"provider-cancel-button",children:"取消"}),e.jsx(N,{type:"submit","data-tour":"provider-save-button",children:"保存"})]})]})]})}),e.jsx(ps,{open:D,onOpenChange:te,children:e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认删除"}),e.jsxs(ms,{children:['确定要删除提供商 "',xe!==null?n[xe]?.name:"",'" 吗? 此操作无法撤销。']})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:Re,children:"删除"})]})]})}),e.jsx(ps,{open:H,onOpenChange:ne,children:e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认批量删除"}),e.jsxs(ms,{children:["确定要删除选中的 ",y.size," 个提供商吗? 此操作无法撤销。"]})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:on,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),z&&e.jsx(Iu,{onRestartComplete:bt,onRestartFailed:Je})]})}function bw({value:n,label:r,onRemove:c}){const{attributes:d,listeners:h,setNodeRef:x,transform:f,transition:j,isDragging:g}=gb({id:n}),_={transform:jb.Transform.toString(f),transition:j,opacity:g?.5:1};return e.jsx("div",{ref:x,style:_,className:$("inline-flex items-center gap-1",g&&"shadow-lg"),children:e.jsxs(Xe,{variant:"secondary",className:"cursor-move hover:bg-secondary/80 flex items-center gap-1",children:[e.jsx("div",{...d,...h,className:"cursor-grab active:cursor-grabbing flex items-center",children:e.jsx(DN,{className:"h-3 w-3 text-muted-foreground"})}),e.jsx("span",{children:r}),e.jsx(li,{className:"ml-1 h-3 w-3 cursor-pointer hover:text-destructive",strokeWidth:2,fill:"none",onClick:v=>{v.stopPropagation(),c(n)}})]})})}function ww({options:n,selected:r,onChange:c,placeholder:d="选择选项...",emptyText:h="未找到选项",className:x}){const[f,j]=u.useState(!1),g=cb(Jf(pb,{activationConstraint:{distance:8}}),Jf(fb,{coordinateGetter:xb})),_=z=>{r.includes(z)?c(r.filter(T=>T!==z)):c([...r,z])},v=z=>{c(r.filter(T=>T!==z))},k=z=>{const{active:T,over:L}=z;if(L&&T.id!==L.id){const K=r.indexOf(T.id),U=r.indexOf(L.id);c(hb(r,K,U))}};return e.jsxs(Da,{open:f,onOpenChange:j,children:[e.jsx(Oa,{asChild:!0,children:e.jsxs(N,{variant:"outline",role:"combobox","aria-expanded":f,className:$("w-full justify-between min-h-10 h-auto",x),children:[e.jsx(ob,{sensors:g,collisionDetection:db,onDragEnd:k,children:e.jsx(ub,{items:r,strategy:mb,children:e.jsx("div",{className:"flex gap-1 flex-wrap flex-1",children:r.length===0?e.jsx("span",{className:"text-muted-foreground",children:d}):r.map(z=>{const T=n.find(L=>L.value===z);return e.jsx(bw,{value:z,label:T?.label||z,onRemove:v},z)})})})}),e.jsx($u,{className:"ml-2 h-4 w-4 shrink-0 opacity-50",strokeWidth:2,fill:"none"})]})}),e.jsx(Na,{className:"w-full p-0",align:"start",children:e.jsxs(oo,{children:[e.jsx(uo,{placeholder:"搜索...",className:"h-9"}),e.jsxs(mo,{children:[e.jsx(ho,{children:h}),e.jsx(vr,{children:n.map(z=>{const T=r.includes(z.value);return e.jsxs(yr,{value:z.value,onSelect:()=>_(z.value),children:[e.jsx("div",{className:$("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",T?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(ha,{className:"h-3 w-3",strokeWidth:2,fill:"none"})}),e.jsx("span",{children:z.label})]},z.value)})})]})]})})]})}const dp=new Map,_w=300*1e3;function Sw(){const[n,r]=u.useState([]),[c,d]=u.useState([]),[h,x]=u.useState([]),[f,j]=u.useState([]),[g,_]=u.useState(null),[v,k]=u.useState(!0),[z,T]=u.useState(!1),[L,K]=u.useState(!1),[U,R]=u.useState(!1),[ee,V]=u.useState(!1),[E,B]=u.useState(!1),[X,w]=u.useState(!1),[D,te]=u.useState(null),[xe,be]=u.useState(null),[ye,ve]=u.useState(!1),[pe,Ne]=u.useState(null),[y,q]=u.useState(""),[H,ne]=u.useState(new Set),[S,me]=u.useState(!1),[he,Q]=u.useState(1),[oe,ge]=u.useState(20),[le,O]=u.useState(""),[F,A]=u.useState([]),[W,_e]=u.useState(!1),[Me,ss]=u.useState(null),[Ie,Rs]=u.useState(!1),[qs,ie]=u.useState(null),[we,Ke]=u.useState({}),{toast:Le}=Bs(),st=It(),{registerTour:Jt,startTour:bt,state:Je,goToStep:Ue}=Ju(),jt=u.useRef(null),nt=u.useRef(null),Ct=u.useRef(!0);u.useEffect(()=>{Jt(ll,Hg)},[Jt]),u.useEffect(()=>{if(Je.activeTourId===ll&&Je.isRunning){const Y=qg[Je.stepIndex];Y&&!window.location.pathname.endsWith(Y.replace("/config/",""))&&st({to:Y})}},[Je.stepIndex,Je.activeTourId,Je.isRunning,st]);const kt=u.useRef(Je.stepIndex);u.useEffect(()=>{if(Je.activeTourId===ll&&Je.isRunning){const Y=kt.current,fe=Je.stepIndex;Y>=12&&Y<=17&&fe<12&&w(!1),kt.current=fe}},[Je.stepIndex,Je.activeTourId,Je.isRunning]),u.useEffect(()=>{if(Je.activeTourId!==ll||!Je.isRunning)return;const Y=fe=>{const De=fe.target,Fe=Je.stepIndex;Fe===2&&De.closest('[data-tour="add-provider-button"]')?setTimeout(()=>Ue(3),300):Fe===9&&De.closest('[data-tour="provider-cancel-button"]')?setTimeout(()=>Ue(10),300):Fe===11&&De.closest('[data-tour="add-model-button"]')?setTimeout(()=>Ue(12),300):Fe===17&&De.closest('[data-tour="model-cancel-button"]')?setTimeout(()=>Ue(18),300):Fe===18&&De.closest('[data-tour="tasks-tab-trigger"]')&&setTimeout(()=>Ue(19),300)};return document.addEventListener("click",Y,!0),()=>document.removeEventListener("click",Y,!0)},[Je,Ue]);const rl=()=>{bt(ll)};u.useEffect(()=>{cl()},[]);const cl=async()=>{try{k(!0);const Y=await ei(),fe=Y.models||[];r(fe),j(fe.map(Fe=>Fe.name));const De=Y.api_providers||[];d(De.map(Fe=>Fe.name)),x(De),_(Y.model_task_config||null),R(!1),Ct.current=!1}catch(Y){console.error("加载配置失败:",Y)}finally{k(!1)}},ol=u.useCallback(Y=>h.find(fe=>fe.name===Y),[h]),Se=u.useCallback(async(Y,fe=!1)=>{const De=ol(Y);if(!De?.base_url){A([]),ie(null),ss('提供商配置不完整,请先在"模型提供商配置"中配置');return}if(!De.api_key){A([]),ie(null),ss('该提供商未配置 API Key,请先在"模型提供商配置"中填写');return}const Fe=yw(De.base_url);if(ie(Fe),!Fe?.modelFetcher){A([]),ss(null);return}const Ys=`${Y}:${De.base_url}`,wa=dp.get(Ys);if(!fe&&wa&&Date.now()-wa.timestamp<_w){A(wa.models),ss(null);return}_e(!0),ss(null);try{const Ba=await Q0(Y,Fe.modelFetcher.parser,Fe.modelFetcher.endpoint);A(Ba),dp.set(Ys,{models:Ba,timestamp:Date.now()})}catch(Ba){console.error("获取模型列表失败:",Ba);const _a=Ba.message||"获取模型列表失败";_a.includes("无效")||_a.includes("过期")||_a.includes("API Key")?ss('API Key 无效或已过期,请检查"模型提供商配置"中的密钥'):_a.includes("权限")?ss("没有权限获取模型列表,请检查 API Key 权限"):_a.includes("timeout")||_a.includes("超时")?ss("请求超时,请检查网络连接后重试"):_a.includes("不支持")?ss("该提供商不支持自动获取模型列表,请手动输入"):ss(_a),A([])}finally{_e(!1)}},[ol]);u.useEffect(()=>{X&&D?.api_provider&&Se(D.api_provider)},[X,D?.api_provider,Se]);const Re=async()=>{try{V(!0),co().catch(()=>{}),B(!0)}catch(Y){console.error("重启失败:",Y),B(!1),Le({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),V(!1)}},it=async()=>{try{T(!0),jt.current&&clearTimeout(jt.current),nt.current&&clearTimeout(nt.current);const Y=await ei();Y.models=n,Y.model_task_config=g,await io(Y),R(!1),Le({title:"保存成功",description:"正在重启麦麦..."}),await Re()}catch(Y){console.error("保存配置失败:",Y),Le({title:"保存失败",description:Y.message,variant:"destructive"}),T(!1)}},ot=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},di=()=>{B(!1),V(!1),Le({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},on=u.useCallback(async Y=>{if(!Ct.current)try{K(!0),await qu("models",Y),R(!1)}catch(fe){console.error("自动保存模型列表失败:",fe),R(!0)}finally{K(!1)}},[]),dt=u.useCallback(async Y=>{if(!Ct.current)try{K(!0),await qu("model_task_config",Y),R(!1)}catch(fe){console.error("自动保存任务配置失败:",fe),R(!0)}finally{K(!1)}},[]);u.useEffect(()=>{if(!Ct.current)return R(!0),jt.current&&clearTimeout(jt.current),jt.current=setTimeout(()=>{on(n)},2e3),()=>{jt.current&&clearTimeout(jt.current)}},[n,on]),u.useEffect(()=>{if(!(Ct.current||!g))return R(!0),nt.current&&clearTimeout(nt.current),nt.current=setTimeout(()=>{dt(g)},2e3),()=>{nt.current&&clearTimeout(nt.current)}},[g,dt]);const Pt=async()=>{try{T(!0),jt.current&&clearTimeout(jt.current),nt.current&&clearTimeout(nt.current);const Y=await ei();Y.models=n,Y.model_task_config=g,await io(Y),R(!1),Le({title:"保存成功",description:"模型配置已保存"}),await cl()}catch(Y){console.error("保存配置失败:",Y),Le({title:"保存失败",description:Y.message,variant:"destructive"})}finally{T(!1)}},Wt=(Y,fe)=>{Ke({}),te(Y||{model_identifier:"",name:"",api_provider:c[0]||"",price_in:0,price_out:0,force_stream_mode:!1,extra_params:{}}),be(fe),w(!0)},La=()=>{if(!D)return;const Y={};if(D.name?.trim()||(Y.name="请输入模型名称"),D.api_provider?.trim()||(Y.api_provider="请选择 API 提供商"),D.model_identifier?.trim()||(Y.model_identifier="请输入模型标识符"),Object.keys(Y).length>0){Ke(Y);return}Ke({});const fe={...D,price_in:D.price_in??0,price_out:D.price_out??0};let De;xe!==null?(De=[...n],De[xe]=fe):De=[...n,fe],r(De),j(De.map(Fe=>Fe.name)),w(!1),te(null),be(null)},Ut=Y=>{if(!Y&&D){const fe={...D,price_in:D.price_in??0,price_out:D.price_out??0};te(fe)}w(Y)},Ua=Y=>{Ne(Y),ve(!0)},ba=()=>{if(pe!==null){const Y=n.filter((fe,De)=>De!==pe);r(Y),j(Y.map(fe=>fe.name)),Le({title:"删除成功",description:"模型已从列表中移除"})}ve(!1),Ne(null)},P=Y=>{const fe=new Set(H);fe.has(Y)?fe.delete(Y):fe.add(Y),ne(fe)},je=()=>{if(H.size===Tt.length)ne(new Set);else{const Y=Tt.map((fe,De)=>n.findIndex(Fe=>Fe===Tt[De]));ne(new Set(Y))}},Ae=()=>{if(H.size===0){Le({title:"提示",description:"请先选择要删除的模型",variant:"default"});return}me(!0)},tt=()=>{const Y=n.filter((fe,De)=>!H.has(De));r(Y),j(Y.map(fe=>fe.name)),ne(new Set),me(!1),Le({title:"批量删除成功",description:`已删除 ${H.size} 个模型`})},Bt=(Y,fe,De)=>{g&&_({...g,[Y]:{...g[Y],[fe]:De}})},Tt=n.filter(Y=>{if(!y)return!0;const fe=y.toLowerCase();return Y.name.toLowerCase().includes(fe)||Y.model_identifier.toLowerCase().includes(fe)||Y.api_provider.toLowerCase().includes(fe)}),dl=Math.ceil(Tt.length/oe),Hl=Tt.slice((he-1)*oe,he*oe),dn=()=>{const Y=parseInt(le);Y>=1&&Y<=dl&&(Q(Y),O(""))},un=Y=>g?[g.utils?.model_list||[],g.utils_small?.model_list||[],g.tool_use?.model_list||[],g.replyer?.model_list||[],g.planner?.model_list||[],g.vlm?.model_list||[],g.voice?.model_list||[],g.embedding?.model_list||[],g.lpmm_entity_extract?.model_list||[],g.lpmm_rdf_build?.model_list||[],g.lpmm_qa?.model_list||[]].some(De=>De.includes(Y)):!1;return v?e.jsx(es,{className:"h-full",children:e.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):e.jsx(es,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型管理与分配"}),e.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"添加模型并为模型分配功能"})]}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[e.jsxs(N,{onClick:Pt,disabled:z||L||!U||ee,size:"sm",variant:"outline",className:"flex-1 sm:flex-none sm:min-w-[120px]",children:[e.jsx(br,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),z?"保存中...":L?"自动保存中...":U?"保存配置":"已保存"]}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsxs(N,{disabled:z||L||ee,size:"sm",className:"flex-1 sm:flex-none sm:min-w-[120px]",children:[e.jsx(Nr,{className:"mr-2 h-4 w-4"}),ee?"重启中...":U?"保存并重启":"重启麦麦"]})}),e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认重启麦麦?"}),e.jsx(ms,{className:"space-y-3",asChild:!0,children:e.jsxs("div",{children:[e.jsx("p",{children:U?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"}),e.jsxs(ua,{className:"border-yellow-500/50 bg-yellow-500/10",children:[e.jsx(Xt,{className:"h-4 w-4 text-yellow-600"}),e.jsxs(ma,{className:"text-yellow-900 dark:text-yellow-100",children:[e.jsx("strong",{children:"重要提示:"}),"由于技术原因,使用重启功能后,将无法再使用 ",e.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。",e.jsxs(Os,{children:[e.jsx(ni,{asChild:!0,children:e.jsxs("button",{className:"ml-1 text-yellow-700 dark:text-yellow-300 underline hover:text-yellow-800 dark:hover:text-yellow-200 inline-flex items-center gap-1",children:[e.jsx(ro,{className:"h-3 w-3"}),"如何结束程序?"]})}),e.jsxs(Es,{className:"max-w-2xl",children:[e.jsxs(zs,{children:[e.jsx(Ms,{children:"如何结束使用重启功能后的麦麦程序"}),e.jsx($s,{children:"由于重启功能会使程序脱离终端控制,需要通过系统命令来结束进程"})]}),e.jsxs(Kt,{defaultValue:"windows",className:"w-full",children:[e.jsxs(Rt,{className:"grid w-full grid-cols-3",children:[e.jsx(He,{value:"windows",children:"Windows"}),e.jsx(He,{value:"macos",children:"macOS"}),e.jsx(He,{value:"linux",children:"Linux"})]}),e.jsxs(We,{value:"windows",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"方法一:使用任务管理器"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[e.jsxs("li",{children:["按 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Ctrl + Shift + Esc"})," 打开任务管理器"]}),e.jsxs("li",{children:['在"进程"或"详细信息"标签页中找到 ',e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"python.exe"})]}),e.jsx("li",{children:'右键点击并选择"结束任务"'})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"方法二:使用命令行"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"打开 PowerShell 或命令提示符,执行以下命令:"}),e.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[e.jsx("p",{children:"# 查找麦麦进程"}),e.jsx("p",{children:'Get-Process python | Where-Object {$_.MainWindowTitle -eq ""}'}),e.jsx("p",{className:"mt-2",children:"# 结束所有 Python 进程(谨慎使用)"}),e.jsx("p",{children:"Stop-Process -Name python -Force"})]})]})]}),e.jsxs(We,{value:"macos",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"方法一:使用活动监视器"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[e.jsxs("li",{children:["按 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Cmd + Space"}),' 打开 Spotlight,搜索"活动监视器"']}),e.jsxs("li",{children:["在进程列表中找到 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Python"})]}),e.jsx("li",{children:"选中后点击左上角的 X 按钮结束进程"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"方法二:使用终端"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),e.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[e.jsx("p",{children:"# 查找麦麦进程"}),e.jsx("p",{children:"ps aux | grep python | grep -v grep"}),e.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),e.jsx("p",{children:"kill -9 "}),e.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),e.jsx("p",{children:"pkill -9 python"})]})]})]}),e.jsxs(We,{value:"linux",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"使用终端命令"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),e.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[e.jsx("p",{children:"# 查找麦麦进程"}),e.jsx("p",{children:"ps aux | grep python | grep -v grep"}),e.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),e.jsx("p",{children:"kill -9 "}),e.jsx("p",{className:"mt-2",children:"# 或使用 pkill 按名称结束"}),e.jsx("p",{children:'pkill -9 -f "bot.py"'}),e.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),e.jsx("p",{children:"pkill -9 python"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"使用 htop(如已安装)"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[e.jsxs("li",{children:["在终端输入 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"htop"})]}),e.jsxs("li",{children:["按 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F3"})," 搜索 python"]}),e.jsxs("li",{children:["按 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F9"})," 发送信号,选择 SIGKILL"]})]})]})]})]}),e.jsx(Is,{children:e.jsx(Zu,{asChild:!0,children:e.jsx(N,{variant:"outline",children:"关闭"})})})]})]})]})]})]})})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:U?it:Re,children:U?"保存并重启":"确认重启"})]})]})]})]})]}),e.jsxs(ua,{children:[e.jsx(Xt,{className:"h-4 w-4"}),e.jsxs(ma,{children:["配置更新后需要",e.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),e.jsxs(ua,{className:"hidden lg:flex border-primary/30 bg-primary/5 cursor-pointer hover:bg-primary/10 transition-colors",onClick:rl,children:[e.jsx(ON,{className:"h-4 w-4 text-primary"}),e.jsxs(ma,{className:"flex items-center justify-between",children:[e.jsxs("span",{children:[e.jsx("strong",{className:"text-primary",children:"新手引导:"}),"不知道如何配置模型?点击这里开始学习如何为麦麦的组件分配模型。"]}),e.jsx(N,{variant:"outline",size:"sm",className:"ml-4 shrink-0",children:"开始引导"})]})]}),e.jsxs(Kt,{defaultValue:"models",className:"w-full",children:[e.jsxs(Rt,{className:"grid w-full max-w-full sm:max-w-md grid-cols-2",children:[e.jsx(He,{value:"models",children:"添加模型"}),e.jsx(He,{value:"tasks","data-tour":"tasks-tab-trigger",children:"为模型分配功能"})]}),e.jsxs(We,{value:"models",className:"space-y-4 mt-0",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-2",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"配置可用的模型列表"}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[H.size>0&&e.jsxs(N,{onClick:Ae,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[e.jsx(ns,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",H.size,")"]}),e.jsxs(N,{onClick:()=>Wt(null,null),size:"sm",variant:"outline",className:"w-full sm:w-auto","data-tour":"add-model-button",children:[e.jsx(gt,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加模型"]})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2",children:[e.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[e.jsx(St,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ce,{placeholder:"搜索模型名称、标识符或提供商...",value:y,onChange:Y=>q(Y.target.value),className:"pl-9"})]}),y&&e.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",Tt.length," 个结果"]})]}),e.jsx("div",{className:"md:hidden space-y-3",children:Hl.length===0?e.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:y?"未找到匹配的模型":"暂无模型配置"}):Hl.map((Y,fe)=>{const De=n.findIndex(Ys=>Ys===Y),Fe=un(Y.name);return e.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h3",{className:"font-semibold text-base",children:Y.name}),e.jsx(Xe,{variant:Fe?"default":"secondary",className:Fe?"bg-green-600 hover:bg-green-700":"",children:Fe?"已使用":"未使用"})]}),e.jsx("p",{className:"text-xs text-muted-foreground break-all",title:Y.model_identifier,children:Y.model_identifier})]}),e.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[e.jsxs(N,{variant:"default",size:"sm",onClick:()=>Wt(Y,De),children:[e.jsx(nn,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),e.jsxs(N,{size:"sm",onClick:()=>Ua(De),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ns,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"提供商"}),e.jsx("p",{className:"font-medium",children:Y.api_provider})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"强制流式"}),e.jsx("p",{className:"font-medium",children:Y.force_stream_mode?"是":"否"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"输入价格"}),e.jsxs("p",{className:"font-medium",children:["¥",Y.price_in,"/M"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"输出价格"}),e.jsxs("p",{className:"font-medium",children:["¥",Y.price_out,"/M"]})]})]})]},fe)})}),e.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs(ii,{children:[e.jsx(ri,{children:e.jsxs(pt,{children:[e.jsx(ls,{className:"w-12",children:e.jsx(yt,{checked:H.size===Tt.length&&Tt.length>0,onCheckedChange:je})}),e.jsx(ls,{className:"w-24",children:"使用状态"}),e.jsx(ls,{children:"模型名称"}),e.jsx(ls,{children:"模型标识符"}),e.jsx(ls,{children:"提供商"}),e.jsx(ls,{className:"text-right",children:"输入价格"}),e.jsx(ls,{className:"text-right",children:"输出价格"}),e.jsx(ls,{className:"text-center",children:"强制流式"}),e.jsx(ls,{className:"text-right",children:"操作"})]})}),e.jsx(ci,{children:Hl.length===0?e.jsx(pt,{children:e.jsx(Ye,{colSpan:9,className:"text-center text-muted-foreground py-8",children:y?"未找到匹配的模型":"暂无模型配置"})}):Hl.map((Y,fe)=>{const De=n.findIndex(Ys=>Ys===Y),Fe=un(Y.name);return e.jsxs(pt,{children:[e.jsx(Ye,{children:e.jsx(yt,{checked:H.has(De),onCheckedChange:()=>P(De)})}),e.jsx(Ye,{children:e.jsx(Xe,{variant:Fe?"default":"secondary",className:Fe?"bg-green-600 hover:bg-green-700":"",children:Fe?"已使用":"未使用"})}),e.jsx(Ye,{className:"font-medium",children:Y.name}),e.jsx(Ye,{className:"max-w-xs truncate",title:Y.model_identifier,children:Y.model_identifier}),e.jsx(Ye,{children:Y.api_provider}),e.jsxs(Ye,{className:"text-right",children:["¥",Y.price_in,"/M"]}),e.jsxs(Ye,{className:"text-right",children:["¥",Y.price_out,"/M"]}),e.jsx(Ye,{className:"text-center",children:Y.force_stream_mode?"是":"否"}),e.jsx(Ye,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(N,{variant:"default",size:"sm",onClick:()=>Wt(Y,De),children:[e.jsx(nn,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),e.jsxs(N,{size:"sm",onClick:()=>Ua(De),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ns,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},fe)})})]})})}),Tt.length>0&&e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{htmlFor:"page-size-model",className:"text-sm whitespace-nowrap",children:"每页显示"}),e.jsxs(Qe,{value:oe.toString(),onValueChange:Y=>{ge(parseInt(Y)),Q(1),ne(new Set)},children:[e.jsx(Ge,{id:"page-size-model",className:"w-20",children:e.jsx($e,{})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"10",children:"10"}),e.jsx(ue,{value:"20",children:"20"}),e.jsx(ue,{value:"50",children:"50"}),e.jsx(ue,{value:"100",children:"100"})]})]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(he-1)*oe+1," 到"," ",Math.min(he*oe,Tt.length)," 条,共 ",Tt.length," 条"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{variant:"outline",size:"sm",onClick:()=>Q(1),disabled:he===1,className:"hidden sm:flex",children:e.jsx(wr,{className:"h-4 w-4"})}),e.jsxs(N,{variant:"outline",size:"sm",onClick:()=>Q(Y=>Math.max(1,Y-1)),disabled:he===1,children:[e.jsx(cn,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{type:"number",value:le,onChange:Y=>O(Y.target.value),onKeyDown:Y=>Y.key==="Enter"&&dn(),placeholder:he.toString(),className:"w-16 h-8 text-center",min:1,max:dl}),e.jsx(N,{variant:"outline",size:"sm",onClick:dn,disabled:!le,className:"h-8",children:"跳转"})]}),e.jsxs(N,{variant:"outline",size:"sm",onClick:()=>Q(Y=>Y+1),disabled:he>=dl,children:[e.jsx("span",{className:"hidden sm:inline",children:"下一页"}),e.jsx(il,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(N,{variant:"outline",size:"sm",onClick:()=>Q(dl),disabled:he>=dl,className:"hidden sm:flex",children:e.jsx(_r,{className:"h-4 w-4"})})]})]})]}),e.jsxs(We,{value:"tasks",className:"space-y-6 mt-0",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"为不同的任务配置使用的模型和参数"}),g&&e.jsxs("div",{className:"grid gap-4 sm:gap-6",children:[e.jsx(ja,{title:"组件模型 (utils)",description:"用于表情包、取名、关系、情绪变化等组件",taskConfig:g.utils,modelNames:f,onChange:(Y,fe)=>Bt("utils",Y,fe),dataTour:"task-model-select"}),e.jsx(ja,{title:"组件小模型 (utils_small)",description:"消耗量较大的组件,建议使用速度较快的小模型",taskConfig:g.utils_small,modelNames:f,onChange:(Y,fe)=>Bt("utils_small",Y,fe)}),e.jsx(ja,{title:"工具调用模型 (tool_use)",description:"需要使用支持工具调用的模型",taskConfig:g.tool_use,modelNames:f,onChange:(Y,fe)=>Bt("tool_use",Y,fe)}),e.jsx(ja,{title:"首要回复模型 (replyer)",description:"用于表达器和表达方式学习",taskConfig:g.replyer,modelNames:f,onChange:(Y,fe)=>Bt("replyer",Y,fe)}),e.jsx(ja,{title:"决策模型 (planner)",description:"负责决定麦麦该什么时候回复",taskConfig:g.planner,modelNames:f,onChange:(Y,fe)=>Bt("planner",Y,fe)}),e.jsx(ja,{title:"图像识别模型 (vlm)",description:"视觉语言模型",taskConfig:g.vlm,modelNames:f,onChange:(Y,fe)=>Bt("vlm",Y,fe),hideTemperature:!0}),e.jsx(ja,{title:"语音识别模型 (voice)",description:"语音转文字",taskConfig:g.voice,modelNames:f,onChange:(Y,fe)=>Bt("voice",Y,fe),hideTemperature:!0,hideMaxTokens:!0}),e.jsx(ja,{title:"嵌入模型 (embedding)",description:"用于向量化",taskConfig:g.embedding,modelNames:f,onChange:(Y,fe)=>Bt("embedding",Y,fe),hideTemperature:!0,hideMaxTokens:!0}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库模型"}),e.jsx(ja,{title:"实体提取模型 (lpmm_entity_extract)",description:"从文本中提取实体",taskConfig:g.lpmm_entity_extract,modelNames:f,onChange:(Y,fe)=>Bt("lpmm_entity_extract",Y,fe)}),e.jsx(ja,{title:"RDF 构建模型 (lpmm_rdf_build)",description:"构建知识图谱",taskConfig:g.lpmm_rdf_build,modelNames:f,onChange:(Y,fe)=>Bt("lpmm_rdf_build",Y,fe)}),e.jsx(ja,{title:"问答模型 (lpmm_qa)",description:"知识库问答",taskConfig:g.lpmm_qa,modelNames:f,onChange:(Y,fe)=>Bt("lpmm_qa",Y,fe)})]})]})]})]}),e.jsx(Os,{open:X,onOpenChange:Ut,children:e.jsxs(Es,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto","data-tour":"model-dialog",preventOutsideClose:Je.isRunning,children:[e.jsxs(zs,{children:[e.jsx(Ms,{children:xe!==null?"编辑模型":"添加模型"}),e.jsx($s,{children:"配置模型的基本信息和参数"})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid gap-2","data-tour":"model-name-input",children:[e.jsx(b,{htmlFor:"model_name",className:we.name?"text-destructive":"",children:"模型名称 *"}),e.jsx(ce,{id:"model_name",value:D?.name||"",onChange:Y=>{te(fe=>fe?{...fe,name:Y.target.value}:null),we.name&&Ke(fe=>({...fe,name:void 0}))},placeholder:"例如: qwen3-30b",className:we.name?"border-destructive focus-visible:ring-destructive":""}),we.name?e.jsx("p",{className:"text-xs text-destructive",children:we.name}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"用于在任务配置中引用此模型"})]}),e.jsxs("div",{className:"grid gap-2","data-tour":"model-provider-select",children:[e.jsx(b,{htmlFor:"api_provider",className:we.api_provider?"text-destructive":"",children:"API 提供商 *"}),e.jsxs(Qe,{value:D?.api_provider||"",onValueChange:Y=>{te(fe=>fe?{...fe,api_provider:Y}:null),A([]),ss(null),we.api_provider&&Ke(fe=>({...fe,api_provider:void 0}))},children:[e.jsx(Ge,{id:"api_provider",className:we.api_provider?"border-destructive focus-visible:ring-destructive":"",children:e.jsx($e,{placeholder:"选择提供商"})}),e.jsx(Ve,{children:c.map(Y=>e.jsx(ue,{value:Y,children:Y},Y))})]}),we.api_provider&&e.jsx("p",{className:"text-xs text-destructive",children:we.api_provider})]}),e.jsxs("div",{className:"grid gap-2","data-tour":"model-identifier-input",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{htmlFor:"model_identifier",className:we.model_identifier?"text-destructive":"",children:"模型标识符 *"}),qs?.modelFetcher&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Xe,{variant:"secondary",className:"text-xs",children:qs.display_name}),e.jsx(N,{variant:"ghost",size:"sm",className:"h-6 px-2",onClick:()=>D?.api_provider&&Se(D.api_provider,!0),disabled:W,children:W?e.jsx(vt,{className:"h-3 w-3 animate-spin"}):e.jsx(ft,{className:"h-3 w-3"})})]})]}),qs?.modelFetcher?e.jsxs(Da,{open:Ie,onOpenChange:Rs,children:[e.jsx(Oa,{asChild:!0,children:e.jsxs(N,{variant:"outline",role:"combobox","aria-expanded":Ie,className:"w-full justify-between font-normal",disabled:W||!!Me,children:[W?e.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(vt,{className:"h-4 w-4 animate-spin"}),"正在获取模型列表..."]}):Me?e.jsx("span",{className:"text-muted-foreground text-sm",children:"点击下方输入框手动填写"}):D?.model_identifier?e.jsx("span",{className:"truncate",children:D.model_identifier}):e.jsx("span",{className:"text-muted-foreground",children:"搜索或选择模型..."}),e.jsx($u,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(Na,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:e.jsxs(oo,{children:[e.jsx(uo,{placeholder:"搜索模型..."}),e.jsx(es,{className:"h-[300px]",children:e.jsxs(mo,{className:"max-h-none overflow-visible",children:[e.jsx(ho,{children:Me?e.jsxs("div",{className:"py-4 px-2 text-center space-y-2",children:[e.jsx("p",{className:"text-sm text-destructive",children:Me}),!Me.includes("API Key")&&e.jsx(N,{variant:"link",size:"sm",onClick:()=>D?.api_provider&&Se(D.api_provider,!0),children:"重试"})]}):"未找到匹配的模型"}),e.jsx(vr,{heading:"可用模型",children:F.map(Y=>e.jsxs(yr,{value:Y.id,onSelect:()=>{te(fe=>fe?{...fe,model_identifier:Y.id}:null),Rs(!1)},children:[e.jsx(ha,{className:`mr-2 h-4 w-4 ${D?.model_identifier===Y.id?"opacity-100":"opacity-0"}`}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:Y.id}),Y.name!==Y.id&&e.jsx("span",{className:"text-xs text-muted-foreground",children:Y.name})]})]},Y.id))}),e.jsx(vr,{heading:"手动输入",children:e.jsxs(yr,{value:"__manual_input__",onSelect:()=>{Rs(!1)},children:[e.jsx(nn,{className:"mr-2 h-4 w-4"}),"手动输入模型标识符..."]})})]})})]})})]}):e.jsx(ce,{id:"model_identifier",value:D?.model_identifier||"",onChange:Y=>{te(fe=>fe?{...fe,model_identifier:Y.target.value}:null),we.model_identifier&&Ke(fe=>({...fe,model_identifier:void 0}))},placeholder:"Qwen/Qwen3-30B-A3B-Instruct-2507",className:we.model_identifier?"border-destructive focus-visible:ring-destructive":""}),we.model_identifier&&e.jsx("p",{className:"text-xs text-destructive",children:we.model_identifier}),Me&&qs?.modelFetcher&&!we.model_identifier&&e.jsxs(ua,{variant:"destructive",className:"mt-2 py-2",children:[e.jsx(Xt,{className:"h-4 w-4"}),e.jsx(ma,{className:"text-xs",children:Me})]}),qs?.modelFetcher&&e.jsx(ce,{value:D?.model_identifier||"",onChange:Y=>{te(fe=>fe?{...fe,model_identifier:Y.target.value}:null),we.model_identifier&&Ke(fe=>({...fe,model_identifier:void 0}))},placeholder:"或手动输入模型标识符",className:`mt-2 ${we.model_identifier?"border-destructive focus-visible:ring-destructive":""}`}),!we.model_identifier&&e.jsx("p",{className:"text-xs text-muted-foreground",children:Me?'请手动输入模型标识符,或前往"模型提供商配置"检查 API Key':qs?.modelFetcher?`已识别为 ${qs.display_name},支持自动获取模型列表`:"API 提供商提供的模型 ID"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"price_in",children:"输入价格 (¥/M token)"}),e.jsx(ce,{id:"price_in",type:"number",step:"0.1",min:"0",value:D?.price_in??"",onChange:Y=>{const fe=Y.target.value===""?null:parseFloat(Y.target.value);te(De=>De?{...De,price_in:fe}:null)},placeholder:"默认: 0"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"price_out",children:"输出价格 (¥/M token)"}),e.jsx(ce,{id:"price_out",type:"number",step:"0.1",min:"0",value:D?.price_out??"",onChange:Y=>{const fe=Y.target.value===""?null:parseFloat(Y.target.value);te(De=>De?{...De,price_out:fe}:null)},placeholder:"默认: 0"})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(qe,{id:"force_stream_mode",checked:D?.force_stream_mode||!1,onCheckedChange:Y=>te(fe=>fe?{...fe,force_stream_mode:Y}:null)}),e.jsx(b,{htmlFor:"force_stream_mode",className:"cursor-pointer",children:"强制流式输出模式"})]})]}),e.jsxs(Is,{children:[e.jsx(N,{variant:"outline",onClick:()=>w(!1),"data-tour":"model-cancel-button",children:"取消"}),e.jsx(N,{onClick:La,"data-tour":"model-save-button",children:"保存"})]})]})}),e.jsx(ps,{open:ye,onOpenChange:ve,children:e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认删除"}),e.jsxs(ms,{children:['确定要删除模型 "',pe!==null?n[pe]?.name:"",'" 吗? 此操作无法撤销。']})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:ba,children:"删除"})]})]})}),e.jsx(ps,{open:S,onOpenChange:me,children:e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认批量删除"}),e.jsxs(ms,{children:["确定要删除选中的 ",H.size," 个模型吗? 此操作无法撤销。"]})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:tt,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),E&&e.jsx(Iu,{onRestartComplete:ot,onRestartFailed:di})]})})}function ja({title:n,description:r,taskConfig:c,modelNames:d,onChange:h,hideTemperature:x=!1,hideMaxTokens:f=!1,dataTour:j}){const g=_=>{h("model_list",_)};return e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-base sm:text-lg",children:n}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:r})]}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2","data-tour":j,children:[e.jsx(b,{children:"模型列表"}),e.jsx(ww,{options:d.map(_=>({label:_,value:_})),selected:c.model_list||[],onChange:g,placeholder:"选择模型...",emptyText:"暂无可用模型"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[!x&&e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{children:"温度"}),e.jsx(ce,{type:"number",step:"0.1",min:"0",max:"1",value:c.temperature??.3,onChange:_=>{const v=parseFloat(_.target.value);!isNaN(v)&&v>=0&&v<=1&&h("temperature",v)},className:"w-20 h-8 text-sm"})]}),e.jsx(za,{value:[c.temperature??.3],onValueChange:_=>h("temperature",_[0]),min:0,max:1,step:.1,className:"w-full"})]}),!f&&e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"最大 Token"}),e.jsx(ce,{type:"number",step:"1",min:"1",value:c.max_tokens??1024,onChange:_=>h("max_tokens",parseInt(_.target.value))})]})]})]})]})}const xo="/api/webui/config";async function Cw(){const r=await(await ke(`${xo}/adapter-config/path`)).json();return!r.success||!r.path?null:{path:r.path,lastModified:r.lastModified}}async function up(n){const c=await(await ke(`${xo}/adapter-config/path`,{method:"POST",headers:ze(),body:JSON.stringify({path:n})})).json();if(!c.success)throw new Error(c.message||"保存路径失败")}async function mp(n){const c=await(await ke(`${xo}/adapter-config?path=${encodeURIComponent(n)}`)).json();if(!c.success)throw new Error("读取配置文件失败");return c.content}async function hp(n,r){const d=await(await ke(`${xo}/adapter-config`,{method:"POST",headers:ze(),body:JSON.stringify({path:n,content:r})})).json();if(!d.success)throw new Error(d.message||"保存配置失败")}const Yt={inner:{version:"0.1.2"},nickname:{nickname:""},napcat_server:{host:"localhost",port:8095,token:"",heartbeat_interval:30},maibot_server:{host:"localhost",port:8e3},chat:{group_list_type:"whitelist",group_list:[],private_list_type:"whitelist",private_list:[],ban_user_id:[],ban_qq_bot:!1,enable_poke:!0},voice:{use_tts:!1},debug:{level:"INFO"}},Du={oneclick:{name:"一键包",description:"使用一键包部署的适配器配置",path:"../MaiBot-Napcat-Adapter/config.toml",icon:rn},docker:{name:"Docker",description:"Docker Compose 部署的适配器配置",path:"/MaiMBot/adapters-config/config.toml",icon:RN}};function kw(){const[n,r]=u.useState("upload"),[c,d]=u.useState(null),[h,x]=u.useState(""),[f,j]=u.useState(""),[g,_]=u.useState("oneclick"),[v,k]=u.useState(""),[z,T]=u.useState(!1),[L,K]=u.useState(!1),[U,R]=u.useState(!1),[ee,V]=u.useState(!1),[E,B]=u.useState(null),X=u.useRef(null),{toast:w}=Bs(),D=u.useRef(null),te=O=>{if(!O.trim())return{valid:!1,error:"路径不能为空"};if(!O.toLowerCase().endsWith(".toml"))return{valid:!1,error:"文件必须是 .toml 格式"};const F=/^([a-zA-Z]:\\|\\\\[^\\]+\\[^\\]+\\).+\.toml$/i,A=/^(\/|~\/).+\.toml$/i,W=/^(\.{1,2}[\\/]|[^:\\/]).+\.toml$/i,_e=F.test(O),Me=A.test(O),ss=W.test(O);return!_e&&!Me&&!ss?{valid:!1,error:"路径格式错误"}:/[<>"|?*\x00-\x1F]/.test(O)?{valid:!1,error:"路径包含非法字符"}:{valid:!0,error:""}},xe=O=>{if(j(O),O.trim()){const F=te(O);k(F.error)}else k("")},be=u.useCallback(async O=>{const F=Du[O];K(!0);try{const A=await mp(F.path),W=he(A);d(W),_(O),j(F.path),await up(F.path),w({title:"加载成功",description:`已从${F.name}预设加载配置`})}catch(A){console.error("加载预设配置失败:",A),w({title:"加载失败",description:A instanceof Error?A.message:"无法读取预设配置文件",variant:"destructive"})}finally{K(!1)}},[w]),ye=u.useCallback(async O=>{const F=te(O);if(!F.valid){k(F.error),w({title:"路径无效",description:F.error,variant:"destructive"});return}k(""),K(!0);try{const A=await mp(O),W=he(A);d(W),j(O),await up(O),w({title:"加载成功",description:"已从配置文件加载"})}catch(A){console.error("加载配置失败:",A),w({title:"加载失败",description:A instanceof Error?A.message:"无法读取配置文件",variant:"destructive"})}finally{K(!1)}},[w]);u.useEffect(()=>{(async()=>{try{const F=await Cw();if(F&&F.path){j(F.path);const A=Object.entries(Du).find(([,W])=>W.path===F.path);A?(r("preset"),_(A[0]),await be(A[0])):(r("path"),await ye(F.path))}}catch(F){console.error("加载保存的路径失败:",F)}})()},[ye,be]);const ve=u.useCallback(O=>{n!=="path"&&n!=="preset"||!f||(D.current&&clearTimeout(D.current),D.current=setTimeout(async()=>{T(!0);try{const F=Q(O);await hp(f,F),w({title:"自动保存成功",description:"配置已保存到文件"})}catch(F){console.error("自动保存失败:",F),w({title:"自动保存失败",description:F instanceof Error?F.message:"保存配置失败",variant:"destructive"})}finally{T(!1)}},1e3))},[n,f,w]),pe=async()=>{if(!c||!f)return;const O=te(f);if(!O.valid){w({title:"保存失败",description:O.error,variant:"destructive"});return}T(!0);try{const F=Q(c);await hp(f,F),w({title:"保存成功",description:"配置已保存到文件"})}catch(F){console.error("保存失败:",F),w({title:"保存失败",description:F instanceof Error?F.message:"保存配置失败",variant:"destructive"})}finally{T(!1)}},Ne=async()=>{f&&await ye(f)},y=O=>{if(O!==n){if(c){B(O),R(!0);return}q(O)}},q=O=>{d(null),x(""),k(""),r(O),O==="preset"&&be("oneclick"),w({title:"已切换模式",description:{upload:"现在可以上传配置文件",path:"现在可以指定配置文件路径",preset:"现在可以使用预设配置"}[O]})},H=()=>{E&&(q(E),B(null)),R(!1)},ne=()=>{if(c){V(!0);return}S()},S=()=>{j(""),d(null),k(""),w({title:"已清空",description:"路径和配置已清空"})},me=()=>{S(),V(!1)},he=O=>{const F=JSON.parse(JSON.stringify(Yt)),A=O.split(` +`);let W="";for(const _e of A){const Me=_e.trim();if(!Me||Me.startsWith("#"))continue;const ss=Me.match(/^\[(\w+)\]/);if(ss){W=ss[1];continue}const Ie=Me.match(/^(\w+)\s*=\s*(.+)$/);if(Ie&&W){const[,Rs,qs]=Ie;let ie=qs.trim();const we=ie.match(/^("[^"]*")/);if(we)ie=we[1];else{const Le=ie.indexOf("#");Le!==-1&&(ie=ie.substring(0,Le).trim())}let Ke;if(ie==="true")Ke=!0;else if(ie==="false")Ke=!1;else if(ie.startsWith("[")&&ie.endsWith("]")){const Le=ie.slice(1,-1).trim();if(Le){const st=Le.split(",").map(bt=>{const Je=bt.trim();return isNaN(Number(Je))?Je.replace(/"/g,""):Number(Je)}),Jt=typeof st[0];Ke=st.every(bt=>typeof bt===Jt)?st:st.filter(bt=>typeof bt=="number")}else Ke=[]}else ie.startsWith('"')&&ie.endsWith('"')?Ke=ie.slice(1,-1):isNaN(Number(ie))?Ke=ie.replace(/"/g,""):Ke=Number(ie);if(W in F){const Le=F[W];Le[Rs]=Ke}}}return F},Q=O=>{const F=[],A=(W,_e)=>W===""||W===null||W===void 0?_e:W;return F.push("[inner]"),F.push(`version = "${A(O.inner.version,Yt.inner.version)}" # 版本号`),F.push("# 请勿修改版本号,除非你知道自己在做什么"),F.push(""),F.push("[nickname] # 现在没用"),F.push(`nickname = "${A(O.nickname.nickname,Yt.nickname.nickname)}"`),F.push(""),F.push("[napcat_server] # Napcat连接的ws服务设置"),F.push(`host = "${A(O.napcat_server.host,Yt.napcat_server.host)}" # Napcat设定的主机地址`),F.push(`port = ${A(O.napcat_server.port||0,Yt.napcat_server.port)} # Napcat设定的端口`),F.push(`token = "${A(O.napcat_server.token,Yt.napcat_server.token)}" # Napcat设定的访问令牌,若无则留空`),F.push(`heartbeat_interval = ${A(O.napcat_server.heartbeat_interval||0,Yt.napcat_server.heartbeat_interval)} # 与Napcat设置的心跳相同(按秒计)`),F.push(""),F.push("[maibot_server] # 连接麦麦的ws服务设置"),F.push(`host = "${A(O.maibot_server.host,Yt.maibot_server.host)}" # 麦麦在.env文件中设置的主机地址,即HOST字段`),F.push(`port = ${A(O.maibot_server.port||0,Yt.maibot_server.port)} # 麦麦在.env文件中设置的端口,即PORT字段`),F.push(""),F.push("[chat] # 黑白名单功能"),F.push(`group_list_type = "${A(O.chat.group_list_type,Yt.chat.group_list_type)}" # 群组名单类型,可选为:whitelist, blacklist`),F.push(`group_list = [${O.chat.group_list.join(", ")}] # 群组名单`),F.push("# 当group_list_type为whitelist时,只有群组名单中的群组可以聊天"),F.push("# 当group_list_type为blacklist时,群组名单中的任何群组无法聊天"),F.push(`private_list_type = "${A(O.chat.private_list_type,Yt.chat.private_list_type)}" # 私聊名单类型,可选为:whitelist, blacklist`),F.push(`private_list = [${O.chat.private_list.join(", ")}] # 私聊名单`),F.push("# 当private_list_type为whitelist时,只有私聊名单中的用户可以聊天"),F.push("# 当private_list_type为blacklist时,私聊名单中的任何用户无法聊天"),F.push(`ban_user_id = [${O.chat.ban_user_id.join(", ")}] # 全局禁止名单(全局禁止名单中的用户无法进行任何聊天)`),F.push(`ban_qq_bot = ${O.chat.ban_qq_bot} # 是否屏蔽QQ官方机器人`),F.push(`enable_poke = ${O.chat.enable_poke} # 是否启用戳一戳功能`),F.push(""),F.push("[voice] # 发送语音设置"),F.push(`use_tts = ${O.voice.use_tts} # 是否使用tts语音(请确保你配置了tts并有对应的adapter)`),F.push(""),F.push("[debug]"),F.push(`level = "${A(O.debug.level,Yt.debug.level)}" # 日志等级(DEBUG, INFO, WARNING, ERROR, CRITICAL)`),F.join(` +`)},oe=O=>{const F=O.target.files?.[0];if(!F)return;const A=new FileReader;A.onload=W=>{try{const _e=W.target?.result,Me=he(_e);d(Me),x(F.name),w({title:"上传成功",description:`已加载配置文件:${F.name}`})}catch(_e){console.error("解析配置文件失败:",_e),w({title:"解析失败",description:"配置文件格式错误,请检查文件内容",variant:"destructive"})}},A.readAsText(F)},ge=()=>{if(!c)return;const O=Q(c),F=new Blob([O],{type:"text/plain;charset=utf-8"}),A=URL.createObjectURL(F),W=document.createElement("a");W.href=A,W.download=h||"config.toml",document.body.appendChild(W),W.click(),document.body.removeChild(W),URL.revokeObjectURL(A),w({title:"下载成功",description:"配置文件已下载,请手动覆盖并重启适配器"})},le=()=>{d(JSON.parse(JSON.stringify(Yt))),x("config.toml"),w({title:"已加载默认配置",description:"可以开始编辑配置"})};return e.jsx(es,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦适配器配置"}),e.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的 QQ 适配器的配置文件"})]})}),e.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg border border-amber-500/50 bg-amber-500/10 text-amber-700 dark:text-amber-400",children:[e.jsx(Aa,{className:"h-4 w-4 mt-0.5 flex-shrink-0"}),e.jsx("p",{className:"text-sm",children:"适配器配置保存之后使用 WebUI 的重启功能适配器并不会重启,需要手动重启适配器。"})]}),e.jsxs(Be,{children:[e.jsxs(gs,{children:[e.jsx(js,{children:"工作模式"}),e.jsx(Zs,{children:"选择配置文件的管理方式"})]}),e.jsxs(bs,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 md:gap-4",children:[e.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${n==="preset"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>y("preset"),children:e.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[e.jsx(rn,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"预设模式"}),e.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"使用预设的部署配置"})]})]})}),e.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${n==="upload"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>y("upload"),children:e.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[e.jsx(hr,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"上传文件模式"}),e.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"上传配置文件,编辑后下载并手动覆盖"})]})]})}),e.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${n==="path"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>y("path"),children:e.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[e.jsx(LN,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"指定路径模式"}),e.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"指定配置文件路径,自动加载和保存"})]})]})})]}),n==="preset"&&e.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[e.jsx(b,{className:"text-sm md:text-base",children:"选择部署方式"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:Object.entries(Du).map(([O,F])=>{const A=F.icon,W=g===O;return e.jsx("div",{className:`border-2 rounded-lg p-3 cursor-pointer transition-all ${W?"border-primary bg-primary/5":"border-muted hover:border-primary/50"}`,onClick:()=>{_(O),be(O)},children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(A,{className:"h-5 w-5 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h4",{className:"font-semibold text-sm",children:F.name}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:F.description}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 font-mono break-all",children:F.path})]})]})},O)})})]}),n==="path"&&e.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"config-path",className:"text-sm md:text-base",children:"配置文件路径"}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx(ce,{id:"config-path",value:f,onChange:O=>xe(O.target.value),placeholder:"例: C:\\Adapter\\config.toml",className:`text-sm ${v?"border-destructive":""}`}),v&&e.jsx("p",{className:"text-xs text-destructive",children:v})]}),e.jsx(N,{onClick:()=>ye(f),disabled:L||!f||!!v,className:"w-full sm:w-auto",children:L?e.jsxs(e.Fragment,{children:[e.jsx(ft,{className:"h-4 w-4 animate-spin mr-2"}),e.jsx("span",{className:"sm:hidden",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sm:hidden",children:"加载配置"}),e.jsx("span",{className:"hidden sm:inline",children:"加载"})]})})]})]}),e.jsxs("details",{className:"rounded-lg bg-muted/50 p-3 group",children:[e.jsxs("summary",{className:"text-xs font-medium cursor-pointer select-none list-none flex items-center justify-between",children:[e.jsx("span",{children:"路径格式说明"}),e.jsx("svg",{className:"h-4 w-4 transition-transform group-open:rotate-180",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),e.jsxs("div",{className:"mt-2 space-y-2 text-xs text-muted-foreground",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"font-mono bg-background px-1.5 py-0.5 rounded text-[10px] md:text-xs whitespace-nowrap",children:"Windows"})}),e.jsxs("div",{className:"pl-2 space-y-0.5 text-[10px] md:text-xs break-all",children:[e.jsx("div",{children:"C:\\Adapter\\config.toml"}),e.jsx("div",{className:"hidden sm:block",children:"D:\\MaiBot\\adapter\\config.toml"}),e.jsx("div",{className:"hidden sm:block",children:"\\\\server\\share\\config.toml"})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"font-mono bg-background px-1.5 py-0.5 rounded text-[10px] md:text-xs whitespace-nowrap",children:"Linux"})}),e.jsxs("div",{className:"pl-2 space-y-0.5 text-[10px] md:text-xs break-all",children:[e.jsx("div",{children:"/opt/adapter/config.toml"}),e.jsx("div",{className:"hidden sm:block",children:"/home/user/adapter/config.toml"}),e.jsx("div",{className:"hidden sm:block",children:"~/adapter/config.toml"})]})]}),e.jsx("p",{className:"pt-1 border-t text-[10px] md:text-xs",children:"💡 配置会自动保存到指定文件,修改后 1 秒自动保存"})]})]})]})]})]}),e.jsxs(ua,{children:[e.jsx(Xt,{className:"h-4 w-4"}),e.jsx(ma,{children:n==="preset"?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"预设模式:"}),"选择预设的部署方式,配置会自动加载,修改后 1 秒自动保存",z&&" (正在保存...)"]}):n==="upload"?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"上传文件模式:"}),"上传配置文件 → 在线编辑 → 下载文件 → 手动覆盖并重启适配器"]}):e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"指定路径模式:"}),"指定配置文件路径后,配置会自动加载,修改后 1 秒自动保存",z&&" (正在保存...)"]})})]}),n==="upload"&&!c&&e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full",children:[e.jsx("input",{ref:X,type:"file",accept:".toml",className:"hidden",onChange:oe}),e.jsxs(N,{onClick:()=>X.current?.click(),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[e.jsx(hr,{className:"mr-2 h-4 w-4"}),"上传配置"]}),e.jsxs(N,{onClick:le,size:"sm",className:"w-full sm:w-auto",children:[e.jsx(Ma,{className:"mr-2 h-4 w-4"}),"使用默认配置"]})]}),n==="upload"&&c&&e.jsx("div",{className:"flex gap-2",children:e.jsxs(N,{onClick:ge,size:"sm",className:"w-full sm:w-auto",children:[e.jsx(nl,{className:"mr-2 h-4 w-4"}),"下载配置"]})}),(n==="preset"||n==="path")&&c&&e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsxs(N,{onClick:pe,size:"sm",disabled:z||!!v,className:"w-full sm:w-auto",children:[e.jsx(br,{className:"mr-2 h-4 w-4"}),z?"保存中...":"立即保存"]}),e.jsxs(N,{onClick:Ne,size:"sm",variant:"outline",disabled:L,className:"w-full sm:w-auto",children:[e.jsx(ft,{className:`mr-2 h-4 w-4 ${L?"animate-spin":""}`}),"刷新"]}),n==="path"&&e.jsxs(N,{onClick:ne,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[e.jsx(ns,{className:"mr-2 h-4 w-4"}),"清空路径"]})]}),c?e.jsxs(Kt,{defaultValue:"napcat",className:"w-full",children:[e.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:e.jsxs(Rt,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5",children:[e.jsxs(He,{value:"napcat",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[e.jsx("span",{className:"hidden sm:inline",children:"Napcat 连接"}),e.jsx("span",{className:"sm:hidden",children:"Napcat"})]}),e.jsxs(He,{value:"maibot",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[e.jsx("span",{className:"hidden sm:inline",children:"麦麦连接"}),e.jsx("span",{className:"sm:hidden",children:"麦麦"})]}),e.jsxs(He,{value:"chat",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[e.jsx("span",{className:"hidden sm:inline",children:"聊天控制"}),e.jsx("span",{className:"sm:hidden",children:"聊天"})]}),e.jsxs(He,{value:"voice",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[e.jsx("span",{className:"hidden sm:inline",children:"语音设置"}),e.jsx("span",{className:"sm:hidden",children:"语音"})]}),e.jsx(He,{value:"debug",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:"调试"})]})}),e.jsx(We,{value:"napcat",className:"space-y-4",children:e.jsx(Tw,{config:c,onChange:O=>{d(O),ve(O)}})}),e.jsx(We,{value:"maibot",className:"space-y-4",children:e.jsx(Ew,{config:c,onChange:O=>{d(O),ve(O)}})}),e.jsx(We,{value:"chat",className:"space-y-4",children:e.jsx(zw,{config:c,onChange:O=>{d(O),ve(O)}})}),e.jsx(We,{value:"voice",className:"space-y-4",children:e.jsx(Mw,{config:c,onChange:O=>{d(O),ve(O)}})}),e.jsx(We,{value:"debug",className:"space-y-4",children:e.jsx(Aw,{config:c,onChange:O=>{d(O),ve(O)}})})]}):e.jsx("div",{className:"rounded-lg border bg-card p-6 md:p-12",children:e.jsxs("div",{className:"text-center space-y-3 md:space-y-4",children:[e.jsx(Ma,{className:"h-12 w-12 md:h-16 md:w-16 mx-auto text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base md:text-lg font-semibold",children:"尚未加载配置"}),e.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-2 px-4",children:n==="preset"?"请选择预设的部署方式":n==="upload"?"请上传现有配置文件,或使用默认配置开始编辑":"请指定配置文件路径并点击加载按钮"})]})]})}),e.jsx(ps,{open:U,onOpenChange:R,children:e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认切换模式"}),e.jsxs(ms,{children:["切换模式将清空当前配置,确定要继续吗?",e.jsx("br",{}),e.jsx("span",{className:"text-destructive font-medium",children:"请确保已保存重要配置"})]})]}),e.jsxs(ds,{children:[e.jsx(xs,{onClick:()=>{R(!1),B(null)},children:"取消"}),e.jsx(hs,{onClick:H,children:"确认切换"})]})]})}),e.jsx(ps,{open:ee,onOpenChange:V,children:e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认清空路径"}),e.jsxs(ms,{children:["清空路径将清除当前配置,确定要继续吗?",e.jsx("br",{}),e.jsx("span",{className:"text-muted-foreground text-sm",children:"此操作不会删除配置文件,只是清除界面中的配置"})]})]}),e.jsxs(ds,{children:[e.jsx(xs,{onClick:()=>V(!1),children:"取消"}),e.jsx(hs,{onClick:me,className:"bg-destructive hover:bg-destructive/90",children:"确认清空"})]})]})})]})})}function Tw({config:n,onChange:r}){return e.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"Napcat WebSocket 服务设置"}),e.jsxs("div",{className:"grid gap-3 md:gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"napcat-host",className:"text-sm md:text-base",children:"主机地址"}),e.jsx(ce,{id:"napcat-host",value:n.napcat_server.host,onChange:c=>r({...n,napcat_server:{...n.napcat_server,host:c.target.value}}),placeholder:"localhost",className:"text-sm md:text-base"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的主机地址"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"napcat-port",className:"text-sm md:text-base",children:"端口"}),e.jsx(ce,{id:"napcat-port",type:"number",value:n.napcat_server.port||"",onChange:c=>r({...n,napcat_server:{...n.napcat_server,port:c.target.value?parseInt(c.target.value):0}}),placeholder:"8095",className:"text-sm md:text-base"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的端口(留空使用默认值 8095)"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"napcat-token",className:"text-sm md:text-base",children:"访问令牌(Token)"}),e.jsx(ce,{id:"napcat-token",type:"password",value:n.napcat_server.token,onChange:c=>r({...n,napcat_server:{...n.napcat_server,token:c.target.value}}),placeholder:"留空表示无需令牌",className:"text-sm md:text-base"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的访问令牌,若无则留空"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"napcat-heartbeat",className:"text-sm md:text-base",children:"心跳间隔(秒)"}),e.jsx(ce,{id:"napcat-heartbeat",type:"number",value:n.napcat_server.heartbeat_interval||"",onChange:c=>r({...n,napcat_server:{...n.napcat_server,heartbeat_interval:c.target.value?parseInt(c.target.value):0}}),placeholder:"30",className:"text-sm md:text-base"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"与 Napcat 设置的心跳间隔保持一致(留空使用默认值 30)"})]})]})]})})}function Ew({config:n,onChange:r}){return e.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"麦麦 WebSocket 服务设置"}),e.jsxs("div",{className:"grid gap-3 md:gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"maibot-host",className:"text-sm md:text-base",children:"主机地址"}),e.jsx(ce,{id:"maibot-host",value:n.maibot_server.host,onChange:c=>r({...n,maibot_server:{...n.maibot_server,host:c.target.value}}),placeholder:"localhost",className:"text-sm md:text-base"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 HOST 字段"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"maibot-port",className:"text-sm md:text-base",children:"端口"}),e.jsx(ce,{id:"maibot-port",type:"number",value:n.maibot_server.port||"",onChange:c=>r({...n,maibot_server:{...n.maibot_server,port:c.target.value?parseInt(c.target.value):0}}),placeholder:"8000",className:"text-sm md:text-base"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 PORT 字段(留空使用默认值 8000)"})]})]})]})})}function zw({config:n,onChange:r}){const c=x=>{const f={...n};x==="group"?f.chat.group_list=[...f.chat.group_list,0]:x==="private"?f.chat.private_list=[...f.chat.private_list,0]:f.chat.ban_user_id=[...f.chat.ban_user_id,0],r(f)},d=(x,f)=>{const j={...n};x==="group"?j.chat.group_list=j.chat.group_list.filter((g,_)=>_!==f):x==="private"?j.chat.private_list=j.chat.private_list.filter((g,_)=>_!==f):j.chat.ban_user_id=j.chat.ban_user_id.filter((g,_)=>_!==f),r(j)},h=(x,f,j)=>{const g={...n};x==="group"?g.chat.group_list[f]=j:x==="private"?g.chat.private_list[f]=j:g.chat.ban_user_id[f]=j,r(g)};return e.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"聊天黑白名单功能"}),e.jsxs("div",{className:"grid gap-4 md:gap-6",children:[e.jsxs("div",{className:"space-y-3 md:space-y-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-sm md:text-base",children:"群组名单类型"}),e.jsxs(Qe,{value:n.chat.group_list_type,onValueChange:x=>r({...n,chat:{...n.chat,group_list_type:x}}),children:[e.jsx(Ge,{children:e.jsx($e,{})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),e.jsx(ue,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[e.jsx(b,{className:"text-sm md:text-base",children:"群组列表"}),e.jsxs(N,{onClick:()=>c("group"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[e.jsx(Ma,{className:"mr-1 h-4 w-4"}),"添加群号"]})]}),n.chat.group_list.map((x,f)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{type:"number",value:x,onChange:j=>h("group",f,parseInt(j.target.value)||0),placeholder:"输入群号",className:"text-sm md:text-base"}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(N,{size:"icon",variant:"outline",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认删除"}),e.jsxs(ms,{children:["确定要删除群号 ",x," 吗?此操作无法撤销。"]})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:()=>d("group",f),children:"删除"})]})]})]})]},f)),n.chat.group_list.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无群组"})]})]}),e.jsxs("div",{className:"space-y-3 md:space-y-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-sm md:text-base",children:"私聊名单类型"}),e.jsxs(Qe,{value:n.chat.private_list_type,onValueChange:x=>r({...n,chat:{...n.chat,private_list_type:x}}),children:[e.jsx(Ge,{children:e.jsx($e,{})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),e.jsx(ue,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[e.jsx(b,{className:"text-sm md:text-base",children:"私聊列表"}),e.jsxs(N,{onClick:()=>c("private"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[e.jsx(Ma,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),n.chat.private_list.map((x,f)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{type:"number",value:x,onChange:j=>h("private",f,parseInt(j.target.value)||0),placeholder:"输入QQ号",className:"text-sm md:text-base"}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(N,{size:"icon",variant:"outline",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认删除"}),e.jsxs(ms,{children:["确定要删除用户 ",x," 吗?此操作无法撤销。"]})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:()=>d("private",f),children:"删除"})]})]})]})]},f)),n.chat.private_list.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无用户"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-sm md:text-base",children:"全局禁止名单"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"名单中的用户无法进行任何聊天"})]}),e.jsxs(N,{onClick:()=>c("ban"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[e.jsx(Ma,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),n.chat.ban_user_id.map((x,f)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{type:"number",value:x,onChange:j=>h("ban",f,parseInt(j.target.value)||0),placeholder:"输入QQ号",className:"text-sm md:text-base"}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(N,{size:"icon",variant:"outline",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认删除"}),e.jsxs(ms,{children:["确定要从全局禁止名单中删除用户 ",x," 吗?此操作无法撤销。"]})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:()=>d("ban",f),children:"删除"})]})]})]})]},f)),n.chat.ban_user_id.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无禁止用户"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-sm md:text-base",children:"屏蔽QQ官方机器人"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否屏蔽来自QQ官方机器人的消息"})]}),e.jsx(qe,{checked:n.chat.ban_qq_bot,onCheckedChange:x=>r({...n,chat:{...n.chat,ban_qq_bot:x}})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-sm md:text-base",children:"启用戳一戳功能"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否响应戳一戳消息"})]}),e.jsx(qe,{checked:n.chat.enable_poke,onCheckedChange:x=>r({...n,chat:{...n.chat,enable_poke:x}})})]})]})]})})}function Mw({config:n,onChange:r}){return e.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"发送语音设置"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-sm md:text-base",children:"使用 TTS 语音"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"请确保已配置 TTS 并有对应的适配器"})]}),e.jsx(qe,{checked:n.voice.use_tts,onCheckedChange:c=>r({...n,voice:{use_tts:c}})})]})]})})}function Aw({config:n,onChange:r}){return e.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"调试设置"}),e.jsx("div",{className:"grid gap-3 md:gap-4",children:e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-sm md:text-base",children:"日志等级"}),e.jsxs(Qe,{value:n.debug.level,onValueChange:c=>r({...n,debug:{level:c}}),children:[e.jsx(Ge,{children:e.jsx($e,{})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"DEBUG",children:"DEBUG(调试)"}),e.jsx(ue,{value:"INFO",children:"INFO(信息)"}),e.jsx(ue,{value:"WARNING",children:"WARNING(警告)"}),e.jsx(ue,{value:"ERROR",children:"ERROR(错误)"}),e.jsx(ue,{value:"CRITICAL",children:"CRITICAL(严重)"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"设置适配器的日志输出等级"})]})})]})})}const Dw=["defaultChecked","defaultValue","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML","accessKey","className","contentEditable","contextMenu","dir","draggable","hidden","id","lang","placeholder","slot","spellCheck","style","tabIndex","title","translate","radioGroup","role","about","datatype","inlist","prefix","property","resource","typeof","vocab","autoCapitalize","autoCorrect","autoSave","color","itemProp","itemScope","itemType","itemID","itemRef","results","security","unselectable","inputMode","is","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],Ow=/^(aria-|data-)/,Gg=n=>Object.fromEntries(Object.entries(n).filter(([r])=>Ow.test(r)||Dw.includes(r)));function Rw(n,r){const c=Gg(n);return Object.keys(n).some(d=>!Object.hasOwn(c,d)&&n[d]!==r[d])}class Lw extends u.Component{container;plugin;componentDidMount(){this.installPlugin()}componentDidUpdate(r){if(r.uppy!==this.props.uppy)this.uninstallPlugin(r),this.installPlugin();else if(Rw(this.props,r)){const{uppy:c,...d}={...this.props,target:this.container};this.plugin.setOptions(d)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:r,...c}={id:"Dashboard",...this.props,inline:!0,target:this.container};r.use(vb,c),this.plugin=r.getPlugin(c.id)}uninstallPlugin(r=this.props){const{uppy:c}=r;c.removePlugin(this.plugin)}render(){return u.createElement("div",{className:"uppy-Container",ref:r=>{this.container=r},...Gg(this.props)})}}function Uw({content:n,className:r=""}){return e.jsx("div",{className:`prose prose-sm dark:prose-invert max-w-none ${r}`,children:e.jsx(Nb,{remarkPlugins:[wb,_b],rehypePlugins:[bb],components:{code({inline:c,className:d,children:h,...x}){return c?e.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",...x,children:h}):e.jsx("code",{className:`${d} block bg-muted p-4 rounded-lg overflow-x-auto`,...x,children:h})},table({children:c,...d}){return e.jsx("div",{className:"overflow-x-auto",children:e.jsx("table",{className:"border-collapse border border-border",...d,children:c})})},th({children:c,...d}){return e.jsx("th",{className:"border border-border bg-muted px-4 py-2 text-left font-semibold",...d,children:c})},td({children:c,...d}){return e.jsx("td",{className:"border border-border px-4 py-2",...d,children:c})},a({children:c,...d}){return e.jsx("a",{className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",...d,children:c})},blockquote({children:c,...d}){return e.jsx("blockquote",{className:"border-l-4 border-primary pl-4 italic text-muted-foreground",...d,children:c})},h1({children:c,...d}){return e.jsx("h1",{className:"text-3xl font-bold mt-6 mb-4",...d,children:c})},h2({children:c,...d}){return e.jsx("h2",{className:"text-2xl font-bold mt-5 mb-3",...d,children:c})},h3({children:c,...d}){return e.jsx("h3",{className:"text-xl font-bold mt-4 mb-2",...d,children:c})},h4({children:c,...d}){return e.jsx("h4",{className:"text-lg font-semibold mt-3 mb-2",...d,children:c})},ul({children:c,...d}){return e.jsx("ul",{className:"list-disc list-inside space-y-1 my-2",...d,children:c})},ol({children:c,...d}){return e.jsx("ol",{className:"list-decimal list-inside space-y-1 my-2",...d,children:c})},p({children:c,...d}){return e.jsx("p",{className:"my-2 leading-relaxed",...d,children:c})},hr({...c}){return e.jsx("hr",{className:"my-4 border-border",...c})}},children:n})})}function Bw({children:n,className:r}){return e.jsx(Uw,{content:n,className:r})}const Ra="/api/webui/emoji";async function Hw(n){const r=new URLSearchParams;n.page&&r.append("page",n.page.toString()),n.page_size&&r.append("page_size",n.page_size.toString()),n.search&&r.append("search",n.search),n.is_registered!==void 0&&r.append("is_registered",n.is_registered.toString()),n.is_banned!==void 0&&r.append("is_banned",n.is_banned.toString()),n.format&&r.append("format",n.format),n.sort_by&&r.append("sort_by",n.sort_by),n.sort_order&&r.append("sort_order",n.sort_order);const c=await ke(`${Ra}/list?${r}`,{headers:ze()});if(!c.ok)throw new Error(`获取表情包列表失败: ${c.statusText}`);return c.json()}async function qw(n){const r=await ke(`${Ra}/${n}`,{headers:ze()});if(!r.ok)throw new Error(`获取表情包详情失败: ${r.statusText}`);return r.json()}async function Gw(n,r){const c=await ke(`${Ra}/${n}`,{method:"PATCH",headers:ze(),body:JSON.stringify(r)});if(!c.ok)throw new Error(`更新表情包失败: ${c.statusText}`);return c.json()}async function Vw(n){const r=await ke(`${Ra}/${n}`,{method:"DELETE",headers:ze()});if(!r.ok)throw new Error(`删除表情包失败: ${r.statusText}`);return r.json()}async function Fw(){const n=await ke(`${Ra}/stats/summary`,{headers:ze()});if(!n.ok)throw new Error(`获取统计数据失败: ${n.statusText}`);return n.json()}async function Qw(n){const r=await ke(`${Ra}/${n}/register`,{method:"POST",headers:ze()});if(!r.ok)throw new Error(`注册表情包失败: ${r.statusText}`);return r.json()}async function $w(n){const r=await ke(`${Ra}/${n}/ban`,{method:"POST",headers:ze()});if(!r.ok)throw new Error(`封禁表情包失败: ${r.statusText}`);return r.json()}function Vg(n){const r=localStorage.getItem("access-token");return`${Ra}/${n}/thumbnail?token=${encodeURIComponent(r||"")}`}async function Yw(n){const r=await ke(`${Ra}/batch/delete`,{method:"POST",headers:ze(),body:JSON.stringify({emoji_ids:n})});if(!r.ok){const c=await r.json();throw new Error(c.detail||"批量删除失败")}return r.json()}function Xw(){return`${Ra}/upload`}function Kw(){const[n,r]=u.useState([]),[c,d]=u.useState(null),[h,x]=u.useState(!1),[f,j]=u.useState(1),[g,_]=u.useState(0),[v,k]=u.useState(20),[z,T]=u.useState("all"),[L,K]=u.useState("all"),[U,R]=u.useState("all"),[ee,V]=u.useState("usage_count"),[E,B]=u.useState("desc"),[X,w]=u.useState(null),[D,te]=u.useState(!1),[xe,be]=u.useState(!1),[ye,ve]=u.useState(!1),[pe,Ne]=u.useState(new Set),[y,q]=u.useState(!1),[H,ne]=u.useState(""),[S,me]=u.useState("medium"),[he,Q]=u.useState(!1),{toast:oe}=Bs(),ge=u.useCallback(async()=>{try{x(!0);const ie=await Hw({page:f,page_size:v,is_registered:z==="all"?void 0:z==="registered",is_banned:L==="all"?void 0:L==="banned",format:U==="all"?void 0:U,sort_by:ee,sort_order:E});r(ie.data),_(ie.total)}catch(ie){const we=ie instanceof Error?ie.message:"加载表情包列表失败";oe({title:"错误",description:we,variant:"destructive"})}finally{x(!1)}},[f,v,z,L,U,ee,E,oe]),le=async()=>{try{const ie=await Fw();d(ie.data)}catch(ie){console.error("加载统计数据失败:",ie)}};u.useEffect(()=>{ge()},[ge]),u.useEffect(()=>{le()},[]);const O=async ie=>{try{const we=await qw(ie.id);w(we.data),te(!0)}catch(we){const Ke=we instanceof Error?we.message:"加载详情失败";oe({title:"错误",description:Ke,variant:"destructive"})}},F=ie=>{w(ie),be(!0)},A=ie=>{w(ie),ve(!0)},W=async()=>{if(X)try{await Vw(X.id),oe({title:"成功",description:"表情包已删除"}),ve(!1),w(null),ge(),le()}catch(ie){const we=ie instanceof Error?ie.message:"删除失败";oe({title:"错误",description:we,variant:"destructive"})}},_e=async ie=>{try{await Qw(ie.id),oe({title:"成功",description:"表情包已注册"}),ge(),le()}catch(we){const Ke=we instanceof Error?we.message:"注册失败";oe({title:"错误",description:Ke,variant:"destructive"})}},Me=async ie=>{try{await $w(ie.id),oe({title:"成功",description:"表情包已封禁"}),ge(),le()}catch(we){const Ke=we instanceof Error?we.message:"封禁失败";oe({title:"错误",description:Ke,variant:"destructive"})}},ss=ie=>{const we=new Set(pe);we.has(ie)?we.delete(ie):we.add(ie),Ne(we)},Ie=async()=>{try{const ie=await Yw(Array.from(pe));oe({title:"批量删除完成",description:ie.message}),Ne(new Set),q(!1),ge(),le()}catch(ie){oe({title:"批量删除失败",description:ie instanceof Error?ie.message:"批量删除失败",variant:"destructive"})}},Rs=()=>{const ie=parseInt(H),we=Math.ceil(g/v);ie>=1&&ie<=we?(j(ie),ne("")):oe({title:"无效的页码",description:`请输入1-${we}之间的页码`,variant:"destructive"})},qs=c?.formats?Object.keys(c.formats):[];return e.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[e.jsxs("div",{className:"mb-4 sm:mb-6 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"表情包管理"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理麦麦的表情包资源"})]}),e.jsxs(N,{onClick:()=>Q(!0),className:"gap-2",children:[e.jsx(hr,{className:"h-4 w-4"}),"上传表情包"]})]}),e.jsx(es,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[c&&e.jsxs("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:[e.jsx(Be,{children:e.jsxs(gs,{className:"pb-2",children:[e.jsx(Zs,{children:"总数"}),e.jsx(js,{className:"text-2xl",children:c.total})]})}),e.jsx(Be,{children:e.jsxs(gs,{className:"pb-2",children:[e.jsx(Zs,{children:"已注册"}),e.jsx(js,{className:"text-2xl text-green-600",children:c.registered})]})}),e.jsx(Be,{children:e.jsxs(gs,{className:"pb-2",children:[e.jsx(Zs,{children:"已封禁"}),e.jsx(js,{className:"text-2xl text-red-600",children:c.banned})]})}),e.jsx(Be,{children:e.jsxs(gs,{className:"pb-2",children:[e.jsx(Zs,{children:"未注册"}),e.jsx(js,{className:"text-2xl text-gray-600",children:c.unregistered})]})})]}),e.jsxs(Be,{children:[e.jsx(gs,{children:e.jsxs(js,{className:"flex items-center gap-2",children:[e.jsx(Lu,{className:"h-5 w-5"}),"筛选和排序"]})}),e.jsxs(bs,{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:"排序方式"}),e.jsxs(Qe,{value:`${ee}-${E}`,onValueChange:ie=>{const[we,Ke]=ie.split("-");V(we),B(Ke),j(1)},children:[e.jsx(Ge,{children:e.jsx($e,{})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"usage_count-desc",children:"使用次数 (多→少)"}),e.jsx(ue,{value:"usage_count-asc",children:"使用次数 (少→多)"}),e.jsx(ue,{value:"register_time-desc",children:"注册时间 (新→旧)"}),e.jsx(ue,{value:"register_time-asc",children:"注册时间 (旧→新)"}),e.jsx(ue,{value:"record_time-desc",children:"记录时间 (新→旧)"}),e.jsx(ue,{value:"record_time-asc",children:"记录时间 (旧→新)"}),e.jsx(ue,{value:"last_used_time-desc",children:"最后使用 (新→旧)"}),e.jsx(ue,{value:"last_used_time-asc",children:"最后使用 (旧→新)"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:"注册状态"}),e.jsxs(Qe,{value:z,onValueChange:ie=>{T(ie),j(1)},children:[e.jsx(Ge,{children:e.jsx($e,{})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"all",children:"全部"}),e.jsx(ue,{value:"registered",children:"已注册"}),e.jsx(ue,{value:"unregistered",children:"未注册"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:"封禁状态"}),e.jsxs(Qe,{value:L,onValueChange:ie=>{K(ie),j(1)},children:[e.jsx(Ge,{children:e.jsx($e,{})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"all",children:"全部"}),e.jsx(ue,{value:"banned",children:"已封禁"}),e.jsx(ue,{value:"unbanned",children:"未封禁"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:"格式"}),e.jsxs(Qe,{value:U,onValueChange:ie=>{R(ie),j(1)},children:[e.jsx(Ge,{children:e.jsx($e,{})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"all",children:"全部"}),qs.map(ie=>e.jsxs(ue,{value:ie,children:[ie.toUpperCase()," (",c?.formats[ie],")"]},ie))]})]})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 pt-4 border-t",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[pe.size>0&&e.jsxs("span",{className:"text-sm text-muted-foreground",children:["已选择 ",pe.size," 个表情包"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{className:"text-sm whitespace-nowrap",children:"卡片大小"}),e.jsxs(Qe,{value:S,onValueChange:ie=>me(ie),children:[e.jsx(Ge,{className:"w-24",children:e.jsx($e,{})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"small",children:"小"}),e.jsx(ue,{value:"medium",children:"中"}),e.jsx(ue,{value:"large",children:"大"})]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{htmlFor:"emoji-page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),e.jsxs(Qe,{value:v.toString(),onValueChange:ie=>{k(parseInt(ie)),j(1),Ne(new Set)},children:[e.jsx(Ge,{id:"emoji-page-size",className:"w-20",children:e.jsx($e,{})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"20",children:"20"}),e.jsx(ue,{value:"40",children:"40"}),e.jsx(ue,{value:"60",children:"60"}),e.jsx(ue,{value:"100",children:"100"})]})]}),pe.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(N,{variant:"outline",size:"sm",onClick:()=>Ne(new Set),children:"取消选择"}),e.jsxs(N,{variant:"destructive",size:"sm",onClick:()=>q(!0),children:[e.jsx(ns,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]}),e.jsx("div",{className:"flex justify-end pt-4 border-t",children:e.jsxs(N,{variant:"outline",size:"sm",onClick:ge,disabled:h,children:[e.jsx(ft,{className:`h-4 w-4 mr-2 ${h?"animate-spin":""}`}),"刷新"]})})]})]}),e.jsxs(Be,{children:[e.jsxs(gs,{children:[e.jsx(js,{children:"表情包列表"}),e.jsxs(Zs,{children:["共 ",g," 个表情包,当前第 ",f," 页"]})]}),e.jsxs(bs,{children:[n.length===0?e.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"暂无数据"}):e.jsx("div",{className:`grid gap-3 ${S==="small"?"grid-cols-3 sm:grid-cols-4 md:grid-cols-6 lg:grid-cols-8 xl:grid-cols-10":S==="medium"?"grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 xl:grid-cols-8":"grid-cols-2 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5"}`,children:n.map(ie=>e.jsxs("div",{className:`group relative rounded-lg border bg-card overflow-hidden hover:ring-2 hover:ring-primary transition-all cursor-pointer ${pe.has(ie.id)?"ring-2 ring-primary bg-primary/5":""}`,onClick:()=>ss(ie.id),children:[e.jsx("div",{className:`absolute top-1 left-1 z-10 transition-opacity ${pe.has(ie.id)?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:e.jsx("div",{className:`w-5 h-5 rounded-full border-2 flex items-center justify-center ${pe.has(ie.id)?"bg-primary border-primary text-primary-foreground":"bg-background/80 border-muted-foreground/50"}`,children:pe.has(ie.id)&&e.jsx(xa,{className:"h-3 w-3"})})}),e.jsxs("div",{className:"absolute top-1 right-1 z-10 flex flex-col gap-0.5",children:[ie.is_registered&&e.jsx(Xe,{variant:"default",className:"bg-green-600 text-[10px] px-1 py-0",children:"已注册"}),ie.is_banned&&e.jsx(Xe,{variant:"destructive",className:"text-[10px] px-1 py-0",children:"已封禁"})]}),e.jsx("div",{className:`aspect-square bg-muted flex items-center justify-center overflow-hidden ${S==="small"?"p-1":S==="medium"?"p-2":"p-3"}`,children:e.jsx("img",{src:Vg(ie.id),alt:"表情包",className:"w-full h-full object-contain",loading:"lazy",onError:we=>{const Ke=we.target;Ke.style.display="none";const Le=Ke.parentElement;Le&&(Le.innerHTML='')}})}),e.jsxs("div",{className:`border-t bg-card ${S==="small"?"p-1":"p-2"}`,children:[e.jsxs("div",{className:"flex items-center justify-between gap-1 text-xs text-muted-foreground mb-1",children:[e.jsx(Xe,{variant:"outline",className:"text-[10px] px-1 py-0",children:ie.format.toUpperCase()}),e.jsxs("span",{className:"font-mono",children:[ie.usage_count,"次"]})]}),e.jsxs("div",{className:`flex gap-1 justify-center opacity-0 group-hover:opacity-100 transition-opacity ${S==="small"?"flex-wrap":""}`,children:[e.jsx(N,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:we=>{we.stopPropagation(),F(ie)},title:"编辑",children:e.jsx(pr,{className:"h-3 w-3"})}),e.jsx(N,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:we=>{we.stopPropagation(),O(ie)},title:"详情",children:e.jsx(Xt,{className:"h-3 w-3"})}),!ie.is_registered&&e.jsx(N,{variant:"ghost",size:"icon",className:"h-6 w-6 text-green-600 hover:text-green-700",onClick:we=>{we.stopPropagation(),_e(ie)},title:"注册",children:e.jsx(xa,{className:"h-3 w-3"})}),!ie.is_banned&&e.jsx(N,{variant:"ghost",size:"icon",className:"h-6 w-6 text-orange-600 hover:text-orange-700",onClick:we=>{we.stopPropagation(),Me(ie)},title:"封禁",children:e.jsx(UN,{className:"h-3 w-3"})}),e.jsx(N,{variant:"ghost",size:"icon",className:"h-6 w-6 text-red-600 hover:text-red-700",onClick:we=>{we.stopPropagation(),A(ie)},title:"删除",children:e.jsx(ns,{className:"h-3 w-3"})})]})]})]},ie.id))}),g>0&&e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[e.jsxs("div",{className:"text-sm text-muted-foreground",children:["显示 ",(f-1)*v+1," 到"," ",Math.min(f*v,g)," 条,共 ",g," 条"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{variant:"outline",size:"sm",onClick:()=>j(1),disabled:f===1,className:"hidden sm:flex",children:e.jsx(wr,{className:"h-4 w-4"})}),e.jsxs(N,{variant:"outline",size:"sm",onClick:()=>j(ie=>Math.max(1,ie-1)),disabled:f===1,children:[e.jsx(cn,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{type:"number",value:H,onChange:ie=>ne(ie.target.value),onKeyDown:ie=>ie.key==="Enter"&&Rs(),placeholder:f.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(g/v)}),e.jsx(N,{variant:"outline",size:"sm",onClick:Rs,disabled:!H,className:"h-8",children:"跳转"})]}),e.jsxs(N,{variant:"outline",size:"sm",onClick:()=>j(ie=>ie+1),disabled:f>=Math.ceil(g/v),children:[e.jsx("span",{className:"hidden sm:inline",children:"下一页"}),e.jsx(il,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(N,{variant:"outline",size:"sm",onClick:()=>j(Math.ceil(g/v)),disabled:f>=Math.ceil(g/v),className:"hidden sm:flex",children:e.jsx(_r,{className:"h-4 w-4"})})]})]})]})]}),e.jsx(Zw,{emoji:X,open:D,onOpenChange:te}),e.jsx(Iw,{emoji:X,open:xe,onOpenChange:be,onSuccess:()=>{ge(),le()}}),e.jsx(Jw,{open:he,onOpenChange:Q,onSuccess:()=>{ge(),le()}})]})}),e.jsx(ps,{open:y,onOpenChange:q,children:e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认批量删除"}),e.jsxs(ms,{children:["你确定要删除选中的 ",pe.size," 个表情包吗?此操作不可撤销。"]})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:Ie,children:"确认删除"})]})]})}),e.jsx(Os,{open:ye,onOpenChange:ve,children:e.jsxs(Es,{children:[e.jsxs(zs,{children:[e.jsx(Ms,{children:"确认删除"}),e.jsx($s,{children:"确定要删除这个表情包吗?此操作无法撤销。"})]}),e.jsxs(Is,{children:[e.jsx(N,{variant:"outline",onClick:()=>ve(!1),children:"取消"}),e.jsx(N,{variant:"destructive",onClick:W,children:"删除"})]})]})})]})}function Zw({emoji:n,open:r,onOpenChange:c}){if(!n)return null;const d=h=>h?new Date(h*1e3).toLocaleString("zh-CN"):"-";return e.jsx(Os,{open:r,onOpenChange:c,children:e.jsxs(Es,{className:"max-w-2xl max-h-[90vh]",children:[e.jsx(zs,{children:e.jsx(Ms,{children:"表情包详情"})}),e.jsx(es,{className:"max-h-[calc(90vh-8rem)] pr-4",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"w-32 h-32 bg-muted rounded-lg flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:Vg(n.id),alt:n.description||"表情包",className:"w-full h-full object-cover",onError:h=>{const x=h.target;x.style.display="none";const f=x.parentElement;f&&(f.innerHTML='')}})})}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-muted-foreground",children:"ID"}),e.jsx("div",{className:"mt-1 font-mono",children:n.id})]}),e.jsxs("div",{children:[e.jsx(b,{className:"text-muted-foreground",children:"格式"}),e.jsx("div",{className:"mt-1",children:e.jsx(Xe,{variant:"outline",children:n.format.toUpperCase()})})]})]}),e.jsxs("div",{children:[e.jsx(b,{className:"text-muted-foreground",children:"文件路径"}),e.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:n.full_path})]}),e.jsxs("div",{children:[e.jsx(b,{className:"text-muted-foreground",children:"哈希值"}),e.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:n.emoji_hash})]}),e.jsxs("div",{children:[e.jsx(b,{className:"text-muted-foreground",children:"描述"}),n.description?e.jsx("div",{className:"mt-1 rounded-lg border bg-muted/50 p-3",children:e.jsx(Bw,{className:"prose-sm",children:n.description})}):e.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:"-"})]}),e.jsxs("div",{children:[e.jsx(b,{className:"text-muted-foreground",children:"情绪"}),e.jsx("div",{className:"mt-1",children:n.emotion?e.jsx("span",{className:"text-sm",children:n.emotion}):e.jsx("span",{className:"text-sm text-muted-foreground",children:"-"})})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-muted-foreground",children:"状态"}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[n.is_registered&&e.jsx(Xe,{variant:"default",className:"bg-green-600",children:"已注册"}),n.is_banned&&e.jsx(Xe,{variant:"destructive",children:"已封禁"}),!n.is_registered&&!n.is_banned&&e.jsx(Xe,{variant:"outline",children:"未注册"})]})]}),e.jsxs("div",{children:[e.jsx(b,{className:"text-muted-foreground",children:"使用次数"}),e.jsx("div",{className:"mt-1 font-mono text-lg",children:n.usage_count})]})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-muted-foreground",children:"记录时间"}),e.jsx("div",{className:"mt-1 text-sm",children:d(n.record_time)})]}),e.jsxs("div",{children:[e.jsx(b,{className:"text-muted-foreground",children:"注册时间"}),e.jsx("div",{className:"mt-1 text-sm",children:d(n.register_time)})]})]}),e.jsxs("div",{children:[e.jsx(b,{className:"text-muted-foreground",children:"最后使用"}),e.jsx("div",{className:"mt-1 text-sm",children:d(n.last_used_time)})]})]})})]})})}function Iw({emoji:n,open:r,onOpenChange:c,onSuccess:d}){const[h,x]=u.useState(""),[f,j]=u.useState(!1),[g,_]=u.useState(!1),[v,k]=u.useState(!1),{toast:z}=Bs();u.useEffect(()=>{n&&(x(n.emotion||""),j(n.is_registered),_(n.is_banned))},[n]);const T=async()=>{if(n)try{k(!0);const L=h.split(/[,,]/).map(K=>K.trim()).filter(Boolean).join(",");await Gw(n.id,{emotion:L||void 0,is_registered:f,is_banned:g}),z({title:"成功",description:"表情包信息已更新"}),c(!1),d()}catch(L){const K=L instanceof Error?L.message:"保存失败";z({title:"错误",description:K,variant:"destructive"})}finally{k(!1)}};return n?e.jsx(Os,{open:r,onOpenChange:c,children:e.jsxs(Es,{className:"max-w-2xl",children:[e.jsxs(zs,{children:[e.jsx(Ms,{children:"编辑表情包"}),e.jsx($s,{children:"修改表情包的情绪和状态信息"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(b,{children:"情绪"}),e.jsx(Us,{value:h,onChange:L=>x(L.target.value),placeholder:"输入情绪描述...",rows:2,className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"输入情绪相关的文本描述"})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(yt,{id:"is_registered",checked:f,onCheckedChange:L=>{L===!0?(j(!0),_(!1)):j(!1)}}),e.jsx(b,{htmlFor:"is_registered",className:"cursor-pointer",children:"已注册"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(yt,{id:"is_banned",checked:g,onCheckedChange:L=>{L===!0?(_(!0),j(!1)):_(!1)}}),e.jsx(b,{htmlFor:"is_banned",className:"cursor-pointer",children:"已封禁"})]})]})]}),e.jsxs(Is,{children:[e.jsx(N,{variant:"outline",onClick:()=>c(!1),children:"取消"}),e.jsx(N,{onClick:T,disabled:v,children:v?"保存中...":"保存"})]})]})}):null}function Jw({open:n,onOpenChange:r,onSuccess:c}){const[d,h]=u.useState("select"),[x,f]=u.useState([]),[j,g]=u.useState(null),[_,v]=u.useState(!1),{toast:k}=Bs(),z=u.useMemo(()=>new yb({id:"emoji-uploader",autoProceed:!1,restrictions:{maxFileSize:10485760,allowedFileTypes:["image/jpeg","image/png","image/gif","image/webp"],maxNumberOfFiles:20},locale:{pluralize:()=>0,strings:{addMoreFiles:"添加更多文件",addingMoreFiles:"正在添加更多文件",allowedFileTypes:"允许的文件类型:%{types}",cancel:"取消",closeModal:"关闭",complete:"完成",connectedToInternet:"已连接到互联网",copyLink:"复制链接",copyLinkToClipboardFallback:"复制下方链接",copyLinkToClipboardSuccess:"链接已复制到剪贴板",dashboardTitle:"选择文件",dashboardWindowTitle:"文件选择窗口(按 ESC 关闭)",done:"完成",dropHereOr:"拖放文件到这里或 %{browse}",dropHint:"将文件拖放到此处",dropPasteFiles:"将文件拖放到这里或 %{browseFiles}",dropPasteFolders:"将文件拖放到这里或 %{browseFolders}",dropPasteBoth:"将文件拖放到这里,%{browseFiles} 或 %{browseFolders}",dropPasteImportFiles:"将文件拖放到这里,%{browseFiles} 或从以下位置导入:",dropPasteImportFolders:"将文件拖放到这里,%{browseFolders} 或从以下位置导入:",dropPasteImportBoth:"将文件拖放到这里,%{browseFiles},%{browseFolders} 或从以下位置导入:",editFile:"编辑文件",editing:"正在编辑 %{file}",emptyFolderAdded:"未从空文件夹添加文件",exceedsSize:"%{file} 超过了最大允许大小 %{size}",failedToUpload:"上传 %{file} 失败",fileSource:"文件来源:%{name}",filesUploadedOfTotal:{0:"已上传 %{complete} / %{smart_count} 个文件",1:"已上传 %{complete} / %{smart_count} 个文件"},filter:"筛选",finishEditingFile:"完成编辑文件",folderAdded:{0:"已从 %{folder} 添加 %{smart_count} 个文件",1:"已从 %{folder} 添加 %{smart_count} 个文件"},generatingThumbnails:"正在生成缩略图...",import:"导入",importFiles:"从以下位置导入文件:",importFrom:"从 %{name} 导入",loading:"加载中...",logOut:"登出",myDevice:"我的设备",noFilesFound:"这里没有文件或文件夹",noInternetConnection:"无网络连接",openFolderNamed:"打开文件夹 %{name}",pause:"暂停",pauseUpload:"暂停上传",paused:"已暂停",poweredBy:"技术支持:%{uppy}",processingXFiles:{0:"正在处理 %{smart_count} 个文件",1:"正在处理 %{smart_count} 个文件"},recording:"录制中",removeFile:"移除文件",resetFilter:"重置筛选",resume:"继续",resumeUpload:"继续上传",retry:"重试",retryUpload:"重试上传",save:"保存",saveChanges:"保存更改",selectFileNamed:"选择文件 %{name}",selectX:{0:"选择 %{smart_count}",1:"选择 %{smart_count}"},smile:"笑一个!",startRecording:"开始录制视频",stopRecording:"停止录制视频",takePicture:"拍照",timedOut:"上传已停滞 %{seconds} 秒,正在中止。",upload:"下一步",uploadComplete:"上传完成",uploadFailed:"上传失败",uploadPaused:"上传已暂停",uploadXFiles:{0:"下一步(%{smart_count} 个文件)",1:"下一步(%{smart_count} 个文件)"},uploadXNewFiles:{0:"下一步(+%{smart_count} 个文件)",1:"下一步(+%{smart_count} 个文件)"},uploading:"正在上传",uploadingXFiles:{0:"正在上传 %{smart_count} 个文件",1:"正在上传 %{smart_count} 个文件"},xFilesSelected:{0:"已选择 %{smart_count} 个文件",1:"已选择 %{smart_count} 个文件"},xMoreFilesAdded:{0:"又添加了 %{smart_count} 个文件",1:"又添加了 %{smart_count} 个文件"},xTimeLeft:"剩余 %{time}",youCanOnlyUploadFileTypes:"您只能上传:%{types}",youCanOnlyUploadX:{0:"您只能上传 %{smart_count} 个文件",1:"您只能上传 %{smart_count} 个文件"},youHaveToAtLeastSelectX:{0:"您至少需要选择 %{smart_count} 个文件",1:"您至少需要选择 %{smart_count} 个文件"},browseFiles:"浏览文件",browseFolders:"浏览文件夹",cancelUpload:"取消上传",addMore:"添加更多",back:"返回",editFileWithFilename:"编辑文件 %{file}"}}}),[]);u.useEffect(()=>{const X=()=>{const w=z.getFiles();if(w.length===0)return;const D=w.map(te=>({id:te.id,name:te.name,previewUrl:te.preview||URL.createObjectURL(te.data),emotion:"",description:"",isRegistered:!0,file:te.data}));f(D),w.length===1?(g(D[0].id),h("edit-single")):h("edit-multiple")};return z.on("upload",X),()=>{z.off("upload",X)}},[z]),u.useEffect(()=>{n||(z.cancelAll(),h("select"),f([]),g(null),v(!1))},[n,z]);const T=u.useCallback((X,w)=>{f(D=>D.map(te=>te.id===X?{...te,...w}:te))},[]),L=u.useCallback(X=>X.emotion.trim().length>0,[]),K=u.useMemo(()=>x.length>0&&x.every(L),[x,L]),U=u.useMemo(()=>x.find(X=>X.id===j)||null,[x,j]),R=u.useCallback(()=>{(d==="edit-single"||d==="edit-multiple")&&(h("select"),f([]),g(null))},[d]),ee=u.useCallback(async()=>{if(!K){k({title:"请填写必填项",description:"每个表情包的情感标签都是必填的",variant:"destructive"});return}v(!0);const X=localStorage.getItem("access-token")||"";let w=0,D=0;try{for(const te of x){const xe=new FormData;xe.append("file",te.file),xe.append("emotion",te.emotion),xe.append("description",te.description),xe.append("is_registered",te.isRegistered.toString());try{(await fetch(Xw(),{method:"POST",headers:{Authorization:`Bearer ${X}`},body:xe})).ok?w++:D++}catch{D++}}D===0?(k({title:"上传成功",description:`成功上传 ${w} 个表情包`}),r(!1),c()):(k({title:"部分上传失败",description:`成功 ${w} 个,失败 ${D} 个`,variant:"destructive"}),c())}finally{v(!1)}},[K,x,k,r,c]),V=()=>e.jsx("div",{className:"space-y-4",children:e.jsx("div",{className:"border rounded-lg overflow-hidden w-full",children:e.jsx(Lw,{uppy:z,proudlyDisplayPoweredByUppy:!1,hideProgressDetails:!0,height:350,width:"100%",theme:"auto",note:"支持 JPG、PNG、GIF、WebP 格式,最多 20 个文件"})})}),E=()=>{const X=x[0];return X?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(N,{variant:"ghost",size:"sm",onClick:R,children:[e.jsx(ti,{className:"h-4 w-4 mr-1"}),"返回"]}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"编辑表情包信息"})]}),e.jsxs("div",{className:"flex gap-6",children:[e.jsxs("div",{className:"flex-shrink-0",children:[e.jsx("div",{className:"w-32 h-32 rounded-lg border overflow-hidden bg-muted flex items-center justify-center",children:e.jsx("img",{src:X.previewUrl,alt:X.name,className:"max-w-full max-h-full object-contain"})}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2 text-center truncate max-w-32",children:X.name})]}),e.jsxs("div",{className:"flex-1 space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(b,{htmlFor:"single-emotion",children:["情感标签 ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ce,{id:"single-emotion",value:X.emotion,onChange:w=>T(X.id,{emotion:w.target.value}),placeholder:"多个标签用逗号分隔,如:开心,高兴",className:X.emotion.trim()?"":"border-destructive"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"用于情感匹配,多个标签用逗号分隔"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"single-description",children:"描述"}),e.jsx(ce,{id:"single-description",value:X.description,onChange:w=>T(X.id,{description:w.target.value}),placeholder:"输入表情包描述..."})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(yt,{id:"single-is-registered",checked:X.isRegistered,onCheckedChange:w=>T(X.id,{isRegistered:w===!0})}),e.jsx(b,{htmlFor:"single-is-registered",className:"cursor-pointer",children:"上传后立即注册(可被麦麦使用)"})]})]})]}),e.jsx(Is,{children:e.jsx(N,{onClick:ee,disabled:!K||_,children:_?"上传中...":"上传"})})]}):null},B=()=>{const X=x.filter(L).length,w=x.length;return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(N,{variant:"ghost",size:"sm",onClick:R,children:[e.jsx(ti,{className:"h-4 w-4 mr-1"}),"返回"]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["编辑表情包信息(",X,"/",w," 已完成)"]})]}),e.jsx(Xe,{variant:K?"default":"secondary",children:K?e.jsxs(e.Fragment,{children:[e.jsx(ha,{className:"h-3 w-3 mr-1"}),"全部完成"]}):e.jsxs(e.Fragment,{children:[e.jsx(li,{className:"h-3 w-3 mr-1"}),"未完成"]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(es,{className:"h-[350px] pr-2",children:e.jsx("div",{className:"space-y-2",children:x.map(D=>{const te=L(D),xe=j===D.id;return e.jsxs("div",{onClick:()=>g(D.id),className:` + flex items-center gap-3 p-3 rounded-lg border-2 cursor-pointer transition-all + ${xe?"ring-2 ring-primary":""} + ${te?"border-green-500 bg-green-50 dark:bg-green-950/20":"border-border hover:border-muted-foreground/50"} + `,children:[e.jsx("div",{className:"w-12 h-12 rounded border overflow-hidden bg-muted flex-shrink-0 flex items-center justify-center",children:e.jsx("img",{src:D.previewUrl,alt:D.name,className:"max-w-full max-h-full object-contain"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:D.name}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.emotion||"未填写情感标签"})]}),te?e.jsx(xa,{className:"h-5 w-5 text-green-500 flex-shrink-0"}):e.jsx("div",{className:"h-5 w-5 rounded-full border-2 border-muted-foreground/30 flex-shrink-0"})]},D.id)})})}),e.jsx("div",{className:"border rounded-lg p-4",children:U?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-16 h-16 rounded border overflow-hidden bg-muted flex items-center justify-center",children:e.jsx("img",{src:U.previewUrl,alt:U.name,className:"max-w-full max-h-full object-contain"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium truncate",children:U.name}),L(U)&&e.jsxs(Xe,{variant:"outline",className:"text-green-600 border-green-600",children:[e.jsx(ha,{className:"h-3 w-3 mr-1"}),"已完成"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(b,{htmlFor:"multi-emotion",children:["情感标签 ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ce,{id:"multi-emotion",value:U.emotion,onChange:D=>T(U.id,{emotion:D.target.value}),placeholder:"多个标签用逗号分隔,如:开心,高兴",className:U.emotion.trim()?"":"border-destructive"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"multi-description",children:"描述"}),e.jsx(ce,{id:"multi-description",value:U.description,onChange:D=>T(U.id,{description:D.target.value}),placeholder:"输入表情包描述..."})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(yt,{id:"multi-is-registered",checked:U.isRegistered,onCheckedChange:D=>T(U.id,{isRegistered:D===!0})}),e.jsx(b,{htmlFor:"multi-is-registered",className:"cursor-pointer text-sm",children:"上传后立即注册"})]})]}):e.jsx("div",{className:"h-full flex items-center justify-center text-muted-foreground",children:e.jsxs("div",{className:"text-center",children:[e.jsx(BN,{className:"h-12 w-12 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:"点击左侧卡片编辑"})]})})})]}),e.jsx(Is,{children:e.jsx(N,{onClick:ee,disabled:!K||_,children:_?"上传中...":`上传全部 (${w})`})})]})};return e.jsx(Os,{open:n,onOpenChange:r,children:e.jsxs(Es,{className:"max-w-3xl max-h-[90vh] overflow-hidden",children:[e.jsxs(zs,{children:[e.jsxs(Ms,{className:"flex items-center gap-2",children:[e.jsx(hr,{className:"h-5 w-5"}),d==="select"&&"上传表情包 - 选择文件",d==="edit-single"&&"上传表情包 - 填写信息",d==="edit-multiple"&&"上传表情包 - 批量编辑"]}),e.jsxs($s,{children:[d==="select"&&"支持 JPG、PNG、GIF、WebP 格式,单个文件最大 10MB,可同时上传多个文件",d==="edit-single"&&"请填写表情包的情感标签(必填)和描述",d==="edit-multiple"&&"点击左侧卡片编辑每个表情包的信息,情感标签为必填项"]})]}),e.jsxs("div",{className:"overflow-y-auto pr-1",children:[d==="select"&&V(),d==="edit-single"&&E(),d==="edit-multiple"&&B()]})]})})}const Bl="/api/webui/expression";async function Pw(){const n=await ke(`${Bl}/chats`,{headers:ze()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取聊天列表失败")}return n.json()}async function Ww(n){const r=new URLSearchParams;n.page&&r.append("page",n.page.toString()),n.page_size&&r.append("page_size",n.page_size.toString()),n.search&&r.append("search",n.search),n.chat_id&&r.append("chat_id",n.chat_id);const c=await ke(`${Bl}/list?${r}`,{headers:ze()});if(!c.ok){const d=await c.json();throw new Error(d.detail||"获取表达方式列表失败")}return c.json()}async function e1(n){const r=await ke(`${Bl}/${n}`,{headers:ze()});if(!r.ok){const c=await r.json();throw new Error(c.detail||"获取表达方式详情失败")}return r.json()}async function s1(n){const r=await ke(`${Bl}/`,{method:"POST",headers:ze(),body:JSON.stringify(n)});if(!r.ok){const c=await r.json();throw new Error(c.detail||"创建表达方式失败")}return r.json()}async function t1(n,r){const c=await ke(`${Bl}/${n}`,{method:"PATCH",headers:ze(),body:JSON.stringify(r)});if(!c.ok){const d=await c.json();throw new Error(d.detail||"更新表达方式失败")}return c.json()}async function a1(n){const r=await ke(`${Bl}/${n}`,{method:"DELETE",headers:ze()});if(!r.ok){const c=await r.json();throw new Error(c.detail||"删除表达方式失败")}return r.json()}async function l1(n){const r=await ke(`${Bl}/batch/delete`,{method:"POST",headers:ze(),body:JSON.stringify({ids:n})});if(!r.ok){const c=await r.json();throw new Error(c.detail||"批量删除表达方式失败")}return r.json()}async function n1(){const n=await ke(`${Bl}/stats/summary`,{headers:ze()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取统计数据失败")}return n.json()}function i1(){const[n,r]=u.useState([]),[c,d]=u.useState(!0),[h,x]=u.useState(0),[f,j]=u.useState(1),[g,_]=u.useState(20),[v,k]=u.useState(""),[z,T]=u.useState(null),[L,K]=u.useState(!1),[U,R]=u.useState(!1),[ee,V]=u.useState(!1),[E,B]=u.useState(null),[X,w]=u.useState(new Set),[D,te]=u.useState(!1),[xe,be]=u.useState(""),[ye,ve]=u.useState({total:0,recent_7days:0,chat_count:0,top_chats:{}}),[pe,Ne]=u.useState([]),[y,q]=u.useState(new Map),{toast:H}=Bs(),ne=async()=>{try{d(!0);const W=await Ww({page:f,page_size:g,search:v||void 0});r(W.data),x(W.total)}catch(W){H({title:"加载失败",description:W instanceof Error?W.message:"无法加载表达方式",variant:"destructive"})}finally{d(!1)}},S=async()=>{try{const W=await n1();W?.data&&ve(W.data)}catch(W){console.error("加载统计数据失败:",W)}},me=async()=>{try{const W=await Pw();if(W?.data){Ne(W.data);const _e=new Map;W.data.forEach(Me=>{_e.set(Me.chat_id,Me.chat_name)}),q(_e)}}catch(W){console.error("加载聊天列表失败:",W)}},he=W=>y.get(W)||W;u.useEffect(()=>{ne(),S(),me()},[f,g,v]);const Q=async W=>{try{const _e=await e1(W.id);T(_e.data),K(!0)}catch(_e){H({title:"加载详情失败",description:_e instanceof Error?_e.message:"无法加载表达方式详情",variant:"destructive"})}},oe=W=>{T(W),R(!0)},ge=async W=>{try{await a1(W.id),H({title:"删除成功",description:`已删除表达方式: ${W.situation}`}),B(null),ne(),S()}catch(_e){H({title:"删除失败",description:_e instanceof Error?_e.message:"无法删除表达方式",variant:"destructive"})}},le=W=>{const _e=new Set(X);_e.has(W)?_e.delete(W):_e.add(W),w(_e)},O=()=>{X.size===n.length&&n.length>0?w(new Set):w(new Set(n.map(W=>W.id)))},F=async()=>{try{await l1(Array.from(X)),H({title:"批量删除成功",description:`已删除 ${X.size} 个表达方式`}),w(new Set),te(!1),ne(),S()}catch(W){H({title:"批量删除失败",description:W instanceof Error?W.message:"无法批量删除表达方式",variant:"destructive"})}},A=()=>{const W=parseInt(xe),_e=Math.ceil(h/g);W>=1&&W<=_e?(j(W),be("")):H({title:"无效的页码",description:`请输入1-${_e}之间的页码`,variant:"destructive"})};return e.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[e.jsx("div",{className:"mb-4 sm:mb-6",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[e.jsx(si,{className:"h-8 w-8",strokeWidth:2}),"表达方式管理"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦的表达方式和话术模板"})]}),e.jsxs(N,{onClick:()=>V(!0),className:"gap-2",children:[e.jsx(gt,{className:"h-4 w-4"}),"新增表达方式"]})]})}),e.jsx(es,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"总数量"}),e.jsx("div",{className:"text-2xl font-bold mt-1",children:ye.total})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"近7天新增"}),e.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:ye.recent_7days})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"关联聊天数"}),e.jsx("div",{className:"text-2xl font-bold mt-1 text-blue-600",children:ye.chat_count})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx(b,{htmlFor:"search",children:"搜索"}),e.jsx("div",{className:"flex flex-col sm:flex-row gap-2 mt-1.5",children:e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(St,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(ce,{id:"search",placeholder:"搜索情境、风格或上下文...",value:v,onChange:W=>k(W.target.value),className:"pl-9"})]})}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 mt-4 pt-4 border-t",children:[e.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:X.size>0&&e.jsxs("span",{children:["已选择 ",X.size," 个表达方式"]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),e.jsxs(Qe,{value:g.toString(),onValueChange:W=>{_(parseInt(W)),j(1),w(new Set)},children:[e.jsx(Ge,{id:"page-size",className:"w-20",children:e.jsx($e,{})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"10",children:"10"}),e.jsx(ue,{value:"20",children:"20"}),e.jsx(ue,{value:"50",children:"50"}),e.jsx(ue,{value:"100",children:"100"})]})]}),X.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(N,{variant:"outline",size:"sm",onClick:()=>w(new Set),children:"取消选择"}),e.jsxs(N,{variant:"destructive",size:"sm",onClick:()=>te(!0),children:[e.jsx(ns,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card",children:[e.jsx("div",{className:"hidden md:block",children:e.jsxs(ii,{children:[e.jsx(ri,{children:e.jsxs(pt,{children:[e.jsx(ls,{className:"w-12",children:e.jsx(yt,{checked:X.size===n.length&&n.length>0,onCheckedChange:O})}),e.jsx(ls,{children:"情境"}),e.jsx(ls,{children:"风格"}),e.jsx(ls,{children:"聊天"}),e.jsx(ls,{className:"text-right",children:"操作"})]})}),e.jsx(ci,{children:c?e.jsx(pt,{children:e.jsx(Ye,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):n.length===0?e.jsx(pt,{children:e.jsx(Ye,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):n.map(W=>e.jsxs(pt,{children:[e.jsx(Ye,{children:e.jsx(yt,{checked:X.has(W.id),onCheckedChange:()=>le(W.id)})}),e.jsx(Ye,{className:"font-medium max-w-xs truncate",children:W.situation}),e.jsx(Ye,{className:"max-w-xs truncate",children:W.style}),e.jsx(Ye,{className:"max-w-[200px] truncate",title:he(W.chat_id),style:{wordBreak:"keep-all"},children:e.jsx("span",{className:"whitespace-nowrap overflow-hidden text-ellipsis block",children:he(W.chat_id)})}),e.jsx(Ye,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(N,{variant:"default",size:"sm",onClick:()=>oe(W),children:[e.jsx(pr,{className:"h-4 w-4 mr-1"}),"编辑"]}),e.jsx(N,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>Q(W),title:"查看详情",children:e.jsx(Zt,{className:"h-4 w-4"})}),e.jsxs(N,{size:"sm",onClick:()=>B(W),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ns,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},W.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3 p-4",children:c?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):n.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):n.map(W=>e.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(yt,{checked:X.has(W.id),onCheckedChange:()=>le(W.id),className:"mt-1"}),e.jsxs("div",{className:"min-w-0 flex-1 overflow-hidden space-y-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"情境"}),e.jsx("h3",{className:"font-semibold text-sm line-clamp-2 w-full break-all",title:W.situation,children:W.situation})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"风格"}),e.jsx("p",{className:"text-sm line-clamp-2 w-full break-all",title:W.style,children:W.style})]})]})]}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"聊天"}),e.jsx("p",{className:"text-sm truncate",title:he(W.chat_id),style:{wordBreak:"keep-all"},children:he(W.chat_id)})]}),e.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[e.jsxs(N,{variant:"outline",size:"sm",onClick:()=>oe(W),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[e.jsx(pr,{className:"h-3 w-3 mr-1"}),"编辑"]}),e.jsx(N,{variant:"outline",size:"sm",onClick:()=>Q(W),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:e.jsx(Zt,{className:"h-3 w-3"})}),e.jsxs(N,{variant:"outline",size:"sm",onClick:()=>B(W),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[e.jsx(ns,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},W.id))}),h>0&&e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[e.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",h," 条记录,第 ",f," / ",Math.ceil(h/g)," 页"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{variant:"outline",size:"sm",onClick:()=>j(1),disabled:f===1,className:"hidden sm:flex",children:e.jsx(wr,{className:"h-4 w-4"})}),e.jsxs(N,{variant:"outline",size:"sm",onClick:()=>j(f-1),disabled:f===1,children:[e.jsx(cn,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{type:"number",value:xe,onChange:W=>be(W.target.value),onKeyDown:W=>W.key==="Enter"&&A(),placeholder:f.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(h/g)}),e.jsx(N,{variant:"outline",size:"sm",onClick:A,disabled:!xe,className:"h-8",children:"跳转"})]}),e.jsxs(N,{variant:"outline",size:"sm",onClick:()=>j(f+1),disabled:f>=Math.ceil(h/g),children:[e.jsx("span",{className:"hidden sm:inline",children:"下一页"}),e.jsx(il,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(N,{variant:"outline",size:"sm",onClick:()=>j(Math.ceil(h/g)),disabled:f>=Math.ceil(h/g),className:"hidden sm:flex",children:e.jsx(_r,{className:"h-4 w-4"})})]})]})]})]})}),e.jsx(r1,{expression:z,open:L,onOpenChange:K,chatNameMap:y}),e.jsx(c1,{open:ee,onOpenChange:V,chatList:pe,onSuccess:()=>{ne(),S(),V(!1)}}),e.jsx(o1,{expression:z,open:U,onOpenChange:R,chatList:pe,onSuccess:()=>{ne(),S(),R(!1)}}),e.jsx(ps,{open:!!E,onOpenChange:()=>B(null),children:e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认删除"}),e.jsxs(ms,{children:['确定要删除表达方式 "',E?.situation,'" 吗? 此操作不可撤销。']})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:()=>E&&ge(E),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),e.jsx(d1,{open:D,onOpenChange:te,onConfirm:F,count:X.size})]})}function r1({expression:n,open:r,onOpenChange:c,chatNameMap:d}){if(!n)return null;const h=f=>f?new Date(f*1e3).toLocaleString("zh-CN"):"-",x=f=>d.get(f)||f;return e.jsx(Os,{open:r,onOpenChange:c,children:e.jsxs(Es,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(zs,{children:[e.jsx(Ms,{children:"表达方式详情"}),e.jsx($s,{children:"查看表达方式的完整信息"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(nr,{label:"情境",value:n.situation}),e.jsx(nr,{label:"风格",value:n.style}),e.jsx(nr,{label:"聊天",value:x(n.chat_id)}),e.jsx(nr,{icon:Uu,label:"记录ID",value:n.id.toString(),mono:!0})]}),e.jsx("div",{className:"grid grid-cols-2 gap-4",children:e.jsx(nr,{icon:Wn,label:"创建时间",value:h(n.create_date)})})]}),e.jsx(Is,{children:e.jsx(N,{onClick:()=>c(!1),children:"关闭"})})]})})}function nr({icon:n,label:r,value:c,mono:d=!1}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs(b,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[n&&e.jsx(n,{className:"h-3 w-3"}),r]}),e.jsx("div",{className:$("text-sm",d&&"font-mono",!c&&"text-muted-foreground"),children:c||"-"})]})}function c1({open:n,onOpenChange:r,chatList:c,onSuccess:d}){const[h,x]=u.useState({situation:"",style:"",chat_id:""}),[f,j]=u.useState(!1),{toast:g}=Bs(),_=async()=>{if(!h.situation||!h.style||!h.chat_id){g({title:"验证失败",description:"请填写必填字段:情境、风格和聊天",variant:"destructive"});return}try{j(!0),await s1(h),g({title:"创建成功",description:"表达方式已创建"}),x({situation:"",style:"",chat_id:""}),d()}catch(v){g({title:"创建失败",description:v instanceof Error?v.message:"无法创建表达方式",variant:"destructive"})}finally{j(!1)}};return e.jsx(Os,{open:n,onOpenChange:r,children:e.jsxs(Es,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(zs,{children:[e.jsx(Ms,{children:"新增表达方式"}),e.jsx($s,{children:"创建新的表达方式记录"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(b,{htmlFor:"situation",children:["情境 ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ce,{id:"situation",value:h.situation,onChange:v=>x({...h,situation:v.target.value}),placeholder:"描述使用场景"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(b,{htmlFor:"style",children:["风格 ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ce,{id:"style",value:h.style,onChange:v=>x({...h,style:v.target.value}),placeholder:"描述表达风格"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(b,{htmlFor:"chat_id",children:["聊天 ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsxs(Qe,{value:h.chat_id,onValueChange:v=>x({...h,chat_id:v}),children:[e.jsx(Ge,{children:e.jsx($e,{placeholder:"选择关联的聊天"})}),e.jsx(Ve,{children:c.map(v=>e.jsx(ue,{value:v.chat_id,children:e.jsxs("span",{className:"truncate",style:{wordBreak:"keep-all"},children:[v.chat_name,v.is_group&&e.jsx("span",{className:"text-muted-foreground ml-1",children:"(群聊)"})]})},v.chat_id))})]})]})]}),e.jsxs(Is,{children:[e.jsx(N,{variant:"outline",onClick:()=>r(!1),children:"取消"}),e.jsx(N,{onClick:_,disabled:f,children:f?"创建中...":"创建"})]})]})})}function o1({expression:n,open:r,onOpenChange:c,chatList:d,onSuccess:h}){const[x,f]=u.useState({}),[j,g]=u.useState(!1),{toast:_}=Bs();u.useEffect(()=>{n&&f({situation:n.situation,style:n.style,chat_id:n.chat_id})},[n]);const v=async()=>{if(n)try{g(!0),await t1(n.id,x),_({title:"保存成功",description:"表达方式已更新"}),h()}catch(k){_({title:"保存失败",description:k instanceof Error?k.message:"无法更新表达方式",variant:"destructive"})}finally{g(!1)}};return n?e.jsx(Os,{open:r,onOpenChange:c,children:e.jsxs(Es,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(zs,{children:[e.jsx(Ms,{children:"编辑表达方式"}),e.jsx($s,{children:"修改表达方式的信息"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"edit_situation",children:"情境"}),e.jsx(ce,{id:"edit_situation",value:x.situation||"",onChange:k=>f({...x,situation:k.target.value}),placeholder:"描述使用场景"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"edit_style",children:"风格"}),e.jsx(ce,{id:"edit_style",value:x.style||"",onChange:k=>f({...x,style:k.target.value}),placeholder:"描述表达风格"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"edit_chat_id",children:"聊天"}),e.jsxs(Qe,{value:x.chat_id||"",onValueChange:k=>f({...x,chat_id:k}),children:[e.jsx(Ge,{children:e.jsx($e,{placeholder:"选择关联的聊天"})}),e.jsx(Ve,{children:d.map(k=>e.jsx(ue,{value:k.chat_id,children:e.jsxs("span",{className:"truncate",style:{wordBreak:"keep-all"},children:[k.chat_name,k.is_group&&e.jsx("span",{className:"text-muted-foreground ml-1",children:"(群聊)"})]})},k.chat_id))})]})]})]}),e.jsxs(Is,{children:[e.jsx(N,{variant:"outline",onClick:()=>c(!1),children:"取消"}),e.jsx(N,{onClick:v,disabled:j,children:j?"保存中...":"保存"})]})]})}):null}function d1({open:n,onOpenChange:r,onConfirm:c,count:d}){return e.jsx(ps,{open:n,onOpenChange:r,children:e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认批量删除"}),e.jsxs(ms,{children:["您即将删除 ",d," 个表达方式,此操作无法撤销。确定要继续吗?"]})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"确认删除"})]})]})})}const oi="/api/webui/person";async function u1(n){const r=new URLSearchParams;n.page&&r.append("page",n.page.toString()),n.page_size&&r.append("page_size",n.page_size.toString()),n.search&&r.append("search",n.search),n.is_known!==void 0&&r.append("is_known",n.is_known.toString()),n.platform&&r.append("platform",n.platform);const c=await ke(`${oi}/list?${r}`,{headers:ze()});if(!c.ok){const d=await c.json();throw new Error(d.detail||"获取人物列表失败")}return c.json()}async function m1(n){const r=await ke(`${oi}/${n}`,{headers:ze()});if(!r.ok){const c=await r.json();throw new Error(c.detail||"获取人物详情失败")}return r.json()}async function h1(n,r){const c=await ke(`${oi}/${n}`,{method:"PATCH",headers:ze(),body:JSON.stringify(r)});if(!c.ok){const d=await c.json();throw new Error(d.detail||"更新人物信息失败")}return c.json()}async function x1(n){const r=await ke(`${oi}/${n}`,{method:"DELETE",headers:ze()});if(!r.ok){const c=await r.json();throw new Error(c.detail||"删除人物信息失败")}return r.json()}async function f1(){const n=await ke(`${oi}/stats/summary`,{headers:ze()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取统计数据失败")}return n.json()}async function p1(n){const r=await ke(`${oi}/batch/delete`,{method:"POST",headers:ze(),body:JSON.stringify({person_ids:n})});if(!r.ok){const c=await r.json();throw new Error(c.detail||"批量删除失败")}return r.json()}function g1(){const[n,r]=u.useState([]),[c,d]=u.useState(!0),[h,x]=u.useState(0),[f,j]=u.useState(1),[g,_]=u.useState(20),[v,k]=u.useState(""),[z,T]=u.useState(void 0),[L,K]=u.useState(void 0),[U,R]=u.useState(null),[ee,V]=u.useState(!1),[E,B]=u.useState(!1),[X,w]=u.useState(null),[D,te]=u.useState({total:0,known:0,unknown:0,platforms:{}}),[xe,be]=u.useState(new Set),[ye,ve]=u.useState(!1),[pe,Ne]=u.useState(""),{toast:y}=Bs(),q=async()=>{try{d(!0);const A=await u1({page:f,page_size:g,search:v||void 0,is_known:z,platform:L});r(A.data),x(A.total)}catch(A){y({title:"加载失败",description:A instanceof Error?A.message:"无法加载人物信息",variant:"destructive"})}finally{d(!1)}},H=async()=>{try{const A=await f1();A?.data&&te(A.data)}catch(A){console.error("加载统计数据失败:",A)}};u.useEffect(()=>{q(),H()},[f,g,v,z,L]);const ne=async A=>{try{const W=await m1(A.person_id);R(W.data),V(!0)}catch(W){y({title:"加载详情失败",description:W instanceof Error?W.message:"无法加载人物详情",variant:"destructive"})}},S=A=>{R(A),B(!0)},me=async A=>{try{await x1(A.person_id),y({title:"删除成功",description:`已删除人物信息: ${A.person_name||A.nickname||A.user_id}`}),w(null),q(),H()}catch(W){y({title:"删除失败",description:W instanceof Error?W.message:"无法删除人物信息",variant:"destructive"})}},he=u.useMemo(()=>Object.keys(D.platforms),[D.platforms]),Q=A=>{const W=new Set(xe);W.has(A)?W.delete(A):W.add(A),be(W)},oe=()=>{xe.size===n.length&&n.length>0?be(new Set):be(new Set(n.map(A=>A.person_id)))},ge=()=>{if(xe.size===0){y({title:"未选择任何人物",description:"请先选择要删除的人物",variant:"destructive"});return}ve(!0)},le=async()=>{try{const A=await p1(Array.from(xe));y({title:"批量删除完成",description:A.message}),be(new Set),ve(!1),q(),H()}catch(A){y({title:"批量删除失败",description:A instanceof Error?A.message:"批量删除失败",variant:"destructive"})}},O=()=>{const A=parseInt(pe),W=Math.ceil(h/g);A>=1&&A<=W?(j(A),Ne("")):y({title:"无效的页码",description:`请输入1-${W}之间的页码`,variant:"destructive"})},F=A=>A?new Date(A*1e3).toLocaleString("zh-CN"):"-";return e.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[e.jsx("div",{className:"mb-4 sm:mb-6",children:e.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[e.jsx(HN,{className:"h-8 w-8",strokeWidth:2}),"人物信息管理"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦认识的所有人物信息"})]})})}),e.jsx(es,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"总人数"}),e.jsx("div",{className:"text-2xl font-bold mt-1",children:D.total})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"已认识"}),e.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:D.known})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"未认识"}),e.jsx("div",{className:"text-2xl font-bold mt-1 text-muted-foreground",children:D.unknown})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx(b,{htmlFor:"search",children:"搜索"}),e.jsxs("div",{className:"relative mt-1.5",children:[e.jsx(St,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(ce,{id:"search",placeholder:"搜索名称、昵称或用户ID...",value:v,onChange:A=>k(A.target.value),className:"pl-9"})]})]}),e.jsxs("div",{children:[e.jsx(b,{htmlFor:"filter-known",children:"认识状态"}),e.jsxs(Qe,{value:z===void 0?"all":z.toString(),onValueChange:A=>{T(A==="all"?void 0:A==="true"),j(1)},children:[e.jsx(Ge,{id:"filter-known",className:"mt-1.5",children:e.jsx($e,{})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"all",children:"全部"}),e.jsx(ue,{value:"true",children:"已认识"}),e.jsx(ue,{value:"false",children:"未认识"})]})]})]}),e.jsxs("div",{children:[e.jsx(b,{htmlFor:"filter-platform",children:"平台"}),e.jsxs(Qe,{value:L||"all",onValueChange:A=>{K(A==="all"?void 0:A),j(1)},children:[e.jsx(Ge,{id:"filter-platform",className:"mt-1.5",children:e.jsx($e,{})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"all",children:"全部平台"}),he.map(A=>e.jsxs(ue,{value:A,children:[A," (",D.platforms[A],")"]},A))]})]})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 mt-4 pt-4 border-t",children:[e.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:xe.size>0&&e.jsxs("span",{children:["已选择 ",xe.size," 个人物"]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),e.jsxs(Qe,{value:g.toString(),onValueChange:A=>{_(parseInt(A)),j(1),be(new Set)},children:[e.jsx(Ge,{id:"page-size",className:"w-20",children:e.jsx($e,{})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"10",children:"10"}),e.jsx(ue,{value:"20",children:"20"}),e.jsx(ue,{value:"50",children:"50"}),e.jsx(ue,{value:"100",children:"100"})]})]}),xe.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(N,{variant:"outline",size:"sm",onClick:()=>be(new Set),children:"取消选择"}),e.jsxs(N,{variant:"destructive",size:"sm",onClick:ge,children:[e.jsx(ns,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card",children:[e.jsx("div",{className:"hidden md:block",children:e.jsxs(ii,{children:[e.jsx(ri,{children:e.jsxs(pt,{children:[e.jsx(ls,{className:"w-12",children:e.jsx(yt,{checked:n.length>0&&xe.size===n.length,onCheckedChange:oe,"aria-label":"全选"})}),e.jsx(ls,{children:"状态"}),e.jsx(ls,{children:"名称"}),e.jsx(ls,{children:"昵称"}),e.jsx(ls,{children:"平台"}),e.jsx(ls,{children:"用户ID"}),e.jsx(ls,{children:"最后更新"}),e.jsx(ls,{className:"text-right",children:"操作"})]})}),e.jsx(ci,{children:c?e.jsx(pt,{children:e.jsx(Ye,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):n.length===0?e.jsx(pt,{children:e.jsx(Ye,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):n.map(A=>e.jsxs(pt,{children:[e.jsx(Ye,{children:e.jsx(yt,{checked:xe.has(A.person_id),onCheckedChange:()=>Q(A.person_id),"aria-label":`选择 ${A.person_name||A.nickname||A.user_id}`})}),e.jsx(Ye,{children:e.jsx("div",{className:$("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",A.is_known?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"),children:A.is_known?"已认识":"未认识"})}),e.jsx(Ye,{className:"font-medium",children:A.person_name||e.jsx("span",{className:"text-muted-foreground",children:"-"})}),e.jsx(Ye,{children:A.nickname||"-"}),e.jsx(Ye,{children:A.platform}),e.jsx(Ye,{className:"font-mono text-sm",children:A.user_id}),e.jsx(Ye,{className:"text-sm text-muted-foreground",children:F(A.last_know)}),e.jsx(Ye,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(N,{variant:"default",size:"sm",onClick:()=>ne(A),children:[e.jsx(Zt,{className:"h-4 w-4 mr-1"}),"详情"]}),e.jsxs(N,{variant:"default",size:"sm",onClick:()=>S(A),children:[e.jsx(pr,{className:"h-4 w-4 mr-1"}),"编辑"]}),e.jsxs(N,{size:"sm",onClick:()=>w(A),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ns,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},A.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3 p-4",children:c?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):n.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):n.map(A=>e.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(yt,{checked:xe.has(A.person_id),onCheckedChange:()=>Q(A.person_id),className:"mt-1"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:$("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium mb-2",A.is_known?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"),children:A.is_known?"已认识":"未认识"}),e.jsx("h3",{className:"font-semibold text-sm line-clamp-1 w-full break-all",children:A.person_name||e.jsx("span",{className:"text-muted-foreground",children:"未命名"})}),A.nickname&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-1 w-full break-all",children:["昵称: ",A.nickname]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"平台"}),e.jsx("p",{className:"font-medium text-xs",children:A.platform})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"用户ID"}),e.jsx("p",{className:"font-mono text-xs truncate",title:A.user_id,children:A.user_id})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"最后更新"}),e.jsx("p",{className:"text-xs",children:F(A.last_know)})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[e.jsxs(N,{variant:"outline",size:"sm",onClick:()=>ne(A),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[e.jsx(Zt,{className:"h-3 w-3 mr-1"}),"查看"]}),e.jsxs(N,{variant:"outline",size:"sm",onClick:()=>S(A),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[e.jsx(pr,{className:"h-3 w-3 mr-1"}),"编辑"]}),e.jsxs(N,{variant:"outline",size:"sm",onClick:()=>w(A),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[e.jsx(ns,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},A.id))}),h>0&&e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[e.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",h," 条记录,第 ",f," / ",Math.ceil(h/g)," 页"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{variant:"outline",size:"sm",onClick:()=>j(1),disabled:f===1,className:"hidden sm:flex",children:e.jsx(wr,{className:"h-4 w-4"})}),e.jsxs(N,{variant:"outline",size:"sm",onClick:()=>j(f-1),disabled:f===1,children:[e.jsx(cn,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{type:"number",value:pe,onChange:A=>Ne(A.target.value),onKeyDown:A=>A.key==="Enter"&&O(),placeholder:f.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(h/g)}),e.jsx(N,{variant:"outline",size:"sm",onClick:O,disabled:!pe,className:"h-8",children:"跳转"})]}),e.jsxs(N,{variant:"outline",size:"sm",onClick:()=>j(f+1),disabled:f>=Math.ceil(h/g),children:[e.jsx("span",{className:"hidden sm:inline",children:"下一页"}),e.jsx(il,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(N,{variant:"outline",size:"sm",onClick:()=>j(Math.ceil(h/g)),disabled:f>=Math.ceil(h/g),className:"hidden sm:flex",children:e.jsx(_r,{className:"h-4 w-4"})})]})]})]})]})}),e.jsx(j1,{person:U,open:ee,onOpenChange:V}),e.jsx(v1,{person:U,open:E,onOpenChange:B,onSuccess:()=>{q(),H(),B(!1)}}),e.jsx(ps,{open:!!X,onOpenChange:()=>w(null),children:e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认删除"}),e.jsxs(ms,{children:['确定要删除人物信息 "',X?.person_name||X?.nickname||X?.user_id,'" 吗? 此操作不可撤销。']})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:()=>X&&me(X),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),e.jsx(ps,{open:ye,onOpenChange:ve,children:e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"确认批量删除"}),e.jsxs(ms,{children:["确定要删除选中的 ",xe.size," 个人物信息吗? 此操作不可撤销。"]})]}),e.jsxs(ds,{children:[e.jsx(xs,{children:"取消"}),e.jsx(hs,{onClick:le,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})})]})}function j1({person:n,open:r,onOpenChange:c}){if(!n)return null;const d=h=>h?new Date(h*1e3).toLocaleString("zh-CN"):"-";return e.jsx(Os,{open:r,onOpenChange:c,children:e.jsxs(Es,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(zs,{children:[e.jsx(Ms,{children:"人物详情"}),e.jsxs($s,{children:["查看 ",n.person_name||n.nickname||n.user_id," 的完整信息"]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(al,{icon:to,label:"人物名称",value:n.person_name}),e.jsx(al,{icon:si,label:"昵称",value:n.nickname}),e.jsx(al,{icon:Uu,label:"用户ID",value:n.user_id,mono:!0}),e.jsx(al,{icon:Uu,label:"人物ID",value:n.person_id,mono:!0}),e.jsx(al,{label:"平台",value:n.platform}),e.jsx(al,{label:"状态",value:n.is_known?"已认识":"未认识"})]}),n.name_reason&&e.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[e.jsx(b,{className:"text-xs text-muted-foreground",children:"名称设定原因"}),e.jsx("p",{className:"mt-1 text-sm",children:n.name_reason})]}),n.memory_points&&e.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[e.jsx(b,{className:"text-xs text-muted-foreground",children:"个人印象"}),e.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:n.memory_points})]}),n.group_nick_name&&n.group_nick_name.length>0&&e.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[e.jsx(b,{className:"text-xs text-muted-foreground",children:"群昵称"}),e.jsx("div",{className:"mt-2 space-y-1",children:n.group_nick_name.map((h,x)=>e.jsxs("div",{className:"text-sm flex items-center gap-2",children:[e.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:h.group_id}),e.jsx("span",{children:"→"}),e.jsx("span",{children:h.group_nick_name})]},x))})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(al,{icon:Wn,label:"认识时间",value:d(n.know_times)}),e.jsx(al,{icon:Wn,label:"首次记录",value:d(n.know_since)}),e.jsx(al,{icon:Wn,label:"最后更新",value:d(n.last_know)})]})]}),e.jsx(Is,{children:e.jsx(N,{onClick:()=>c(!1),children:"关闭"})})]})})}function al({icon:n,label:r,value:c,mono:d=!1}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs(b,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[n&&e.jsx(n,{className:"h-3 w-3"}),r]}),e.jsx("div",{className:$("text-sm",d&&"font-mono",!c&&"text-muted-foreground"),children:c||"-"})]})}function v1({person:n,open:r,onOpenChange:c,onSuccess:d}){const[h,x]=u.useState({}),[f,j]=u.useState(!1),{toast:g}=Bs();u.useEffect(()=>{n&&x({person_name:n.person_name||"",name_reason:n.name_reason||"",nickname:n.nickname||"",memory_points:n.memory_points||"",is_known:n.is_known})},[n]);const _=async()=>{if(n)try{j(!0),await h1(n.person_id,h),g({title:"保存成功",description:"人物信息已更新"}),d()}catch(v){g({title:"保存失败",description:v instanceof Error?v.message:"无法更新人物信息",variant:"destructive"})}finally{j(!1)}};return n?e.jsx(Os,{open:r,onOpenChange:c,children:e.jsxs(Es,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(zs,{children:[e.jsx(Ms,{children:"编辑人物信息"}),e.jsxs($s,{children:["修改 ",n.person_name||n.nickname||n.user_id," 的信息"]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"person_name",children:"人物名称"}),e.jsx(ce,{id:"person_name",value:h.person_name||"",onChange:v=>x({...h,person_name:v.target.value}),placeholder:"为这个人设置一个名称"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"nickname",children:"昵称"}),e.jsx(ce,{id:"nickname",value:h.nickname||"",onChange:v=>x({...h,nickname:v.target.value}),placeholder:"昵称"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"name_reason",children:"名称设定原因"}),e.jsx(Us,{id:"name_reason",value:h.name_reason||"",onChange:v=>x({...h,name_reason:v.target.value}),placeholder:"为什么这样称呼这个人?",rows:2})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"memory_points",children:"个人印象"}),e.jsx(Us,{id:"memory_points",value:h.memory_points||"",onChange:v=>x({...h,memory_points:v.target.value}),placeholder:"对这个人的印象和记忆点...",rows:4})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[e.jsxs("div",{children:[e.jsx(b,{htmlFor:"is_known",className:"text-base font-medium",children:"已认识"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"标记是否已经认识这个人"})]}),e.jsx(qe,{id:"is_known",checked:h.is_known,onCheckedChange:v=>x({...h,is_known:v})})]})]}),e.jsxs(Is,{children:[e.jsx(N,{variant:"outline",onClick:()=>c(!1),children:"取消"}),e.jsx(N,{onClick:_,disabled:f,children:f?"保存中...":"保存"})]})]})}):null}var y1=Sb();const xp=wy(y1),Pu="/api/webui";async function N1(n=100,r="all"){const c=`${Pu}/knowledge/graph?limit=${n}&node_type=${r}`,d=await fetch(c);if(!d.ok)throw new Error(`获取知识图谱失败: ${d.status}`);return d.json()}async function b1(){const n=await fetch(`${Pu}/knowledge/stats`);if(!n.ok)throw new Error("获取知识图谱统计信息失败");return n.json()}async function w1(n){const r=await fetch(`${Pu}/knowledge/search?query=${encodeURIComponent(n)}`);if(!r.ok)throw new Error("搜索知识节点失败");return r.json()}const Fg=u.memo(({data:n})=>e.jsxs("div",{className:"px-4 py-2 shadow-md rounded-lg bg-gradient-to-br from-blue-500 to-blue-600 border-2 border-blue-700 min-w-[120px]",children:[e.jsx(lo,{type:"target",position:no.Top}),e.jsx("div",{className:"font-semibold text-white text-sm truncate max-w-[200px]",title:n.content,children:n.label}),e.jsx(lo,{type:"source",position:no.Bottom})]}));Fg.displayName="EntityNode";const Qg=u.memo(({data:n})=>e.jsxs("div",{className:"px-3 py-2 shadow-md rounded-md bg-gradient-to-br from-green-500 to-green-600 border-2 border-green-700 min-w-[100px]",children:[e.jsx(lo,{type:"target",position:no.Top}),e.jsx("div",{className:"font-medium text-white text-xs truncate max-w-[150px]",title:n.content,children:n.label}),e.jsx(lo,{type:"source",position:no.Bottom})]}));Qg.displayName="ParagraphNode";const _1={entity:Fg,paragraph:Qg};function S1(n,r){const c=new xp.graphlib.Graph;c.setDefaultEdgeLabel(()=>({})),c.setGraph({rankdir:"TB",ranksep:100,nodesep:80});const d=[],h=[];return n.forEach(x=>{c.setNode(x.id,{width:150,height:50})}),r.forEach(x=>{c.setEdge(x.source,x.target)}),xp.layout(c),n.forEach(x=>{const f=c.node(x.id);d.push({id:x.id,type:x.type,position:{x:f.x-75,y:f.y-25},data:{label:x.content.slice(0,20)+(x.content.length>20?"...":""),content:x.content}})}),r.forEach((x,f)=>{const j={id:`edge-${f}`,source:x.source,target:x.target,animated:n.length<=200&&x.weight>5,style:{strokeWidth:Math.min(x.weight/2,5),opacity:.6}};x.weight>10&&n.length<100&&(j.label=`${x.weight.toFixed(0)}`),h.push(j)}),{nodes:d,edges:h}}function C1(){const n=It(),[r,c]=u.useState(!1),[d,h]=u.useState(null),[x,f]=u.useState(""),[j,g]=u.useState("all"),[_,v]=u.useState(50),[k,z]=u.useState("50"),[T,L]=u.useState(!1),[K,U]=u.useState(!0),[R,ee]=u.useState(!1),[V,E]=u.useState(!1),[B,X,w]=Cb([]),[D,te,xe]=kb([]),[be,ye]=u.useState(0),[ve,pe]=u.useState(null),[Ne,y]=u.useState(null),{toast:q}=Bs(),H=u.useCallback(le=>le.type==="entity"?"#6366f1":le.type==="paragraph"?"#10b981":"#6b7280",[]),ne=u.useCallback(async(le=!1)=>{try{if(!le&&_>200){E(!0);return}c(!0);const[O,F]=await Promise.all([N1(_,j),b1()]);if(h(F),O.nodes.length===0){q({title:"提示",description:"知识库为空,请先导入知识数据"}),X([]),te([]);return}const{nodes:A,edges:W}=S1(O.nodes,O.edges);X(A),te(W),ye(A.length),F&&F.total_nodes>_&&q({title:"提示",description:`知识图谱包含 ${F.total_nodes} 个节点,当前显示 ${A.length} 个`}),q({title:"加载成功",description:`已加载 ${A.length} 个节点,${W.length} 条边`})}catch(O){console.error("加载知识图谱失败:",O),q({title:"加载失败",description:O instanceof Error?O.message:"未知错误",variant:"destructive"})}finally{c(!1)}},[_,j,q]),S=u.useCallback(async()=>{if(!x.trim()){q({title:"提示",description:"请输入搜索关键词"});return}try{const le=await w1(x);if(le.length===0){q({title:"未找到",description:"没有找到匹配的节点"});return}const O=new Set(le.map(F=>F.id));X(F=>F.map(A=>({...A,style:{...A.style,opacity:O.has(A.id)?1:.3,filter:O.has(A.id)?"brightness(1.2)":"brightness(0.8)"}}))),q({title:"搜索完成",description:`找到 ${le.length} 个匹配节点`})}catch(le){console.error("搜索失败:",le),q({title:"搜索失败",description:le instanceof Error?le.message:"未知错误",variant:"destructive"})}},[x,q]),me=u.useCallback(()=>{X(le=>le.map(O=>({...O,style:{...O.style,opacity:1,filter:"brightness(1)"}})))},[]),he=u.useCallback(()=>{U(!1),ee(!0),ne()},[ne]),Q=u.useCallback(()=>{E(!1),setTimeout(()=>{ne(!0)},0)},[ne]),oe=u.useCallback((le,O)=>{B.find(A=>A.id===O.id)&&pe({id:O.id,type:O.type,content:O.data.content})},[B]);u.useEffect(()=>{K||R&&ne()},[_,j,K,R]);const ge=u.useCallback((le,O)=>{const F=B.find(_e=>_e.id===O.source),A=B.find(_e=>_e.id===O.target),W=D.find(_e=>_e.id===O.id);F&&A&&W&&y({source:{id:F.id,type:F.type,content:F.data.content},target:{id:A.id,type:A.type,content:A.data.content},edge:{source:O.source,target:O.target,weight:parseFloat(O.label||"0")}})},[B,D]);return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"flex-shrink-0 p-4 border-b bg-background",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦知识库图谱"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"可视化知识实体与关系网络"})]}),d&&e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsxs(Xe,{variant:"outline",className:"gap-1",children:[e.jsx(eo,{className:"h-3 w-3"}),"节点: ",d.total_nodes]}),e.jsxs(Xe,{variant:"outline",className:"gap-1",children:[e.jsx(jg,{className:"h-3 w-3"}),"边: ",d.total_edges]}),e.jsxs(Xe,{variant:"outline",className:"gap-1",children:[e.jsx(Xt,{className:"h-3 w-3"}),"实体: ",d.entity_nodes]}),e.jsxs(Xe,{variant:"outline",className:"gap-1",children:[e.jsx(Ma,{className:"h-3 w-3"}),"段落: ",d.paragraph_nodes]})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 mt-4",children:[e.jsxs("div",{className:"flex-1 flex gap-2",children:[e.jsx(ce,{placeholder:"搜索节点内容...",value:x,onChange:le=>f(le.target.value),onKeyDown:le=>le.key==="Enter"&&S(),className:"flex-1"}),e.jsx(N,{onClick:S,size:"sm",children:e.jsx(St,{className:"h-4 w-4"})}),e.jsx(N,{onClick:me,variant:"outline",size:"sm",children:"重置"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(Qe,{value:j,onValueChange:le=>g(le),children:[e.jsx(Ge,{className:"w-[120px]",children:e.jsx($e,{})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"all",children:"全部节点"}),e.jsx(ue,{value:"entity",children:"仅实体"}),e.jsx(ue,{value:"paragraph",children:"仅段落"})]})]}),e.jsxs(Qe,{value:_===1e4?"all":T?"custom":_.toString(),onValueChange:le=>{le==="custom"?(L(!0),z(_.toString())):le==="all"?(L(!1),v(1e4)):(L(!1),v(Number(le)))},children:[e.jsx(Ge,{className:"w-[120px]",children:e.jsx($e,{})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"50",children:"50 节点"}),e.jsx(ue,{value:"100",children:"100 节点"}),e.jsx(ue,{value:"200",children:"200 节点"}),e.jsx(ue,{value:"500",children:"500 节点"}),e.jsx(ue,{value:"1000",children:"1000 节点"}),e.jsx(ue,{value:"all",children:"全部 (最多10000)"}),e.jsx(ue,{value:"custom",children:"自定义..."})]})]}),T&&e.jsx(ce,{type:"number",min:"50",value:k,onChange:le=>z(le.target.value),onBlur:()=>{const le=parseInt(k);!isNaN(le)&&le>=50?v(le):(z("50"),v(50))},onKeyDown:le=>{if(le.key==="Enter"){const O=parseInt(k);!isNaN(O)&&O>=50?v(O):(z("50"),v(50))}},placeholder:"最少50个",className:"w-[120px]"}),e.jsx(N,{onClick:()=>ne(),variant:"outline",size:"sm",disabled:r,children:e.jsx(ft,{className:$("h-4 w-4",r&&"animate-spin")})})]})]})]}),e.jsx("div",{className:"flex-1 relative",children:r?e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(ft,{className:"h-8 w-8 animate-spin mx-auto mb-2 text-muted-foreground"}),e.jsx("p",{className:"text-muted-foreground",children:"加载知识图谱中..."})]})}):B.length===0?e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(eo,{className:"h-12 w-12 mx-auto mb-4 text-muted-foreground"}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"知识库为空"}),e.jsx("p",{className:"text-muted-foreground",children:"请先导入知识数据"})]})}):e.jsxs(Tb,{nodes:B,edges:D,onNodesChange:w,onEdgesChange:xe,onNodeClick:oe,onEdgeClick:ge,nodeTypes:_1,fitView:!0,minZoom:.05,maxZoom:1.5,defaultViewport:{x:0,y:0,zoom:.5},elevateNodesOnSelect:be<=500,nodesDraggable:be<=1e3,attributionPosition:"bottom-left",children:[e.jsx(Eb,{variant:zb.Dots,gap:12,size:1}),e.jsx(Mb,{}),be<=500&&e.jsx(Ab,{nodeColor:H,nodeBorderRadius:8,pannable:!0,zoomable:!0}),e.jsxs(Db,{position:"top-right",className:"bg-background/95 backdrop-blur-sm rounded-lg border p-3 shadow-lg",children:[e.jsx("div",{className:"text-sm font-semibold mb-2",children:"图例"}),e.jsxs("div",{className:"space-y-2 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-blue-500 to-blue-600 border-2 border-blue-700"}),e.jsx("span",{children:"实体节点"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-green-500 to-green-600 border-2 border-green-700"}),e.jsx("span",{children:"段落节点"})]}),be>200&&e.jsxs("div",{className:"mt-2 pt-2 border-t text-yellow-600 dark:text-yellow-500",children:[e.jsx("div",{className:"font-semibold",children:"性能模式"}),e.jsx("div",{children:"已禁用动画"}),be>500&&e.jsx("div",{children:"已禁用缩略图"})]})]})]})]})}),e.jsx(Os,{open:!!ve,onOpenChange:le=>!le&&pe(null),children:e.jsxs(Es,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsx(zs,{children:e.jsx(Ms,{children:"节点详情"})}),ve&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"grid grid-cols-2 gap-4",children:e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"类型"}),e.jsx("div",{className:"mt-1",children:e.jsx(Xe,{variant:ve.type==="entity"?"default":"secondary",children:ve.type==="entity"?"🏷️ 实体":"📄 段落"})})]})}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"ID"}),e.jsx("code",{className:"mt-1 block p-2 bg-muted rounded text-xs break-all",children:ve.id})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"内容"}),e.jsx(es,{className:"mt-1 h-40 p-3 bg-muted rounded",children:e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:ve.content})})]})]})]})}),e.jsx(Os,{open:!!Ne,onOpenChange:le=>!le&&y(null),children:e.jsxs(Es,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[e.jsx(zs,{children:e.jsx(Ms,{children:"边详情"})}),Ne&&e.jsx(es,{className:"flex-1 pr-4",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0 p-3 bg-blue-50 dark:bg-blue-950 rounded border-2 border-blue-200 dark:border-blue-800",children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"源节点"}),e.jsx("div",{className:"font-medium text-sm mb-2 truncate",children:Ne.source.content}),e.jsxs("code",{className:"text-xs text-muted-foreground truncate block",children:[Ne.source.id.slice(0,40),"..."]})]}),e.jsx("div",{className:"text-2xl text-muted-foreground flex-shrink-0",children:"→"}),e.jsxs("div",{className:"flex-1 min-w-0 p-3 bg-green-50 dark:bg-green-950 rounded border-2 border-green-200 dark:border-green-800",children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"目标节点"}),e.jsx("div",{className:"font-medium text-sm mb-2 truncate",children:Ne.target.content}),e.jsxs("code",{className:"text-xs text-muted-foreground truncate block",children:[Ne.target.id.slice(0,40),"..."]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"权重"}),e.jsx("div",{className:"mt-1",children:e.jsx(Xe,{variant:"outline",className:"text-base font-mono",children:Ne.edge.weight.toFixed(4)})})]})]})})]})}),e.jsx(ps,{open:K,onOpenChange:U,children:e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"加载知识图谱"}),e.jsxs(ms,{children:["知识图谱的动态展示会消耗较多系统资源。",e.jsx("br",{}),"确定要加载知识图谱吗?"]})]}),e.jsxs(ds,{children:[e.jsx(xs,{onClick:()=>n({to:"/"}),children:"取消 (返回首页)"}),e.jsx(hs,{onClick:he,children:"确认加载"})]})]})}),e.jsx(ps,{open:V,onOpenChange:E,children:e.jsxs(cs,{children:[e.jsxs(os,{children:[e.jsx(us,{children:"⚠️ 节点数量较多"}),e.jsx(ms,{asChild:!0,children:e.jsxs("div",{children:[e.jsxs("p",{children:["您正在尝试加载 ",e.jsx("strong",{className:"text-orange-600",children:_>=1e4?"全部 (最多10000个)":_})," 个节点。"]}),e.jsx("p",{className:"mt-4",children:"节点数量过多可能导致:"}),e.jsxs("ul",{className:"list-disc list-inside mt-2 space-y-1",children:[e.jsx("li",{children:"页面加载时间较长"}),e.jsx("li",{children:"浏览器卡顿或崩溃"}),e.jsx("li",{children:"系统资源占用过高"})]}),e.jsx("p",{className:"mt-4",children:"建议先选择较少的节点数量 (50-200 个)。"})]})})]}),e.jsxs(ds,{children:[e.jsx(xs,{onClick:()=>{E(!1),_>200&&(v(50),L(!1))},children:"取消"}),e.jsx(hs,{onClick:Q,className:"bg-orange-600 hover:bg-orange-700",children:"我了解风险,继续加载"})]})]})})]})}function fp({className:n,classNames:r,showOutsideDays:c=!0,captionLayout:d="label",buttonVariant:h="ghost",formatters:x,components:f,...j}){const g=bg();return e.jsx(rb,{showOutsideDays:c,className:$("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,n),captionLayout:d,formatters:{formatMonthDropdown:_=>_.toLocaleString("default",{month:"short"}),...x},classNames:{root:$("w-fit",g.root),months:$("relative flex flex-col gap-4 md:flex-row",g.months),month:$("flex w-full flex-col gap-4",g.month),nav:$("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",g.nav),button_previous:$(gr({variant:h}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",g.button_previous),button_next:$(gr({variant:h}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",g.button_next),month_caption:$("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",g.month_caption),dropdowns:$("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",g.dropdowns),dropdown_root:$("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",g.dropdown_root),dropdown:$("bg-popover absolute inset-0 opacity-0",g.dropdown),caption_label:$("select-none font-medium",d==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",g.caption_label),table:"w-full border-collapse",weekdays:$("flex",g.weekdays),weekday:$("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",g.weekday),week:$("mt-2 flex w-full",g.week),week_number_header:$("w-[--cell-size] select-none",g.week_number_header),week_number:$("text-muted-foreground select-none text-[0.8rem]",g.week_number),day:$("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",g.day),range_start:$("bg-accent rounded-l-md",g.range_start),range_middle:$("rounded-none",g.range_middle),range_end:$("bg-accent rounded-r-md",g.range_end),today:$("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",g.today),outside:$("text-muted-foreground aria-selected:text-muted-foreground",g.outside),disabled:$("text-muted-foreground opacity-50",g.disabled),hidden:$("invisible",g.hidden),...r},components:{Root:({className:_,rootRef:v,...k})=>e.jsx("div",{"data-slot":"calendar",ref:v,className:$(_),...k}),Chevron:({className:_,orientation:v,...k})=>v==="left"?e.jsx(cn,{className:$("size-4",_),...k}):v==="right"?e.jsx(il,{className:$("size-4",_),...k}):e.jsx(Ll,{className:$("size-4",_),...k}),DayButton:k1,WeekNumber:({children:_,...v})=>e.jsx("td",{...v,children:e.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:_})}),...f},...j})}function k1({className:n,day:r,modifiers:c,...d}){const h=bg(),x=u.useRef(null);return u.useEffect(()=>{c.focused&&x.current?.focus()},[c.focused]),e.jsx(N,{ref:x,variant:"ghost",size:"icon","data-day":r.date.toLocaleDateString(),"data-selected-single":c.selected&&!c.range_start&&!c.range_end&&!c.range_middle,"data-range-start":c.range_start,"data-range-end":c.range_end,"data-range-middle":c.range_middle,className:$("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",h.day,n),...d})}const T1={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},E1=(n,r,c)=>{let d;const h=T1[n];return typeof h=="string"?d=h:r===1?d=h.one:d=h.other.replace("{{count}}",String(r)),c?.addSuffix?c.comparison&&c.comparison>0?d+"内":d+"前":d},z1={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},M1={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},A1={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},D1={date:wu({formats:z1,defaultWidth:"full"}),time:wu({formats:M1,defaultWidth:"full"}),dateTime:wu({formats:A1,defaultWidth:"full"})};function pp(n,r,c){const d="eeee p";return Cy(n,r,c)?d:n.getTime()>r.getTime()?"'下个'"+d:"'上个'"+d}const O1={lastWeek:pp,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:pp,other:"PP p"},R1=(n,r,c,d)=>{const h=O1[n];return typeof h=="function"?h(r,c,d):h},L1={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},U1={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},B1={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},H1={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},q1={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},G1={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},V1=(n,r)=>{const c=Number(n);switch(r?.unit){case"date":return c.toString()+"日";case"hour":return c.toString()+"时";case"minute":return c.toString()+"分";case"second":return c.toString()+"秒";default:return"第 "+c.toString()}},F1={ordinalNumber:V1,era:er({values:L1,defaultWidth:"wide"}),quarter:er({values:U1,defaultWidth:"wide",argumentCallback:n=>n-1}),month:er({values:B1,defaultWidth:"wide"}),day:er({values:H1,defaultWidth:"wide"}),dayPeriod:er({values:q1,defaultWidth:"wide",formattingValues:G1,defaultFormattingWidth:"wide"})},Q1=/^(第\s*)?\d+(日|时|分|秒)?/i,$1=/\d+/i,Y1={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},X1={any:[/^(前)/i,/^(公元)/i]},K1={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},Z1={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},I1={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},J1={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},P1={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},W1={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},e2={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},s2={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},t2={ordinalNumber:ky({matchPattern:Q1,parsePattern:$1,valueCallback:n=>parseInt(n,10)}),era:sr({matchPatterns:Y1,defaultMatchWidth:"wide",parsePatterns:X1,defaultParseWidth:"any"}),quarter:sr({matchPatterns:K1,defaultMatchWidth:"wide",parsePatterns:Z1,defaultParseWidth:"any",valueCallback:n=>n+1}),month:sr({matchPatterns:I1,defaultMatchWidth:"wide",parsePatterns:J1,defaultParseWidth:"any"}),day:sr({matchPatterns:P1,defaultMatchWidth:"wide",parsePatterns:W1,defaultParseWidth:"any"}),dayPeriod:sr({matchPatterns:e2,defaultMatchWidth:"any",parsePatterns:s2,defaultParseWidth:"any"})},Qc={code:"zh-CN",formatDistance:E1,formatLong:D1,formatRelative:R1,localize:F1,match:t2,options:{weekStartsOn:1,firstWeekContainsDate:4}},$c={xs:{label:"小",rowHeight:28,class:"text-[10px] sm:text-xs"},sm:{label:"中",rowHeight:36,class:"text-xs sm:text-sm"},base:{label:"大",rowHeight:44,class:"text-sm sm:text-base"}};function a2(){const[n,r]=u.useState([]),[c,d]=u.useState(""),[h,x]=u.useState("all"),[f,j]=u.useState("all"),[g,_]=u.useState(void 0),[v,k]=u.useState(void 0),[z,T]=u.useState(!0),[L,K]=u.useState(!1),[U,R]=u.useState("xs"),[ee,V]=u.useState(4),E=u.useRef(null);u.useEffect(()=>{const y=an.getAllLogs();r(y);const q=an.onLog(()=>{r(an.getAllLogs())}),H=an.onConnectionChange(ne=>{K(ne)});return()=>{q(),H()}},[]);const B=u.useMemo(()=>{const y=new Set(n.map(q=>q.module).filter(q=>q&&q.trim()!==""));return Array.from(y).sort()},[n]),X=y=>{switch(y){case"DEBUG":return"text-muted-foreground";case"INFO":return"text-blue-500 dark:text-blue-400";case"WARNING":return"text-yellow-600 dark:text-yellow-500";case"ERROR":return"text-red-600 dark:text-red-500";case"CRITICAL":return"text-red-700 dark:text-red-400 font-bold";default:return"text-foreground"}},w=y=>{switch(y){case"DEBUG":return"bg-gray-800/30 dark:bg-gray-800/50";case"INFO":return"bg-blue-900/20 dark:bg-blue-500/20";case"WARNING":return"bg-yellow-900/20 dark:bg-yellow-500/20";case"ERROR":return"bg-red-900/20 dark:bg-red-500/20";case"CRITICAL":return"bg-red-900/30 dark:bg-red-600/30";default:return"bg-gray-800/20 dark:bg-gray-800/30"}},D=()=>{window.location.reload()},te=()=>{an.clearLogs(),r([])},xe=()=>{const y=ve.map(S=>`${S.timestamp} [${S.level.padEnd(8)}] [${S.module}] ${S.message}`).join(` +`),q=new Blob([y],{type:"text/plain;charset=utf-8"}),H=URL.createObjectURL(q),ne=document.createElement("a");ne.href=H,ne.download=`logs-${_u(new Date,"yyyy-MM-dd-HHmmss")}.txt`,ne.click(),URL.revokeObjectURL(H)},be=()=>{T(!z)},ye=()=>{_(void 0),k(void 0)},ve=u.useMemo(()=>n.filter(y=>{const q=c===""||y.message.toLowerCase().includes(c.toLowerCase())||y.module.toLowerCase().includes(c.toLowerCase()),H=h==="all"||y.level===h,ne=f==="all"||y.module===f;let S=!0;if(g||v){const me=new Date(y.timestamp);if(g){const he=new Date(g);he.setHours(0,0,0,0),S=S&&me>=he}if(v){const he=new Date(v);he.setHours(23,59,59,999),S=S&&me<=he}}return q&&H&&ne&&S}),[n,c,h,f,g,v]),pe=$c[U].rowHeight+ee,Ne=fy({count:ve.length,getScrollElement:()=>E.current,estimateSize:()=>pe,overscan:15});return u.useEffect(()=>{z&&ve.length>0&&Ne.scrollToIndex(ve.length-1,{align:"end",behavior:"auto"})},[ve.length,z,Ne]),e.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex-shrink-0 space-y-4 p-3 sm:p-4 lg:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl sm:text-2xl lg:text-3xl font-bold",children:"日志查看器"}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:"实时查看和分析麦麦运行日志"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:$("h-2.5 w-2.5 sm:h-3 sm:w-3 rounded-full",L?"bg-green-500 animate-pulse":"bg-red-500")}),e.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground",children:L?"已连接":"未连接"})]})]}),e.jsx(Be,{className:"p-3 sm:p-4",children:e.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:gap-4",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(St,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ce,{placeholder:"搜索日志...",value:c,onChange:y=>d(y.target.value),className:"pl-9 h-9 text-sm"})]}),e.jsxs(Qe,{value:h,onValueChange:x,children:[e.jsxs(Ge,{className:"w-full sm:w-[140px] lg:w-[180px] h-9 text-sm",children:[e.jsx(Lu,{className:"h-4 w-4 mr-2"}),e.jsx($e,{placeholder:"级别"})]}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"all",children:"全部级别"}),e.jsx(ue,{value:"DEBUG",children:"DEBUG"}),e.jsx(ue,{value:"INFO",children:"INFO"}),e.jsx(ue,{value:"WARNING",children:"WARNING"}),e.jsx(ue,{value:"ERROR",children:"ERROR"}),e.jsx(ue,{value:"CRITICAL",children:"CRITICAL"})]})]}),e.jsxs(Qe,{value:f,onValueChange:j,children:[e.jsxs(Ge,{className:"w-full sm:w-[160px] lg:w-[200px] h-9 text-sm",children:[e.jsx(Lu,{className:"h-4 w-4 mr-2"}),e.jsx($e,{placeholder:"模块"})]}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"all",children:"全部模块"}),B.map(y=>e.jsx(ue,{value:y,children:y},y))]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-4",children:[e.jsxs(Da,{children:[e.jsx(Oa,{asChild:!0,children:e.jsxs(N,{variant:"outline",size:"sm",className:$("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!g&&"text-muted-foreground"),children:[e.jsx(Yf,{className:"mr-2 h-4 w-4"}),e.jsx("span",{className:"text-xs sm:text-sm",children:g?_u(g,"PPP",{locale:Qc}):"开始日期"})]})}),e.jsx(Na,{className:"w-auto p-0",align:"start",children:e.jsx(fp,{mode:"single",selected:g,onSelect:_,initialFocus:!0,locale:Qc})})]}),e.jsxs(Da,{children:[e.jsx(Oa,{asChild:!0,children:e.jsxs(N,{variant:"outline",size:"sm",className:$("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!v&&"text-muted-foreground"),children:[e.jsx(Yf,{className:"mr-2 h-4 w-4"}),e.jsx("span",{className:"text-xs sm:text-sm",children:v?_u(v,"PPP",{locale:Qc}):"结束日期"})]})}),e.jsx(Na,{className:"w-auto p-0",align:"start",children:e.jsx(fp,{mode:"single",selected:v,onSelect:k,initialFocus:!0,locale:Qc})})]}),(g||v)&&e.jsxs(N,{variant:"outline",size:"sm",onClick:ye,className:"w-full sm:w-auto h-9",children:[e.jsx(li,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline text-sm",children:"清除时间筛选"}),e.jsx("span",{className:"sm:hidden text-sm",children:"清除"})]})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center",children:[e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsxs(N,{variant:z?"default":"outline",size:"sm",onClick:be,className:"flex-1 sm:flex-none h-9",children:[z?e.jsx(qN,{className:"h-4 w-4"}):e.jsx(GN,{className:"h-4 w-4"}),e.jsx("span",{className:"ml-2 text-sm",children:z?"自动滚动":"已暂停"})]}),e.jsxs(N,{variant:"outline",size:"sm",onClick:D,className:"flex-1 sm:flex-none h-9",children:[e.jsx(ft,{className:"h-4 w-4"}),e.jsx("span",{className:"ml-2 text-sm",children:"刷新"})]}),e.jsxs(N,{variant:"outline",size:"sm",onClick:te,className:"flex-1 sm:flex-none h-9",children:[e.jsx(ns,{className:"h-4 w-4"}),e.jsx("span",{className:"ml-2 text-sm",children:"清空"})]}),e.jsxs(N,{variant:"outline",size:"sm",onClick:xe,className:"flex-1 sm:flex-none h-9",children:[e.jsx(nl,{className:"h-4 w-4"}),e.jsx("span",{className:"ml-2 text-sm",children:"导出"})]})]}),e.jsx("div",{className:"flex-1 hidden sm:block"}),e.jsxs("div",{className:"text-xs sm:text-sm text-muted-foreground flex items-center justify-center sm:justify-end",children:[e.jsxs("span",{className:"font-mono",children:[ve.length," / ",n.length]}),e.jsx("span",{className:"ml-1",children:"条日志"})]})]}),e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-6 pt-2 border-t border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(VN,{className:"h-4 w-4"}),e.jsx("span",{children:"字号"})]}),e.jsx("div",{className:"flex gap-1",children:Object.keys($c).map(y=>e.jsx(N,{variant:U===y?"default":"outline",size:"sm",onClick:()=>R(y),className:"h-7 px-3 text-xs",children:$c[y].label},y))})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-1 max-w-xs",children:[e.jsx("span",{className:"text-sm text-muted-foreground whitespace-nowrap",children:"行距"}),e.jsx(za,{value:[ee],onValueChange:([y])=>V(y),min:0,max:12,step:2,className:"flex-1"}),e.jsxs("span",{className:"text-xs text-muted-foreground w-8",children:[ee,"px"]})]})]})]})})]}),e.jsx("div",{className:"flex-1 min-h-0 px-3 sm:px-4 lg:px-6 pb-3 sm:pb-4 lg:pb-6",children:e.jsx(Be,{className:"bg-black dark:bg-gray-950 border-gray-800 dark:border-gray-900 h-full",children:e.jsx(es,{viewportRef:E,className:"h-full",children:e.jsx("div",{className:$("p-2 sm:p-3 font-mono relative",$c[U].class),style:{height:`${Ne.getTotalSize()}px`},children:ve.length===0?e.jsx("div",{className:"text-gray-500 dark:text-gray-600 text-center py-8 text-sm",children:"暂无日志数据"}):Ne.getVirtualItems().map(y=>{const q=ve[y.index];return e.jsxs("div",{"data-index":y.index,ref:Ne.measureElement,className:$("absolute top-0 left-0 w-full px-2 sm:px-3 rounded hover:bg-white/5 transition-colors group",w(q.level)),style:{transform:`translateY(${y.start}px)`,paddingTop:`${ee/2}px`,paddingBottom:`${ee/2}px`},children:[e.jsxs("div",{className:"flex flex-col gap-0.5 sm:hidden",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-gray-500 dark:text-gray-600",children:q.timestamp}),e.jsxs("span",{className:$("font-semibold",X(q.level)),children:["[",q.level,"]"]})]}),e.jsx("div",{className:"text-cyan-400 dark:text-cyan-500 truncate",children:q.module}),e.jsx("div",{className:"text-gray-300 dark:text-gray-400 whitespace-pre-wrap break-words",children:q.message})]}),e.jsxs("div",{className:"hidden sm:flex gap-2 items-start",children:[e.jsx("span",{className:"text-gray-500 dark:text-gray-600 flex-shrink-0 w-[130px] lg:w-[160px]",children:q.timestamp}),e.jsxs("span",{className:$("flex-shrink-0 w-[65px] lg:w-[75px] font-semibold",X(q.level)),children:["[",q.level,"]"]}),e.jsx("span",{className:"text-cyan-400 dark:text-cyan-500 flex-shrink-0 w-[100px] lg:w-[130px] truncate",children:q.module}),e.jsx("span",{className:"text-gray-300 dark:text-gray-400 flex-1 whitespace-pre-wrap break-words",children:q.message})]})]},y.key)})})})})})]})}const l2="Mai-with-u",n2="plugin-repo",i2="main",r2="plugin_details.json";async function c2(){try{const n=await ke("/api/webui/plugins/fetch-raw",{method:"POST",headers:ze(),body:JSON.stringify({owner:l2,repo:n2,branch:i2,file_path:r2})});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const r=await n.json();if(!r.success||!r.data)throw new Error(r.error||"获取插件列表失败");return JSON.parse(r.data).filter(h=>!h?.id||!h?.manifest?(console.warn("跳过无效插件数据:",h),!1):!h.manifest.name||!h.manifest.version?(console.warn("跳过缺少必需字段的插件:",h.id),!1):!0).map(h=>({id:h.id,manifest:{manifest_version:h.manifest.manifest_version||1,name:h.manifest.name,version:h.manifest.version,description:h.manifest.description||"",author:h.manifest.author||{name:"Unknown"},license:h.manifest.license||"Unknown",host_application:h.manifest.host_application||{min_version:"0.0.0"},homepage_url:h.manifest.homepage_url,repository_url:h.manifest.repository_url,keywords:h.manifest.keywords||[],categories:h.manifest.categories||[],default_locale:h.manifest.default_locale||"zh-CN",locales_path:h.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!1,published_at:new Date().toISOString(),updated_at:new Date().toISOString()}))}catch(n){throw console.error("Failed to fetch plugin list:",n),n}}async function o2(){try{const n=await ke("/api/webui/plugins/git-status");if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return await n.json()}catch(n){return console.error("Failed to check Git status:",n),{installed:!1,error:"无法检测 Git 安装状态"}}}async function d2(){try{const n=await ke("/api/webui/plugins/version");if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return await n.json()}catch(n){return console.error("Failed to get Maimai version:",n),{version:"0.0.0",version_major:0,version_minor:0,version_patch:0}}}function u2(n,r,c){const d=n.split(".").map(j=>parseInt(j)||0),h=d[0]||0,x=d[1]||0,f=d[2]||0;if(c.version_majorparseInt(k)||0),g=j[0]||0,_=j[1]||0,v=j[2]||0;if(c.version_major>g||c.version_major===g&&c.version_minor>_||c.version_major===g&&c.version_minor===_&&c.version_patch>v)return!1}return!0}function m2(n,r){const c=window.location.protocol==="https:"?"wss:":"ws:",d=window.location.host,h=new WebSocket(`${c}//${d}/api/webui/ws/plugin-progress`);return h.onopen=()=>{console.log("Plugin progress WebSocket connected");const x=setInterval(()=>{h.readyState===WebSocket.OPEN?h.send("ping"):clearInterval(x)},3e4)},h.onmessage=x=>{try{if(x.data==="pong")return;const f=JSON.parse(x.data);n(f)}catch(f){console.error("Failed to parse progress data:",f)}},h.onerror=x=>{console.error("Plugin progress WebSocket error:",x),r?.(x)},h.onclose=()=>{console.log("Plugin progress WebSocket disconnected")},h}async function cr(){try{const n=await ke("/api/webui/plugins/installed",{headers:ze()});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const r=await n.json();if(!r.success)throw new Error(r.message||"获取已安装插件列表失败");return r.plugins||[]}catch(n){return console.error("Failed to get installed plugins:",n),[]}}function Yc(n,r){return r.some(c=>c.id===n)}function Xc(n,r){const c=r.find(d=>d.id===n);if(c)return c.manifest?.version||c.version}async function h2(n,r,c="main"){const d=await ke("/api/webui/plugins/install",{method:"POST",headers:ze(),body:JSON.stringify({plugin_id:n,repository_url:r,branch:c})});if(!d.ok){const h=await d.json();throw new Error(h.detail||"安装失败")}return await d.json()}async function x2(n){const r=await ke("/api/webui/plugins/uninstall",{method:"POST",headers:ze(),body:JSON.stringify({plugin_id:n})});if(!r.ok){const c=await r.json();throw new Error(c.detail||"卸载失败")}return await r.json()}async function f2(n,r,c="main"){const d=await ke("/api/webui/plugins/update",{method:"POST",headers:ze(),body:JSON.stringify({plugin_id:n,repository_url:r,branch:c})});if(!d.ok){const h=await d.json();throw new Error(h.detail||"更新失败")}return await d.json()}async function p2(n){const r=await ke(`/api/webui/plugins/config/${n}/schema`,{headers:ze()});if(!r.ok){const d=await r.json();throw new Error(d.detail||"获取配置 Schema 失败")}const c=await r.json();if(!c.success)throw new Error(c.message||"获取配置 Schema 失败");return c.schema}async function g2(n){const r=await ke(`/api/webui/plugins/config/${n}`,{headers:ze()});if(!r.ok){const d=await r.json();throw new Error(d.detail||"获取配置失败")}const c=await r.json();if(!c.success)throw new Error(c.message||"获取配置失败");return c.config}async function j2(n,r){const c=await ke(`/api/webui/plugins/config/${n}`,{method:"PUT",headers:ze(),body:JSON.stringify({config:r})});if(!c.ok){const d=await c.json();throw new Error(d.detail||"保存配置失败")}return await c.json()}async function v2(n){const r=await ke(`/api/webui/plugins/config/${n}/reset`,{method:"POST",headers:ze()});if(!r.ok){const c=await r.json();throw new Error(c.detail||"重置配置失败")}return await r.json()}async function y2(n){const r=await ke(`/api/webui/plugins/config/${n}/toggle`,{method:"POST",headers:ze()});if(!r.ok){const c=await r.json();throw new Error(c.detail||"切换状态失败")}return await r.json()}const Cr="https://maibot-plugin-stats.maibot-webui.workers.dev";async function $g(n){try{const r=await fetch(`${Cr}/stats/${n}`);return r.ok?await r.json():(console.error("Failed to fetch plugin stats:",r.statusText),null)}catch(r){return console.error("Error fetching plugin stats:",r),null}}async function N2(n,r){try{const c=r||Wu(),d=await fetch(`${Cr}/stats/like`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:n,user_id:c})}),h=await d.json();return d.status===429?{success:!1,error:"操作过于频繁,请稍后再试"}:d.ok?{success:!0,...h}:{success:!1,error:h.error||"点赞失败"}}catch(c){return console.error("Error liking plugin:",c),{success:!1,error:"网络错误"}}}async function b2(n,r){try{const c=r||Wu(),d=await fetch(`${Cr}/stats/dislike`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:n,user_id:c})}),h=await d.json();return d.status===429?{success:!1,error:"操作过于频繁,请稍后再试"}:d.ok?{success:!0,...h}:{success:!1,error:h.error||"点踩失败"}}catch(c){return console.error("Error disliking plugin:",c),{success:!1,error:"网络错误"}}}async function w2(n,r,c,d){if(r<1||r>5)return{success:!1,error:"评分必须在 1-5 之间"};try{const h=d||Wu(),x=await fetch(`${Cr}/stats/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:n,rating:r,comment:c,user_id:h})}),f=await x.json();return x.status===429?{success:!1,error:"每天最多评分 3 次"}:x.ok?{success:!0,...f}:{success:!1,error:f.error||"评分失败"}}catch(h){return console.error("Error rating plugin:",h),{success:!1,error:"网络错误"}}}async function _2(n){try{const r=await fetch(`${Cr}/stats/download`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:n})}),c=await r.json();return r.status===429?(console.warn("Download recording rate limited"),{success:!0}):r.ok?{success:!0,...c}:(console.error("Failed to record download:",c.error),{success:!1,error:c.error})}catch(r){return console.error("Error recording download:",r),{success:!1,error:"网络错误"}}}function S2(){const n=navigator,r=[navigator.userAgent,navigator.language,navigator.languages?.join(",")||"",navigator.platform,navigator.hardwareConcurrency||0,screen.width,screen.height,screen.colorDepth,screen.pixelDepth,new Date().getTimezoneOffset(),Intl.DateTimeFormat().resolvedOptions().timeZone,navigator.maxTouchPoints||0,n.deviceMemory||0].join("|");let c=0;for(let d=0;d{x(!0);const R=await $g(n);R&&d(R),x(!1)};u.useEffect(()=>{T()},[n]);const L=async()=>{const R=await N2(n);R.success?(z({title:"已点赞",description:"感谢你的支持!"}),T()):z({title:"点赞失败",description:R.error||"未知错误",variant:"destructive"})},K=async()=>{const R=await b2(n);R.success?(z({title:"已反馈",description:"感谢你的反馈!"}),T()):z({title:"操作失败",description:R.error||"未知错误",variant:"destructive"})},U=async()=>{if(f===0){z({title:"请选择评分",description:"至少选择 1 颗星",variant:"destructive"});return}const R=await w2(n,f,g||void 0);R.success?(z({title:"评分成功",description:"感谢你的评价!"}),k(!1),j(0),_(""),T()):z({title:"评分失败",description:R.error||"未知错误",variant:"destructive"})};return h?e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(nl,{className:"h-4 w-4"}),e.jsx("span",{children:"-"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Ol,{className:"h-4 w-4"}),e.jsx("span",{children:"-"})]})]}):c?r?e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1",title:`下载量: ${c.downloads.toLocaleString()}`,children:[e.jsx(nl,{className:"h-4 w-4"}),e.jsx("span",{children:c.downloads.toLocaleString()})]}),e.jsxs("div",{className:"flex items-center gap-1",title:`评分: ${c.rating.toFixed(1)} (${c.rating_count} 条评价)`,children:[e.jsx(Ol,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),e.jsx("span",{children:c.rating.toFixed(1)})]}),e.jsxs("div",{className:"flex items-center gap-1",title:`点赞数: ${c.likes}`,children:[e.jsx(Cu,{className:"h-4 w-4"}),e.jsx("span",{children:c.likes})]})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[e.jsx(nl,{className:"h-5 w-5 text-muted-foreground mb-1"}),e.jsx("span",{className:"text-2xl font-bold",children:c.downloads.toLocaleString()}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"下载量"})]}),e.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[e.jsx(Ol,{className:"h-5 w-5 text-yellow-400 mb-1 fill-yellow-400"}),e.jsx("span",{className:"text-2xl font-bold",children:c.rating.toFixed(1)}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[c.rating_count," 条评价"]})]}),e.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[e.jsx(Cu,{className:"h-5 w-5 text-green-500 mb-1"}),e.jsx("span",{className:"text-2xl font-bold",children:c.likes}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"点赞"})]}),e.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[e.jsx(Xf,{className:"h-5 w-5 text-red-500 mb-1"}),e.jsx("span",{className:"text-2xl font-bold",children:c.dislikes}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"点踩"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(N,{variant:"outline",size:"sm",onClick:L,children:[e.jsx(Cu,{className:"h-4 w-4 mr-1"}),"点赞"]}),e.jsxs(N,{variant:"outline",size:"sm",onClick:K,children:[e.jsx(Xf,{className:"h-4 w-4 mr-1"}),"点踩"]}),e.jsxs(Os,{open:v,onOpenChange:k,children:[e.jsx(ni,{asChild:!0,children:e.jsxs(N,{variant:"default",size:"sm",children:[e.jsx(Ol,{className:"h-4 w-4 mr-1"}),"评分"]})}),e.jsxs(Es,{children:[e.jsxs(zs,{children:[e.jsx(Ms,{children:"为插件评分"}),e.jsx($s,{children:"分享你的使用体验,帮助其他用户"})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx("div",{className:"flex gap-2",children:[1,2,3,4,5].map(R=>e.jsx("button",{onClick:()=>j(R),className:"focus:outline-none",children:e.jsx(Ol,{className:`h-8 w-8 transition-colors ${R<=f?"fill-yellow-400 text-yellow-400":"text-muted-foreground hover:text-yellow-300"}`})},R))}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[f===0&&"点击星星进行评分",f===1&&"很差",f===2&&"一般",f===3&&"还行",f===4&&"不错",f===5&&"非常好"]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium mb-2 block",children:"评论(可选)"}),e.jsx(Us,{value:g,onChange:R=>_(R.target.value),placeholder:"分享你的使用体验...",rows:4,maxLength:500}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-1 text-right",children:[g.length," / 500"]})]})]}),e.jsxs(Is,{children:[e.jsx(N,{variant:"outline",onClick:()=>k(!1),children:"取消"}),e.jsx(N,{onClick:U,disabled:f===0,children:"提交评分"})]})]})]})]}),c.recent_ratings&&c.recent_ratings.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"text-sm font-semibold",children:"最近评价"}),e.jsx("div",{className:"space-y-3",children:c.recent_ratings.map((R,ee)=>e.jsxs("div",{className:"p-3 rounded-lg border bg-muted/50",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("div",{className:"flex gap-1",children:[1,2,3,4,5].map(V=>e.jsx(Ol,{className:`h-3 w-3 ${V<=R.rating?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},V))}),e.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(R.created_at).toLocaleDateString()})]}),R.comment&&e.jsx("p",{className:"text-sm text-muted-foreground",children:R.comment})]},ee))})]})]}):null}const gp={"Group Management":"群组管理","Entertainment & Interaction":"娱乐互动","Utility Tools":"实用工具","Content Generation":"内容生成",Multimedia:"多媒体","External Integration":"外部集成","Data Analysis & Insights":"数据分析与洞察",Other:"其他"};function k2(){const n=It(),[r,c]=u.useState(null),[d,h]=u.useState(""),[x,f]=u.useState("all"),[j,g]=u.useState("all"),[_,v]=u.useState(!0),[k,z]=u.useState([]),[T,L]=u.useState(!0),[K,U]=u.useState(null),[R,ee]=u.useState(null),[V,E]=u.useState(null),[B,X]=u.useState(null),[,w]=u.useState([]),[D,te]=u.useState({}),{toast:xe}=Bs(),be=async S=>{const me=S.map(async oe=>{try{const ge=await $g(oe.id);return{id:oe.id,stats:ge}}catch(ge){return console.warn(`Failed to load stats for ${oe.id}:`,ge),{id:oe.id,stats:null}}}),he=await Promise.all(me),Q={};he.forEach(({id:oe,stats:ge})=>{ge&&(Q[oe]=ge)}),te(Q)};u.useEffect(()=>{let S=null,me=!1;return(async()=>{if(S=m2(Q=>{me||(E(Q),Q.stage==="success"?setTimeout(()=>{me||E(null)},2e3):Q.stage==="error"&&(L(!1),U(Q.error||"加载失败")))},Q=>{console.error("WebSocket error:",Q),me||xe({title:"WebSocket 连接失败",description:"无法实时显示加载进度",variant:"destructive"})}),await new Promise(Q=>{if(!S){Q();return}const oe=()=>{S&&S.readyState===WebSocket.OPEN?(console.log("WebSocket connected, starting to load plugins"),Q()):S&&S.readyState===WebSocket.CLOSED?(console.warn("WebSocket closed before loading plugins"),Q()):setTimeout(oe,100)};oe()}),!me){const Q=await o2();ee(Q),Q.installed||xe({title:"Git 未安装",description:Q.error||"请先安装 Git 才能使用插件安装功能",variant:"destructive"})}if(!me){const Q=await d2();X(Q)}if(!me)try{L(!0),U(null);const Q=await c2();if(!me){const oe=await cr();w(oe);const ge=Q.map(le=>{const O=Yc(le.id,oe),F=Xc(le.id,oe);return{...le,installed:O,installed_version:F}});for(const le of oe)!ge.some(F=>F.id===le.id)&&le.manifest&&ge.push({id:le.id,manifest:{manifest_version:le.manifest.manifest_version||1,name:le.manifest.name,version:le.manifest.version,description:le.manifest.description||"",author:le.manifest.author,license:le.manifest.license||"Unknown",host_application:le.manifest.host_application,homepage_url:le.manifest.homepage_url,repository_url:le.manifest.repository_url,keywords:le.manifest.keywords||[],categories:le.manifest.categories||[],default_locale:le.manifest.default_locale||"zh-CN",locales_path:le.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!0,installed_version:le.manifest.version,published_at:new Date().toISOString(),updated_at:new Date().toISOString()});z(ge),be(ge)}}catch(Q){if(!me){const oe=Q instanceof Error?Q.message:"加载插件列表失败";U(oe),xe({title:"加载失败",description:oe,variant:"destructive"})}}finally{me||L(!1)}})(),()=>{me=!0,S&&S.close()}},[xe]);const ye=S=>{if(!S.installed&&B&&!ve(S))return e.jsxs(Xe,{variant:"destructive",className:"gap-1",children:[e.jsx(Aa,{className:"h-3 w-3"}),"不兼容"]});if(S.installed){const me=S.installed_version?.trim(),he=S.manifest.version?.trim();if(me!==he){const Q=me?.split(".").map(Number)||[0,0,0],oe=he?.split(".").map(Number)||[0,0,0];for(let ge=0;ge<3;ge++){if((oe[ge]||0)>(Q[ge]||0))return e.jsxs(Xe,{variant:"outline",className:"gap-1 text-orange-600 border-orange-600",children:[e.jsx(Aa,{className:"h-3 w-3"}),"可更新"]});if((oe[ge]||0)<(Q[ge]||0))break}}return e.jsxs(Xe,{variant:"default",className:"gap-1",children:[e.jsx(xa,{className:"h-3 w-3"}),"已安装"]})}return null},ve=S=>!B||!S.manifest?.host_application?!0:u2(S.manifest.host_application.min_version,S.manifest.host_application.max_version,B),pe=S=>{if(!S.installed||!S.installed_version||!S.manifest?.version)return!1;const me=S.installed_version.trim(),he=S.manifest.version.trim();if(me===he)return!1;const Q=me.split(".").map(Number),oe=he.split(".").map(Number);for(let ge=0;ge<3;ge++){if((oe[ge]||0)>(Q[ge]||0))return!0;if((oe[ge]||0)<(Q[ge]||0))return!1}return!1},Ne=k.filter(S=>{if(!S.manifest)return console.warn("[过滤] 跳过无 manifest 的插件:",S.id),!1;const me=d===""||S.manifest.name?.toLowerCase().includes(d.toLowerCase())||S.manifest.description?.toLowerCase().includes(d.toLowerCase())||S.manifest.keywords&&S.manifest.keywords.some(ge=>ge.toLowerCase().includes(d.toLowerCase())),he=x==="all"||S.manifest.categories&&S.manifest.categories.includes(x);let Q=!0;j==="installed"?Q=S.installed===!0:j==="updates"&&(Q=S.installed===!0&&pe(S));const oe=!_||!B||ve(S);return me&&he&&Q&&oe}),y=()=>{c(null)},q=async S=>{if(!R?.installed){xe({title:"无法安装",description:"Git 未安装",variant:"destructive"});return}if(B&&!ve(S)){xe({title:"无法安装",description:"插件与当前麦麦版本不兼容",variant:"destructive"});return}try{await h2(S.id,S.manifest.repository_url||"","main"),_2(S.id).catch(he=>{console.warn("Failed to record download:",he)}),xe({title:"安装成功",description:`${S.manifest.name} 已成功安装`});const me=await cr();w(me),z(he=>he.map(Q=>{if(Q.id===S.id){const oe=Yc(Q.id,me),ge=Xc(Q.id,me);return{...Q,installed:oe,installed_version:ge}}return Q}))}catch(me){xe({title:"安装失败",description:me instanceof Error?me.message:"未知错误",variant:"destructive"})}},H=async S=>{try{await x2(S.id),xe({title:"卸载成功",description:`${S.manifest.name} 已成功卸载`});const me=await cr();w(me),z(he=>he.map(Q=>{if(Q.id===S.id){const oe=Yc(Q.id,me),ge=Xc(Q.id,me);return{...Q,installed:oe,installed_version:ge}}return Q}))}catch(me){xe({title:"卸载失败",description:me instanceof Error?me.message:"未知错误",variant:"destructive"})}},ne=async S=>{if(!R?.installed){xe({title:"无法更新",description:"Git 未安装",variant:"destructive"});return}try{const me=await f2(S.id,S.manifest.repository_url||"","main");xe({title:"更新成功",description:`${S.manifest.name} 已从 ${me.old_version} 更新到 ${me.new_version}`});const he=await cr();w(he),z(Q=>Q.map(oe=>{if(oe.id===S.id){const ge=Yc(oe.id,he),le=Xc(oe.id,he);return{...oe,installed:ge,installed_version:le}}return oe}))}catch(me){xe({title:"更新失败",description:me instanceof Error?me.message:"未知错误",variant:"destructive"})}};return e.jsx(es,{className:"h-full",children:e.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件市场"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"浏览和管理麦麦的插件"})]}),e.jsxs(N,{onClick:()=>n({to:"/plugin-mirrors"}),children:[e.jsx(FN,{className:"h-4 w-4 mr-2"}),"配置镜像源"]})]}),R&&!R.installed&&e.jsxs(Be,{className:"border-orange-600 bg-orange-50 dark:bg-orange-950/20",children:[e.jsx(gs,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ya,{className:"h-5 w-5 text-orange-600"}),e.jsxs("div",{children:[e.jsx(js,{className:"text-lg text-orange-900 dark:text-orange-100",children:"Git 未安装"}),e.jsx(Zs,{className:"text-orange-800 dark:text-orange-200",children:R.error||"请先安装 Git 才能使用插件安装功能"})]})]})}),e.jsx(bs,{children:e.jsxs("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:["您可以从 ",e.jsx("a",{href:"https://git-scm.com/downloads",target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",children:"git-scm.com"})," 下载并安装 Git。 安装完成后,请重启麦麦应用。"]})})]}),e.jsx(Be,{className:"p-4",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(St,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ce,{placeholder:"搜索插件...",value:d,onChange:S=>h(S.target.value),className:"pl-9"})]}),e.jsxs(Qe,{value:x,onValueChange:f,children:[e.jsx(Ge,{className:"w-full sm:w-[200px]",children:e.jsx($e,{placeholder:"选择分类"})}),e.jsxs(Ve,{children:[e.jsx(ue,{value:"all",children:"全部分类"}),e.jsx(ue,{value:"Group Management",children:"群组管理"}),e.jsx(ue,{value:"Entertainment & Interaction",children:"娱乐互动"}),e.jsx(ue,{value:"Utility Tools",children:"实用工具"}),e.jsx(ue,{value:"Content Generation",children:"内容生成"}),e.jsx(ue,{value:"Multimedia",children:"多媒体"}),e.jsx(ue,{value:"External Integration",children:"外部集成"}),e.jsx(ue,{value:"Data Analysis & Insights",children:"数据分析与洞察"}),e.jsx(ue,{value:"Other",children:"其他"})]})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(yt,{id:"compatible-only",checked:_,onCheckedChange:S=>v(S===!0)}),e.jsx("label",{htmlFor:"compatible-only",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:"只显示兼容当前版本的插件"})]})]})}),e.jsx(Kt,{value:j,onValueChange:g,className:"w-full",children:e.jsxs(Rt,{className:"grid w-full grid-cols-3",children:[e.jsxs(He,{value:"all",children:["全部插件 (",k.filter(S=>{if(!S.manifest)return!1;const me=d===""||S.manifest.name?.toLowerCase().includes(d.toLowerCase())||S.manifest.description?.toLowerCase().includes(d.toLowerCase())||S.manifest.keywords&&S.manifest.keywords.some(oe=>oe.toLowerCase().includes(d.toLowerCase())),he=x==="all"||S.manifest.categories&&S.manifest.categories.includes(x),Q=!_||!B||ve(S);return me&&he&&Q}).length,")"]}),e.jsxs(He,{value:"installed",children:["已安装 (",k.filter(S=>{if(!S.manifest)return!1;const me=d===""||S.manifest.name?.toLowerCase().includes(d.toLowerCase())||S.manifest.description?.toLowerCase().includes(d.toLowerCase())||S.manifest.keywords&&S.manifest.keywords.some(oe=>oe.toLowerCase().includes(d.toLowerCase())),he=x==="all"||S.manifest.categories&&S.manifest.categories.includes(x),Q=!_||!B||ve(S);return S.installed&&me&&he&&Q}).length,")"]}),e.jsxs(He,{value:"updates",children:["可更新 (",k.filter(S=>{if(!S.manifest)return!1;const me=d===""||S.manifest.name?.toLowerCase().includes(d.toLowerCase())||S.manifest.description?.toLowerCase().includes(d.toLowerCase())||S.manifest.keywords&&S.manifest.keywords.some(oe=>oe.toLowerCase().includes(d.toLowerCase())),he=x==="all"||S.manifest.categories&&S.manifest.categories.includes(x),Q=!_||!B||ve(S);return S.installed&&pe(S)&&me&&he&&Q}).length,")"]})]})}),V&&V.stage==="loading"&&e.jsx(Be,{className:"p-4",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(vt,{className:"h-4 w-4 animate-spin"}),e.jsxs("span",{className:"text-sm font-medium",children:[V.operation==="fetch"&&"加载插件列表",V.operation==="install"&&`安装插件${V.plugin_id?`: ${V.plugin_id}`:""}`,V.operation==="uninstall"&&`卸载插件${V.plugin_id?`: ${V.plugin_id}`:""}`,V.operation==="update"&&`更新插件${V.plugin_id?`: ${V.plugin_id}`:""}`]})]}),e.jsxs("span",{className:"text-sm font-medium",children:[V.progress,"%"]})]}),e.jsx(Sr,{value:V.progress,className:"h-2"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:V.message}),V.operation==="fetch"&&V.total_plugins>0&&e.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["已加载 ",V.loaded_plugins," / ",V.total_plugins," 个插件"]})]})}),V&&V.stage==="error"&&V.error&&e.jsx(Be,{className:"border-destructive bg-destructive/10",children:e.jsx(gs,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ya,{className:"h-5 w-5 text-destructive"}),e.jsxs("div",{children:[e.jsx(js,{className:"text-lg text-destructive",children:"加载失败"}),e.jsx(Zs,{className:"text-destructive/80",children:V.error})]})]})})}),T?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(vt,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:"加载插件列表中..."})]}):K?e.jsx(Be,{className:"p-6",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(ya,{className:"h-12 w-12 text-destructive mb-4"}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:K}),e.jsx(N,{onClick:()=>window.location.reload(),children:"重新加载"})]})}):Ne.length===0?e.jsx(Be,{className:"p-6",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(St,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"未找到插件"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:d||x!=="all"?"尝试调整搜索条件或筛选器":"暂无可用插件"})]})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:Ne.map(S=>e.jsxs(Be,{className:"flex flex-col hover:shadow-lg transition-shadow h-full",children:[e.jsxs(gs,{children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx(js,{className:"text-xl",children:S.manifest?.name||S.id}),e.jsxs("div",{className:"flex flex-col gap-1",children:[S.manifest?.categories&&S.manifest.categories[0]&&e.jsx(Xe,{variant:"secondary",className:"text-xs whitespace-nowrap",children:gp[S.manifest.categories[0]]||S.manifest.categories[0]}),ye(S)]})]}),e.jsx(Zs,{className:"line-clamp-2",children:S.manifest?.description||"无描述"})]}),e.jsx(bs,{className:"flex-1",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(nl,{className:"h-4 w-4"}),e.jsx("span",{children:(D[S.id]?.downloads??S.downloads??0).toLocaleString()})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Ol,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),e.jsx("span",{children:(D[S.id]?.rating??S.rating??0).toFixed(1)})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[S.manifest?.keywords&&S.manifest.keywords.slice(0,3).map(me=>e.jsx(Xe,{variant:"outline",className:"text-xs",children:me},me)),S.manifest?.keywords&&S.manifest.keywords.length>3&&e.jsxs(Xe,{variant:"outline",className:"text-xs",children:["+",S.manifest.keywords.length-3]})]}),e.jsxs("div",{className:"text-xs text-muted-foreground pt-2 border-t space-y-1",children:[e.jsxs("div",{children:["v",S.manifest?.version||"unknown"," · ",S.manifest?.author?.name||"Unknown"]}),S.manifest?.host_application&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{children:"支持:"}),e.jsxs("span",{className:"font-medium",children:[S.manifest.host_application.min_version,S.manifest.host_application.max_version?` - ${S.manifest.host_application.max_version}`:" - 最新版本"]})]})]})]})}),e.jsx(wg,{className:"pt-4",children:e.jsxs("div",{className:"flex items-center justify-end gap-2 w-full",children:[e.jsx(N,{variant:"outline",size:"sm",onClick:()=>c(S),children:"查看详情"}),S.installed?pe(S)?e.jsxs(N,{size:"sm",disabled:!R?.installed,title:R?.installed?void 0:"Git 未安装",onClick:()=>ne(S),children:[e.jsx(ft,{className:"h-4 w-4 mr-1"}),"更新"]}):e.jsxs(N,{variant:"destructive",size:"sm",disabled:!R?.installed,title:R?.installed?void 0:"Git 未安装",onClick:()=>H(S),children:[e.jsx(ns,{className:"h-4 w-4 mr-1"}),"卸载"]}):e.jsxs(N,{size:"sm",disabled:!R?.installed||V?.operation==="install"||B!==null&&!ve(S),title:R?.installed?B!==null&&!ve(S)?`不兼容当前版本 (需要 ${S.manifest?.host_application?.min_version||"未知"}${S.manifest?.host_application?.max_version?` - ${S.manifest.host_application.max_version}`:"+"},当前 ${B?.version})`:void 0:"Git 未安装",onClick:()=>q(S),children:[e.jsx(nl,{className:"h-4 w-4 mr-1"}),V?.operation==="install"&&V?.plugin_id===S.id?"安装中...":"安装"]})]})})]},S.id))}),e.jsx(Os,{open:r!==null,onOpenChange:y,children:r&&r.manifest&&e.jsxs(Es,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsx(zs,{children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"space-y-2 flex-1",children:[e.jsx(Ms,{className:"text-2xl",children:r.manifest.name}),e.jsxs($s,{children:["作者: ",r.manifest.author?.name||"Unknown",r.manifest.author?.url&&e.jsx("a",{href:r.manifest.author.url,target:"_blank",rel:"noopener noreferrer",className:"ml-2 text-primary hover:underline",children:e.jsx(dr,{className:"h-3 w-3 inline"})})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[r.manifest.categories&&r.manifest.categories[0]&&e.jsx(Xe,{variant:"secondary",children:gp[r.manifest.categories[0]]||r.manifest.categories[0]}),ye(r)]})]})}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(C2,{pluginId:r.id}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"版本"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["v",r.manifest?.version||"unknown"]}),r.installed&&r.installed_version&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["已安装: v",r.installed_version]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"下载量"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:(D[r.id]?.downloads??r.downloads??0).toLocaleString()})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"评分"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Ol,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[(D[r.id]?.rating??r.rating??0).toFixed(1)," (",D[r.id]?.rating_count??r.review_count??0,")"]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"许可证"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r.manifest.license||"Unknown"})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("p",{className:"text-sm font-medium",children:"支持版本"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[r.manifest.host_application?.min_version||"未知",r.manifest.host_application?.max_version?` - ${r.manifest.host_application.max_version}`:" - 最新版本"]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"关键词"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:r.manifest.keywords&&r.manifest.keywords.map(S=>e.jsx(Xe,{variant:"outline",children:S},S))})]}),r.detailed_description&&e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"详细说明"}),e.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:r.detailed_description})]}),!r.detailed_description&&e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"说明"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r.manifest.description||"无描述"})]}),e.jsxs("div",{className:"space-y-2",children:[r.manifest.homepage_url&&e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"font-medium",children:"主页: "}),e.jsx("a",{href:r.manifest.homepage_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:r.manifest.homepage_url})]}),r.manifest.repository_url&&e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"font-medium",children:"仓库: "}),e.jsx("a",{href:r.manifest.repository_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:r.manifest.repository_url})]})]})]}),e.jsxs(Is,{children:[r.manifest.homepage_url&&e.jsxs(N,{onClick:()=>window.open(r.manifest.homepage_url,"_blank"),children:[e.jsx(dr,{className:"h-4 w-4 mr-2"}),"访问主页"]}),r.manifest.repository_url&&e.jsxs(N,{variant:"outline",onClick:()=>window.open(r.manifest.repository_url,"_blank"),children:[e.jsx(dr,{className:"h-4 w-4 mr-2"}),"查看仓库"]})]})]})})]})})}const Gu=Fy,Vu=Qy,Fu=$y;function T2({field:n,value:r,onChange:c}){const[d,h]=u.useState(!1);switch(n.ui_type){case"switch":return e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(b,{children:n.label}),n.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n.hint})]}),e.jsx(qe,{checked:!!r,onCheckedChange:c,disabled:n.disabled})]});case"number":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:n.label}),e.jsx(ce,{type:"number",value:r??n.default,onChange:x=>c(parseFloat(x.target.value)||0),min:n.min,max:n.max,step:n.step??1,placeholder:n.placeholder,disabled:n.disabled}),n.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n.hint})]});case"slider":return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{children:n.label}),e.jsx("span",{className:"text-sm text-muted-foreground",children:r??n.default})]}),e.jsx(za,{value:[r??n.default],onValueChange:x=>c(x[0]),min:n.min??0,max:n.max??100,step:n.step??1,disabled:n.disabled}),n.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n.hint})]});case"select":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:n.label}),e.jsxs(Qe,{value:String(r??n.default),onValueChange:c,disabled:n.disabled,children:[e.jsx(Ge,{children:e.jsx($e,{placeholder:n.placeholder??"请选择"})}),e.jsx(Ve,{children:n.choices?.map(x=>e.jsx(ue,{value:String(x),children:String(x)},String(x)))})]}),n.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n.hint})]});case"textarea":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:n.label}),e.jsx(Us,{value:r??n.default,onChange:x=>c(x.target.value),placeholder:n.placeholder,rows:n.rows??3,disabled:n.disabled}),n.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n.hint})]});case"password":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:n.label}),e.jsxs("div",{className:"relative",children:[e.jsx(ce,{type:d?"text":"password",value:r??"",onChange:x=>c(x.target.value),placeholder:n.placeholder,disabled:n.disabled,className:"pr-10"}),e.jsx(N,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3",onClick:()=>h(!d),children:d?e.jsx(mr,{className:"h-4 w-4"}):e.jsx(Zt,{className:"h-4 w-4"})})]}),n.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n.hint})]});case"text":default:return e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:n.label}),e.jsx(ce,{type:"text",value:r??n.default??"",onChange:x=>c(x.target.value),placeholder:n.placeholder,maxLength:n.max_length,disabled:n.disabled}),n.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n.hint})]})}}function jp({section:n,config:r,onChange:c}){const[d,h]=u.useState(!n.collapsed),x=Object.entries(n.fields).filter(([,f])=>!f.hidden).sort(([,f],[,j])=>f.order-j.order);return e.jsx(Gu,{open:d,onOpenChange:h,children:e.jsxs(Be,{children:[e.jsx(Vu,{asChild:!0,children:e.jsxs(gs,{className:"cursor-pointer hover:bg-muted/50 transition-colors",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[d?e.jsx(Ll,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(il,{className:"h-4 w-4 text-muted-foreground"}),e.jsx(js,{className:"text-lg",children:n.title})]}),e.jsxs(Xe,{variant:"secondary",className:"text-xs",children:[x.length," 项"]})]}),n.description&&e.jsx(Zs,{className:"ml-6",children:n.description})]})}),e.jsx(Fu,{children:e.jsx(bs,{className:"space-y-4 pt-0",children:x.map(([f,j])=>e.jsx(T2,{field:j,value:r[n.name]?.[f],onChange:g=>c(n.name,f,g),sectionName:n.name},f))})})]})})}function E2({plugin:n,onBack:r}){const{toast:c}=Bs(),[d,h]=u.useState(null),[x,f]=u.useState({}),[j,g]=u.useState({}),[_,v]=u.useState(!0),[k,z]=u.useState(!1),[T,L]=u.useState(!1),[K,U]=u.useState(!1),R=u.useCallback(async()=>{v(!0);try{const[D,te]=await Promise.all([p2(n.id),g2(n.id)]);h(D),f(te),g(JSON.parse(JSON.stringify(te)))}catch(D){c({title:"加载配置失败",description:D instanceof Error?D.message:"未知错误",variant:"destructive"})}finally{v(!1)}},[n.id,c]);u.useEffect(()=>{R()},[R]),u.useEffect(()=>{L(JSON.stringify(x)!==JSON.stringify(j))},[x,j]);const ee=(D,te,xe)=>{f(be=>({...be,[D]:{...be[D]||{},[te]:xe}}))},V=async()=>{z(!0);try{await j2(n.id,x),g(JSON.parse(JSON.stringify(x))),c({title:"配置已保存",description:"更改将在插件重新加载后生效"})}catch(D){c({title:"保存失败",description:D instanceof Error?D.message:"未知错误",variant:"destructive"})}finally{z(!1)}},E=async()=>{try{await v2(n.id),c({title:"配置已重置",description:"下次加载插件时将使用默认配置"}),U(!1),R()}catch(D){c({title:"重置失败",description:D instanceof Error?D.message:"未知错误",variant:"destructive"})}},B=async()=>{try{const D=await y2(n.id);c({title:D.message,description:D.note}),R()}catch(D){c({title:"切换状态失败",description:D instanceof Error?D.message:"未知错误",variant:"destructive"})}};if(_)return e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx(vt,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(!d)return e.jsxs("div",{className:"flex flex-col items-center justify-center h-64 space-y-4",children:[e.jsx(Aa,{className:"h-12 w-12 text-muted-foreground"}),e.jsx("p",{className:"text-muted-foreground",children:"无法加载配置"}),e.jsxs(N,{onClick:r,variant:"outline",children:[e.jsx(ti,{className:"h-4 w-4 mr-2"}),"返回"]})]});const X=Object.values(d.sections).sort((D,te)=>D.order-te.order),w=x.plugin?.enabled!==!1;return e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(N,{variant:"ghost",size:"icon",onClick:r,children:e.jsx(ti,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:d.plugin_info.name||n.manifest.name}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx(Xe,{variant:w?"default":"secondary",children:w?"已启用":"已禁用"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["v",d.plugin_info.version||n.manifest.version]})]})]})]}),e.jsxs("div",{className:"flex gap-2 ml-10 sm:ml-0",children:[e.jsxs(N,{variant:"outline",size:"sm",onClick:B,children:[e.jsx(Nr,{className:"h-4 w-4 mr-2"}),w?"禁用":"启用"]}),e.jsxs(N,{variant:"outline",size:"sm",onClick:()=>U(!0),children:[e.jsx(Wc,{className:"h-4 w-4 mr-2"}),"重置"]}),e.jsxs(N,{size:"sm",onClick:V,disabled:!T||k,children:[k?e.jsx(vt,{className:"h-4 w-4 mr-2 animate-spin"}):e.jsx(br,{className:"h-4 w-4 mr-2"}),"保存"]})]})]}),T&&e.jsx(Be,{className:"border-orange-200 bg-orange-50 dark:bg-orange-950/20 dark:border-orange-900",children:e.jsx(bs,{className:"py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Xt,{className:"h-4 w-4 text-orange-600"}),e.jsx("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:"有未保存的更改"})]})})}),d.layout.type==="tabs"&&d.layout.tabs.length>0?e.jsxs(Kt,{defaultValue:d.layout.tabs[0]?.id,children:[e.jsx(Rt,{children:d.layout.tabs.map(D=>e.jsxs(He,{value:D.id,children:[D.title,D.badge&&e.jsx(Xe,{variant:"secondary",className:"ml-2 text-xs",children:D.badge})]},D.id))}),d.layout.tabs.map(D=>e.jsx(We,{value:D.id,className:"space-y-4 mt-4",children:D.sections.map(te=>{const xe=d.sections[te];return xe?e.jsx(jp,{section:xe,config:x,onChange:ee},te):null})},D.id))]}):e.jsx("div",{className:"space-y-4",children:X.map(D=>e.jsx(jp,{section:D,config:x,onChange:ee},D.name))}),e.jsx(Os,{open:K,onOpenChange:U,children:e.jsxs(Es,{children:[e.jsxs(zs,{children:[e.jsx(Ms,{children:"确认重置配置"}),e.jsx($s,{children:"这将删除当前配置文件,下次加载插件时将使用默认配置。此操作不可撤销。"})]}),e.jsxs(Is,{children:[e.jsx(N,{variant:"outline",onClick:()=>U(!1),children:"取消"}),e.jsx(N,{variant:"destructive",onClick:E,children:"确认重置"})]})]})})]})}function z2(){const{toast:n}=Bs(),[r,c]=u.useState([]),[d,h]=u.useState(!0),[x,f]=u.useState(""),[j,g]=u.useState(null),_=async()=>{h(!0);try{const T=await cr();c(T)}catch(T){n({title:"加载插件列表失败",description:T instanceof Error?T.message:"未知错误",variant:"destructive"})}finally{h(!1)}};u.useEffect(()=>{_()},[]);const v=r.filter(T=>{const L=x.toLowerCase();return T.id.toLowerCase().includes(L)||T.manifest.name.toLowerCase().includes(L)||T.manifest.description?.toLowerCase().includes(L)}),k=r.length,z=0;return j?e.jsx(es,{className:"h-full",children:e.jsx("div",{className:"p-4 sm:p-6",children:e.jsx(E2,{plugin:j,onBack:()=>g(null)})})}):e.jsx(es,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件配置"}),e.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理和配置已安装的插件"})]}),e.jsxs(N,{variant:"outline",size:"sm",onClick:_,children:[e.jsx(ft,{className:`h-4 w-4 mr-2 ${d?"animate-spin":""}`}),"刷新"]})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-3",children:[e.jsxs(Be,{children:[e.jsxs(gs,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(js,{className:"text-sm font-medium",children:"已安装插件"}),e.jsx(rn,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(bs,{children:[e.jsx("div",{className:"text-2xl font-bold",children:r.length}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:d?"正在加载...":"个插件"})]})]}),e.jsxs(Be,{children:[e.jsxs(gs,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(js,{className:"text-sm font-medium",children:"已启用"}),e.jsx(xa,{className:"h-4 w-4 text-green-600"})]}),e.jsxs(bs,{children:[e.jsx("div",{className:"text-2xl font-bold",children:k}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"运行中的插件"})]})]}),e.jsxs(Be,{children:[e.jsxs(gs,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(js,{className:"text-sm font-medium",children:"已禁用"}),e.jsx(Aa,{className:"h-4 w-4 text-orange-600"})]}),e.jsxs(bs,{children:[e.jsx("div",{className:"text-2xl font-bold",children:z}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"未激活的插件"})]})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(St,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ce,{placeholder:"搜索插件...",value:x,onChange:T=>f(T.target.value),className:"pl-9"})]}),e.jsxs(Be,{children:[e.jsxs(gs,{children:[e.jsx(js,{children:"已安装的插件"}),e.jsx(Zs,{children:"点击插件查看和编辑配置"})]}),e.jsx(bs,{children:d?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(vt,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):v.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx(rn,{className:"h-16 w-16 text-muted-foreground/50"}),e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx("p",{className:"text-lg font-medium text-muted-foreground",children:x?"没有找到匹配的插件":"暂无已安装的插件"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:x?"尝试其他搜索关键词":"前往插件市场安装插件"})]})]}):e.jsx("div",{className:"space-y-2",children:v.map(T=>e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg border hover:bg-muted/50 cursor-pointer transition-colors",onClick:()=>g(T),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"h-10 w-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:e.jsx(rn,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"font-medium truncate",children:T.manifest.name}),e.jsxs(Xe,{variant:"secondary",className:"text-xs flex-shrink-0",children:["v",T.manifest.version]})]}),e.jsx("p",{className:"text-sm text-muted-foreground truncate",children:T.manifest.description||"暂无描述"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(N,{variant:"ghost",size:"sm",children:e.jsx(Rl,{className:"h-4 w-4"})}),e.jsx(il,{className:"h-4 w-4 text-muted-foreground"})]})]},T.id))})})]})]})})}function M2(){const n=It(),{toast:r}=Bs(),[c,d]=u.useState([]),[h,x]=u.useState(!0),[f,j]=u.useState(null),[g,_]=u.useState(null),[v,k]=u.useState(!1),[z,T]=u.useState(!1),[L,K]=u.useState({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),U=u.useCallback(async()=>{try{x(!0),j(null);const w=localStorage.getItem("access-token"),D=await fetch("/api/webui/plugins/mirrors",{headers:{Authorization:`Bearer ${w}`}});if(!D.ok)throw new Error("获取镜像源列表失败");const te=await D.json();d(te.mirrors||[])}catch(w){const D=w instanceof Error?w.message:"加载镜像源失败";j(D),r({title:"加载失败",description:D,variant:"destructive"})}finally{x(!1)}},[r]);u.useEffect(()=>{U()},[U]);const R=async()=>{try{const w=localStorage.getItem("access-token"),D=await fetch("/api/webui/plugins/mirrors",{method:"POST",headers:{Authorization:`Bearer ${w}`,"Content-Type":"application/json"},body:JSON.stringify(L)});if(!D.ok){const te=await D.json();throw new Error(te.detail||"添加镜像源失败")}r({title:"添加成功",description:"镜像源已添加"}),k(!1),K({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),U()}catch(w){r({title:"添加失败",description:w instanceof Error?w.message:"未知错误",variant:"destructive"})}},ee=async()=>{if(g)try{const w=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${g.id}`,{method:"PUT",headers:{Authorization:`Bearer ${w}`,"Content-Type":"application/json"},body:JSON.stringify({name:L.name,raw_prefix:L.raw_prefix,clone_prefix:L.clone_prefix,enabled:L.enabled,priority:L.priority})})).ok)throw new Error("更新镜像源失败");r({title:"更新成功",description:"镜像源已更新"}),T(!1),_(null),U()}catch(w){r({title:"更新失败",description:w instanceof Error?w.message:"未知错误",variant:"destructive"})}},V=async w=>{if(confirm("确定要删除这个镜像源吗?"))try{const D=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${w}`,{method:"DELETE",headers:{Authorization:`Bearer ${D}`}})).ok)throw new Error("删除镜像源失败");r({title:"删除成功",description:"镜像源已删除"}),U()}catch(D){r({title:"删除失败",description:D instanceof Error?D.message:"未知错误",variant:"destructive"})}},E=async w=>{try{const D=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${w.id}`,{method:"PUT",headers:{Authorization:`Bearer ${D}`,"Content-Type":"application/json"},body:JSON.stringify({enabled:!w.enabled})})).ok)throw new Error("更新状态失败");U()}catch(D){r({title:"更新失败",description:D instanceof Error?D.message:"未知错误",variant:"destructive"})}},B=w=>{_(w),K({id:w.id,name:w.name,raw_prefix:w.raw_prefix,clone_prefix:w.clone_prefix,enabled:w.enabled,priority:w.priority}),T(!0)},X=async(w,D)=>{const te=D==="up"?w.priority-1:w.priority+1;if(!(te<1))try{const xe=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${w.id}`,{method:"PUT",headers:{Authorization:`Bearer ${xe}`,"Content-Type":"application/json"},body:JSON.stringify({priority:te})})).ok)throw new Error("更新优先级失败");U()}catch(xe){r({title:"更新失败",description:xe instanceof Error?xe.message:"未知错误",variant:"destructive"})}};return e.jsx(es,{className:"h-full",children:e.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(N,{variant:"ghost",size:"icon",onClick:()=>n({to:"/plugins"}),children:e.jsx(ti,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"镜像源配置"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理 Git 克隆和文件下载的镜像源"})]})]}),e.jsxs(N,{onClick:()=>k(!0),children:[e.jsx(gt,{className:"h-4 w-4 mr-2"}),"添加镜像源"]})]}),h?e.jsx(Be,{className:"p-6",children:e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(vt,{className:"h-8 w-8 animate-spin text-primary"})})}):f?e.jsx(Be,{className:"p-6",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(ya,{className:"h-12 w-12 text-destructive mb-4"}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:f}),e.jsx(N,{onClick:U,children:"重新加载"})]})}):e.jsxs(Be,{children:[e.jsx("div",{className:"hidden md:block",children:e.jsxs(ii,{children:[e.jsx(ri,{children:e.jsxs(pt,{children:[e.jsx(ls,{children:"状态"}),e.jsx(ls,{children:"名称"}),e.jsx(ls,{children:"ID"}),e.jsx(ls,{children:"优先级"}),e.jsx(ls,{className:"text-right",children:"操作"})]})}),e.jsx(ci,{children:c.map(w=>e.jsxs(pt,{children:[e.jsx(Ye,{children:e.jsx(qe,{checked:w.enabled,onCheckedChange:()=>E(w)})}),e.jsx(Ye,{children:e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:w.name}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Raw: ",w.raw_prefix]})]})}),e.jsx(Ye,{children:e.jsx(Xe,{variant:"outline",children:w.id})}),e.jsx(Ye,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono",children:w.priority}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(N,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>X(w,"up"),disabled:w.priority===1,children:e.jsx(fr,{className:"h-3 w-3"})}),e.jsx(N,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>X(w,"down"),children:e.jsx(Ll,{className:"h-3 w-3"})})]})]})}),e.jsx(Ye,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx(N,{variant:"ghost",size:"icon",onClick:()=>B(w),children:e.jsx(nn,{className:"h-4 w-4"})}),e.jsx(N,{variant:"ghost",size:"icon",onClick:()=>V(w.id),children:e.jsx(ns,{className:"h-4 w-4 text-destructive"})})]})})]},w.id))})]})}),e.jsx("div",{className:"md:hidden p-4 space-y-4",children:c.map(w=>e.jsx(Be,{className:"p-4",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"font-semibold",children:w.name}),w.enabled&&e.jsx(Xe,{variant:"default",className:"text-xs",children:"启用"})]}),e.jsx(Xe,{variant:"outline",className:"mt-1 text-xs",children:w.id})]}),e.jsx(qe,{checked:w.enabled,onCheckedChange:()=>E(w)})]}),e.jsxs("div",{className:"text-sm space-y-1",children:[e.jsxs("div",{className:"text-muted-foreground",children:[e.jsx("span",{className:"font-medium",children:"Raw: "}),e.jsx("span",{className:"break-all",children:w.raw_prefix})]}),e.jsxs("div",{className:"text-muted-foreground",children:[e.jsx("span",{className:"font-medium",children:"优先级: "}),e.jsx("span",{className:"font-mono",children:w.priority})]})]}),e.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t",children:[e.jsxs(N,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>B(w),children:[e.jsx(nn,{className:"h-4 w-4 mr-1"}),"编辑"]}),e.jsx(N,{variant:"outline",size:"sm",onClick:()=>X(w,"up"),disabled:w.priority===1,children:e.jsx(fr,{className:"h-4 w-4"})}),e.jsx(N,{variant:"outline",size:"sm",onClick:()=>X(w,"down"),children:e.jsx(Ll,{className:"h-4 w-4"})}),e.jsx(N,{variant:"destructive",size:"sm",onClick:()=>V(w.id),children:e.jsx(ns,{className:"h-4 w-4"})})]})]})},w.id))})]}),e.jsx(Os,{open:v,onOpenChange:k,children:e.jsxs(Es,{className:"max-w-lg",children:[e.jsxs(zs,{children:[e.jsx(Ms,{children:"添加镜像源"}),e.jsx($s,{children:"添加新的 Git 镜像源配置"})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"add-id",children:"镜像源 ID *"}),e.jsx(ce,{id:"add-id",placeholder:"例如: my-mirror",value:L.id,onChange:w=>K({...L,id:w.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"add-name",children:"名称 *"}),e.jsx(ce,{id:"add-name",placeholder:"例如: 我的镜像源",value:L.name,onChange:w=>K({...L,name:w.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"add-raw",children:"Raw 文件前缀 *"}),e.jsx(ce,{id:"add-raw",placeholder:"https://example.com/raw",value:L.raw_prefix,onChange:w=>K({...L,raw_prefix:w.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"add-clone",children:"克隆前缀 *"}),e.jsx(ce,{id:"add-clone",placeholder:"https://example.com/clone",value:L.clone_prefix,onChange:w=>K({...L,clone_prefix:w.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"add-priority",children:"优先级"}),e.jsx(ce,{id:"add-priority",type:"number",min:"1",value:L.priority,onChange:w=>K({...L,priority:parseInt(w.target.value)||1})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(qe,{id:"add-enabled",checked:L.enabled,onCheckedChange:w=>K({...L,enabled:w})}),e.jsx(b,{htmlFor:"add-enabled",children:"启用此镜像源"})]})]}),e.jsxs(Is,{children:[e.jsx(N,{variant:"outline",onClick:()=>k(!1),children:"取消"}),e.jsx(N,{onClick:R,children:"添加"})]})]})}),e.jsx(Os,{open:z,onOpenChange:T,children:e.jsxs(Es,{className:"max-w-lg",children:[e.jsxs(zs,{children:[e.jsx(Ms,{children:"编辑镜像源"}),e.jsx($s,{children:"修改镜像源配置"})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:"镜像源 ID"}),e.jsx(ce,{value:L.id,disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"edit-name",children:"名称 *"}),e.jsx(ce,{id:"edit-name",value:L.name,onChange:w=>K({...L,name:w.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"edit-raw",children:"Raw 文件前缀 *"}),e.jsx(ce,{id:"edit-raw",value:L.raw_prefix,onChange:w=>K({...L,raw_prefix:w.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"edit-clone",children:"克隆前缀 *"}),e.jsx(ce,{id:"edit-clone",value:L.clone_prefix,onChange:w=>K({...L,clone_prefix:w.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"edit-priority",children:"优先级"}),e.jsx(ce,{id:"edit-priority",type:"number",min:"1",value:L.priority,onChange:w=>K({...L,priority:parseInt(w.target.value)||1})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(qe,{id:"edit-enabled",checked:L.enabled,onCheckedChange:w=>K({...L,enabled:w})}),e.jsx(b,{htmlFor:"edit-enabled",children:"启用此镜像源"})]})]}),e.jsxs(Is,{children:[e.jsx(N,{variant:"outline",onClick:()=>T(!1),children:"取消"}),e.jsx(N,{onClick:ee,children:"保存"})]})]})})]})})}const Jc=u.forwardRef(({className:n,...r},c)=>e.jsx(Lp,{ref:c,className:$("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",n),...r}));Jc.displayName=Lp.displayName;const A2=u.forwardRef(({className:n,...r},c)=>e.jsx(Up,{ref:c,className:$("aspect-square h-full w-full",n),...r}));A2.displayName=Up.displayName;const Pc=u.forwardRef(({className:n,...r},c)=>e.jsx(Bp,{ref:c,className:$("flex h-full w-full items-center justify-center rounded-full bg-muted",n),...r}));Pc.displayName=Bp.displayName;function D2(){return"webui_"+Math.random().toString(36).substr(2,9)+"_"+Date.now().toString(36)}function O2(){const n="maibot_webui_user_id";let r=localStorage.getItem(n);return r||(r=D2(),localStorage.setItem(n,r)),r}function R2(){return localStorage.getItem("maibot_webui_user_name")||"WebUI用户"}function L2(n){localStorage.setItem("maibot_webui_user_name",n)}function U2(){const[n,r]=u.useState([]),[c,d]=u.useState(""),[h,x]=u.useState(!1),[f,j]=u.useState(!1),[g,_]=u.useState(!1),[v,k]=u.useState(!0),[z,T]=u.useState(R2()),[L,K]=u.useState(!1),[U,R]=u.useState(""),[ee,V]=u.useState({}),E=u.useRef(O2()),B=u.useRef(null),X=u.useRef(null),w=u.useRef(null),D=u.useRef(0),te=u.useRef(new Set),{toast:xe}=Bs(),be=Q=>(D.current+=1,`${Q}-${Date.now()}-${D.current}-${Math.random().toString(36).substr(2,9)}`),ye=u.useCallback(()=>{X.current?.scrollIntoView({behavior:"smooth"})},[]);u.useEffect(()=>{ye()},[n,ye]);const ve=u.useCallback(async()=>{k(!0);try{const Q=`/api/chat/history?user_id=${E.current}&limit=50`;console.log("[Chat] 正在加载历史消息:",Q);const oe=await fetch(Q);if(console.log("[Chat] 历史消息响应状态:",oe.status,oe.statusText),console.log("[Chat] 响应 Content-Type:",oe.headers.get("content-type")),oe.ok){const ge=await oe.text();console.log("[Chat] 响应内容前100字符:",ge.substring(0,100));try{const le=JSON.parse(ge);if(console.log("[Chat] 解析后的数据:",le),le.messages&&le.messages.length>0){const O=le.messages.map(F=>({id:F.id,type:F.type,content:F.content,timestamp:F.timestamp,sender:{name:F.sender_name||(F.is_bot?"麦麦":"WebUI用户"),user_id:F.user_id,is_bot:F.is_bot}}));r(O),console.log("[Chat] 已加载历史消息数量:",O.length),O.forEach(F=>{if(F.type==="bot"){const A=`bot-${F.content}-${Math.floor(F.timestamp*1e3)}`;te.current.add(A)}})}else console.log("[Chat] 没有历史消息")}catch(le){console.error("[Chat] JSON 解析失败:",le),console.error("[Chat] 原始响应内容:",ge)}}else{console.error("[Chat] 响应失败:",oe.status);const ge=await oe.text();console.error("[Chat] 错误响应内容:",ge.substring(0,200))}}catch(Q){console.error("[Chat] 加载历史消息失败:",Q)}finally{k(!1)}},[]),pe=u.useCallback(()=>{if(B.current?.readyState===WebSocket.OPEN||B.current?.readyState===WebSocket.CONNECTING){console.log("WebSocket 已存在,跳过连接");return}j(!0);const oe=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/chat/ws?user_id=${encodeURIComponent(E.current)}&user_name=${encodeURIComponent(z)}`;console.log("正在连接 WebSocket:",oe);try{const ge=new WebSocket(oe);B.current=ge,ge.onopen=()=>{x(!0),j(!1),console.log("WebSocket 已连接")},ge.onmessage=le=>{try{const O=JSON.parse(le.data);switch(O.type){case"session_info":V({session_id:O.session_id,user_id:O.user_id,user_name:O.user_name,bot_name:O.bot_name});break;case"system":r(F=>[...F,{id:be("sys"),type:"system",content:O.content||"",timestamp:O.timestamp||Date.now()/1e3}]);break;case"user_message":r(F=>[...F,{id:O.message_id||be("user"),type:"user",content:O.content||"",timestamp:O.timestamp||Date.now()/1e3,sender:O.sender}]);break;case"bot_message":{_(!1);const F=`bot-${O.content}-${Math.floor((O.timestamp||0)*1e3)}`;if(te.current.has(F)){console.log("跳过重复的机器人消息");break}if(te.current.add(F),te.current.size>100){const A=te.current.values().next().value;A&&te.current.delete(A)}r(A=>[...A,{id:be("bot"),type:"bot",content:O.content||"",timestamp:O.timestamp||Date.now()/1e3,sender:O.sender}]);break}case"typing":_(O.is_typing||!1);break;case"error":r(F=>[...F,{id:be("error"),type:"error",content:O.content||"发生错误",timestamp:O.timestamp||Date.now()/1e3}]),xe({title:"错误",description:O.content,variant:"destructive"});break;case"pong":break;default:console.log("未知消息类型:",O.type)}}catch(O){console.error("解析消息失败:",O)}},ge.onclose=()=>{x(!1),j(!1),B.current=null,console.log("WebSocket 已断开"),w.current&&clearTimeout(w.current),w.current=window.setTimeout(()=>{Ne.current||pe()},5e3)},ge.onerror=le=>{console.error("WebSocket 错误:",le),j(!1)}}catch(ge){console.error("创建 WebSocket 失败:",ge),j(!1)}},[xe,z]),Ne=u.useRef(!1);u.useEffect(()=>{Ne.current=!1,ve();const Q=setTimeout(()=>{Ne.current||pe()},100),oe=setInterval(()=>{B.current?.readyState===WebSocket.OPEN&&B.current.send(JSON.stringify({type:"ping"}))},3e4);return()=>{Ne.current=!0,clearTimeout(Q),clearInterval(oe),w.current&&(clearTimeout(w.current),w.current=null),B.current&&(B.current.close(),B.current=null)}},[pe,ve]);const y=u.useCallback(()=>{!c.trim()||!B.current||B.current.readyState!==WebSocket.OPEN||(B.current.send(JSON.stringify({type:"message",content:c.trim(),user_name:z})),d(""))},[c,z]),q=Q=>{Q.key==="Enter"&&!Q.shiftKey&&(Q.preventDefault(),y())},H=()=>{R(z),K(!0)},ne=()=>{const Q=U.trim()||"WebUI用户";T(Q),L2(Q),K(!1),B.current?.readyState===WebSocket.OPEN&&B.current.send(JSON.stringify({type:"update_nickname",user_name:Q}))},S=()=>{R(""),K(!1)},me=Q=>new Date(Q*1e3).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}),he=()=>{B.current&&B.current.close(),pe()};return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsx("div",{className:"shrink-0 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:e.jsxs("div",{className:"p-3 sm:p-4 max-w-4xl mx-auto",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0",children:[e.jsx(Jc,{className:"h-8 w-8 sm:h-10 sm:w-10 shrink-0",children:e.jsx(Pc,{className:"bg-primary/10 text-primary",children:e.jsx(ir,{className:"h-4 w-4 sm:h-5 sm:w-5"})})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-base sm:text-lg font-semibold truncate",children:ee.bot_name||"麦麦"}),e.jsx("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:h?e.jsxs(e.Fragment,{children:[e.jsx(QN,{className:"h-3 w-3 text-green-500"}),e.jsx("span",{className:"text-green-600 dark:text-green-400",children:"已连接"})]}):f?e.jsxs(e.Fragment,{children:[e.jsx(vt,{className:"h-3 w-3 animate-spin"}),e.jsx("span",{children:"连接中..."})]}):e.jsxs(e.Fragment,{children:[e.jsx($N,{className:"h-3 w-3 text-red-500"}),e.jsx("span",{className:"text-red-600 dark:text-red-400",children:"未连接"})]})})]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[v&&e.jsx(vt,{className:"h-4 w-4 animate-spin text-muted-foreground"}),e.jsx(N,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:he,disabled:f,title:"重新连接",children:e.jsx(ft,{className:$("h-4 w-4",f&&"animate-spin")})})]})]}),e.jsxs("div",{className:"hidden sm:flex items-center gap-2 mt-2 text-sm text-muted-foreground",children:[e.jsx(to,{className:"h-3 w-3"}),e.jsx("span",{children:"当前身份:"}),L?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{value:U,onChange:Q=>R(Q.target.value),onKeyDown:Q=>{Q.key==="Enter"&&ne(),Q.key==="Escape"&&S()},className:"h-7 w-32",placeholder:"输入昵称",autoFocus:!0}),e.jsx(N,{size:"sm",variant:"ghost",className:"h-7 px-2",onClick:ne,children:"保存"}),e.jsx(N,{size:"sm",variant:"ghost",className:"h-7 px-2",onClick:S,children:"取消"})]}):e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"font-medium text-foreground",children:z}),e.jsx(N,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:H,title:"修改昵称",children:e.jsx(YN,{className:"h-3 w-3"})})]})]})]})}),e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsx(es,{className:"h-full",children:e.jsxs("div",{className:"p-3 sm:p-4 max-w-4xl mx-auto space-y-3 sm:space-y-4",children:[n.length===0&&!v&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[e.jsx(ir,{className:"h-12 w-12 mb-4 opacity-50"}),e.jsxs("p",{className:"text-sm",children:["开始与 ",ee.bot_name||"麦麦"," 对话吧!"]})]}),n.map(Q=>e.jsxs("div",{className:$("flex gap-2 sm:gap-3",Q.type==="user"&&"flex-row-reverse",Q.type==="system"&&"justify-center",Q.type==="error"&&"justify-center"),children:[Q.type==="system"&&e.jsx("div",{className:"text-xs text-muted-foreground bg-muted/50 px-3 py-1 rounded-full max-w-[90%]",children:Q.content}),Q.type==="error"&&e.jsx("div",{className:"text-xs text-red-600 dark:text-red-400 bg-red-100 dark:bg-red-900/30 px-3 py-1 rounded-full max-w-[90%]",children:Q.content}),(Q.type==="user"||Q.type==="bot")&&e.jsxs(e.Fragment,{children:[e.jsx(Jc,{className:"h-7 w-7 sm:h-8 sm:w-8 shrink-0",children:e.jsx(Pc,{className:$("text-xs",Q.type==="bot"?"bg-primary/10 text-primary":"bg-secondary text-secondary-foreground"),children:Q.type==="bot"?e.jsx(ir,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"}):e.jsx(to,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"})})}),e.jsxs("div",{className:$("flex flex-col gap-1 max-w-[75%] sm:max-w-[70%]",Q.type==="user"&&"items-end"),children:[e.jsxs("div",{className:"flex items-center gap-2 text-[10px] sm:text-xs text-muted-foreground",children:[e.jsx("span",{className:"hidden sm:inline",children:Q.sender?.name||(Q.type==="bot"?ee.bot_name:z)}),e.jsx("span",{children:me(Q.timestamp)})]}),e.jsx("div",{className:$("rounded-2xl px-3 py-2 text-sm whitespace-pre-wrap break-words",Q.type==="bot"?"bg-muted rounded-tl-sm":"bg-primary text-primary-foreground rounded-tr-sm"),children:Q.content})]})]})]},Q.id)),g&&e.jsxs("div",{className:"flex gap-2 sm:gap-3",children:[e.jsx(Jc,{className:"h-7 w-7 sm:h-8 sm:w-8 shrink-0",children:e.jsx(Pc,{className:"bg-primary/10 text-primary",children:e.jsx(ir,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"})})}),e.jsx("div",{className:"bg-muted rounded-2xl rounded-tl-sm px-4 py-3",children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("span",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),e.jsx("span",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),e.jsx("span",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})})]}),e.jsx("div",{ref:X})]})})}),e.jsx("div",{className:"shrink-0 border-t bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:e.jsx("div",{className:"p-3 sm:p-4 max-w-4xl mx-auto",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{value:c,onChange:Q=>d(Q.target.value),onKeyDown:q,placeholder:h?"输入消息...":"等待连接...",disabled:!h,className:"flex-1 h-10 sm:h-10"}),e.jsx(N,{onClick:y,disabled:!h||!c.trim(),size:"icon",className:"h-10 w-10 shrink-0",children:e.jsx(XN,{className:"h-4 w-4"})})]})})})]})}const B2=ai("pointer-events-none inline-flex select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono font-medium opacity-100",{variants:{size:{sm:"h-5 text-[10px]",default:"h-6 text-xs",lg:"h-7 text-sm"}},defaultVariants:{size:"default"}}),Yg=u.forwardRef(({className:n,size:r,abbrTitle:c,children:d,...h},x)=>e.jsx("kbd",{className:$(B2({size:r,className:n})),ref:x,...h,children:c?e.jsx("abbr",{title:c,children:d}):d}));Yg.displayName="Kbd";const H2=[{icon:xr,title:"首页",description:"查看仪表板概览",path:"/",category:"概览"},{icon:Ma,title:"麦麦主程序配置",description:"配置麦麦的核心设置",path:"/config/bot",category:"配置"},{icon:vg,title:"麦麦模型提供商配置",description:"配置模型提供商",path:"/config/modelProvider",category:"配置"},{icon:yg,title:"麦麦模型配置",description:"配置模型参数",path:"/config/model",category:"配置"},{icon:Qu,title:"表情包管理",description:"管理麦麦的表情包",path:"/resource/emoji",category:"资源"},{icon:si,title:"表达方式管理",description:"管理麦麦的表达方式",path:"/resource/expression",category:"资源"},{icon:Ng,title:"人物信息管理",description:"管理人物信息",path:"/resource/person",category:"资源"},{icon:KN,title:"统计信息",description:"查看使用统计",path:"/statistics",category:"监控"},{icon:rn,title:"插件市场",description:"浏览和安装插件",path:"/plugins",category:"扩展"},{icon:ao,title:"日志查看器",description:"查看系统日志",path:"/logs",category:"监控"},{icon:Rl,title:"系统设置",description:"配置系统参数",path:"/settings",category:"系统"}];function q2({open:n,onOpenChange:r}){const[c,d]=u.useState(""),[h,x]=u.useState(0),f=It(),j=H2.filter(v=>v.title.toLowerCase().includes(c.toLowerCase())||v.description.toLowerCase().includes(c.toLowerCase())||v.category.toLowerCase().includes(c.toLowerCase()));u.useEffect(()=>{n&&(d(""),x(0))},[n]);const g=u.useCallback(v=>{f({to:v}),r(!1)},[f,r]),_=u.useCallback(v=>{v.key==="ArrowDown"?(v.preventDefault(),x(k=>(k+1)%j.length)):v.key==="ArrowUp"?(v.preventDefault(),x(k=>(k-1+j.length)%j.length)):v.key==="Enter"&&j[h]&&(v.preventDefault(),g(j[h].path))},[j,h,g]);return e.jsx(Os,{open:n,onOpenChange:r,children:e.jsxs(Es,{className:"max-w-2xl p-0 gap-0",children:[e.jsxs(zs,{className:"px-4 pt-4 pb-0",children:[e.jsx(Ms,{className:"sr-only",children:"搜索"}),e.jsxs("div",{className:"relative",children:[e.jsx(St,{className:"absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground"}),e.jsx(ce,{value:c,onChange:v=>{d(v.target.value),x(0)},onKeyDown:_,placeholder:"搜索页面...",className:"h-12 pl-11 text-base border-0 focus-visible:ring-0 shadow-none",autoFocus:!0})]})]}),e.jsx("div",{className:"border-t",children:e.jsx(es,{className:"h-[400px]",children:j.length>0?e.jsx("div",{className:"p-2",children:j.map((v,k)=>{const z=v.icon;return e.jsxs("button",{onClick:()=>g(v.path),onMouseEnter:()=>x(k),className:$("w-full flex items-center gap-3 px-3 py-2.5 rounded-md text-left transition-colors",k===h?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:[e.jsx(z,{className:"h-5 w-5 flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium text-sm",children:v.title}),e.jsx("div",{className:"text-xs text-muted-foreground truncate",children:v.description})]}),e.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1 bg-muted rounded",children:v.category})]},v.path)})}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(St,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:c?"未找到匹配的页面":"输入关键词开始搜索"})]})})}),e.jsx("div",{className:"border-t px-4 py-3 flex items-center justify-between text-xs text-muted-foreground",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↑"}),e.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↓"}),"导航"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Enter"}),"选择"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Esc"}),"关闭"]})]})})]})})}const G2=Xy,V2=Ky,F2=Zy,Xg=u.forwardRef(({className:n,inset:r,children:c,...d},h)=>e.jsxs(Hp,{ref:h,className:$("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",r&&"pl-8",n),...d,children:[c,e.jsx(il,{className:"ml-auto h-4 w-4"})]}));Xg.displayName=Hp.displayName;const Kg=u.forwardRef(({className:n,...r},c)=>e.jsx(qp,{ref:c,className:$("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",n),...r}));Kg.displayName=qp.displayName;const Zg=u.forwardRef(({className:n,...r},c)=>e.jsx(Yy,{children:e.jsx(Gp,{ref:c,className:$("z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",n),...r})}));Zg.displayName=Gp.displayName;const va=u.forwardRef(({className:n,inset:r,...c},d)=>e.jsx(Vp,{ref:d,className:$("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r&&"pl-8",n),...c}));va.displayName=Vp.displayName;const Q2=u.forwardRef(({className:n,children:r,checked:c,...d},h)=>e.jsxs(Fp,{ref:h,className:$("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),checked:c,...d,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Qp,{children:e.jsx(ha,{className:"h-4 w-4"})})}),r]}));Q2.displayName=Fp.displayName;const $2=u.forwardRef(({className:n,children:r,...c},d)=>e.jsxs($p,{ref:d,className:$("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),...c,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Qp,{children:e.jsx(ZN,{className:"h-2 w-2 fill-current"})})}),r]}));$2.displayName=$p.displayName;const Y2=u.forwardRef(({className:n,inset:r,...c},d)=>e.jsx(Yp,{ref:d,className:$("px-2 py-1.5 text-sm font-semibold text-foreground",r&&"pl-8",n),...c}));Y2.displayName=Yp.displayName;const or=u.forwardRef(({className:n,...r},c)=>e.jsx(Xp,{ref:c,className:$("-mx-1 my-1 h-px bg-border",n),...r}));or.displayName=Xp.displayName;const Jn=({className:n,...r})=>e.jsx("span",{className:$("ml-auto text-xs tracking-widest text-muted-foreground",n),...r});Jn.displayName="ContextMenuShortcut";const X2=gN,K2=jN,Z2=vN,Ig=u.forwardRef(({className:n,sideOffset:r=4,...c},d)=>e.jsx(pN,{children:e.jsx(cg,{ref:d,sideOffset:r,className:$("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",n),...c})}));Ig.displayName=cg.displayName;function I2({children:n}){y0();const[r,c]=u.useState(!0),[d,h]=u.useState(!1),[x,f]=u.useState(!1),{theme:j,setTheme:g}=Yu(),_=py(),v=It();u.useEffect(()=>{const K=U=>{(U.metaKey||U.ctrlKey)&&U.key==="k"&&(U.preventDefault(),f(!0))};return window.addEventListener("keydown",K),()=>window.removeEventListener("keydown",K)},[]);const k=[{title:"概览",items:[{icon:xr,label:"首页",path:"/"}]},{title:"麦麦配置编辑",items:[{icon:Ma,label:"麦麦主程序配置",path:"/config/bot"},{icon:vg,label:"AI模型厂商配置",path:"/config/modelProvider",tourId:"sidebar-model-provider"},{icon:yg,label:"模型管理与分配",path:"/config/model",tourId:"sidebar-model-management"},{icon:Kf,label:"麦麦适配器配置",path:"/config/adapter"}]},{title:"麦麦资源管理",items:[{icon:Qu,label:"表情包管理",path:"/resource/emoji"},{icon:si,label:"表达方式管理",path:"/resource/expression"},{icon:Ng,label:"人物信息管理",path:"/resource/person"},{icon:jg,label:"知识库图谱可视化",path:"/resource/knowledge-graph"}]},{title:"扩展与监控",items:[{icon:rn,label:"插件市场",path:"/plugins"},{icon:Kf,label:"插件配置",path:"/plugin-config"},{icon:ao,label:"日志查看器",path:"/logs"},{icon:si,label:"本地聊天室",path:"/chat"}]},{title:"系统",items:[{icon:Rl,label:"系统设置",path:"/settings"}]}],T=j==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":j,L=()=>{localStorage.removeItem("access-token"),v({to:"/auth"})};return e.jsx(X2,{delayDuration:300,children:e.jsxs("div",{className:"flex h-screen overflow-hidden",children:[e.jsxs("aside",{className:$("fixed inset-y-0 left-0 z-50 flex flex-col border-r bg-card transition-all duration-300 lg:relative lg:z-0","w-64 lg:w-auto",r?"lg:w-64":"lg:w-16",d?"translate-x-0":"-translate-x-full lg:translate-x-0"),children:[e.jsx("div",{className:"flex h-16 items-center border-b px-4",children:e.jsxs("div",{className:$("relative flex items-center justify-center flex-1 transition-all overflow-hidden","lg:flex-1",!r&&"lg:flex-none lg:w-8"),children:[e.jsxs("div",{className:$("flex items-baseline gap-2",!r&&"lg:hidden"),children:[e.jsx("span",{className:"font-bold text-xl text-primary-gradient whitespace-nowrap",children:"MaiBot WebUI"}),e.jsx("span",{className:"text-xs text-primary/60 whitespace-nowrap",children:a0()})]}),!r&&e.jsx("span",{className:"hidden lg:block font-bold text-primary-gradient text-2xl",children:"M"})]})}),e.jsx(es,{className:$("flex-1 overflow-x-hidden",!r&&"lg:w-16"),children:e.jsx("nav",{className:$("p-4",!r&&"lg:p-2 lg:w-16"),children:e.jsx("ul",{className:$("space-y-6",!r&&"lg:space-y-3 lg:w-full"),children:k.map((K,U)=>e.jsxs("li",{children:[e.jsx("div",{className:$("px-3 h-[1.25rem]","mb-2",!r&&"lg:mb-1 lg:invisible"),children:e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/60 whitespace-nowrap",children:K.title})}),!r&&U>0&&e.jsx("div",{className:"hidden lg:block mb-2 border-t border-border"}),e.jsx("ul",{className:"space-y-1",children:K.items.map(R=>{const ee=_({to:R.path}),V=R.icon,E=e.jsxs(e.Fragment,{children:[ee&&e.jsx("div",{className:"absolute left-0 top-1/2 h-8 w-1 -translate-y-1/2 rounded-r-full bg-primary transition-opacity duration-300"}),e.jsxs("div",{className:$("flex items-center transition-all duration-300",r?"gap-3":"gap-3 lg:gap-0"),children:[e.jsx(V,{className:$("h-5 w-5 flex-shrink-0",ee&&"text-primary"),strokeWidth:2,fill:"none"}),e.jsx("span",{className:$("text-sm font-medium whitespace-nowrap transition-all duration-300",ee&&"font-semibold",r?"opacity-100 max-w-[200px]":"opacity-100 max-w-[200px] lg:opacity-0 lg:max-w-0 lg:overflow-hidden"),children:R.label})]})]});return e.jsx("li",{className:"relative",children:e.jsxs(K2,{children:[e.jsx(Z2,{asChild:!0,children:e.jsx(Kc,{to:R.path,"data-tour":R.tourId,className:$("relative flex items-center rounded-lg py-2 transition-all duration-300","hover:bg-accent hover:text-accent-foreground",ee?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground",r?"px-3":"px-3 lg:px-0 lg:justify-center lg:w-12 lg:mx-auto"),onClick:()=>h(!1),children:E})}),!r&&e.jsx(Ig,{side:"right",className:"hidden lg:block",children:e.jsx("p",{children:R.label})})]})},R.path)})})]},K.title))})})})]}),d&&e.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>h(!1)}),e.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[e.jsxs("header",{className:"flex h-16 items-center justify-between border-b bg-card/80 backdrop-blur-md px-4 sticky top-0 z-10",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("button",{onClick:()=>h(!d),className:"rounded-lg p-2 hover:bg-accent lg:hidden",children:e.jsx(IN,{className:"h-5 w-5"})}),e.jsx("button",{onClick:()=>c(!r),className:"hidden rounded-lg p-2 hover:bg-accent lg:block",title:r?"收起侧边栏":"展开侧边栏",children:e.jsx(cn,{className:$("h-5 w-5 transition-transform",!r&&"rotate-180")})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>f(!0),className:"relative hidden md:flex items-center w-64 h-9 pl-9 pr-16 bg-background/50 border rounded-md hover:bg-accent/50 transition-colors text-left",children:[e.jsx(St,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"搜索..."}),e.jsxs(Yg,{size:"sm",className:"absolute right-2 top-1/2 -translate-y-1/2",children:[e.jsx("span",{className:"text-xs",children:"⌘"}),"K"]})]}),e.jsx(q2,{open:x,onOpenChange:f}),e.jsxs(N,{variant:"ghost",size:"sm",onClick:()=>window.open("https://docs.mai-mai.org","_blank"),className:"gap-2",title:"查看麦麦文档",children:[e.jsx(JN,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"麦麦文档"})]}),e.jsx("button",{onClick:K=>{Pb(T==="dark"?"light":"dark",g,K)},className:"rounded-lg p-2 hover:bg-accent",title:T==="dark"?"切换到浅色模式":"切换到深色模式",children:T==="dark"?e.jsx(Ou,{className:"h-5 w-5"}):e.jsx(Ru,{className:"h-5 w-5"})}),e.jsx("div",{className:"h-6 w-px bg-border"}),e.jsxs(N,{variant:"ghost",size:"sm",onClick:L,className:"gap-2",title:"登出系统",children:[e.jsx(Zf,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"登出"})]})]})]}),e.jsxs(G2,{children:[e.jsx(V2,{asChild:!0,children:e.jsx("main",{className:"flex-1 overflow-hidden bg-background",children:n})}),e.jsxs(Zg,{className:"w-64",children:[e.jsxs(va,{onClick:()=>v({to:"/"}),children:[e.jsx(xr,{className:"mr-2 h-4 w-4"}),"首页"]}),e.jsxs(va,{onClick:()=>v({to:"/settings"}),children:[e.jsx(Rl,{className:"mr-2 h-4 w-4"}),"系统设置"]}),e.jsxs(va,{onClick:()=>v({to:"/logs"}),children:[e.jsx(ao,{className:"mr-2 h-4 w-4"}),"日志查看器"]}),e.jsx(or,{}),e.jsxs(F2,{children:[e.jsxs(Xg,{children:[e.jsx(fg,{className:"mr-2 h-4 w-4"}),"切换主题"]}),e.jsxs(Kg,{className:"w-48",children:[e.jsxs(va,{onClick:()=>g("light"),disabled:j==="light",children:[e.jsx(Ou,{className:"mr-2 h-4 w-4"}),"浅色",j==="light"&&e.jsx(Jn,{children:"✓"})]}),e.jsxs(va,{onClick:()=>g("dark"),disabled:j==="dark",children:[e.jsx(Ru,{className:"mr-2 h-4 w-4"}),"深色",j==="dark"&&e.jsx(Jn,{children:"✓"})]}),e.jsxs(va,{onClick:()=>g("system"),disabled:j==="system",children:[e.jsx(Rl,{className:"mr-2 h-4 w-4"}),"跟随系统",j==="system"&&e.jsx(Jn,{children:"✓"})]})]})]}),e.jsx(or,{}),e.jsxs(va,{onClick:()=>window.location.reload(),children:[e.jsx(PN,{className:"mr-2 h-4 w-4"}),"刷新页面",e.jsx(Jn,{children:"⌘R"})]}),e.jsxs(va,{onClick:()=>f(!0),children:[e.jsx(St,{className:"mr-2 h-4 w-4"}),"搜索",e.jsx(Jn,{children:"⌘K"})]}),e.jsx(or,{}),e.jsxs(va,{onClick:()=>window.open("https://docs.mai-mai.org","_blank"),children:[e.jsx(dr,{className:"mr-2 h-4 w-4"}),"麦麦文档"]}),e.jsx(or,{}),e.jsxs(va,{onClick:L,className:"text-destructive focus:text-destructive",children:[e.jsx(Zf,{className:"mr-2 h-4 w-4"}),"登出系统"]})]})]})]})]})})}function J2(n){const r=n.split(` +`).slice(1),c=[];for(const d of r){const h=d.trim();if(!h.startsWith("at "))continue;const x=h.match(/at\s+(?:(.+?)\s+\()?(.+?):(\d+):(\d+)\)?$/);x?c.push({functionName:x[1]||"",fileName:x[2],lineNumber:x[3],columnNumber:x[4],raw:h}):c.push({functionName:"",fileName:"",lineNumber:"",columnNumber:"",raw:h})}return c}function P2({error:n,errorInfo:r}){const[c,d]=u.useState(!0),[h,x]=u.useState(!1),[f,j]=u.useState(!1),g=n.stack?J2(n.stack):[],_=async()=>{const v=` +Error: ${n.name} +Message: ${n.message} + +Stack Trace: +${n.stack||"No stack trace available"} + +Component Stack: +${r?.componentStack||"No component stack available"} + +URL: ${window.location.href} +User Agent: ${navigator.userAgent} +Time: ${new Date().toISOString()} + `.trim();try{await navigator.clipboard.writeText(v),j(!0),setTimeout(()=>j(!1),2e3)}catch(k){console.error("Failed to copy:",k)}};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs(ua,{variant:"destructive",className:"border-red-500/50 bg-red-500/10",children:[e.jsx(ya,{className:"h-4 w-4"}),e.jsxs(ma,{className:"font-mono text-sm",children:[e.jsxs("span",{className:"font-semibold",children:[n.name,":"]})," ",n.message]})]}),g.length>0&&e.jsxs(Gu,{open:c,onOpenChange:d,children:[e.jsx(Vu,{asChild:!0,children:e.jsxs(N,{variant:"ghost",className:"w-full justify-between p-3 h-auto",children:[e.jsxs("span",{className:"font-semibold text-sm flex items-center gap-2",children:[e.jsx(WN,{className:"h-4 w-4"}),"Stack Trace (",g.length," frames)"]}),c?e.jsx(fr,{className:"h-4 w-4"}):e.jsx(Ll,{className:"h-4 w-4"})]})}),e.jsx(Fu,{children:e.jsx(es,{className:"h-[280px] rounded-md border bg-muted/30",children:e.jsx("div",{className:"p-3 space-y-1",children:g.map((v,k)=>e.jsx("div",{className:"font-mono text-xs p-2 rounded hover:bg-muted/50 transition-colors",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsxs("span",{className:"text-muted-foreground w-6 text-right flex-shrink-0",children:[k+1,"."]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-primary font-medium",children:v.functionName}),v.fileName&&e.jsxs("div",{className:"text-muted-foreground mt-0.5 break-all",children:[v.fileName,v.lineNumber&&e.jsxs("span",{className:"text-yellow-600 dark:text-yellow-400",children:[":",v.lineNumber,":",v.columnNumber]})]})]})]})},k))})})})]}),r?.componentStack&&e.jsxs(Gu,{open:h,onOpenChange:x,children:[e.jsx(Vu,{asChild:!0,children:e.jsxs(N,{variant:"ghost",className:"w-full justify-between p-3 h-auto",children:[e.jsxs("span",{className:"font-semibold text-sm flex items-center gap-2",children:[e.jsx(ya,{className:"h-4 w-4"}),"Component Stack"]}),h?e.jsx(fr,{className:"h-4 w-4"}):e.jsx(Ll,{className:"h-4 w-4"})]})}),e.jsx(Fu,{children:e.jsx(es,{className:"h-[200px] rounded-md border bg-muted/30",children:e.jsx("pre",{className:"p-3 font-mono text-xs whitespace-pre-wrap text-muted-foreground",children:r.componentStack})})})]}),e.jsx(N,{variant:"outline",size:"sm",onClick:_,className:"w-full",children:f?e.jsxs(e.Fragment,{children:[e.jsx(ha,{className:"mr-2 h-4 w-4 text-green-500"}),"已复制到剪贴板"]}):e.jsxs(e.Fragment,{children:[e.jsx(so,{className:"mr-2 h-4 w-4"}),"复制错误信息"]})})]})}function Jg({error:n,errorInfo:r}){const c=()=>{window.location.href="/"},d=()=>{window.location.reload()};return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:e.jsxs(Be,{className:"w-full max-w-2xl shadow-lg",children:[e.jsxs(gs,{className:"text-center pb-2",children:[e.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30 mb-4",children:e.jsx(ya,{className:"h-8 w-8 text-red-600 dark:text-red-400"})}),e.jsx(js,{className:"text-2xl font-bold",children:"页面出现了问题"}),e.jsx(Zs,{className:"text-base mt-2",children:"应用程序遇到了意外错误。您可以尝试刷新页面或返回首页。"})]}),e.jsxs(bs,{className:"space-y-4",children:[e.jsx(P2,{error:n,errorInfo:r}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 pt-2",children:[e.jsxs(N,{onClick:d,className:"flex-1",children:[e.jsx(ft,{className:"mr-2 h-4 w-4"}),"刷新页面"]}),e.jsxs(N,{onClick:c,variant:"outline",className:"flex-1",children:[e.jsx(xr,{className:"mr-2 h-4 w-4"}),"返回首页"]})]}),e.jsx("p",{className:"text-xs text-center text-muted-foreground pt-2",children:"如果问题持续存在,请将错误信息复制并反馈给开发者"})]})]})})}class W2 extends u.Component{constructor(r){super(r),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,c){console.error("ErrorBoundary caught an error:",r,c),this.setState({errorInfo:c})}handleReset=()=>{this.setState({hasError:!1,error:null,errorInfo:null})};render(){return this.state.hasError&&this.state.error?this.props.fallback?this.props.fallback:e.jsx(Jg,{error:this.state.error,errorInfo:this.state.errorInfo}):this.props.children}}function Pg({error:n}){return e.jsx(Jg,{error:n,errorInfo:null})}const kr=gy({component:()=>e.jsxs(e.Fragment,{children:[e.jsx(vp,{}),!1]}),beforeLoad:()=>{if(window.location.pathname==="/"&&!Dg())throw vy({to:"/auth"})}}),e_=lt({getParentRoute:()=>kr,path:"/auth",component:N0}),s_=lt({getParentRoute:()=>kr,path:"/setup",component:B0}),Nt=lt({getParentRoute:()=>kr,id:"protected",component:()=>e.jsx(I2,{children:e.jsx(vp,{})}),errorComponent:({error:n})=>e.jsx(Pg,{error:n})}),t_=lt({getParentRoute:()=>Nt,path:"/",component:Ib}),a_=lt({getParentRoute:()=>Nt,path:"/config/bot",component:J0}),l_=lt({getParentRoute:()=>Nt,path:"/config/modelProvider",component:Nw}),n_=lt({getParentRoute:()=>Nt,path:"/config/model",component:Sw}),i_=lt({getParentRoute:()=>Nt,path:"/config/adapter",component:kw}),r_=lt({getParentRoute:()=>Nt,path:"/resource/emoji",component:Kw}),c_=lt({getParentRoute:()=>Nt,path:"/resource/expression",component:i1}),o_=lt({getParentRoute:()=>Nt,path:"/resource/person",component:g1}),d_=lt({getParentRoute:()=>Nt,path:"/resource/knowledge-graph",component:C1}),u_=lt({getParentRoute:()=>Nt,path:"/logs",component:a2}),m_=lt({getParentRoute:()=>Nt,path:"/chat",component:U2}),h_=lt({getParentRoute:()=>Nt,path:"/plugins",component:k2}),x_=lt({getParentRoute:()=>Nt,path:"/plugin-config",component:z2}),f_=lt({getParentRoute:()=>Nt,path:"/plugin-mirrors",component:M2}),p_=lt({getParentRoute:()=>Nt,path:"/settings",component:h0}),g_=lt({getParentRoute:()=>kr,path:"*",component:Og}),j_=kr.addChildren([e_,s_,Nt.addChildren([t_,a_,l_,n_,i_,r_,c_,o_,d_,h_,x_,f_,u_,m_,p_]),g_]),v_=jy({routeTree:j_,defaultNotFoundComponent:Og,defaultErrorComponent:({error:n})=>e.jsx(Pg,{error:n})});function y_({children:n,defaultTheme:r="system",storageKey:c="ui-theme",...d}){const[h,x]=u.useState(()=>localStorage.getItem(c)||r);u.useEffect(()=>{const j=window.document.documentElement;if(j.classList.remove("light","dark"),h==="system"){const g=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";j.classList.add(g);return}j.classList.add(h)},[h]),u.useEffect(()=>{const j=localStorage.getItem("accent-color");if(j){const g=document.documentElement,v={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%",gradient:null},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%",gradient:null},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%",gradient:null},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%",gradient:null},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%",gradient:null},red:{hsl:"0 84% 60%",darkHsl:"0 90% 70%",gradient:null},"gradient-sunset":{hsl:"15 95% 60%",darkHsl:"15 95% 65%",gradient:"linear-gradient(135deg, hsl(25 95% 53%) 0%, hsl(330 81% 60%) 100%)"},"gradient-ocean":{hsl:"200 90% 55%",darkHsl:"200 90% 60%",gradient:"linear-gradient(135deg, hsl(221.2 83.2% 53.3%) 0%, hsl(189 94% 43%) 100%)"},"gradient-forest":{hsl:"150 70% 45%",darkHsl:"150 75% 40%",gradient:"linear-gradient(135deg, hsl(142 71% 45%) 0%, hsl(158 64% 52%) 100%)"},"gradient-aurora":{hsl:"310 85% 65%",darkHsl:"310 90% 70%",gradient:"linear-gradient(135deg, hsl(271 91% 65%) 0%, hsl(330 81% 60%) 100%)"},"gradient-fire":{hsl:"15 95% 55%",darkHsl:"15 95% 60%",gradient:"linear-gradient(135deg, hsl(0 84% 60%) 0%, hsl(25 95% 53%) 100%)"},"gradient-twilight":{hsl:"250 90% 60%",darkHsl:"250 95% 65%",gradient:"linear-gradient(135deg, hsl(239 84% 67%) 0%, hsl(271 91% 65%) 100%)"}}[j];v&&(g.style.setProperty("--primary",v.hsl),v.gradient?(g.style.setProperty("--primary-gradient",v.gradient),g.classList.add("has-gradient")):(g.style.removeProperty("--primary-gradient"),g.classList.remove("has-gradient")))}},[]);const f={theme:h,setTheme:j=>{localStorage.setItem(c,j),x(j)}};return e.jsx(kg.Provider,{...d,value:f,children:n})}function N_({children:n,defaultEnabled:r=!0,defaultWavesEnabled:c=!0,storageKey:d="enable-animations",wavesStorageKey:h="enable-waves-background"}){const[x,f]=u.useState(()=>{const v=localStorage.getItem(d);return v!==null?v==="true":r}),[j,g]=u.useState(()=>{const v=localStorage.getItem(h);return v!==null?v==="true":c});u.useEffect(()=>{const v=document.documentElement;x?v.classList.remove("no-animations"):v.classList.add("no-animations"),localStorage.setItem(d,String(x))},[x,d]),u.useEffect(()=>{localStorage.setItem(h,String(j))},[j,h]);const _={enableAnimations:x,setEnableAnimations:f,enableWavesBackground:j,setEnableWavesBackground:g};return e.jsx(Tg.Provider,{value:_,children:n})}const b_=yN,Wg=u.forwardRef(({className:n,...r},c)=>e.jsx(og,{ref:c,className:$("fixed bottom-0 right-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:max-w-[420px] gap-2",n),...r}));Wg.displayName=og.displayName;const w_=ai("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-slide-in-from-right data-[state=open]:animate-fade-in data-[state=closed]:animate-slide-out-to-right data-[state=closed]:animate-fade-out data-[swipe=end]:animate-slide-out-to-right",{variants:{variant:{default:"border bg-primary/5 text-foreground backdrop-blur-sm",destructive:"destructive group border-destructive bg-destructive/10 text-destructive-foreground backdrop-blur-sm"}},defaultVariants:{variant:"default"}}),ej=u.forwardRef(({className:n,variant:r,...c},d)=>e.jsx(dg,{ref:d,className:$(w_({variant:r}),n),...c}));ej.displayName=dg.displayName;const __=u.forwardRef(({className:n,...r},c)=>e.jsx(ug,{ref:c,className:$("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",n),...r}));__.displayName=ug.displayName;const sj=u.forwardRef(({className:n,...r},c)=>e.jsx(mg,{ref:c,className:$("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",n),"toast-close":"",...r,children:e.jsx(li,{className:"h-4 w-4"})}));sj.displayName=mg.displayName;const tj=u.forwardRef(({className:n,...r},c)=>e.jsx(hg,{ref:c,className:$("text-sm font-semibold [&+div]:text-xs",n),...r}));tj.displayName=hg.displayName;const aj=u.forwardRef(({className:n,...r},c)=>e.jsx(xg,{ref:c,className:$("text-sm opacity-90",n),...r}));aj.displayName=xg.displayName;function S_(){const{toasts:n}=Bs();return e.jsxs(b_,{children:[n.map(function({id:r,title:c,description:d,action:h,...x}){return e.jsxs(ej,{...x,children:[e.jsxs("div",{className:"grid gap-1",children:[c&&e.jsx(tj,{children:c}),d&&e.jsx(aj,{children:d})]}),h,e.jsx(sj,{})]},r)}),e.jsx(Wg,{})]})}Bb.createRoot(document.getElementById("root")).render(e.jsx(u.StrictMode,{children:e.jsx(W2,{children:e.jsx(y_,{defaultTheme:"system",children:e.jsx(N_,{children:e.jsxs(pw,{children:[e.jsx(yy,{router:v_}),e.jsx(vw,{}),e.jsx(S_,{})]})})})})})); diff --git a/webui/dist/assets/index-_a_MShLH.css b/webui/dist/assets/index-_a_MShLH.css deleted file mode 100644 index 6cfb460f..00000000 --- a/webui/dist/assets/index-_a_MShLH.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 221.2 83.2% 53.3%;--primary-foreground: 210 40% 98%;--primary-gradient: none;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 221.2 83.2% 53.3%;--radius: .5rem;--chart-1: 221.2 83.2% 53.3%;--chart-2: 160 60% 45%;--chart-3: 30 80% 55%;--chart-4: 280 65% 60%;--chart-5: 340 75% 55%}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--primary: 217.2 91.2% 59.8%;--primary-foreground: 222.2 47.4% 11.2%;--primary-gradient: none;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--ring: 224.3 76.3% 48%;--chart-1: 217.2 91.2% 59.8%;--chart-2: 160 60% 50%;--chart-3: 30 80% 60%;--chart-4: 280 65% 65%;--chart-5: 340 75% 60%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield;-webkit-appearance:textfield;appearance:textfield}.\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.invisible{visibility:hidden}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.bottom-1\/4{bottom:25%}.bottom-4{bottom:1rem}.left-0{left:0}.left-1{left:.25rem}.left-1\/2{left:50%}.left-1\/4{left:25%}.left-2{left:.5rem}.left-2\.5{left:.625rem}.left-3{left:.75rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-1{right:.25rem}.right-1\.5{right:.375rem}.right-1\/4{right:25%}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-1\/4{top:25%}.top-2{top:.5rem}.top-2\.5{top:.625rem}.top-3{top:.75rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.order-1{order:1}.order-2{order:2}.col-span-2{grid-column:span 2 / span 2}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.-mt-2{margin-top:-.5rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-10{margin-left:2.5rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-12{margin-top:3rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-auto{aspect-ratio:auto}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.size-4{width:1rem;height:1rem}.size-\[--cell-size\]{width:var(--cell-size);height:var(--cell-size)}.h-0\.5{height:.125rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-4{height:1rem}.h-40{height:10rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[--cell-size\]{height:var(--cell-size)}.h-\[1\.25rem\]{height:1.25rem}.h-\[1px\]{height:1px}.h-\[200px\]{height:200px}.h-\[250px\]{height:250px}.h-\[280px\]{height:280px}.h-\[300px\]{height:300px}.h-\[400px\]{height:400px}.h-\[calc\(100vh-200px\)\]{height:calc(100vh - 200px)}.h-\[calc\(100vh-240px\)\]{height:calc(100vh - 240px)}.h-\[calc\(100vh-260px\)\]{height:calc(100vh - 260px)}.h-\[calc\(100vh-4rem\)\]{height:calc(100vh - 4rem)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\[--radix-context-menu-content-available-height\]{max-height:var(--radix-context-menu-content-available-height)}.max-h-\[--radix-select-content-available-height\]{max-height:var(--radix-select-content-available-height)}.max-h-\[300px\]{max-height:300px}.max-h-\[80vh\]{max-height:80vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[calc\(90vh-120px\)\]{max-height:calc(90vh - 120px)}.max-h-\[calc\(90vh-8rem\)\]{max-height:calc(90vh - 8rem)}.max-h-none{max-height:none}.max-h-screen{max-height:100vh}.min-h-0{min-height:0px}.min-h-10{min-height:2.5rem}.min-h-\[100px\]{min-height:100px}.min-h-\[300px\]{min-height:300px}.min-h-\[60px\]{min-height:60px}.min-h-screen{min-height:100vh}.w-0{width:0px}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\[--cell-size\]{width:var(--cell-size)}.w-\[100px\]{width:100px}.w-\[120px\]{width:120px}.w-\[130px\]{width:130px}.w-\[1px\]{width:1px}.w-\[65px\]{width:65px}.w-\[95vw\]{width:95vw}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-\[--cell-size\]{min-width:var(--cell-size)}.min-w-\[100px\]{min-width:100px}.min-w-\[120px\]{min-width:120px}.min-w-\[80px\]{min-width:80px}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.min-w-full{min-width:100%}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-\[150px\]{max-width:150px}.max-w-\[200px\]{max-width:200px}.max-w-\[60px\]{max-width:60px}.max-w-\[75\%\]{max-width:75%}.max-w-\[90\%\]{max-width:90%}.max-w-\[95vw\]{max-width:95vw}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.origin-\[--radix-context-menu-content-transform-origin\]{transform-origin:var(--radix-context-menu-content-transform-origin)}.origin-\[--radix-popover-content-transform-origin\]{transform-origin:var(--radix-popover-content-transform-origin)}.origin-\[--radix-select-content-transform-origin\]{transform-origin:var(--radix-select-content-transform-origin)}.origin-\[--radix-tooltip-content-transform-origin\]{transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-move{cursor:move}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize{resize:both}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-l-md{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.rounded-r-md{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.rounded-tl-sm{border-top-left-radius:calc(var(--radius) - 4px)}.rounded-tr-sm{border-top-right-radius:calc(var(--radius) - 4px)}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-4{border-width:4px}.border-\[1\.5px\]{border-width:1.5px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[--color-border\]{border-color:var(--color-border)}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-amber-500\/50{border-color:#f59e0b80}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-700{--tw-border-opacity: 1;border-color:rgb(29 78 216 / var(--tw-border-opacity, 1))}.border-border{border-color:hsl(var(--border))}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-current{border-color:currentColor}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-green-300{--tw-border-opacity: 1;border-color:rgb(134 239 172 / var(--tw-border-opacity, 1))}.border-green-700{--tw-border-opacity: 1;border-color:rgb(21 128 61 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-muted{border-color:hsl(var(--muted))}.border-muted-foreground\/30{border-color:hsl(var(--muted-foreground) / .3)}.border-muted-foreground\/50{border-color:hsl(var(--muted-foreground) / .5)}.border-orange-200{--tw-border-opacity: 1;border-color:rgb(254 215 170 / var(--tw-border-opacity, 1))}.border-orange-600{--tw-border-opacity: 1;border-color:rgb(234 88 12 / var(--tw-border-opacity, 1))}.border-primary{border-color:hsl(var(--primary))}.border-primary\/20{border-color:hsl(var(--primary) / .2)}.border-primary\/30{border-color:hsl(var(--primary) / .3)}.border-primary\/50{border-color:hsl(var(--primary) / .5)}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-red-500\/50{border-color:#ef444480}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.border-yellow-500\/50{border-color:#eab30880}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\[--color-bg\]{background-color:var(--color-bg)}.bg-accent{background-color:hsl(var(--accent))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500\/10{background-color:#f59e0b1a}.bg-background{background-color:hsl(var(--background))}.bg-background\/50{background-color:hsl(var(--background) / .5)}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-background\/95{background-color:hsl(var(--background) / .95)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/50{background-color:#00000080}.bg-black\/80{background-color:#000c}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-blue-900\/20{background-color:#1e3a8a33}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-card\/80{background-color:hsl(var(--card) / .8)}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.bg-gray-800\/20{background-color:#1f293733}.bg-gray-800\/30{background-color:#1f29374d}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted-foreground\/50{background-color:hsl(var(--muted-foreground) / .5)}.bg-muted\/20{background-color:hsl(var(--muted) / .2)}.bg-muted\/30{background-color:hsl(var(--muted) / .3)}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-orange-50{--tw-bg-opacity: 1;background-color:rgb(255 247 237 / var(--tw-bg-opacity, 1))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-orange-600{--tw-bg-opacity: 1;background-color:rgb(234 88 12 / var(--tw-bg-opacity, 1))}.bg-pink-500{--tw-bg-opacity: 1;background-color:rgb(236 72 153 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\/5{background-color:hsl(var(--primary) / .05)}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-red-900\/20{background-color:#7f1d1d33}.bg-red-900\/30{background-color:#7f1d1d4d}.bg-secondary{background-color:hsl(var(--secondary))}.bg-secondary\/5{background-color:hsl(var(--secondary) / .05)}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-300{--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}.bg-slate-400{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.bg-slate-700{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(254 240 138 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/10{background-color:#eab3081a}.bg-yellow-500\/5{background-color:#eab3080d}.bg-yellow-900\/20{background-color:#713f1233}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-blue-500{--tw-gradient-from: #3b82f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-500{--tw-gradient-from: #22c55e var(--tw-gradient-from-position);--tw-gradient-to: rgb(34 197 94 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-indigo-500{--tw-gradient-from: #6366f1 var(--tw-gradient-from-position);--tw-gradient-to: rgb(99 102 241 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-orange-500{--tw-gradient-from: #f97316 var(--tw-gradient-from-position);--tw-gradient-to: rgb(249 115 22 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary\/5{--tw-gradient-from: hsl(var(--primary) / .05) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from: #a855f7 var(--tw-gradient-from-position);--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-500{--tw-gradient-from: #ef4444 var(--tw-gradient-from-position);--tw-gradient-to: rgb(239 68 68 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-200{--tw-gradient-from: #e2e8f0 var(--tw-gradient-from-position);--tw-gradient-to: rgb(226 232 240 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-300{--tw-gradient-from: #cbd5e1 var(--tw-gradient-from-position);--tw-gradient-to: rgb(203 213 225 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-400{--tw-gradient-from: #94a3b8 var(--tw-gradient-from-position);--tw-gradient-to: rgb(148 163 184 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-background{--tw-gradient-to: hsl(var(--background) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--background)) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-blue-600{--tw-gradient-to: #2563eb var(--tw-gradient-to-position)}.to-cyan-500{--tw-gradient-to: #06b6d4 var(--tw-gradient-to-position)}.to-emerald-500{--tw-gradient-to: #10b981 var(--tw-gradient-to-position)}.to-green-600{--tw-gradient-to: #16a34a var(--tw-gradient-to-position)}.to-orange-500{--tw-gradient-to: #f97316 var(--tw-gradient-to-position)}.to-pink-500{--tw-gradient-to: #ec4899 var(--tw-gradient-to-position)}.to-primary\/10{--tw-gradient-to: hsl(var(--primary) / .1) var(--tw-gradient-to-position)}.to-purple-500{--tw-gradient-to: #a855f7 var(--tw-gradient-to-position)}.to-secondary\/5{--tw-gradient-to: hsl(var(--secondary) / .05) var(--tw-gradient-to-position)}.to-slate-700{--tw-gradient-to: #334155 var(--tw-gradient-to-position)}.to-slate-800{--tw-gradient-to: #1e293b var(--tw-gradient-to-position)}.to-slate-900{--tw-gradient-to: #0f172a var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.fill-yellow-400{fill:#facc15}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[1px\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\[--cell-size\]{padding-left:var(--cell-size);padding-right:var(--cell-size)}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-0{padding-bottom:0}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pl-10{padding-left:2.5rem}.pl-11{padding-left:2.75rem}.pl-2{padding-left:.5rem}.pl-4{padding-left:1rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-10{padding-right:2.5rem}.pr-16{padding-right:4rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.pr-6{padding-right:1.5rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[0\.8rem\]{font-size:.8rem}.text-\[10px\]{font-size:10px}.text-\[150px\]{font-size:150px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-black{font-weight:900}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.tracking-tight{letter-spacing:-.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-900{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/50{color:hsl(var(--muted-foreground) / .5)}.text-muted-foreground\/60{color:hsl(var(--muted-foreground) / .6)}.text-orange-600{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-orange-900{--tw-text-opacity: 1;color:rgb(124 45 18 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-primary\/10{color:hsl(var(--primary) / .1)}.text-primary\/30{color:hsl(var(--primary) / .3)}.text-primary\/60{color:hsl(var(--primary) / .6)}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.text-yellow-900{--tw-text-opacity: 1;color:rgb(113 63 18 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-primary{--tw-ring-color: hsl(var(--primary))}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.blur-3xl{--tw-blur: blur(64px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-xl{--tw-backdrop-blur: blur(24px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.text-primary-gradient{color:hsl(var(--primary))}.has-gradient .text-primary-gradient{background:var(--primary-gradient);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent}.\[--cell-size\:2rem\]{--cell-size: 2rem}.no-animations *,.no-animations *:before,.no-animations *:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}.no-animations *:hover{transition-duration:.01ms!important}::view-transition-old(root),::view-transition-new(root){animation:none;mix-blend-mode:normal}::view-transition-old(root){z-index:1}::view-transition-new(root){z-index:999}.__floater{z-index:99999!important;pointer-events:auto!important}.react-joyride__overlay,.react-joyride__spotlight{z-index:99998!important}.react-joyride__tooltip{pointer-events:auto!important}#tour-portal-container *{pointer-events:auto}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\:border-primary\/50:hover{border-color:hsl(var(--primary) / .5)}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-accent\/50:hover{background-color:hsl(var(--accent) / .5)}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-orange-700:hover{--tw-bg-opacity: 1;background-color:rgb(194 65 12 / var(--tw-bg-opacity, 1))}.hover\:bg-primary\/10:hover{background-color:hsl(var(--primary) / .1)}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-secondary\/90:hover{background-color:hsl(var(--secondary) / .9)}.hover\:bg-transparent:hover{background-color:transparent}.hover\:bg-white\/5:hover{background-color:#ffffff0d}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-green-700:hover{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.hover\:text-orange-700:hover{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.hover\:text-primary\/80:hover{color:hsl(var(--primary) / .8)}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.hover\:text-yellow-300:hover{--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.hover\:text-yellow-800:hover{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:ring-2:hover{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.hover\:ring-primary:hover{--tw-ring-color: hsl(var(--primary))}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:bg-gray-100:focus{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-0:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-red-500:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.active\:cursor-grabbing:active{cursor:grabbing}.active\:border-primary\/70:active{border-color:hsl(var(--primary) / .7)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group[open] .group-open\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:opacity-100{opacity:1}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.destructive .group-\[\.destructive\]\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:hover\:text-red-50:hover{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-selected\:text-muted-foreground[aria-selected=true]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true],.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked],.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes fade-out{0%{opacity:1}to{opacity:0}}.data-\[state\=closed\]\:animate-fade-out[data-state=closed]{animation:fade-out .15s ease-in}.data-\[state\=closed\]\:animate-slide-out-to-right[data-state=closed]{animation:slide-out-to-right .2s ease-in}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.data-\[state\=open\]\:animate-fade-in[data-state=open]{animation:fade-in .2s ease-out}@keyframes slide-in-from-right{0%{transform:translate(100%)}to{transform:translate(0)}}.data-\[state\=open\]\:animate-slide-in-from-right[data-state=open]{animation:slide-in-from-right .3s ease-out}@keyframes slide-out-to-right{0%{transform:translate(0)}to{transform:translate(100%)}}.data-\[swipe\=end\]\:animate-slide-out-to-right[data-swipe=end]{animation:slide-out-to-right .2s ease-in}.data-\[range-end\=true\]\:rounded-md[data-range-end=true]{border-radius:calc(var(--radius) - 2px)}.data-\[range-middle\=true\]\:rounded-none[data-range-middle=true]{border-radius:0}.data-\[range-start\=true\]\:rounded-md[data-range-start=true]{border-radius:calc(var(--radius) - 2px)}.data-\[selected\=true\]\:rounded-none[data-selected=true]{border-radius:0}.data-\[range-end\=true\]\:bg-primary[data-range-end=true]{background-color:hsl(var(--primary))}.data-\[range-middle\=true\]\:bg-accent[data-range-middle=true]{background-color:hsl(var(--accent))}.data-\[range-start\=true\]\:bg-primary[data-range-start=true],.data-\[selected-single\=true\]\:bg-primary[data-selected-single=true]{background-color:hsl(var(--primary))}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:hsl(var(--accent))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:hsl(var(--muted-foreground))}.data-\[range-end\=true\]\:text-primary-foreground[data-range-end=true]{color:hsl(var(--primary-foreground))}.data-\[range-middle\=true\]\:text-accent-foreground[data-range-middle=true]{color:hsl(var(--accent-foreground))}.data-\[range-start\=true\]\:text-primary-foreground[data-range-start=true],.data-\[selected-single\=true\]\:text-primary-foreground[data-selected-single=true]{color:hsl(var(--primary-foreground))}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:hsl(var(--accent-foreground))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:hsl(var(--accent-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:opacity-50[data-disabled=true],.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[state\=active\]\:duration-300[data-state=active]{transition-duration:.3s}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:relative{position:relative}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:z-10{z-index:10}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:border-ring{border-color:hsl(var(--ring))}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:ring-\[3px\]{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:ring-ring\/50{--tw-ring-color: hsl(var(--ring) / .5)}@supports (backdrop-filter: var(--tw)){.supports-\[backdrop-filter\]\:bg-background\/60{background-color:hsl(var(--background) / .6)}}.dark\:border-amber-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(146 64 14 / var(--tw-border-opacity, 1))}.dark\:border-blue-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 64 175 / var(--tw-border-opacity, 1))}.dark\:border-gray-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(17 24 39 / var(--tw-border-opacity, 1))}.dark\:border-green-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(22 101 52 / var(--tw-border-opacity, 1))}.dark\:border-orange-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(124 45 18 / var(--tw-border-opacity, 1))}.dark\:border-yellow-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(113 63 18 / var(--tw-border-opacity, 1))}.dark\:bg-amber-950\/30:is(.dark *){background-color:#451a034d}.dark\:bg-blue-500\/20:is(.dark *){background-color:#3b82f633}.dark\:bg-blue-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(23 37 84 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-950\/20:is(.dark *){background-color:#17255433}.dark\:bg-blue-950\/30:is(.dark *){background-color:#1725544d}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-800\/30:is(.dark *){background-color:#1f29374d}.dark\:bg-gray-800\/50:is(.dark *){background-color:#1f293780}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(3 7 18 / var(--tw-bg-opacity, 1))}.dark\:bg-green-900\/30:is(.dark *){background-color:#14532d4d}.dark\:bg-green-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(5 46 22 / var(--tw-bg-opacity, 1))}.dark\:bg-orange-950\/20:is(.dark *){background-color:#43140733}.dark\:bg-red-500\/20:is(.dark *){background-color:#ef444433}.dark\:bg-red-600\/30:is(.dark *){background-color:#dc26264d}.dark\:bg-red-900\/30:is(.dark *){background-color:#7f1d1d4d}.dark\:bg-red-950\/50:is(.dark *){background-color:#450a0a80}.dark\:bg-yellow-500\/20:is(.dark *){background-color:#eab30833}.dark\:bg-yellow-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(113 63 18 / var(--tw-bg-opacity, 1))}.dark\:bg-yellow-950\/30:is(.dark *){background-color:#4220064d}.dark\:text-amber-100:is(.dark *){--tw-text-opacity: 1;color:rgb(254 243 199 / var(--tw-text-opacity, 1))}.dark\:text-amber-400:is(.dark *){--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.dark\:text-blue-100:is(.dark *){--tw-text-opacity: 1;color:rgb(219 234 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-200:is(.dark *){--tw-text-opacity: 1;color:rgb(191 219 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\:text-blue-400:is(.dark *){--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.dark\:text-cyan-500:is(.dark *){--tw-text-opacity: 1;color:rgb(6 182 212 / var(--tw-text-opacity, 1))}.dark\:text-gray-100:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-gray-600:is(.dark *){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-orange-100:is(.dark *){--tw-text-opacity: 1;color:rgb(255 237 213 / var(--tw-text-opacity, 1))}.dark\:text-orange-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 215 170 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-red-500:is(.dark *){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.dark\:text-yellow-100:is(.dark *){--tw-text-opacity: 1;color:rgb(254 249 195 / var(--tw-text-opacity, 1))}.dark\:text-yellow-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.dark\:text-yellow-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.dark\:text-yellow-400:is(.dark *){--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.dark\:text-yellow-500:is(.dark *){--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.dark\:hover\:bg-gray-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:hover\:text-yellow-200:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.dark\:focus\:bg-gray-800:focus:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}@media(min-width:640px){.sm\:right-2{right:.5rem}.sm\:right-3{right:.75rem}.sm\:top-2{top:.5rem}.sm\:top-3{top:.75rem}.sm\:order-1{order:1}.sm\:order-2{order:2}.sm\:col-span-2{grid-column:span 2 / span 2}.sm\:mx-0{margin-left:0;margin-right:0}.sm\:mb-3{margin-bottom:.75rem}.sm\:mb-4{margin-bottom:1rem}.sm\:mb-6{margin-bottom:1.5rem}.sm\:ml-0{margin-left:0}.sm\:ml-1{margin-left:.25rem}.sm\:mr-1{margin-right:.25rem}.sm\:mr-2{margin-right:.5rem}.sm\:mt-0{margin-top:0}.sm\:mt-2{margin-top:.5rem}.sm\:mt-3{margin-top:.75rem}.sm\:mt-6{margin-top:1.5rem}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:grid{display:grid}.sm\:hidden{display:none}.sm\:h-10{height:2.5rem}.sm\:h-12{height:3rem}.sm\:h-2{height:.5rem}.sm\:h-24{height:6rem}.sm\:h-3{height:.75rem}.sm\:h-4{height:1rem}.sm\:h-5{height:1.25rem}.sm\:h-8{height:2rem}.sm\:h-\[300px\]{height:300px}.sm\:h-\[400px\]{height:400px}.sm\:h-\[500px\]{height:500px}.sm\:h-\[calc\(100vh-280px\)\]{height:calc(100vh - 280px)}.sm\:w-10{width:2.5rem}.sm\:w-2{width:.5rem}.sm\:w-24{width:6rem}.sm\:w-3{width:.75rem}.sm\:w-4{width:1rem}.sm\:w-5{width:1.25rem}.sm\:w-8{width:2rem}.sm\:w-\[140px\]{width:140px}.sm\:w-\[160px\]{width:160px}.sm\:w-\[200px\]{width:200px}.sm\:w-\[500px\]{width:500px}.sm\:w-auto{width:auto}.sm\:w-full{width:100%}.sm\:min-w-\[120px\]{min-width:120px}.sm\:max-w-2xl{max-width:42rem}.sm\:max-w-\[420px\]{max-width:420px}.sm\:max-w-\[70\%\]{max-width:70%}.sm\:max-w-\[900px\]{max-width:900px}.sm\:max-w-md{max-width:28rem}.sm\:max-w-sm{max-width:24rem}.sm\:flex-1{flex:1 1 0%}.sm\:flex-none{flex:none}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.sm\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-start{align-items:flex-start}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-0{gap:0px}.sm\:gap-1{gap:.25rem}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:gap-6{gap:1.5rem}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.sm\:space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.sm\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.sm\:space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:p-3{padding:.75rem}.sm\:p-4{padding:1rem}.sm\:p-6{padding:1.5rem}.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:pb-4{padding-bottom:1rem}.sm\:text-left{text-align:left}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}.sm\:text-\[200px\]{font-size:200px}.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.sm\:text-xl{font-size:1.25rem;line-height:1.75rem}.sm\:text-xs{font-size:.75rem;line-height:1rem}}@media(min-width:768px){.md\:top-4{top:1rem}.md\:mb-4{margin-bottom:1rem}.md\:mb-6{margin-bottom:1.5rem}.md\:mb-8{margin-bottom:2rem}.md\:mt-8{margin-top:2rem}.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:h-16{height:4rem}.md\:h-4{height:1rem}.md\:h-5{height:1.25rem}.md\:h-8{height:2rem}.md\:h-96{height:24rem}.md\:h-\[500px\]{height:500px}.md\:min-h-\[400px\]{min-height:400px}.md\:w-16{width:4rem}.md\:w-4{width:1rem}.md\:w-5{width:1.25rem}.md\:w-8{width:2rem}.md\:w-96{width:24rem}.md\:max-w-none{max-width:none}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:gap-2{gap:.5rem}.md\:gap-3{gap:.75rem}.md\:gap-4{gap:1rem}.md\:gap-6{gap:1.5rem}.md\:space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.md\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.md\:whitespace-normal{white-space:normal}.md\:p-12{padding:3rem}.md\:p-4{padding:1rem}.md\:p-6{padding:1.5rem}.md\:p-8{padding:2rem}.md\:text-2xl{font-size:1.5rem;line-height:2rem}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:text-base{font-size:1rem;line-height:1.5rem}.md\:text-lg{font-size:1.125rem;line-height:1.75rem}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:text-xs{font-size:.75rem;line-height:1rem}}@media(min-width:1024px){.lg\:invisible{visibility:hidden}.lg\:relative{position:relative}.lg\:z-0{z-index:0}.lg\:col-span-1{grid-column:span 1 / span 1}.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:mx-auto{margin-left:auto;margin-right:auto}.lg\:mb-1{margin-bottom:.25rem}.lg\:block{display:block}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:w-12{width:3rem}.lg\:w-16{width:4rem}.lg\:w-64{width:16rem}.lg\:w-8{width:2rem}.lg\:w-\[130px\]{width:130px}.lg\:w-\[160px\]{width:160px}.lg\:w-\[180px\]{width:180px}.lg\:w-\[200px\]{width:200px}.lg\:w-\[240px\]{width:240px}.lg\:w-\[75px\]{width:75px}.lg\:w-auto{width:auto}.lg\:w-full{width:100%}.lg\:max-w-0{max-width:0px}.lg\:flex-1{flex:1 1 0%}.lg\:flex-none{flex:none}.lg\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.lg\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.lg\:justify-center{justify-content:center}.lg\:gap-0{gap:0px}.lg\:space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.lg\:overflow-hidden{overflow:hidden}.lg\:p-2{padding:.5rem}.lg\:p-6{padding:1.5rem}.lg\:px-0{padding-left:0;padding-right:0}.lg\:px-6{padding-left:1.5rem;padding-right:1.5rem}.lg\:pb-6{padding-bottom:1.5rem}.lg\:text-3xl{font-size:1.875rem;line-height:2.25rem}.lg\:opacity-0{opacity:0}}@media(min-width:1280px){.xl\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}}.\[\&\+div\]\:text-xs+div{font-size:.75rem;line-height:1rem}.\[\&\:first-child\[data-selected\=true\]_button\]\:rounded-l-md:first-child[data-selected=true] button{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\:last-child\[data-selected\=true\]_button\]\:rounded-r-md:last-child[data-selected=true] button{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y: 2px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>span\]\:text-xs>span{font-size:.75rem;line-height:1rem}.\[\&\>span\]\:opacity-70>span{opacity:.7}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:size-3\.5>svg{width:.875rem;height:.875rem}.\[\&\>svg\]\:h-2\.5>svg{height:.625rem}.\[\&\>svg\]\:h-3>svg{height:.75rem}.\[\&\>svg\]\:w-2\.5>svg{width:.625rem}.\[\&\>svg\]\:w-3>svg{width:.75rem}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\]\:text-muted-foreground>svg{color:hsl(var(--muted-foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:hsl(var(--muted-foreground))}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:hsl(var(--border) / .5)}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:hsl(var(--border))}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-layer\]\:outline-none .recharts-layer{outline:2px solid transparent;outline-offset:2px}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:hsl(var(--muted))}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-sector\]\:outline-none .recharts-sector,.\[\&_\.recharts-surface\]\:outline-none .recharts-surface{outline:2px solid transparent;outline-offset:2px}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:invisible svg{visibility:hidden}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}[data-slot=card-content] .\[\[data-slot\=card-content\]_\&\]\:bg-transparent,[data-slot=popover-content] .\[\[data-slot\=popover-content\]_\&\]\:bg-transparent{background-color:transparent}@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2) format("woff2"),url(/assets/KaTeX_AMS-Regular-DMm9YOAa.woff) format("woff"),url(/assets/KaTeX_AMS-Regular-DRggAlZN.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff) format("woff"),url(/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff) format("woff"),url(/assets/KaTeX_Fraktur-Regular-CB_wures.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Main-Bold-Cx986IdX.woff2) format("woff2"),url(/assets/KaTeX_Main-Bold-Jm3AIy58.woff) format("woff"),url(/assets/KaTeX_Main-Bold-waoOVXN0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2) format("woff2"),url(/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff) format("woff"),url(/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2) format("woff2"),url(/assets/KaTeX_Main-Italic-BMLOBm91.woff) format("woff"),url(/assets/KaTeX_Main-Italic-3WenGoN9.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Main-Regular-B22Nviop.woff2) format("woff2"),url(/assets/KaTeX_Main-Regular-Dr94JaBh.woff) format("woff"),url(/assets/KaTeX_Main-Regular-ypZvNtVU.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2) format("woff2"),url(/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff) format("woff"),url(/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Math-Italic-t53AETM-.woff2) format("woff2"),url(/assets/KaTeX_Math-Italic-DA0__PXp.woff) format("woff"),url(/assets/KaTeX_Math-Italic-flOr_0UB.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff) format("woff"),url(/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff) format("woff"),url(/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff) format("woff"),url(/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Script-Regular-D3wIWfF6.woff2) format("woff2"),url(/assets/KaTeX_Script-Regular-D5yQViql.woff) format("woff"),url(/assets/KaTeX_Script-Regular-C5JkGWo-.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2) format("woff2"),url(/assets/KaTeX_Size1-Regular-C195tn64.woff) format("woff"),url(/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2) format("woff2"),url(/assets/KaTeX_Size2-Regular-oD1tc_U0.woff) format("woff"),url(/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC) format("woff2"),url(/assets/KaTeX_Size3-Regular-CTq5MqoE.woff) format("woff"),url(/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2) format("woff2"),url(/assets/KaTeX_Size4-Regular-BF-4gkZK.woff) format("woff"),url(/assets/KaTeX_Size4-Regular-DWFBv043.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2) format("woff2"),url(/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff) format("woff"),url(/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf) format("truetype")}.katex{font: 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.25"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}.react-flow{direction:ltr}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;cursor:grab}.react-flow__pane.selection{cursor:pointer}.react-flow__pane.dragging{cursor:grabbing}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow .react-flow__edges{pointer-events:none;overflow:visible}.react-flow__edge-path,.react-flow__connection-path{stroke:#b1b1b7;stroke-width:1;fill:none}.react-flow__edge{pointer-events:visibleStroke;cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge:focus .react-flow__edge-path,.react-flow__edge:focus-visible .react-flow__edge-path{stroke:#555}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge-textbg{fill:#fff}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__connectionline{z-index:1001}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:grab}.react-flow__node.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background:#1a192b;border:1px solid white;border-radius:100%}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:-4px;transform:translate(-50%)}.react-flow__handle-top{left:50%;top:-4px;transform:translate(-50%)}.react-flow__handle-left{top:50%;left:-4px;transform:translateY(-50%)}.react-flow__handle-right{right:-4px;top:50%;transform:translateY(-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.center{left:50%;transform:translate(-50%)}.react-flow__attribution{font-size:10px;background:#ffffff80;padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-default,.react-flow__node-input,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:3px;width:150px;font-size:12px;color:#222;text-align:center;border-width:1px;border-style:solid;border-color:#1a192b;background-color:#fff}.react-flow__node-default.selectable:hover,.react-flow__node-input.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:0 1px 4px 1px #00000014}.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:0 0 0 .5px #1a192b}.react-flow__node-group{background-color:#f0f0f040}.react-flow__nodesselection-rect,.react-flow__selection{background:#0059dc14;border:1px dotted rgba(0,89,220,.8)}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls{box-shadow:0 0 2px 1px #00000014}.react-flow__controls-button{border:none;background:#fefefe;border-bottom:1px solid #eee;box-sizing:content-box;display:flex;justify-content:center;align-items:center;width:16px;height:16px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:5px}.react-flow__controls-button:hover{background:#f4f4f4}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__minimap{background-color:#fff}.react-flow__minimap svg{display:block}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:4px;height:4px;border:1px solid #fff;border-radius:1px;background-color:#3367d9;transform:translate(-50%,-50%)}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:#3367d9;border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%} diff --git a/webui/dist/assets/markdown-A1ShuLvG.js b/webui/dist/assets/markdown-A1ShuLvG.js new file mode 100644 index 00000000..92fb2e43 --- /dev/null +++ b/webui/dist/assets/markdown-A1ShuLvG.js @@ -0,0 +1,295 @@ +import{j as gn}from"./router-CWhjJi2n.js";import{g as Oa}from"./react-vendor-Dtc2IqVY.js";function ni(e){const t=[],r=String(e||"");let n=r.indexOf(","),i=0,a=!1;for(;!a;){n===-1&&(n=r.length,a=!0);const l=r.slice(i,n).trim();(l||!a)&&t.push(l),i=n+1,n=r.indexOf(",",i)}return t}function Js(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const eo=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,to=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ro={};function ii(e,t){return(ro.jsx?to:eo).test(e)}const no=/[ \t\n\f\r]/g;function io(e){return typeof e=="object"?e.type==="text"?ai(e.value):!1:ai(e)}function ai(e){return e.replace(no,"")===""}class Sr{constructor(t,r,n){this.normal=r,this.property=t,n&&(this.space=n)}}Sr.prototype.normal={};Sr.prototype.property={};Sr.prototype.space=void 0;function qa(e,t){const r={},n={};for(const i of e)Object.assign(r,i.property),Object.assign(n,i.normal);return new Sr(r,n,t)}function yr(e){return e.toLowerCase()}class He{constructor(t,r){this.attribute=r,this.property=t}}He.prototype.attribute="";He.prototype.booleanish=!1;He.prototype.boolean=!1;He.prototype.commaOrSpaceSeparated=!1;He.prototype.commaSeparated=!1;He.prototype.defined=!1;He.prototype.mustUseProperty=!1;He.prototype.number=!1;He.prototype.overloadedBoolean=!1;He.prototype.property="";He.prototype.spaceSeparated=!1;He.prototype.space=void 0;let ao=0;const te=qt(),Ae=qt(),Kn=qt(),R=qt(),pe=qt(),Kt=qt(),Ue=qt();function qt(){return 2**++ao}const Zn=Object.freeze(Object.defineProperty({__proto__:null,boolean:te,booleanish:Ae,commaOrSpaceSeparated:Ue,commaSeparated:Kt,number:R,overloadedBoolean:Kn,spaceSeparated:pe},Symbol.toStringTag,{value:"Module"})),vn=Object.keys(Zn);class v0 extends He{constructor(t,r,n,i){let a=-1;if(super(t,r),li(this,"space",i),typeof n=="number")for(;++a4&&r.slice(0,4)==="data"&&co.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(si,mo);n="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!si.test(a)){let l=a.replace(uo,ho);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=v0}return new i(n,t)}function ho(e){return"-"+e.toLowerCase()}function mo(e){return e.charAt(1).toUpperCase()}const Wa=qa([Ha,lo,$a,Ua,_a],"html"),tn=qa([Ha,so,$a,Ua,_a],"svg");function oi(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function fo(e){return e.join(" ").trim()}var Gt={},yn,ui;function po(){if(ui)return yn;ui=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,s=/^\s+|\s+$/g,o=` +`,u="/",h="*",m="",d="comment",p="declaration";function y(M,S){if(typeof M!="string")throw new TypeError("First argument must be a string");if(!M)return[];S=S||{};var z=1,I=1;function V(Y){var q=Y.match(t);q&&(z+=q.length);var ae=Y.lastIndexOf(o);I=~ae?Y.length-ae:I+Y.length}function O(){var Y={line:z,column:I};return function(q){return q.position=new E(Y),U(),q}}function E(Y){this.start=Y,this.end={line:z,column:I},this.source=S.source}E.prototype.content=M;function G(Y){var q=new Error(S.source+":"+z+":"+I+": "+Y);if(q.reason=Y,q.filename=S.source,q.line=z,q.column=I,q.source=M,!S.silent)throw q}function K(Y){var q=Y.exec(M);if(q){var ae=q[0];return V(ae),M=M.slice(ae.length),q}}function U(){K(r)}function D(Y){var q;for(Y=Y||[];q=$();)q!==!1&&Y.push(q);return Y}function $(){var Y=O();if(!(u!=M.charAt(0)||h!=M.charAt(1))){for(var q=2;m!=M.charAt(q)&&(h!=M.charAt(q)||u!=M.charAt(q+1));)++q;if(q+=2,m===M.charAt(q-1))return G("End of comment missing");var ae=M.slice(2,q-2);return I+=2,V(ae),M=M.slice(q),I+=2,Y({type:d,comment:ae})}}function j(){var Y=O(),q=K(n);if(q){if($(),!K(i))return G("property missing ':'");var ae=K(a),fe=Y({type:p,property:w(q[0].replace(e,m)),value:ae?w(ae[0].replace(e,m)):m});return K(l),fe}}function ie(){var Y=[];D(Y);for(var q;q=j();)q!==!1&&(Y.push(q),D(Y));return Y}return U(),ie()}function w(M){return M?M.replace(s,m):m}return yn=y,yn}var ci;function go(){if(ci)return Gt;ci=1;var e=Gt&&Gt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.default=r;const t=e(po());function r(n,i){let a=null;if(!n||typeof n!="string")return a;const l=(0,t.default)(n),s=typeof i=="function";return l.forEach(o=>{if(o.type!=="declaration")return;const{property:u,value:h}=o;s?i(u,h,o):h&&(a=a||{},a[u]=h)}),a}return Gt}var ur={},hi;function vo(){if(hi)return ur;hi=1,Object.defineProperty(ur,"__esModule",{value:!0}),ur.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,n=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(u){return!u||r.test(u)||e.test(u)},l=function(u,h){return h.toUpperCase()},s=function(u,h){return"".concat(h,"-")},o=function(u,h){return h===void 0&&(h={}),a(u)?u:(u=u.toLowerCase(),h.reactCompat?u=u.replace(i,s):u=u.replace(n,s),u.replace(t,l))};return ur.camelCase=o,ur}var cr,mi;function yo(){if(mi)return cr;mi=1;var e=cr&&cr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(go()),r=vo();function n(i,a){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(s,o){s&&o&&(l[(0,r.camelCase)(s,a)]=o)}),l}return n.default=n,cr=n,cr}var bo=yo();const xo=Oa(bo),Ya=Xa("end"),y0=Xa("start");function Xa(e){return t;function t(r){const n=r&&r.position&&r.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function wo(e){const t=y0(e),r=Ya(e);if(t&&r)return{start:t,end:r}}function pr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?fi(e.position):"start"in e||"end"in e?fi(e):"line"in e||"column"in e?Qn(e):""}function Qn(e){return pi(e&&e.line)+":"+pi(e&&e.column)}function fi(e){return Qn(e&&e.start)+"-"+Qn(e&&e.end)}function pi(e){return e&&typeof e=="number"?e:1}class Ee extends Error{constructor(t,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let i="",a={},l=!1;if(r&&("line"in r&&"column"in r?a={place:r}:"start"in r&&"end"in r?a={place:r}:"type"in r?a={ancestors:[r],place:r.position}:a={...r}),typeof t=="string"?i=t:!a.cause&&t&&(l=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof n=="string"){const o=n.indexOf(":");o===-1?a.ruleId=n:(a.source=n.slice(0,o),a.ruleId=n.slice(o+1))}if(!a.place&&a.ancestors&&a.ancestors){const o=a.ancestors[a.ancestors.length-1];o&&(a.place=o.position)}const s=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=pr(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ee.prototype.file="";Ee.prototype.name="";Ee.prototype.reason="";Ee.prototype.message="";Ee.prototype.stack="";Ee.prototype.column=void 0;Ee.prototype.line=void 0;Ee.prototype.ancestors=void 0;Ee.prototype.cause=void 0;Ee.prototype.fatal=void 0;Ee.prototype.place=void 0;Ee.prototype.ruleId=void 0;Ee.prototype.source=void 0;const b0={}.hasOwnProperty,ko=new Map,So=/[A-Z]/g,Ao=new Set(["table","tbody","thead","tfoot","tr"]),To=new Set(["td","th"]),Ka="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function zo(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let n;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=Fo(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=No(r,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:n,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?tn:Wa,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Za(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Za(e,t,r){if(t.type==="element")return Mo(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Co(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Do(e,t,r);if(t.type==="mdxjsEsm")return Eo(e,t);if(t.type==="root")return Io(e,t,r);if(t.type==="text")return Bo(e,t)}function Mo(e,t,r){const n=e.schema;let i=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(i=tn,e.schema=i),e.ancestors.push(t);const a=Ja(e,t.tagName,!1),l=Lo(e,t);let s=w0(e,t);return Ao.has(t.tagName)&&(s=s.filter(function(o){return typeof o=="string"?!io(o):!0})),Qa(e,l,a,t),x0(l,s),e.ancestors.pop(),e.schema=n,e.create(t,a,l,r)}function Co(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}br(e,t.position)}function Eo(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);br(e,t.position)}function Do(e,t,r){const n=e.schema;let i=n;t.name==="svg"&&n.space==="html"&&(i=tn,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:Ja(e,t.name,!0),l=Ro(e,t),s=w0(e,t);return Qa(e,l,a,t),x0(l,s),e.ancestors.pop(),e.schema=n,e.create(t,a,l,r)}function Io(e,t,r){const n={};return x0(n,w0(e,t)),e.create(t,e.Fragment,n,r)}function Bo(e,t){return t.value}function Qa(e,t,r,n){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=n)}function x0(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function No(e,t,r){return n;function n(i,a,l,s){const u=Array.isArray(l.children)?r:t;return s?u(a,l,s):u(a,l)}}function Fo(e,t){return r;function r(n,i,a,l){const s=Array.isArray(a.children),o=y0(n);return t(i,a,l,s,{columnNumber:o?o.column-1:void 0,fileName:e,lineNumber:o?o.line:void 0},void 0)}}function Lo(e,t){const r={};let n,i;for(i in t.properties)if(i!=="children"&&b0.call(t.properties,i)){const a=Po(e,i,t.properties[i]);if(a){const[l,s]=a;e.tableCellAlignToStyle&&l==="align"&&typeof s=="string"&&To.has(t.tagName)?n=s:r[l]=s}}if(n){const a=r.style||(r.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return r}function Ro(e,t){const r={};for(const n of t.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){const a=n.data.estree.body[0];a.type;const l=a.expression;l.type;const s=l.properties[0];s.type,Object.assign(r,e.evaluater.evaluateExpression(s.argument))}else br(e,t.position);else{const i=n.name;let a;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){const s=n.value.data.estree.body[0];s.type,a=e.evaluater.evaluateExpression(s.expression)}else br(e,t.position);else a=n.value===null?!0:n.value;r[i]=a}return r}function w0(e,t){const r=[];let n=-1;const i=e.passKeys?new Map:ko;for(;++ni?0:i+t:t=t>i?i:t,r=r>0?r:0,n.length<1e4)l=Array.from(n),l.unshift(t,r),e.splice(...l);else for(r&&e.splice(t,r);a0?(Ge(e,e.length,0,t),e):t}const vi={}.hasOwnProperty;function tl(e){const t={};let r=-1;for(;++r13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function it(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ne=It(/[A-Za-z]/),Ce=It(/[\dA-Za-z]/),Go=It(/[#-'*+\--9=?A-Z^-~]/);function Gr(e){return e!==null&&(e<32||e===127)}const Jn=It(/\d/),Wo=It(/[\dA-Fa-f]/),Yo=It(/[!-/:-@[-`{-~]/);function X(e){return e!==null&&e<-2}function he(e){return e!==null&&(e<0||e===32)}function le(e){return e===-2||e===-1||e===32}const rn=It(new RegExp("\\p{P}|\\p{S}","u")),Ot=It(/\s/);function It(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function tr(e){const t=[];let r=-1,n=0,i=0;for(;++r55295&&a<57344){const s=e.charCodeAt(r+1);a<56320&&s>56319&&s<57344?(l=String.fromCharCode(a,s),i=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(n,r),encodeURIComponent(l)),n=r+i+1,l=""),i&&(r+=i,i=0)}return t.join("")+e.slice(n)}function ne(e,t,r,n){const i=n?n-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(o){return le(o)?(e.enter(r),s(o)):t(o)}function s(o){return le(o)&&a++l))return;const G=t.events.length;let K=G,U,D;for(;K--;)if(t.events[K][0]==="exit"&&t.events[K][1].type==="chunkFlow"){if(U){D=t.events[K][1].end;break}U=!0}for(S(n),E=G;EI;){const O=r[V];t.containerState=O[1],O[0].exit.call(t,e)}r.length=I}function z(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Jo(e,t,r){return ne(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Qt(e){if(e===null||he(e)||Ot(e))return 1;if(rn(e))return 2}function nn(e,t,r){const n=[];let i=-1;for(;++i1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const m={...e[n][1].end},d={...e[r][1].start};bi(m,-o),bi(d,o),l={type:o>1?"strongSequence":"emphasisSequence",start:m,end:{...e[n][1].end}},s={type:o>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:d},a={type:o>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[r][1].start}},i={type:o>1?"strong":"emphasis",start:{...l.start},end:{...s.end}},e[n][1].end={...l.start},e[r][1].start={...s.end},u=[],e[n][1].end.offset-e[n][1].start.offset&&(u=Ke(u,[["enter",e[n][1],t],["exit",e[n][1],t]])),u=Ke(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",a,t]]),u=Ke(u,nn(t.parser.constructs.insideSpan.null,e.slice(n+1,r),t)),u=Ke(u,[["exit",a,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[r][1].end.offset-e[r][1].start.offset?(h=2,u=Ke(u,[["enter",e[r][1],t],["exit",e[r][1],t]])):h=0,Ge(e,n-1,r-n+3,u),r=n+u.length-h-2;break}}for(r=-1;++r0&&le(E)?ne(e,z,"linePrefix",a+1)(E):z(E)}function z(E){return E===null||X(E)?e.check(xi,w,V)(E):(e.enter("codeFlowValue"),I(E))}function I(E){return E===null||X(E)?(e.exit("codeFlowValue"),z(E)):(e.consume(E),I)}function V(E){return e.exit("codeFenced"),t(E)}function O(E,G,K){let U=0;return D;function D(q){return E.enter("lineEnding"),E.consume(q),E.exit("lineEnding"),$}function $(q){return E.enter("codeFencedFence"),le(q)?ne(E,j,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):j(q)}function j(q){return q===s?(E.enter("codeFencedFenceSequence"),ie(q)):K(q)}function ie(q){return q===s?(U++,E.consume(q),ie):U>=l?(E.exit("codeFencedFenceSequence"),le(q)?ne(E,Y,"whitespace")(q):Y(q)):K(q)}function Y(q){return q===null||X(q)?(E.exit("codeFencedFence"),G(q)):K(q)}}}function hu(e,t,r){const n=this;return i;function i(l){return l===null?r(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return n.parser.lazy[n.now().line]?r(l):t(l)}}const xn={name:"codeIndented",tokenize:fu},mu={partial:!0,tokenize:pu};function fu(e,t,r){const n=this;return i;function i(u){return e.enter("codeIndented"),ne(e,a,"linePrefix",5)(u)}function a(u){const h=n.events[n.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?l(u):r(u)}function l(u){return u===null?o(u):X(u)?e.attempt(mu,l,o)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||X(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),s)}function o(u){return e.exit("codeIndented"),t(u)}}function pu(e,t,r){const n=this;return i;function i(l){return n.parser.lazy[n.now().line]?r(l):X(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):ne(e,a,"linePrefix",5)(l)}function a(l){const s=n.events[n.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(l):X(l)?i(l):r(l)}}const du={name:"codeText",previous:vu,resolve:gu,tokenize:yu};function gu(e){let t=e.length-4,r=3,n,i;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=r;++n=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(t,r,n){const i=r||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&hr(this.left,n),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),hr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),hr(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(l):e.interrupt(n.parser.constructs.flow,r,t)(l)}}function sl(e,t,r,n,i,a,l,s,o){const u=o||Number.POSITIVE_INFINITY;let h=0;return m;function m(S){return S===60?(e.enter(n),e.enter(i),e.enter(a),e.consume(S),e.exit(a),d):S===null||S===32||S===41||Gr(S)?r(S):(e.enter(n),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),w(S))}function d(S){return S===62?(e.enter(a),e.consume(S),e.exit(a),e.exit(i),e.exit(n),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(S))}function p(S){return S===62?(e.exit("chunkString"),e.exit(s),d(S)):S===null||S===60||X(S)?r(S):(e.consume(S),S===92?y:p)}function y(S){return S===60||S===62||S===92?(e.consume(S),p):p(S)}function w(S){return!h&&(S===null||S===41||he(S))?(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(n),t(S)):h999||p===null||p===91||p===93&&!o||p===94&&!s&&"_hiddenFootnoteSupport"in l.parser.constructs?r(p):p===93?(e.exit(a),e.enter(i),e.consume(p),e.exit(i),e.exit(n),t):X(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),m(p))}function m(p){return p===null||p===91||p===93||X(p)||s++>999?(e.exit("chunkString"),h(p)):(e.consume(p),o||(o=!le(p)),p===92?d:m)}function d(p){return p===91||p===92||p===93?(e.consume(p),s++,m):m(p)}}function ul(e,t,r,n,i,a){let l;return s;function s(d){return d===34||d===39||d===40?(e.enter(n),e.enter(i),e.consume(d),e.exit(i),l=d===40?41:d,o):r(d)}function o(d){return d===l?(e.enter(i),e.consume(d),e.exit(i),e.exit(n),t):(e.enter(a),u(d))}function u(d){return d===l?(e.exit(a),o(l)):d===null?r(d):X(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),ne(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(d))}function h(d){return d===l||d===null||X(d)?(e.exit("chunkString"),u(d)):(e.consume(d),d===92?m:h)}function m(d){return d===l||d===92?(e.consume(d),h):h(d)}}function dr(e,t){let r;return n;function n(i){return X(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),r=!0,n):le(i)?ne(e,n,r?"linePrefix":"lineSuffix")(i):t(i)}}const zu={name:"definition",tokenize:Cu},Mu={partial:!0,tokenize:Eu};function Cu(e,t,r){const n=this;let i;return a;function a(p){return e.enter("definition"),l(p)}function l(p){return ol.call(n,e,s,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function s(p){return i=it(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),o):r(p)}function o(p){return he(p)?dr(e,u)(p):u(p)}function u(p){return sl(e,h,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function h(p){return e.attempt(Mu,m,m)(p)}function m(p){return le(p)?ne(e,d,"whitespace")(p):d(p)}function d(p){return p===null||X(p)?(e.exit("definition"),n.parser.defined.push(i),t(p)):r(p)}}function Eu(e,t,r){return n;function n(s){return he(s)?dr(e,i)(s):r(s)}function i(s){return ul(e,a,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function a(s){return le(s)?ne(e,l,"whitespace")(s):l(s)}function l(s){return s===null||X(s)?t(s):r(s)}}const Du={name:"hardBreakEscape",tokenize:Iu};function Iu(e,t,r){return n;function n(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return X(a)?(e.exit("hardBreakEscape"),t(a)):r(a)}}const Bu={name:"headingAtx",resolve:Nu,tokenize:Fu};function Nu(e,t){let r=e.length-2,n=3,i,a;return e[n][1].type==="whitespace"&&(n+=2),r-2>n&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&e[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(i={type:"atxHeadingText",start:e[n][1].start,end:e[r][1].end},a={type:"chunkText",start:e[n][1].start,end:e[r][1].end,contentType:"text"},Ge(e,n,r-n+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function Fu(e,t,r){let n=0;return i;function i(h){return e.enter("atxHeading"),a(h)}function a(h){return e.enter("atxHeadingSequence"),l(h)}function l(h){return h===35&&n++<6?(e.consume(h),l):h===null||he(h)?(e.exit("atxHeadingSequence"),s(h)):r(h)}function s(h){return h===35?(e.enter("atxHeadingSequence"),o(h)):h===null||X(h)?(e.exit("atxHeading"),t(h)):le(h)?ne(e,s,"whitespace")(h):(e.enter("atxHeadingText"),u(h))}function o(h){return h===35?(e.consume(h),o):(e.exit("atxHeadingSequence"),s(h))}function u(h){return h===null||h===35||he(h)?(e.exit("atxHeadingText"),s(h)):(e.consume(h),u)}}const Lu=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ki=["pre","script","style","textarea"],Ru={concrete:!0,name:"htmlFlow",resolveTo:qu,tokenize:Hu},Pu={partial:!0,tokenize:ju},Ou={partial:!0,tokenize:Vu};function qu(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Hu(e,t,r){const n=this;let i,a,l,s,o;return u;function u(A){return h(A)}function h(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),m}function m(A){return A===33?(e.consume(A),d):A===47?(e.consume(A),a=!0,w):A===63?(e.consume(A),i=3,n.interrupt?t:k):Ne(A)?(e.consume(A),l=String.fromCharCode(A),M):r(A)}function d(A){return A===45?(e.consume(A),i=2,p):A===91?(e.consume(A),i=5,s=0,y):Ne(A)?(e.consume(A),i=4,n.interrupt?t:k):r(A)}function p(A){return A===45?(e.consume(A),n.interrupt?t:k):r(A)}function y(A){const De="CDATA[";return A===De.charCodeAt(s++)?(e.consume(A),s===De.length?n.interrupt?t:j:y):r(A)}function w(A){return Ne(A)?(e.consume(A),l=String.fromCharCode(A),M):r(A)}function M(A){if(A===null||A===47||A===62||he(A)){const De=A===47,Re=l.toLowerCase();return!De&&!a&&ki.includes(Re)?(i=1,n.interrupt?t(A):j(A)):Lu.includes(l.toLowerCase())?(i=6,De?(e.consume(A),S):n.interrupt?t(A):j(A)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(A):a?z(A):I(A))}return A===45||Ce(A)?(e.consume(A),l+=String.fromCharCode(A),M):r(A)}function S(A){return A===62?(e.consume(A),n.interrupt?t:j):r(A)}function z(A){return le(A)?(e.consume(A),z):D(A)}function I(A){return A===47?(e.consume(A),D):A===58||A===95||Ne(A)?(e.consume(A),V):le(A)?(e.consume(A),I):D(A)}function V(A){return A===45||A===46||A===58||A===95||Ce(A)?(e.consume(A),V):O(A)}function O(A){return A===61?(e.consume(A),E):le(A)?(e.consume(A),O):I(A)}function E(A){return A===null||A===60||A===61||A===62||A===96?r(A):A===34||A===39?(e.consume(A),o=A,G):le(A)?(e.consume(A),E):K(A)}function G(A){return A===o?(e.consume(A),o=null,U):A===null||X(A)?r(A):(e.consume(A),G)}function K(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||he(A)?O(A):(e.consume(A),K)}function U(A){return A===47||A===62||le(A)?I(A):r(A)}function D(A){return A===62?(e.consume(A),$):r(A)}function $(A){return A===null||X(A)?j(A):le(A)?(e.consume(A),$):r(A)}function j(A){return A===45&&i===2?(e.consume(A),ae):A===60&&i===1?(e.consume(A),fe):A===62&&i===4?(e.consume(A),ke):A===63&&i===3?(e.consume(A),k):A===93&&i===5?(e.consume(A),je):X(A)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Pu,be,ie)(A)):A===null||X(A)?(e.exit("htmlFlowData"),ie(A)):(e.consume(A),j)}function ie(A){return e.check(Ou,Y,be)(A)}function Y(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),q}function q(A){return A===null||X(A)?ie(A):(e.enter("htmlFlowData"),j(A))}function ae(A){return A===45?(e.consume(A),k):j(A)}function fe(A){return A===47?(e.consume(A),l="",Me):j(A)}function Me(A){if(A===62){const De=l.toLowerCase();return ki.includes(De)?(e.consume(A),ke):j(A)}return Ne(A)&&l.length<8?(e.consume(A),l+=String.fromCharCode(A),Me):j(A)}function je(A){return A===93?(e.consume(A),k):j(A)}function k(A){return A===62?(e.consume(A),ke):A===45&&i===2?(e.consume(A),k):j(A)}function ke(A){return A===null||X(A)?(e.exit("htmlFlowData"),be(A)):(e.consume(A),ke)}function be(A){return e.exit("htmlFlow"),t(A)}}function Vu(e,t,r){const n=this;return i;function i(l){return X(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):r(l)}function a(l){return n.parser.lazy[n.now().line]?r(l):t(l)}}function ju(e,t,r){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ar,t,r)}}const $u={name:"htmlText",tokenize:Uu};function Uu(e,t,r){const n=this;let i,a,l;return s;function s(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),o}function o(k){return k===33?(e.consume(k),u):k===47?(e.consume(k),O):k===63?(e.consume(k),I):Ne(k)?(e.consume(k),K):r(k)}function u(k){return k===45?(e.consume(k),h):k===91?(e.consume(k),a=0,y):Ne(k)?(e.consume(k),z):r(k)}function h(k){return k===45?(e.consume(k),p):r(k)}function m(k){return k===null?r(k):k===45?(e.consume(k),d):X(k)?(l=m,fe(k)):(e.consume(k),m)}function d(k){return k===45?(e.consume(k),p):m(k)}function p(k){return k===62?ae(k):k===45?d(k):m(k)}function y(k){const ke="CDATA[";return k===ke.charCodeAt(a++)?(e.consume(k),a===ke.length?w:y):r(k)}function w(k){return k===null?r(k):k===93?(e.consume(k),M):X(k)?(l=w,fe(k)):(e.consume(k),w)}function M(k){return k===93?(e.consume(k),S):w(k)}function S(k){return k===62?ae(k):k===93?(e.consume(k),S):w(k)}function z(k){return k===null||k===62?ae(k):X(k)?(l=z,fe(k)):(e.consume(k),z)}function I(k){return k===null?r(k):k===63?(e.consume(k),V):X(k)?(l=I,fe(k)):(e.consume(k),I)}function V(k){return k===62?ae(k):I(k)}function O(k){return Ne(k)?(e.consume(k),E):r(k)}function E(k){return k===45||Ce(k)?(e.consume(k),E):G(k)}function G(k){return X(k)?(l=G,fe(k)):le(k)?(e.consume(k),G):ae(k)}function K(k){return k===45||Ce(k)?(e.consume(k),K):k===47||k===62||he(k)?U(k):r(k)}function U(k){return k===47?(e.consume(k),ae):k===58||k===95||Ne(k)?(e.consume(k),D):X(k)?(l=U,fe(k)):le(k)?(e.consume(k),U):ae(k)}function D(k){return k===45||k===46||k===58||k===95||Ce(k)?(e.consume(k),D):$(k)}function $(k){return k===61?(e.consume(k),j):X(k)?(l=$,fe(k)):le(k)?(e.consume(k),$):U(k)}function j(k){return k===null||k===60||k===61||k===62||k===96?r(k):k===34||k===39?(e.consume(k),i=k,ie):X(k)?(l=j,fe(k)):le(k)?(e.consume(k),j):(e.consume(k),Y)}function ie(k){return k===i?(e.consume(k),i=void 0,q):k===null?r(k):X(k)?(l=ie,fe(k)):(e.consume(k),ie)}function Y(k){return k===null||k===34||k===39||k===60||k===61||k===96?r(k):k===47||k===62||he(k)?U(k):(e.consume(k),Y)}function q(k){return k===47||k===62||he(k)?U(k):r(k)}function ae(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):r(k)}function fe(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),Me}function Me(k){return le(k)?ne(e,je,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):je(k)}function je(k){return e.enter("htmlTextData"),l(k)}}const A0={name:"labelEnd",resolveAll:Yu,resolveTo:Xu,tokenize:Ku},_u={tokenize:Zu},Gu={tokenize:Qu},Wu={tokenize:Ju};function Yu(e){let t=-1;const r=[];for(;++t=3&&(u===null||X(u))?(e.exit("thematicBreak"),t(u)):r(u)}function o(u){return u===i?(e.consume(u),n++,o):(e.exit("thematicBreakSequence"),le(u)?ne(e,s,"whitespace")(u):s(u))}}const Pe={continuation:{tokenize:u1},exit:h1,name:"list",tokenize:o1},l1={partial:!0,tokenize:m1},s1={partial:!0,tokenize:c1};function o1(e,t,r){const n=this,i=n.events[n.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return s;function s(p){const y=n.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!n.containerState.marker||p===n.containerState.marker:Jn(p)){if(n.containerState.type||(n.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check($r,r,u)(p):u(p);if(!n.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),o(p)}return r(p)}function o(p){return Jn(p)&&++l<10?(e.consume(p),o):(!n.interrupt||l<2)&&(n.containerState.marker?p===n.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):r(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||p,e.check(Ar,n.interrupt?r:h,e.attempt(l1,d,m))}function h(p){return n.containerState.initialBlankLine=!0,a++,d(p)}function m(p){return le(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),d):r(p)}function d(p){return n.containerState.size=a+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function u1(e,t,r){const n=this;return n.containerState._closeFlow=void 0,e.check(Ar,i,a);function i(s){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,ne(e,t,"listItemIndent",n.containerState.size+1)(s)}function a(s){return n.containerState.furtherBlankLines||!le(s)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,l(s)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(s1,t,l)(s))}function l(s){return n.containerState._closeFlow=!0,n.interrupt=void 0,ne(e,e.attempt(Pe,t,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function c1(e,t,r){const n=this;return ne(e,i,"listItemIndent",n.containerState.size+1);function i(a){const l=n.events[n.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===n.containerState.size?t(a):r(a)}}function h1(e){e.exit(this.containerState.type)}function m1(e,t,r){const n=this;return ne(e,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const l=n.events[n.events.length-1];return!le(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):r(a)}}const Si={name:"setextUnderline",resolveTo:f1,tokenize:p1};function f1(e,t){let r=e.length,n,i,a;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){n=r;break}e[r][1].type==="paragraph"&&(i=r)}else e[r][1].type==="content"&&e.splice(r,1),!a&&e[r][1].type==="definition"&&(a=r);const l={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",l,t]),e.splice(a+1,0,["exit",e[n][1],t]),e[n][1].end={...e[a][1].end}):e[n][1]=l,e.push(["exit",l,t]),e}function p1(e,t,r){const n=this;let i;return a;function a(u){let h=n.events.length,m;for(;h--;)if(n.events[h][1].type!=="lineEnding"&&n.events[h][1].type!=="linePrefix"&&n.events[h][1].type!=="content"){m=n.events[h][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||m)?(e.enter("setextHeadingLine"),i=u,l(u)):r(u)}function l(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===i?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),le(u)?ne(e,o,"lineSuffix")(u):o(u))}function o(u){return u===null||X(u)?(e.exit("setextHeadingLine"),t(u)):r(u)}}const d1={tokenize:g1};function g1(e){const t=this,r=e.attempt(Ar,n,e.attempt(this.parser.constructs.flowInitial,i,ne(e,e.attempt(this.parser.constructs.flow,i,e.attempt(wu,i)),"linePrefix")));return r;function n(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const v1={resolveAll:hl()},y1=cl("string"),b1=cl("text");function cl(e){return{resolveAll:hl(e==="text"?x1:void 0),tokenize:t};function t(r){const n=this,i=this.parser.constructs[e],a=r.attempt(i,l,s);return l;function l(h){return u(h)?a(h):s(h)}function s(h){if(h===null){r.consume(h);return}return r.enter("data"),r.consume(h),o}function o(h){return u(h)?(r.exit("data"),a(h)):(r.consume(h),o)}function u(h){if(h===null)return!0;const m=i[h];let d=-1;if(m)for(;++d-1){const s=l[0];typeof s=="string"?l[0]=s.slice(n):l.shift()}a>0&&l.push(e[i].slice(0,a))}return l}function N1(e,t){let r=-1;const n=[];let i;for(;++r0){const rt=ee.tokenStack[ee.tokenStack.length-1];(rt[1]||Ti).call(ee,void 0,rt[0])}for(H.position={start:At(B.length>0?B[0][1].start:{line:1,column:1,offset:0}),end:At(B.length>0?B[B.length-2][1].end:{line:1,column:1,offset:0})},ce=-1;++ce1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,o);const u={type:"element",tagName:"sup",properties:{},children:[o]};return e.patch(t,u),e.applyData(t,u)}function K1(e,t){const r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Z1(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function pl(e,t){const r=t.referenceType;let n="]";if(r==="collapsed"?n+="[]":r==="full"&&(n+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+n}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=n:i.push({type:"text",value:n}),i}function Q1(e,t){const r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return pl(e,t);const i={src:tr(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(i.title=n.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function J1(e,t){const r={src:tr(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);const n={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,n),e.applyData(t,n)}function ec(e,t){const r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);const n={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,n),e.applyData(t,n)}function tc(e,t){const r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return pl(e,t);const i={href:tr(n.url||"")};n.title!==null&&n.title!==void 0&&(i.title=n.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function rc(e,t){const r={href:tr(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);const n={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nc(e,t,r){const n=e.all(t),i=r?ic(r):dl(t),a={},l=[];if(typeof t.checked=="boolean"){const h=n[0];let m;h&&h.type==="element"&&h.tagName==="p"?m=h:(m={type:"element",tagName:"p",properties:{},children:[]},n.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let s=-1;for(;++s1}function ac(e,t){const r={},n=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++i0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},s=y0(t.children[1]),o=Ya(t.children[t.children.length-1]);s&&o&&(l.position={start:s,end:o}),i.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function cc(e,t,r){const n=r?r.children:void 0,a=(n?n.indexOf(t):1)===0?"th":"td",l=r&&r.type==="table"?r.align:void 0,s=l?l.length:t.children.length;let o=-1;const u=[];for(;++o0,!0),n[0]),i=n.index+n[0].length,n=r.exec(t);return a.push(Ci(t.slice(i),i>0,!1)),a.join("")}function Ci(e,t,r){let n=0,i=e.length;if(t){let a=e.codePointAt(n);for(;a===zi||a===Mi;)n++,a=e.codePointAt(n)}if(r){let a=e.codePointAt(i-1);for(;a===zi||a===Mi;)i--,a=e.codePointAt(i-1)}return i>n?e.slice(n,i):""}function fc(e,t){const r={type:"text",value:mc(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function pc(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const dc={blockquote:U1,break:_1,code:G1,delete:W1,emphasis:Y1,footnoteReference:X1,heading:K1,html:Z1,imageReference:Q1,image:J1,inlineCode:ec,linkReference:tc,link:rc,listItem:nc,list:ac,paragraph:lc,root:sc,strong:oc,table:uc,tableCell:hc,tableRow:cc,text:fc,thematicBreak:pc,toml:Dr,yaml:Dr,definition:Dr,footnoteDefinition:Dr};function Dr(){}const gl=-1,an=0,gr=1,Wr=2,T0=3,z0=4,M0=5,C0=6,vl=7,yl=8,Ei=typeof self=="object"?self:globalThis,gc=(e,t)=>{const r=(i,a)=>(e.set(a,i),i),n=i=>{if(e.has(i))return e.get(i);const[a,l]=t[i];switch(a){case an:case gl:return r(l,i);case gr:{const s=r([],i);for(const o of l)s.push(n(o));return s}case Wr:{const s=r({},i);for(const[o,u]of l)s[n(o)]=n(u);return s}case T0:return r(new Date(l),i);case z0:{const{source:s,flags:o}=l;return r(new RegExp(s,o),i)}case M0:{const s=r(new Map,i);for(const[o,u]of l)s.set(n(o),n(u));return s}case C0:{const s=r(new Set,i);for(const o of l)s.add(n(o));return s}case vl:{const{name:s,message:o}=l;return r(new Ei[s](o),i)}case yl:return r(BigInt(l),i);case"BigInt":return r(Object(BigInt(l)),i);case"ArrayBuffer":return r(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:s}=new Uint8Array(l);return r(new DataView(s),l)}}return r(new Ei[a](l),i)};return n},Di=e=>gc(new Map,e)(0),Wt="",{toString:vc}={},{keys:yc}=Object,mr=e=>{const t=typeof e;if(t!=="object"||!e)return[an,t];const r=vc.call(e).slice(8,-1);switch(r){case"Array":return[gr,Wt];case"Object":return[Wr,Wt];case"Date":return[T0,Wt];case"RegExp":return[z0,Wt];case"Map":return[M0,Wt];case"Set":return[C0,Wt];case"DataView":return[gr,r]}return r.includes("Array")?[gr,r]:r.includes("Error")?[vl,r]:[Wr,r]},Ir=([e,t])=>e===an&&(t==="function"||t==="symbol"),bc=(e,t,r,n)=>{const i=(l,s)=>{const o=n.push(l)-1;return r.set(s,o),o},a=l=>{if(r.has(l))return r.get(l);let[s,o]=mr(l);switch(s){case an:{let h=l;switch(o){case"bigint":s=yl,h=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+o);h=null;break;case"undefined":return i([gl],l)}return i([s,h],l)}case gr:{if(o){let d=l;return o==="DataView"?d=new Uint8Array(l.buffer):o==="ArrayBuffer"&&(d=new Uint8Array(l)),i([o,[...d]],l)}const h=[],m=i([s,h],l);for(const d of l)h.push(a(d));return m}case Wr:{if(o)switch(o){case"BigInt":return i([o,l.toString()],l);case"Boolean":case"Number":case"String":return i([o,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const h=[],m=i([s,h],l);for(const d of yc(l))(e||!Ir(mr(l[d])))&&h.push([a(d),a(l[d])]);return m}case T0:return i([s,l.toISOString()],l);case z0:{const{source:h,flags:m}=l;return i([s,{source:h,flags:m}],l)}case M0:{const h=[],m=i([s,h],l);for(const[d,p]of l)(e||!(Ir(mr(d))||Ir(mr(p))))&&h.push([a(d),a(p)]);return m}case C0:{const h=[],m=i([s,h],l);for(const d of l)(e||!Ir(mr(d)))&&h.push(a(d));return m}}const{message:u}=l;return i([s,{name:o,message:u}],l)};return a},Ii=(e,{json:t,lossy:r}={})=>{const n=[];return bc(!(t||r),!!t,new Map,n)(e),n},Yr=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Di(Ii(e,t)):structuredClone(e):(e,t)=>Di(Ii(e,t));function xc(e,t){const r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function wc(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function kc(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||xc,n=e.options.footnoteBackLabel||wc,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let o=-1;for(;++o0&&y.push({type:"text",value:" "});let z=typeof r=="string"?r:r(o,p);typeof z=="string"&&(z={type:"text",value:z}),y.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+d+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(o,p),className:["data-footnote-backref"]},children:Array.isArray(z)?z:[z]})}const M=h[h.length-1];if(M&&M.type==="element"&&M.tagName==="p"){const z=M.children[M.children.length-1];z&&z.type==="text"?z.value+=" ":M.children.push({type:"text",value:" "}),M.children.push(...y)}else h.push(...y);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+d},children:e.wrap(h,!0)};e.patch(u,S),s.push(S)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Yr(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:` +`}]}}const Tr=(function(e){if(e==null)return zc;if(typeof e=="function")return ln(e);if(typeof e=="object")return Array.isArray(e)?Sc(e):Ac(e);if(typeof e=="string")return Tc(e);throw new Error("Expected function, string, or object as test")});function Sc(e){const t=[];let r=-1;for(;++r":""))+")"})}return d;function d(){let p=bl,y,w,M;if((!t||a(o,u,h[h.length-1]||void 0))&&(p=Ec(r(o,h)),p[0]===t0))return p;if("children"in o&&o.children){const S=o;if(S.children&&p[0]!==xl)for(w=(n?S.children.length:-1)+l,M=h.concat(S);w>-1&&w0&&r.push({type:"text",value:` +`}),r}function Bi(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function Ni(e,t){const r=Ic(e,t),n=r.one(e,void 0),i=kc(r),a=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return i&&a.children.push({type:"text",value:` +`},i),a}function Rc(e,t){return e&&"run"in e?async function(r,n){const i=Ni(r,{file:n,...t});await e.run(i,n)}:function(r,n){return Ni(r,{file:n,...e||t})}}function Fi(e){if(e)throw e}var kn,Li;function Pc(){if(Li)return kn;Li=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):t.call(u)==="[object Array]"},a=function(u){if(!u||t.call(u)!=="[object Object]")return!1;var h=e.call(u,"constructor"),m=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!h&&!m)return!1;var d;for(d in u);return typeof d>"u"||e.call(u,d)},l=function(u,h){r&&h.name==="__proto__"?r(u,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):u[h.name]=h.newValue},s=function(u,h){if(h==="__proto__")if(e.call(u,h)){if(n)return n(u,h).value}else return;return u[h]};return kn=function o(){var u,h,m,d,p,y,w=arguments[0],M=1,S=arguments.length,z=!1;for(typeof w=="boolean"&&(z=w,w=arguments[1]||{},M=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});Ml.length;let o;s&&l.push(i);try{o=e.apply(this,l)}catch(u){const h=u;if(s&&r)throw h;return i(h)}s||(o&&o.then&&typeof o.then=="function"?o.then(a,i):o instanceof Error?i(o):a(o))}function i(l,...s){r||(r=!0,t(l,...s))}function a(l){i(null,l)}}const at={basename:Vc,dirname:jc,extname:$c,join:Uc,sep:"/"};function Vc(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');zr(e);let r=0,n=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){r=i+1;break}}else n<0&&(a=!0,n=i+1);return n<0?"":e.slice(r,n)}if(t===e)return"";let l=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){r=i+1;break}}else l<0&&(a=!0,l=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(n=i):(s=-1,n=l));return r===n?n=l:n<0&&(n=e.length),e.slice(r,n)}function jc(e){if(zr(e),e.length===0)return".";let t=-1,r=e.length,n;for(;--r;)if(e.codePointAt(r)===47){if(n){t=r;break}}else n||(n=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function $c(e){zr(e);let t=e.length,r=-1,n=0,i=-1,a=0,l;for(;t--;){const s=e.codePointAt(t);if(s===47){if(l){n=t+1;break}continue}r<0&&(l=!0,r=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||r<0||a===0||a===1&&i===r-1&&i===n+1?"":e.slice(i,r)}function Uc(...e){let t=-1,r;for(;++t0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function Gc(e,t){let r="",n=0,i=-1,a=0,l=-1,s,o;for(;++l<=e.length;){if(l2){if(o=r.lastIndexOf("/"),o!==r.length-1){o<0?(r="",n=0):(r=r.slice(0,o),n=r.length-1-r.lastIndexOf("/")),i=l,a=0;continue}}else if(r.length>0){r="",n=0,i=l,a=0;continue}}t&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+e.slice(i+1,l):r=e.slice(i+1,l),n=l-i-1;i=l,a=0}else s===46&&a>-1?a++:a=-1}return r}function zr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Wc={cwd:Yc};function Yc(){return"/"}function i0(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Xc(e){if(typeof e=="string")e=new URL(e);else if(!i0(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Kc(e)}function Kc(e){if(e.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const t=e.pathname;let r=-1;for(;++r0){let[p,...y]=h;const w=n[d][1];n0(w)&&n0(p)&&(p=Sn(!0,w,p)),n[d]=[u,p,...y]}}}}const eh=new I0().freeze();function Mn(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Cn(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function En(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Pi(e){if(!n0(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Oi(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Br(e){return th(e)?e:new wl(e)}function th(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function rh(e){return typeof e=="string"||nh(e)}function nh(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ih="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",qi=[],Hi={allowDangerousHtml:!0},ah=/^(https?|ircs?|mailto|xmpp)$/i,lh=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function s5(e){const t=sh(e),r=oh(e);return uh(t.runSync(t.parse(r),r),e)}function sh(e){const t=e.rehypePlugins||qi,r=e.remarkPlugins||qi,n=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Hi}:Hi;return eh().use($1).use(r).use(Rc,n).use(t)}function oh(e){const t=e.children||"",r=new wl;return typeof t=="string"&&(r.value=t),r}function uh(e,t){const r=t.allowedElements,n=t.allowElement,i=t.components,a=t.disallowedElements,l=t.skipHtml,s=t.unwrapDisallowed,o=t.urlTransform||ch;for(const h of lh)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+ih+h.id,void 0);return D0(e,u),zo(e,{Fragment:gn.Fragment,components:i,ignoreInvalidStyle:!0,jsx:gn.jsx,jsxs:gn.jsxs,passKeys:!0,passNode:!0});function u(h,m,d){if(h.type==="raw"&&d&&typeof m=="number")return l?d.children.splice(m,1):d.children[m]={type:"text",value:h.value},m;if(h.type==="element"){let p;for(p in bn)if(Object.hasOwn(bn,p)&&Object.hasOwn(h.properties,p)){const y=h.properties[p],w=bn[p];(w===null||w.includes(h.tagName))&&(h.properties[p]=o(String(y||""),p,h))}}if(h.type==="element"){let p=r?!r.includes(h.tagName):a?a.includes(h.tagName):!1;if(!p&&n&&typeof m=="number"&&(p=!n(h,m,d)),p&&d&&typeof m=="number")return s&&h.children?d.children.splice(m,1,...h.children):d.children.splice(m,1),m}}}function ch(e){const t=e.indexOf(":"),r=e.indexOf("?"),n=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||r!==-1&&t>r||n!==-1&&t>n||ah.test(e.slice(0,t))?e:""}function Vi(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,i=r.indexOf(t);for(;i!==-1;)n++,i=r.indexOf(t,i+t.length);return n}function hh(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function mh(e,t,r){const i=Tr((r||{}).ignore||[]),a=fh(t);let l=-1;for(;++l0?{type:"text",value:E}:void 0),E===!1?d.lastIndex=V+1:(y!==V&&z.push({type:"text",value:u.value.slice(y,V)}),Array.isArray(E)?z.push(...E):E&&z.push(E),y=V+I[0].length,S=!0),!d.global)break;I=d.exec(u.value)}return S?(y?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let r=t[0],n=r.indexOf(")");const i=Vi(e,"(");let a=Vi(e,")");for(;n!==-1&&i>a;)e+=r.slice(0,n+1),r=r.slice(n+1),n=r.indexOf(")"),a++;return[e,r]}function kl(e,t){const r=e.input.charCodeAt(e.index-1);return(e.index===0||Ot(r)||rn(r))&&(!t||r!==47)}Sl.peek=Rh;function Ch(){this.buffer()}function Eh(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Dh(){this.buffer()}function Ih(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Bh(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=it(this.sliceSerialize(e)).toLowerCase(),r.label=t}function Nh(e){this.exit(e)}function Fh(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=it(this.sliceSerialize(e)).toLowerCase(),r.label=t}function Lh(e){this.exit(e)}function Rh(){return"["}function Sl(e,t,r,n){const i=r.createTracker(n);let a=i.move("[^");const l=r.enter("footnoteReference"),s=r.enter("reference");return a+=i.move(r.safe(r.associationId(e),{after:"]",before:a})),s(),l(),a+=i.move("]"),a}function Ph(){return{enter:{gfmFootnoteCallString:Ch,gfmFootnoteCall:Eh,gfmFootnoteDefinitionLabelString:Dh,gfmFootnoteDefinition:Ih},exit:{gfmFootnoteCallString:Bh,gfmFootnoteCall:Nh,gfmFootnoteDefinitionLabelString:Fh,gfmFootnoteDefinition:Lh}}}function Oh(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:r,footnoteReference:Sl},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(n,i,a,l){const s=a.createTracker(l);let o=s.move("[^");const u=a.enter("footnoteDefinition"),h=a.enter("label");return o+=s.move(a.safe(a.associationId(n),{before:o,after:"]"})),h(),o+=s.move("]:"),n.children&&n.children.length>0&&(s.shift(4),o+=s.move((t?` +`:" ")+a.indentLines(a.containerFlow(n,s.current()),t?Al:qh))),u(),o}}function qh(e,t,r){return t===0?e:Al(e,t,r)}function Al(e,t,r){return(r?"":" ")+e}const Hh=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Tl.peek=_h;function Vh(){return{canContainEols:["delete"],enter:{strikethrough:$h},exit:{strikethrough:Uh}}}function jh(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Hh}],handlers:{delete:Tl}}}function $h(e){this.enter({type:"delete",children:[]},e)}function Uh(e){this.exit(e)}function Tl(e,t,r,n){const i=r.createTracker(n),a=r.enter("strikethrough");let l=i.move("~~");return l+=r.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),a(),l}function _h(){return"~"}function Gh(e){return e.length}function Wh(e,t){const r=t||{},n=(r.align||[]).concat(),i=r.stringLength||Gh,a=[],l=[],s=[],o=[];let u=0,h=-1;for(;++hu&&(u=e[h].length);++So[S])&&(o[S]=I)}w.push(z)}l[h]=w,s[h]=M}let m=-1;if(typeof n=="object"&&"length"in n)for(;++mo[m]&&(o[m]=z),p[m]=z),d[m]=I}l.splice(1,0,d),s.splice(1,0,p),h=-1;const y=[];for(;++h "),a.shift(2);const l=r.indentLines(r.containerFlow(e,a.current()),Kh);return i(),l}function Kh(e,t,r){return">"+(r?"":" ")+e}function Zh(e,t){return $i(e,t.inConstruct,!0)&&!$i(e,t.notInConstruct,!1)}function $i(e,t,r){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return r;let n=-1;for(;++nl&&(l=a):a=1,i=n+t.length,n=r.indexOf(t,i);return l}function Qh(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Jh(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function e4(e,t,r,n){const i=Jh(r),a=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(Qh(e,r)){const m=r.enter("codeIndented"),d=r.indentLines(a,t4);return m(),d}const s=r.createTracker(n),o=i.repeat(Math.max(zl(a,i)+1,3)),u=r.enter("codeFenced");let h=s.move(o);if(e.lang){const m=r.enter(`codeFencedLang${l}`);h+=s.move(r.safe(e.lang,{before:h,after:" ",encode:["`"],...s.current()})),m()}if(e.lang&&e.meta){const m=r.enter(`codeFencedMeta${l}`);h+=s.move(" "),h+=s.move(r.safe(e.meta,{before:h,after:` +`,encode:["`"],...s.current()})),m()}return h+=s.move(` +`),a&&(h+=s.move(a+` +`)),h+=s.move(o),u(),h}function t4(e,t,r){return(r?"":" ")+e}function B0(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function r4(e,t,r,n){const i=B0(r),a=i==='"'?"Quote":"Apostrophe",l=r.enter("definition");let s=r.enter("label");const o=r.createTracker(n);let u=o.move("[");return u+=o.move(r.safe(r.associationId(e),{before:u,after:"]",...o.current()})),u+=o.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=r.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(r.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(s=r.enter("destinationRaw"),u+=o.move(r.safe(e.url,{before:u,after:e.title?" ":` +`,...o.current()}))),s(),e.title&&(s=r.enter(`title${a}`),u+=o.move(" "+i),u+=o.move(r.safe(e.title,{before:u,after:i,...o.current()})),u+=o.move(i),s()),l(),u}function n4(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function xr(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Xr(e,t,r){const n=Qt(e),i=Qt(t);return n===void 0?i===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Ml.peek=i4;function Ml(e,t,r,n){const i=n4(r),a=r.enter("emphasis"),l=r.createTracker(n),s=l.move(i);let o=l.move(r.containerPhrasing(e,{after:i,before:s,...l.current()}));const u=o.charCodeAt(0),h=Xr(n.before.charCodeAt(n.before.length-1),u,i);h.inside&&(o=xr(u)+o.slice(1));const m=o.charCodeAt(o.length-1),d=Xr(n.after.charCodeAt(0),m,i);d.inside&&(o=o.slice(0,-1)+xr(m));const p=l.move(i);return a(),r.attentionEncodeSurroundingInfo={after:d.outside,before:h.outside},s+o+p}function i4(e,t,r){return r.options.emphasis||"*"}function a4(e,t){let r=!1;return D0(e,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return r=!0,t0}),!!((!e.depth||e.depth<3)&&k0(e)&&(t.options.setext||r))}function l4(e,t,r,n){const i=Math.max(Math.min(6,e.depth||1),1),a=r.createTracker(n);if(a4(e,r)){const h=r.enter("headingSetext"),m=r.enter("phrasing"),d=r.containerPhrasing(e,{...a.current(),before:` +`,after:` +`});return m(),h(),d+` +`+(i===1?"=":"-").repeat(d.length-(Math.max(d.lastIndexOf("\r"),d.lastIndexOf(` +`))+1))}const l="#".repeat(i),s=r.enter("headingAtx"),o=r.enter("phrasing");a.move(l+" ");let u=r.containerPhrasing(e,{before:"# ",after:` +`,...a.current()});return/^[\t ]/.test(u)&&(u=xr(u.charCodeAt(0))+u.slice(1)),u=u?l+" "+u:l,r.options.closeAtx&&(u+=" "+l),o(),s(),u}Cl.peek=s4;function Cl(e){return e.value||""}function s4(){return"<"}El.peek=o4;function El(e,t,r,n){const i=B0(r),a=i==='"'?"Quote":"Apostrophe",l=r.enter("image");let s=r.enter("label");const o=r.createTracker(n);let u=o.move("![");return u+=o.move(r.safe(e.alt,{before:u,after:"]",...o.current()})),u+=o.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=r.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(r.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(s=r.enter("destinationRaw"),u+=o.move(r.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),s(),e.title&&(s=r.enter(`title${a}`),u+=o.move(" "+i),u+=o.move(r.safe(e.title,{before:u,after:i,...o.current()})),u+=o.move(i),s()),u+=o.move(")"),l(),u}function o4(){return"!"}Dl.peek=u4;function Dl(e,t,r,n){const i=e.referenceType,a=r.enter("imageReference");let l=r.enter("label");const s=r.createTracker(n);let o=s.move("![");const u=r.safe(e.alt,{before:o,after:"]",...s.current()});o+=s.move(u+"]["),l();const h=r.stack;r.stack=[],l=r.enter("reference");const m=r.safe(r.associationId(e),{before:o,after:"]",...s.current()});return l(),r.stack=h,a(),i==="full"||!u||u!==m?o+=s.move(m+"]"):i==="shortcut"?o=o.slice(0,-1):o+=s.move("]"),o}function u4(){return"!"}Il.peek=c4;function Il(e,t,r){let n=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(n);)i+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++a\u007F]/.test(e.url))}Nl.peek=h4;function Nl(e,t,r,n){const i=B0(r),a=i==='"'?"Quote":"Apostrophe",l=r.createTracker(n);let s,o;if(Bl(e,r)){const h=r.stack;r.stack=[],s=r.enter("autolink");let m=l.move("<");return m+=l.move(r.containerPhrasing(e,{before:m,after:">",...l.current()})),m+=l.move(">"),s(),r.stack=h,m}s=r.enter("link"),o=r.enter("label");let u=l.move("[");return u+=l.move(r.containerPhrasing(e,{before:u,after:"](",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=r.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(r.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=r.enter("destinationRaw"),u+=l.move(r.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=r.enter(`title${a}`),u+=l.move(" "+i),u+=l.move(r.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),o()),u+=l.move(")"),s(),u}function h4(e,t,r){return Bl(e,r)?"<":"["}Fl.peek=m4;function Fl(e,t,r,n){const i=e.referenceType,a=r.enter("linkReference");let l=r.enter("label");const s=r.createTracker(n);let o=s.move("[");const u=r.containerPhrasing(e,{before:o,after:"]",...s.current()});o+=s.move(u+"]["),l();const h=r.stack;r.stack=[],l=r.enter("reference");const m=r.safe(r.associationId(e),{before:o,after:"]",...s.current()});return l(),r.stack=h,a(),i==="full"||!u||u!==m?o+=s.move(m+"]"):i==="shortcut"?o=o.slice(0,-1):o+=s.move("]"),o}function m4(){return"["}function N0(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function f4(e){const t=N0(e),r=e.options.bulletOther;if(!r)return t==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+r+"`) to be different");return r}function p4(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Ll(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function d4(e,t,r,n){const i=r.enter("list"),a=r.bulletCurrent;let l=e.ordered?p4(r):N0(r);const s=e.ordered?l==="."?")":".":f4(r);let o=t&&r.bulletLastUsed?l===r.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&h&&(!h.children||!h.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(o=!0),Ll(r)===l&&h){let m=-1;for(;++m-1?t.start:1)+(r.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let l=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const s=r.createTracker(n);s.move(a+" ".repeat(l-a.length)),s.shift(l);const o=r.enter("listItem"),u=r.indentLines(r.containerFlow(e,s.current()),h);return o(),u;function h(m,d,p){return d?(p?"":" ".repeat(l))+m:(p?a:a+" ".repeat(l-a.length))+m}}function y4(e,t,r,n){const i=r.enter("paragraph"),a=r.enter("phrasing"),l=r.containerPhrasing(e,n);return a(),i(),l}const b4=Tr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function x4(e,t,r,n){return(e.children.some(function(l){return b4(l)})?r.containerPhrasing:r.containerFlow).call(r,e,n)}function w4(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Rl.peek=k4;function Rl(e,t,r,n){const i=w4(r),a=r.enter("strong"),l=r.createTracker(n),s=l.move(i+i);let o=l.move(r.containerPhrasing(e,{after:i,before:s,...l.current()}));const u=o.charCodeAt(0),h=Xr(n.before.charCodeAt(n.before.length-1),u,i);h.inside&&(o=xr(u)+o.slice(1));const m=o.charCodeAt(o.length-1),d=Xr(n.after.charCodeAt(0),m,i);d.inside&&(o=o.slice(0,-1)+xr(m));const p=l.move(i+i);return a(),r.attentionEncodeSurroundingInfo={after:d.outside,before:h.outside},s+o+p}function k4(e,t,r){return r.options.strong||"*"}function S4(e,t,r,n){return r.safe(e.value,n)}function A4(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function T4(e,t,r){const n=(Ll(r)+(r.options.ruleSpaces?" ":"")).repeat(A4(r));return r.options.ruleSpaces?n.slice(0,-1):n}const Pl={blockquote:Xh,break:Ui,code:e4,definition:r4,emphasis:Ml,hardBreak:Ui,heading:l4,html:Cl,image:El,imageReference:Dl,inlineCode:Il,link:Nl,linkReference:Fl,list:d4,listItem:v4,paragraph:y4,root:x4,strong:Rl,text:S4,thematicBreak:T4};function z4(){return{enter:{table:M4,tableData:_i,tableHeader:_i,tableRow:E4},exit:{codeText:D4,table:C4,tableData:Nn,tableHeader:Nn,tableRow:Nn}}}function M4(e){const t=e._align;this.enter({type:"table",align:t.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function C4(e){this.exit(e),this.data.inTable=void 0}function E4(e){this.enter({type:"tableRow",children:[]},e)}function Nn(e){this.exit(e)}function _i(e){this.enter({type:"tableCell",children:[]},e)}function D4(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,I4));const r=this.stack[this.stack.length-1];r.type,r.value=t,this.exit(e)}function I4(e,t){return t==="|"?t:e}function B4(e){const t=e||{},r=t.tableCellPadding,n=t.tablePipeAlign,i=t.stringLength,a=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:d,table:l,tableCell:o,tableRow:s}};function l(p,y,w,M){return u(h(p,w,M),p.align)}function s(p,y,w,M){const S=m(p,w,M),z=u([S]);return z.slice(0,z.indexOf(` +`))}function o(p,y,w,M){const S=w.enter("tableCell"),z=w.enter("phrasing"),I=w.containerPhrasing(p,{...M,before:a,after:a});return z(),S(),I}function u(p,y){return Wh(p,{align:y,alignDelimiters:n,padding:r,stringLength:i})}function h(p,y,w){const M=p.children;let S=-1;const z=[],I=y.enter("table");for(;++S0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const K4={tokenize:im,partial:!0};function Z4(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:tm,continuation:{tokenize:rm},exit:nm}},text:{91:{name:"gfmFootnoteCall",tokenize:em},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Q4,resolveTo:J4}}}}function Q4(e,t,r){const n=this;let i=n.events.length;const a=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let l;for(;i--;){const o=n.events[i][1];if(o.type==="labelImage"){l=o;break}if(o.type==="gfmFootnoteCall"||o.type==="labelLink"||o.type==="label"||o.type==="image"||o.type==="link")break}return s;function s(o){if(!l||!l._balanced)return r(o);const u=it(n.sliceSerialize({start:l.end,end:n.now()}));return u.codePointAt(0)!==94||!a.includes(u.slice(1))?r(o):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),t(o))}}function J4(e,t){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const n={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[r+1],e[r+2],["enter",n,t],e[r+3],e[r+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",n,t]];return e.splice(r,e.length-r+1,...s),e}function em(e,t,r){const n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let a=0,l;return s;function s(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),o}function o(m){return m!==94?r(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(m){if(a>999||m===93&&!l||m===null||m===91||he(m))return r(m);if(m===93){e.exit("chunkString");const d=e.exit("gfmFootnoteCallString");return i.includes(it(n.sliceSerialize(d)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):r(m)}return he(m)||(l=!0),a++,e.consume(m),m===92?h:u}function h(m){return m===91||m===92||m===93?(e.consume(m),a++,u):u(m)}}function tm(e,t,r){const n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let a,l=0,s;return o;function o(y){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(y){return y===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):r(y)}function h(y){if(l>999||y===93&&!s||y===null||y===91||he(y))return r(y);if(y===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return a=it(n.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return he(y)||(s=!0),l++,e.consume(y),y===92?m:h}function m(y){return y===91||y===92||y===93?(e.consume(y),l++,h):h(y)}function d(y){return y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),i.includes(a)||i.push(a),ne(e,p,"gfmFootnoteDefinitionWhitespace")):r(y)}function p(y){return t(y)}}function rm(e,t,r){return e.check(Ar,t,e.attempt(K4,t,r))}function nm(e){e.exit("gfmFootnoteDefinition")}function im(e,t,r){const n=this;return ne(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const l=n.events[n.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(a):r(a)}}function am(e){let r=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:a,resolveAll:i};return r==null&&(r=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function i(l,s){let o=-1;for(;++o1?o(y):(l.consume(y),m++,p);if(m<2&&!r)return o(y);const M=l.exit("strikethroughSequenceTemporary"),S=Qt(y);return M._open=!S||S===2&&!!w,M._close=!w||w===2&&!!S,s(y)}}}class lm{constructor(){this.map=[]}add(t,r,n){sm(this,t,r,n)}consume(t){if(this.map.sort(function(a,l){return a[0]-l[0]}),this.map.length===0)return;let r=this.map.length;const n=[];for(;r>0;)r-=1,n.push(t.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),t.length=this.map[r][0];n.push(t.slice()),t.length=0;let i=n.pop();for(;i;){for(const a of i)t.push(a);i=n.pop()}this.map.length=0}}function sm(e,t,r,n){let i=0;if(!(r===0&&n.length===0)){for(;i-1;){const Y=n.events[$][1].type;if(Y==="lineEnding"||Y==="linePrefix")$--;else break}const j=$>-1?n.events[$][1].type:null,ie=j==="tableHead"||j==="tableRow"?E:o;return ie===E&&n.parser.lazy[n.now().line]?r(D):ie(D)}function o(D){return e.enter("tableHead"),e.enter("tableRow"),u(D)}function u(D){return D===124||(l=!0,a+=1),h(D)}function h(D){return D===null?r(D):X(D)?a>1?(a=0,n.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),p):r(D):le(D)?ne(e,h,"whitespace")(D):(a+=1,l&&(l=!1,i+=1),D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),l=!0,h):(e.enter("data"),m(D)))}function m(D){return D===null||D===124||he(D)?(e.exit("data"),h(D)):(e.consume(D),D===92?d:m)}function d(D){return D===92||D===124?(e.consume(D),m):m(D)}function p(D){return n.interrupt=!1,n.parser.lazy[n.now().line]?r(D):(e.enter("tableDelimiterRow"),l=!1,le(D)?ne(e,y,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):y(D))}function y(D){return D===45||D===58?M(D):D===124?(l=!0,e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),w):O(D)}function w(D){return le(D)?ne(e,M,"whitespace")(D):M(D)}function M(D){return D===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),S):D===45?(a+=1,S(D)):D===null||X(D)?V(D):O(D)}function S(D){return D===45?(e.enter("tableDelimiterFiller"),z(D)):O(D)}function z(D){return D===45?(e.consume(D),z):D===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),I):(e.exit("tableDelimiterFiller"),I(D))}function I(D){return le(D)?ne(e,V,"whitespace")(D):V(D)}function V(D){return D===124?y(D):D===null||X(D)?!l||i!==a?O(D):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(D)):O(D)}function O(D){return r(D)}function E(D){return e.enter("tableRow"),G(D)}function G(D){return D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),G):D===null||X(D)?(e.exit("tableRow"),t(D)):le(D)?ne(e,G,"whitespace")(D):(e.enter("data"),K(D))}function K(D){return D===null||D===124||he(D)?(e.exit("data"),G(D)):(e.consume(D),D===92?U:K)}function U(D){return D===92||D===124?(e.consume(D),K):K(D)}}function hm(e,t){let r=-1,n=!0,i=0,a=[0,0,0,0],l=[0,0,0,0],s=!1,o=0,u,h,m;const d=new lm;for(;++rr[2]+1){const y=r[2]+1,w=r[3]-r[2]-1;e.add(y,w,[])}}e.add(r[3]+1,0,[["exit",m,t]])}return i!==void 0&&(a.end=Object.assign({},Xt(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function Wi(e,t,r,n,i){const a=[],l=Xt(t.events,r);i&&(i.end=Object.assign({},l),a.push(["exit",i,t])),n.end=Object.assign({},l),a.push(["exit",n,t]),e.add(r+1,0,a)}function Xt(e,t){const r=e[t],n=r[0]==="enter"?"start":"end";return r[1][n]}const mm={name:"tasklistCheck",tokenize:pm};function fm(){return{text:{91:mm}}}function pm(e,t,r){const n=this;return i;function i(o){return n.previous!==null||!n._gfmTasklistFirstContentOfListItem?r(o):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(o),e.exit("taskListCheckMarker"),a)}function a(o){return he(o)?(e.enter("taskListCheckValueUnchecked"),e.consume(o),e.exit("taskListCheckValueUnchecked"),l):o===88||o===120?(e.enter("taskListCheckValueChecked"),e.consume(o),e.exit("taskListCheckValueChecked"),l):r(o)}function l(o){return o===93?(e.enter("taskListCheckMarker"),e.consume(o),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):r(o)}function s(o){return X(o)?t(o):le(o)?e.check({tokenize:dm},t,r)(o):r(o)}}function dm(e,t,r){return ne(e,n,"whitespace");function n(i){return i===null?r(i):t(i)}}function gm(e){return tl([V4(),Z4(),am(e),um(),fm()])}const vm={};function o5(e){const t=this,r=e||vm,n=t.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),a=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),l=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(gm(r)),a.push(P4()),l.push(O4(r))}function ym(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:n,mathFlowFenceMeta:r,mathFlowValue:s,mathText:l,mathTextData:s}};function e(o){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},o)}function t(){this.buffer()}function r(){const o=this.resume(),u=this.stack[this.stack.length-1];u.type,u.meta=o}function n(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(o){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),h=this.stack[this.stack.length-1];h.type,this.exit(o),h.value=u;const m=h.data.hChildren[0];m.type,m.tagName,m.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function a(o){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},o),this.buffer()}function l(o){const u=this.resume(),h=this.stack[this.stack.length-1];h.type,this.exit(o),h.value=u,h.data.hChildren.push({type:"text",value:u})}function s(o){this.config.enter.data.call(this,o),this.config.exit.data.call(this,o)}}function bm(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),n.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` +`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:r,inlineMath:n}};function r(a,l,s,o){const u=a.value||"",h=s.createTracker(o),m="$".repeat(Math.max(zl(u,"$")+1,2)),d=s.enter("mathFlow");let p=h.move(m);if(a.meta){const y=s.enter("mathFlowMeta");p+=h.move(s.safe(a.meta,{after:` +`,before:p,encode:["$"],...h.current()})),y()}return p+=h.move(` +`),u&&(p+=h.move(u+` +`)),p+=h.move(m),d(),p}function n(a,l,s){let o=a.value||"",u=1;for(t||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(o);)u++;const h="$".repeat(u);/[^ \r\n]/.test(o)&&(/^[ \r\n]/.test(o)&&/[ \r\n]$/.test(o)||/^\$|\$$/.test(o))&&(o=" "+o+" ");let m=-1;for(;++m15?u="…"+s.slice(i-15,i):u=s.slice(0,i);var h;a+15":">","<":"<",'"':""","'":"'"},Im=/[&><"']/g;function Bm(e){return String(e).replace(Im,t=>Dm[t])}var Gl=function e(t){return t.type==="ordgroup"||t.type==="color"?t.body.length===1?e(t.body[0]):t:t.type==="font"?e(t.body):t},Nm=function(t){var r=Gl(t);return r.type==="mathord"||r.type==="textord"||r.type==="atom"},Fm=function(t){if(!t)throw new Error("Expected non-null, but got "+String(t));return t},Lm=function(t){var r=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return r?r[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(r[1])?null:r[1].toLowerCase():"_relative"},ue={deflt:Mm,escape:Bm,hyphenate:Em,getBaseElem:Gl,isCharacterBox:Nm,protocolFromUrl:Lm},Ur={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function Rm(e){if(e.default)return e.default;var t=e.type,r=Array.isArray(t)?t[0]:t;if(typeof r!="string")return r.enum[0];switch(r){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class L0{constructor(t){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{};for(var r in Ur)if(Ur.hasOwnProperty(r)){var n=Ur[r];this[r]=t[r]!==void 0?n.processor?n.processor(t[r]):t[r]:Rm(n)}}reportNonstrict(t,r,n){var i=this.strict;if(typeof i=="function"&&(i=i(t,r,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new L("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+t+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+t+"]"))}}useStrictBehavior(t,r,n){var i=this.strict;if(typeof i=="function")try{i=i(t,r,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+t+"]")),!1)}isTrusted(t){if(t.url&&!t.protocol){var r=ue.protocolFromUrl(t.url);if(r==null)return!1;t.protocol=r}var n=typeof this.trust=="function"?this.trust(t):this.trust;return!!n}}class Tt{constructor(t,r,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=r,this.cramped=n}sup(){return lt[Pm[this.id]]}sub(){return lt[Om[this.id]]}fracNum(){return lt[qm[this.id]]}fracDen(){return lt[Hm[this.id]]}cramp(){return lt[Vm[this.id]]}text(){return lt[jm[this.id]]}isTight(){return this.size>=2}}var R0=0,Kr=1,Zt=2,vt=3,wr=4,Ze=5,Jt=6,Fe=7,lt=[new Tt(R0,0,!1),new Tt(Kr,0,!0),new Tt(Zt,1,!1),new Tt(vt,1,!0),new Tt(wr,2,!1),new Tt(Ze,2,!0),new Tt(Jt,3,!1),new Tt(Fe,3,!0)],Pm=[wr,Ze,wr,Ze,Jt,Fe,Jt,Fe],Om=[Ze,Ze,Ze,Ze,Fe,Fe,Fe,Fe],qm=[Zt,vt,wr,Ze,Jt,Fe,Jt,Fe],Hm=[vt,vt,Ze,Ze,Fe,Fe,Fe,Fe],Vm=[Kr,Kr,vt,vt,Ze,Ze,Fe,Fe],jm=[R0,Kr,Zt,vt,Zt,vt,Zt,vt],Q={DISPLAY:lt[R0],TEXT:lt[Zt],SCRIPT:lt[wr],SCRIPTSCRIPT:lt[Jt]},l0=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function $m(e){for(var t=0;t=i[0]&&e<=i[1])return r.name}return null}var _r=[];l0.forEach(e=>e.blocks.forEach(t=>_r.push(...t)));function Wl(e){for(var t=0;t<_r.length;t+=2)if(e>=_r[t]&&e<=_r[t+1])return!0;return!1}var Yt=80,Um=function(t,r){return"M95,"+(622+t+r)+` +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l`+t/2.075+" -"+t+` +c5.3,-9.3,12,-14,20,-14 +H400000v`+(40+t)+`H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M`+(834+t)+" "+r+"h400000v"+(40+t)+"h-400000z"},_m=function(t,r){return"M263,"+(601+t+r)+`c0.7,0,18,39.7,52,119 +c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 +c340,-704.7,510.7,-1060.3,512,-1067 +l`+t/2.084+" -"+t+` +c4.7,-7.3,11,-11,19,-11 +H40000v`+(40+t)+`H1012.3 +s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232 +c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 +s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 +c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z +M`+(1001+t)+" "+r+"h400000v"+(40+t)+"h-400000z"},Gm=function(t,r){return"M983 "+(10+t+r)+` +l`+t/3.13+" -"+t+` +c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+` +H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 +s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744 +c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 +c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 +c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 +c53.7,-170.3,84.5,-266.8,92.5,-289.5z +M`+(1001+t)+" "+r+"h400000v"+(40+t)+"h-400000z"},Wm=function(t,r){return"M424,"+(2398+t+r)+` +c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 +c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 +s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 +s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081 +l`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000 +v`+(40+t)+`H1014.6 +s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 +c-2,6,-10,9,-24,9 +c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+r+` +h400000v`+(40+t)+"h-400000z"},Ym=function(t,r){return"M473,"+(2713+t+r)+` +c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+` +c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7 +s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 +c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 +c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 +s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, +606zM`+(1001+t)+" "+r+"h400000v"+(40+t)+"H1017.7z"},Xm=function(t){var r=t/2;return"M400000 "+t+" H0 L"+r+" 0 l65 45 L145 "+(t-80)+" H400000z"},Km=function(t,r,n){var i=n-54-r-t;return"M702 "+(t+r)+"H400000"+(40+t)+` +H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 +h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 +c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 +219 661 l218 661zM702 `+r+"H400000v"+(40+t)+"H742z"},Zm=function(t,r,n){r=1e3*r;var i="";switch(t){case"sqrtMain":i=Um(r,Yt);break;case"sqrtSize1":i=_m(r,Yt);break;case"sqrtSize2":i=Gm(r,Yt);break;case"sqrtSize3":i=Wm(r,Yt);break;case"sqrtSize4":i=Ym(r,Yt);break;case"sqrtTall":i=Km(r,Yt,n)}return i},Qm=function(t,r){switch(t){case"⎜":return"M291 0 H417 V"+r+" H291z M291 0 H417 V"+r+" H291z";case"∣":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z";case"∥":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z"+("M367 0 H410 V"+r+" H367z M367 0 H410 V"+r+" H367z");case"⎟":return"M457 0 H583 V"+r+" H457z M457 0 H583 V"+r+" H457z";case"⎢":return"M319 0 H403 V"+r+" H319z M319 0 H403 V"+r+" H319z";case"⎥":return"M263 0 H347 V"+r+" H263z M263 0 H347 V"+r+" H263z";case"⎪":return"M384 0 H504 V"+r+" H384z M384 0 H504 V"+r+" H384z";case"⏐":return"M312 0 H355 V"+r+" H312z M312 0 H355 V"+r+" H312z";case"‖":return"M257 0 H300 V"+r+" H257z M257 0 H300 V"+r+" H257z"+("M478 0 H521 V"+r+" H478z M478 0 H521 V"+r+" H478z");default:return""}},Xi={doubleleftarrow:`M262 157 +l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 + 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 + 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 +c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5 + 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87 +-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7 +-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z +m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l +-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5 + 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88 +-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68 +-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18 +-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782 +c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3 +-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120 + 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8 +-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247 +c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208 + 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3 + 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202 + l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117 +-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7 + 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13 + 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688 + 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7 +-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80 +H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0 + 435 0h399565z`,leftgroupunder:`M400000 262 +H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219 + 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3 +-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5 +-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7 +-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5 + 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3 +-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7 +-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z +m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333 + 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5 + 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667 +-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12 + 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7 +-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0 +v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 +-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 +-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 + 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z +M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z +M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 +-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 +c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 + 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z +M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334 +c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 +-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 + 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 + 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214 +c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14 + 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3 + 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0 +-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6 +-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z +m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8 +60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8 +-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z +m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2 +c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6 +-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z +m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0 +85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8 +-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z +m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1 +c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128 +-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 + 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 + 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85 +-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 +-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 + 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l +-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5 +s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1 +c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3 + 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237 +-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0 + 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18 + 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3 +-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2 +-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 + 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11 +-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7 + 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z +m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8 + 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5 +-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95 +-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8 + 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 + 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3 +-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z +m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 + 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 +-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 + 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z +M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 + 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 +-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 +-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 + 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69 +-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3 +-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19 +-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101 + 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167 +c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 + 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42 + 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333 +-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70 + 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7 +-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0 + 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0 + 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128 +-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418 +-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9 + 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114 +c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751 + 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457 +-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0 + 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697 + 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696 + -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345 +-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409 + 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9 + 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409 + -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5 +3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11 +10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63 +-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1 +-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59 +H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359 +c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22 +c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1, +-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202 +c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5 +c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130 +s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47 +121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6 +s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11 +c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z +M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32 +-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0 +13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39 +-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5 +-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 +-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 +151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 +c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17 +c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21 +c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40 +c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z +M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0 +c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, +-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 +c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z +M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 +c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9, +1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7, +-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z +M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0 +c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, +-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 +c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},Jm=function(t,r){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 h347 v-84 +H403z M403 1759 V0 H319 V1759 v`+r+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v1759 H0 v84 H347z +M347 1759 V0 H263 V1759 v`+r+" v1759 h84z";case"vert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+r+" v585 h43z";case"doublevert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+r+` v585 h43z +M367 15 v585 v`+r+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+r+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+r+` v1715 h263 v84 H319z +MM319 602 V0 H403 V602 v`+r+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+r+` v1799 H0 v-84 H319z +MM319 602 V0 H403 V602 v`+r+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v602 h84z +M403 1759 V0 H319 V1759 v`+r+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v602 h84z +M347 1759 V0 h-84 V1759 v`+r+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1 +c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349, +-36,557 l0,`+(r+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210, +949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9 +c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5, +-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189 +l0,-`+(r+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3, +-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3, +63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5 +c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(r+9)+` +c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664 +c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11 +c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 +c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 +l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, +-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class Mr{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),r=0;rr.toText();return this.children.map(t).join("")}}var st={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Fr={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Ki={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function ef(e,t){st[e]=t}function P0(e,t,r){if(!st[t])throw new Error("Font metrics not found for font: "+t+".");var n=e.charCodeAt(0),i=st[t][n];if(!i&&e[0]in Ki&&(n=Ki[e[0]].charCodeAt(0),i=st[t][n]),!i&&r==="text"&&Wl(n)&&(i=st[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var Fn={};function tf(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!Fn[t]){var r=Fn[t]={cssEmPerMu:Fr.quad[t]/18};for(var n in Fr)Fr.hasOwnProperty(n)&&(r[n]=Fr[n][t])}return Fn[t]}var rf=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Zi=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Qi=function(t,r){return r.size<2?t:rf[t-1][r.size-1]};class gt{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||gt.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=Zi[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var r={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);return new gt(r)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:Qi(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:Zi[t-1]})}havingBaseStyle(t){t=t||this.style.text();var r=Qi(gt.BASESIZE,t);return this.size===r&&this.textSize===gt.BASESIZE&&this.style===t?this:this.extend({style:t,size:r})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==gt.BASESIZE?["sizing","reset-size"+this.size,"size"+gt.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=tf(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}gt.BASESIZE=6;var s0={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},nf={ex:!0,em:!0,mu:!0},Yl=function(t){return typeof t!="string"&&(t=t.unit),t in s0||t in nf||t==="ex"},ye=function(t,r){var n;if(t.unit in s0)n=s0[t.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier;else if(t.unit==="mu")n=r.fontMetrics().cssEmPerMu;else{var i;if(r.style.isTight()?i=r.havingStyle(r.style.text()):i=r,t.unit==="ex")n=i.fontMetrics().xHeight;else if(t.unit==="em")n=i.fontMetrics().quad;else throw new L("Invalid unit: '"+t.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(t.number*n,r.maxSize)},P=function(t){return+t.toFixed(4)+"em"},Ct=function(t){return t.filter(r=>r).join(" ")},Xl=function(t,r,n){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},r){r.style.isTight()&&this.classes.push("mtight");var i=r.getColor();i&&(this.style.color=i)}},Kl=function(t){var r=document.createElement(t);r.className=Ct(this.classes);for(var n in this.style)this.style.hasOwnProperty(n)&&(r.style[n]=this.style[n]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&r.setAttribute(i,this.attributes[i]);for(var a=0;a/=\x00-\x1f]/,Zl=function(t){var r="<"+t;this.classes.length&&(r+=' class="'+ue.escape(Ct(this.classes))+'"');var n="";for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=ue.hyphenate(i)+":"+this.style[i]+";");n&&(r+=' style="'+ue.escape(n)+'"');for(var a in this.attributes)if(this.attributes.hasOwnProperty(a)){if(af.test(a))throw new L("Invalid attribute name '"+a+"'");r+=" "+a+'="'+ue.escape(this.attributes[a])+'"'}r+=">";for(var l=0;l",r};class Cr{constructor(t,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,Xl.call(this,t,n,i),this.children=r||[]}setAttribute(t,r){this.attributes[t]=r}hasClass(t){return this.classes.includes(t)}toNode(){return Kl.call(this,"span")}toMarkup(){return Zl.call(this,"span")}}class O0{constructor(t,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Xl.call(this,r,i),this.children=n||[],this.setAttribute("href",t)}setAttribute(t,r){this.attributes[t]=r}hasClass(t){return this.classes.includes(t)}toNode(){return Kl.call(this,"a")}toMarkup(){return Zl.call(this,"a")}}class lf{constructor(t,r,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=r,this.src=t,this.classes=["mord"],this.style=n}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");t.src=this.src,t.alt=this.alt,t.className="mord";for(var r in this.style)this.style.hasOwnProperty(r)&&(t.style[r]=this.style[r]);return t}toMarkup(){var t=''+ue.escape(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=P(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=Ct(this.classes));for(var n in this.style)this.style.hasOwnProperty(n)&&(r=r||document.createElement("span"),r.style[n]=this.style[n]);return r?(r.appendChild(t),r):t}toMarkup(){var t=!1,r="0&&(n+="margin-right:"+this.italic+"em;");for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=ue.hyphenate(i)+":"+this.style[i]+";");n&&(t=!0,r+=' style="'+ue.escape(n)+'"');var a=ue.escape(this.text);return t?(r+=">",r+=a,r+="",r):a}}class bt{constructor(t,r){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=r||{}}toNode(){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&r.setAttribute(n,this.attributes[n]);for(var i=0;i':''}}class o0{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"line");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var t=" but got "+String(e)+".")}var uf={bin:1,close:1,inner:1,open:1,punct:1,rel:1},cf={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},de={math:{},text:{}};function c(e,t,r,n,i,a){de[e][i]={font:t,group:r,replace:n},a&&n&&(de[e][n]=de[e][i])}var f="math",N="text",g="main",b="ams",ge="accent-token",W="bin",Le="close",rr="inner",Z="mathord",Te="op-token",Ye="open",sn="punct",x="rel",St="spacing",T="textord";c(f,g,x,"≡","\\equiv",!0);c(f,g,x,"≺","\\prec",!0);c(f,g,x,"≻","\\succ",!0);c(f,g,x,"∼","\\sim",!0);c(f,g,x,"⊥","\\perp");c(f,g,x,"⪯","\\preceq",!0);c(f,g,x,"⪰","\\succeq",!0);c(f,g,x,"≃","\\simeq",!0);c(f,g,x,"∣","\\mid",!0);c(f,g,x,"≪","\\ll",!0);c(f,g,x,"≫","\\gg",!0);c(f,g,x,"≍","\\asymp",!0);c(f,g,x,"∥","\\parallel");c(f,g,x,"⋈","\\bowtie",!0);c(f,g,x,"⌣","\\smile",!0);c(f,g,x,"⊑","\\sqsubseteq",!0);c(f,g,x,"⊒","\\sqsupseteq",!0);c(f,g,x,"≐","\\doteq",!0);c(f,g,x,"⌢","\\frown",!0);c(f,g,x,"∋","\\ni",!0);c(f,g,x,"∝","\\propto",!0);c(f,g,x,"⊢","\\vdash",!0);c(f,g,x,"⊣","\\dashv",!0);c(f,g,x,"∋","\\owns");c(f,g,sn,".","\\ldotp");c(f,g,sn,"⋅","\\cdotp");c(f,g,T,"#","\\#");c(N,g,T,"#","\\#");c(f,g,T,"&","\\&");c(N,g,T,"&","\\&");c(f,g,T,"ℵ","\\aleph",!0);c(f,g,T,"∀","\\forall",!0);c(f,g,T,"ℏ","\\hbar",!0);c(f,g,T,"∃","\\exists",!0);c(f,g,T,"∇","\\nabla",!0);c(f,g,T,"♭","\\flat",!0);c(f,g,T,"ℓ","\\ell",!0);c(f,g,T,"♮","\\natural",!0);c(f,g,T,"♣","\\clubsuit",!0);c(f,g,T,"℘","\\wp",!0);c(f,g,T,"♯","\\sharp",!0);c(f,g,T,"♢","\\diamondsuit",!0);c(f,g,T,"ℜ","\\Re",!0);c(f,g,T,"♡","\\heartsuit",!0);c(f,g,T,"ℑ","\\Im",!0);c(f,g,T,"♠","\\spadesuit",!0);c(f,g,T,"§","\\S",!0);c(N,g,T,"§","\\S");c(f,g,T,"¶","\\P",!0);c(N,g,T,"¶","\\P");c(f,g,T,"†","\\dag");c(N,g,T,"†","\\dag");c(N,g,T,"†","\\textdagger");c(f,g,T,"‡","\\ddag");c(N,g,T,"‡","\\ddag");c(N,g,T,"‡","\\textdaggerdbl");c(f,g,Le,"⎱","\\rmoustache",!0);c(f,g,Ye,"⎰","\\lmoustache",!0);c(f,g,Le,"⟯","\\rgroup",!0);c(f,g,Ye,"⟮","\\lgroup",!0);c(f,g,W,"∓","\\mp",!0);c(f,g,W,"⊖","\\ominus",!0);c(f,g,W,"⊎","\\uplus",!0);c(f,g,W,"⊓","\\sqcap",!0);c(f,g,W,"∗","\\ast");c(f,g,W,"⊔","\\sqcup",!0);c(f,g,W,"◯","\\bigcirc",!0);c(f,g,W,"∙","\\bullet",!0);c(f,g,W,"‡","\\ddagger");c(f,g,W,"≀","\\wr",!0);c(f,g,W,"⨿","\\amalg");c(f,g,W,"&","\\And");c(f,g,x,"⟵","\\longleftarrow",!0);c(f,g,x,"⇐","\\Leftarrow",!0);c(f,g,x,"⟸","\\Longleftarrow",!0);c(f,g,x,"⟶","\\longrightarrow",!0);c(f,g,x,"⇒","\\Rightarrow",!0);c(f,g,x,"⟹","\\Longrightarrow",!0);c(f,g,x,"↔","\\leftrightarrow",!0);c(f,g,x,"⟷","\\longleftrightarrow",!0);c(f,g,x,"⇔","\\Leftrightarrow",!0);c(f,g,x,"⟺","\\Longleftrightarrow",!0);c(f,g,x,"↦","\\mapsto",!0);c(f,g,x,"⟼","\\longmapsto",!0);c(f,g,x,"↗","\\nearrow",!0);c(f,g,x,"↩","\\hookleftarrow",!0);c(f,g,x,"↪","\\hookrightarrow",!0);c(f,g,x,"↘","\\searrow",!0);c(f,g,x,"↼","\\leftharpoonup",!0);c(f,g,x,"⇀","\\rightharpoonup",!0);c(f,g,x,"↙","\\swarrow",!0);c(f,g,x,"↽","\\leftharpoondown",!0);c(f,g,x,"⇁","\\rightharpoondown",!0);c(f,g,x,"↖","\\nwarrow",!0);c(f,g,x,"⇌","\\rightleftharpoons",!0);c(f,b,x,"≮","\\nless",!0);c(f,b,x,"","\\@nleqslant");c(f,b,x,"","\\@nleqq");c(f,b,x,"⪇","\\lneq",!0);c(f,b,x,"≨","\\lneqq",!0);c(f,b,x,"","\\@lvertneqq");c(f,b,x,"⋦","\\lnsim",!0);c(f,b,x,"⪉","\\lnapprox",!0);c(f,b,x,"⊀","\\nprec",!0);c(f,b,x,"⋠","\\npreceq",!0);c(f,b,x,"⋨","\\precnsim",!0);c(f,b,x,"⪹","\\precnapprox",!0);c(f,b,x,"≁","\\nsim",!0);c(f,b,x,"","\\@nshortmid");c(f,b,x,"∤","\\nmid",!0);c(f,b,x,"⊬","\\nvdash",!0);c(f,b,x,"⊭","\\nvDash",!0);c(f,b,x,"⋪","\\ntriangleleft");c(f,b,x,"⋬","\\ntrianglelefteq",!0);c(f,b,x,"⊊","\\subsetneq",!0);c(f,b,x,"","\\@varsubsetneq");c(f,b,x,"⫋","\\subsetneqq",!0);c(f,b,x,"","\\@varsubsetneqq");c(f,b,x,"≯","\\ngtr",!0);c(f,b,x,"","\\@ngeqslant");c(f,b,x,"","\\@ngeqq");c(f,b,x,"⪈","\\gneq",!0);c(f,b,x,"≩","\\gneqq",!0);c(f,b,x,"","\\@gvertneqq");c(f,b,x,"⋧","\\gnsim",!0);c(f,b,x,"⪊","\\gnapprox",!0);c(f,b,x,"⊁","\\nsucc",!0);c(f,b,x,"⋡","\\nsucceq",!0);c(f,b,x,"⋩","\\succnsim",!0);c(f,b,x,"⪺","\\succnapprox",!0);c(f,b,x,"≆","\\ncong",!0);c(f,b,x,"","\\@nshortparallel");c(f,b,x,"∦","\\nparallel",!0);c(f,b,x,"⊯","\\nVDash",!0);c(f,b,x,"⋫","\\ntriangleright");c(f,b,x,"⋭","\\ntrianglerighteq",!0);c(f,b,x,"","\\@nsupseteqq");c(f,b,x,"⊋","\\supsetneq",!0);c(f,b,x,"","\\@varsupsetneq");c(f,b,x,"⫌","\\supsetneqq",!0);c(f,b,x,"","\\@varsupsetneqq");c(f,b,x,"⊮","\\nVdash",!0);c(f,b,x,"⪵","\\precneqq",!0);c(f,b,x,"⪶","\\succneqq",!0);c(f,b,x,"","\\@nsubseteqq");c(f,b,W,"⊴","\\unlhd");c(f,b,W,"⊵","\\unrhd");c(f,b,x,"↚","\\nleftarrow",!0);c(f,b,x,"↛","\\nrightarrow",!0);c(f,b,x,"⇍","\\nLeftarrow",!0);c(f,b,x,"⇏","\\nRightarrow",!0);c(f,b,x,"↮","\\nleftrightarrow",!0);c(f,b,x,"⇎","\\nLeftrightarrow",!0);c(f,b,x,"△","\\vartriangle");c(f,b,T,"ℏ","\\hslash");c(f,b,T,"▽","\\triangledown");c(f,b,T,"◊","\\lozenge");c(f,b,T,"Ⓢ","\\circledS");c(f,b,T,"®","\\circledR");c(N,b,T,"®","\\circledR");c(f,b,T,"∡","\\measuredangle",!0);c(f,b,T,"∄","\\nexists");c(f,b,T,"℧","\\mho");c(f,b,T,"Ⅎ","\\Finv",!0);c(f,b,T,"⅁","\\Game",!0);c(f,b,T,"‵","\\backprime");c(f,b,T,"▲","\\blacktriangle");c(f,b,T,"▼","\\blacktriangledown");c(f,b,T,"■","\\blacksquare");c(f,b,T,"⧫","\\blacklozenge");c(f,b,T,"★","\\bigstar");c(f,b,T,"∢","\\sphericalangle",!0);c(f,b,T,"∁","\\complement",!0);c(f,b,T,"ð","\\eth",!0);c(N,g,T,"ð","ð");c(f,b,T,"╱","\\diagup");c(f,b,T,"╲","\\diagdown");c(f,b,T,"□","\\square");c(f,b,T,"□","\\Box");c(f,b,T,"◊","\\Diamond");c(f,b,T,"¥","\\yen",!0);c(N,b,T,"¥","\\yen",!0);c(f,b,T,"✓","\\checkmark",!0);c(N,b,T,"✓","\\checkmark");c(f,b,T,"ℶ","\\beth",!0);c(f,b,T,"ℸ","\\daleth",!0);c(f,b,T,"ℷ","\\gimel",!0);c(f,b,T,"ϝ","\\digamma",!0);c(f,b,T,"ϰ","\\varkappa");c(f,b,Ye,"┌","\\@ulcorner",!0);c(f,b,Le,"┐","\\@urcorner",!0);c(f,b,Ye,"└","\\@llcorner",!0);c(f,b,Le,"┘","\\@lrcorner",!0);c(f,b,x,"≦","\\leqq",!0);c(f,b,x,"⩽","\\leqslant",!0);c(f,b,x,"⪕","\\eqslantless",!0);c(f,b,x,"≲","\\lesssim",!0);c(f,b,x,"⪅","\\lessapprox",!0);c(f,b,x,"≊","\\approxeq",!0);c(f,b,W,"⋖","\\lessdot");c(f,b,x,"⋘","\\lll",!0);c(f,b,x,"≶","\\lessgtr",!0);c(f,b,x,"⋚","\\lesseqgtr",!0);c(f,b,x,"⪋","\\lesseqqgtr",!0);c(f,b,x,"≑","\\doteqdot");c(f,b,x,"≓","\\risingdotseq",!0);c(f,b,x,"≒","\\fallingdotseq",!0);c(f,b,x,"∽","\\backsim",!0);c(f,b,x,"⋍","\\backsimeq",!0);c(f,b,x,"⫅","\\subseteqq",!0);c(f,b,x,"⋐","\\Subset",!0);c(f,b,x,"⊏","\\sqsubset",!0);c(f,b,x,"≼","\\preccurlyeq",!0);c(f,b,x,"⋞","\\curlyeqprec",!0);c(f,b,x,"≾","\\precsim",!0);c(f,b,x,"⪷","\\precapprox",!0);c(f,b,x,"⊲","\\vartriangleleft");c(f,b,x,"⊴","\\trianglelefteq");c(f,b,x,"⊨","\\vDash",!0);c(f,b,x,"⊪","\\Vvdash",!0);c(f,b,x,"⌣","\\smallsmile");c(f,b,x,"⌢","\\smallfrown");c(f,b,x,"≏","\\bumpeq",!0);c(f,b,x,"≎","\\Bumpeq",!0);c(f,b,x,"≧","\\geqq",!0);c(f,b,x,"⩾","\\geqslant",!0);c(f,b,x,"⪖","\\eqslantgtr",!0);c(f,b,x,"≳","\\gtrsim",!0);c(f,b,x,"⪆","\\gtrapprox",!0);c(f,b,W,"⋗","\\gtrdot");c(f,b,x,"⋙","\\ggg",!0);c(f,b,x,"≷","\\gtrless",!0);c(f,b,x,"⋛","\\gtreqless",!0);c(f,b,x,"⪌","\\gtreqqless",!0);c(f,b,x,"≖","\\eqcirc",!0);c(f,b,x,"≗","\\circeq",!0);c(f,b,x,"≜","\\triangleq",!0);c(f,b,x,"∼","\\thicksim");c(f,b,x,"≈","\\thickapprox");c(f,b,x,"⫆","\\supseteqq",!0);c(f,b,x,"⋑","\\Supset",!0);c(f,b,x,"⊐","\\sqsupset",!0);c(f,b,x,"≽","\\succcurlyeq",!0);c(f,b,x,"⋟","\\curlyeqsucc",!0);c(f,b,x,"≿","\\succsim",!0);c(f,b,x,"⪸","\\succapprox",!0);c(f,b,x,"⊳","\\vartriangleright");c(f,b,x,"⊵","\\trianglerighteq");c(f,b,x,"⊩","\\Vdash",!0);c(f,b,x,"∣","\\shortmid");c(f,b,x,"∥","\\shortparallel");c(f,b,x,"≬","\\between",!0);c(f,b,x,"⋔","\\pitchfork",!0);c(f,b,x,"∝","\\varpropto");c(f,b,x,"◀","\\blacktriangleleft");c(f,b,x,"∴","\\therefore",!0);c(f,b,x,"∍","\\backepsilon");c(f,b,x,"▶","\\blacktriangleright");c(f,b,x,"∵","\\because",!0);c(f,b,x,"⋘","\\llless");c(f,b,x,"⋙","\\gggtr");c(f,b,W,"⊲","\\lhd");c(f,b,W,"⊳","\\rhd");c(f,b,x,"≂","\\eqsim",!0);c(f,g,x,"⋈","\\Join");c(f,b,x,"≑","\\Doteq",!0);c(f,b,W,"∔","\\dotplus",!0);c(f,b,W,"∖","\\smallsetminus");c(f,b,W,"⋒","\\Cap",!0);c(f,b,W,"⋓","\\Cup",!0);c(f,b,W,"⩞","\\doublebarwedge",!0);c(f,b,W,"⊟","\\boxminus",!0);c(f,b,W,"⊞","\\boxplus",!0);c(f,b,W,"⋇","\\divideontimes",!0);c(f,b,W,"⋉","\\ltimes",!0);c(f,b,W,"⋊","\\rtimes",!0);c(f,b,W,"⋋","\\leftthreetimes",!0);c(f,b,W,"⋌","\\rightthreetimes",!0);c(f,b,W,"⋏","\\curlywedge",!0);c(f,b,W,"⋎","\\curlyvee",!0);c(f,b,W,"⊝","\\circleddash",!0);c(f,b,W,"⊛","\\circledast",!0);c(f,b,W,"⋅","\\centerdot");c(f,b,W,"⊺","\\intercal",!0);c(f,b,W,"⋒","\\doublecap");c(f,b,W,"⋓","\\doublecup");c(f,b,W,"⊠","\\boxtimes",!0);c(f,b,x,"⇢","\\dashrightarrow",!0);c(f,b,x,"⇠","\\dashleftarrow",!0);c(f,b,x,"⇇","\\leftleftarrows",!0);c(f,b,x,"⇆","\\leftrightarrows",!0);c(f,b,x,"⇚","\\Lleftarrow",!0);c(f,b,x,"↞","\\twoheadleftarrow",!0);c(f,b,x,"↢","\\leftarrowtail",!0);c(f,b,x,"↫","\\looparrowleft",!0);c(f,b,x,"⇋","\\leftrightharpoons",!0);c(f,b,x,"↶","\\curvearrowleft",!0);c(f,b,x,"↺","\\circlearrowleft",!0);c(f,b,x,"↰","\\Lsh",!0);c(f,b,x,"⇈","\\upuparrows",!0);c(f,b,x,"↿","\\upharpoonleft",!0);c(f,b,x,"⇃","\\downharpoonleft",!0);c(f,g,x,"⊶","\\origof",!0);c(f,g,x,"⊷","\\imageof",!0);c(f,b,x,"⊸","\\multimap",!0);c(f,b,x,"↭","\\leftrightsquigarrow",!0);c(f,b,x,"⇉","\\rightrightarrows",!0);c(f,b,x,"⇄","\\rightleftarrows",!0);c(f,b,x,"↠","\\twoheadrightarrow",!0);c(f,b,x,"↣","\\rightarrowtail",!0);c(f,b,x,"↬","\\looparrowright",!0);c(f,b,x,"↷","\\curvearrowright",!0);c(f,b,x,"↻","\\circlearrowright",!0);c(f,b,x,"↱","\\Rsh",!0);c(f,b,x,"⇊","\\downdownarrows",!0);c(f,b,x,"↾","\\upharpoonright",!0);c(f,b,x,"⇂","\\downharpoonright",!0);c(f,b,x,"⇝","\\rightsquigarrow",!0);c(f,b,x,"⇝","\\leadsto");c(f,b,x,"⇛","\\Rrightarrow",!0);c(f,b,x,"↾","\\restriction");c(f,g,T,"‘","`");c(f,g,T,"$","\\$");c(N,g,T,"$","\\$");c(N,g,T,"$","\\textdollar");c(f,g,T,"%","\\%");c(N,g,T,"%","\\%");c(f,g,T,"_","\\_");c(N,g,T,"_","\\_");c(N,g,T,"_","\\textunderscore");c(f,g,T,"∠","\\angle",!0);c(f,g,T,"∞","\\infty",!0);c(f,g,T,"′","\\prime");c(f,g,T,"△","\\triangle");c(f,g,T,"Γ","\\Gamma",!0);c(f,g,T,"Δ","\\Delta",!0);c(f,g,T,"Θ","\\Theta",!0);c(f,g,T,"Λ","\\Lambda",!0);c(f,g,T,"Ξ","\\Xi",!0);c(f,g,T,"Π","\\Pi",!0);c(f,g,T,"Σ","\\Sigma",!0);c(f,g,T,"Υ","\\Upsilon",!0);c(f,g,T,"Φ","\\Phi",!0);c(f,g,T,"Ψ","\\Psi",!0);c(f,g,T,"Ω","\\Omega",!0);c(f,g,T,"A","Α");c(f,g,T,"B","Β");c(f,g,T,"E","Ε");c(f,g,T,"Z","Ζ");c(f,g,T,"H","Η");c(f,g,T,"I","Ι");c(f,g,T,"K","Κ");c(f,g,T,"M","Μ");c(f,g,T,"N","Ν");c(f,g,T,"O","Ο");c(f,g,T,"P","Ρ");c(f,g,T,"T","Τ");c(f,g,T,"X","Χ");c(f,g,T,"¬","\\neg",!0);c(f,g,T,"¬","\\lnot");c(f,g,T,"⊤","\\top");c(f,g,T,"⊥","\\bot");c(f,g,T,"∅","\\emptyset");c(f,b,T,"∅","\\varnothing");c(f,g,Z,"α","\\alpha",!0);c(f,g,Z,"β","\\beta",!0);c(f,g,Z,"γ","\\gamma",!0);c(f,g,Z,"δ","\\delta",!0);c(f,g,Z,"ϵ","\\epsilon",!0);c(f,g,Z,"ζ","\\zeta",!0);c(f,g,Z,"η","\\eta",!0);c(f,g,Z,"θ","\\theta",!0);c(f,g,Z,"ι","\\iota",!0);c(f,g,Z,"κ","\\kappa",!0);c(f,g,Z,"λ","\\lambda",!0);c(f,g,Z,"μ","\\mu",!0);c(f,g,Z,"ν","\\nu",!0);c(f,g,Z,"ξ","\\xi",!0);c(f,g,Z,"ο","\\omicron",!0);c(f,g,Z,"π","\\pi",!0);c(f,g,Z,"ρ","\\rho",!0);c(f,g,Z,"σ","\\sigma",!0);c(f,g,Z,"τ","\\tau",!0);c(f,g,Z,"υ","\\upsilon",!0);c(f,g,Z,"ϕ","\\phi",!0);c(f,g,Z,"χ","\\chi",!0);c(f,g,Z,"ψ","\\psi",!0);c(f,g,Z,"ω","\\omega",!0);c(f,g,Z,"ε","\\varepsilon",!0);c(f,g,Z,"ϑ","\\vartheta",!0);c(f,g,Z,"ϖ","\\varpi",!0);c(f,g,Z,"ϱ","\\varrho",!0);c(f,g,Z,"ς","\\varsigma",!0);c(f,g,Z,"φ","\\varphi",!0);c(f,g,W,"∗","*",!0);c(f,g,W,"+","+");c(f,g,W,"−","-",!0);c(f,g,W,"⋅","\\cdot",!0);c(f,g,W,"∘","\\circ",!0);c(f,g,W,"÷","\\div",!0);c(f,g,W,"±","\\pm",!0);c(f,g,W,"×","\\times",!0);c(f,g,W,"∩","\\cap",!0);c(f,g,W,"∪","\\cup",!0);c(f,g,W,"∖","\\setminus",!0);c(f,g,W,"∧","\\land");c(f,g,W,"∨","\\lor");c(f,g,W,"∧","\\wedge",!0);c(f,g,W,"∨","\\vee",!0);c(f,g,T,"√","\\surd");c(f,g,Ye,"⟨","\\langle",!0);c(f,g,Ye,"∣","\\lvert");c(f,g,Ye,"∥","\\lVert");c(f,g,Le,"?","?");c(f,g,Le,"!","!");c(f,g,Le,"⟩","\\rangle",!0);c(f,g,Le,"∣","\\rvert");c(f,g,Le,"∥","\\rVert");c(f,g,x,"=","=");c(f,g,x,":",":");c(f,g,x,"≈","\\approx",!0);c(f,g,x,"≅","\\cong",!0);c(f,g,x,"≥","\\ge");c(f,g,x,"≥","\\geq",!0);c(f,g,x,"←","\\gets");c(f,g,x,">","\\gt",!0);c(f,g,x,"∈","\\in",!0);c(f,g,x,"","\\@not");c(f,g,x,"⊂","\\subset",!0);c(f,g,x,"⊃","\\supset",!0);c(f,g,x,"⊆","\\subseteq",!0);c(f,g,x,"⊇","\\supseteq",!0);c(f,b,x,"⊈","\\nsubseteq",!0);c(f,b,x,"⊉","\\nsupseteq",!0);c(f,g,x,"⊨","\\models");c(f,g,x,"←","\\leftarrow",!0);c(f,g,x,"≤","\\le");c(f,g,x,"≤","\\leq",!0);c(f,g,x,"<","\\lt",!0);c(f,g,x,"→","\\rightarrow",!0);c(f,g,x,"→","\\to");c(f,b,x,"≱","\\ngeq",!0);c(f,b,x,"≰","\\nleq",!0);c(f,g,St," ","\\ ");c(f,g,St," ","\\space");c(f,g,St," ","\\nobreakspace");c(N,g,St," ","\\ ");c(N,g,St," "," ");c(N,g,St," ","\\space");c(N,g,St," ","\\nobreakspace");c(f,g,St,null,"\\nobreak");c(f,g,St,null,"\\allowbreak");c(f,g,sn,",",",");c(f,g,sn,";",";");c(f,b,W,"⊼","\\barwedge",!0);c(f,b,W,"⊻","\\veebar",!0);c(f,g,W,"⊙","\\odot",!0);c(f,g,W,"⊕","\\oplus",!0);c(f,g,W,"⊗","\\otimes",!0);c(f,g,T,"∂","\\partial",!0);c(f,g,W,"⊘","\\oslash",!0);c(f,b,W,"⊚","\\circledcirc",!0);c(f,b,W,"⊡","\\boxdot",!0);c(f,g,W,"△","\\bigtriangleup");c(f,g,W,"▽","\\bigtriangledown");c(f,g,W,"†","\\dagger");c(f,g,W,"⋄","\\diamond");c(f,g,W,"⋆","\\star");c(f,g,W,"◃","\\triangleleft");c(f,g,W,"▹","\\triangleright");c(f,g,Ye,"{","\\{");c(N,g,T,"{","\\{");c(N,g,T,"{","\\textbraceleft");c(f,g,Le,"}","\\}");c(N,g,T,"}","\\}");c(N,g,T,"}","\\textbraceright");c(f,g,Ye,"{","\\lbrace");c(f,g,Le,"}","\\rbrace");c(f,g,Ye,"[","\\lbrack",!0);c(N,g,T,"[","\\lbrack",!0);c(f,g,Le,"]","\\rbrack",!0);c(N,g,T,"]","\\rbrack",!0);c(f,g,Ye,"(","\\lparen",!0);c(f,g,Le,")","\\rparen",!0);c(N,g,T,"<","\\textless",!0);c(N,g,T,">","\\textgreater",!0);c(f,g,Ye,"⌊","\\lfloor",!0);c(f,g,Le,"⌋","\\rfloor",!0);c(f,g,Ye,"⌈","\\lceil",!0);c(f,g,Le,"⌉","\\rceil",!0);c(f,g,T,"\\","\\backslash");c(f,g,T,"∣","|");c(f,g,T,"∣","\\vert");c(N,g,T,"|","\\textbar",!0);c(f,g,T,"∥","\\|");c(f,g,T,"∥","\\Vert");c(N,g,T,"∥","\\textbardbl");c(N,g,T,"~","\\textasciitilde");c(N,g,T,"\\","\\textbackslash");c(N,g,T,"^","\\textasciicircum");c(f,g,x,"↑","\\uparrow",!0);c(f,g,x,"⇑","\\Uparrow",!0);c(f,g,x,"↓","\\downarrow",!0);c(f,g,x,"⇓","\\Downarrow",!0);c(f,g,x,"↕","\\updownarrow",!0);c(f,g,x,"⇕","\\Updownarrow",!0);c(f,g,Te,"∐","\\coprod");c(f,g,Te,"⋁","\\bigvee");c(f,g,Te,"⋀","\\bigwedge");c(f,g,Te,"⨄","\\biguplus");c(f,g,Te,"⋂","\\bigcap");c(f,g,Te,"⋃","\\bigcup");c(f,g,Te,"∫","\\int");c(f,g,Te,"∫","\\intop");c(f,g,Te,"∬","\\iint");c(f,g,Te,"∭","\\iiint");c(f,g,Te,"∏","\\prod");c(f,g,Te,"∑","\\sum");c(f,g,Te,"⨂","\\bigotimes");c(f,g,Te,"⨁","\\bigoplus");c(f,g,Te,"⨀","\\bigodot");c(f,g,Te,"∮","\\oint");c(f,g,Te,"∯","\\oiint");c(f,g,Te,"∰","\\oiiint");c(f,g,Te,"⨆","\\bigsqcup");c(f,g,Te,"∫","\\smallint");c(N,g,rr,"…","\\textellipsis");c(f,g,rr,"…","\\mathellipsis");c(N,g,rr,"…","\\ldots",!0);c(f,g,rr,"…","\\ldots",!0);c(f,g,rr,"⋯","\\@cdots",!0);c(f,g,rr,"⋱","\\ddots",!0);c(f,g,T,"⋮","\\varvdots");c(N,g,T,"⋮","\\varvdots");c(f,g,ge,"ˊ","\\acute");c(f,g,ge,"ˋ","\\grave");c(f,g,ge,"¨","\\ddot");c(f,g,ge,"~","\\tilde");c(f,g,ge,"ˉ","\\bar");c(f,g,ge,"˘","\\breve");c(f,g,ge,"ˇ","\\check");c(f,g,ge,"^","\\hat");c(f,g,ge,"⃗","\\vec");c(f,g,ge,"˙","\\dot");c(f,g,ge,"˚","\\mathring");c(f,g,Z,"","\\@imath");c(f,g,Z,"","\\@jmath");c(f,g,T,"ı","ı");c(f,g,T,"ȷ","ȷ");c(N,g,T,"ı","\\i",!0);c(N,g,T,"ȷ","\\j",!0);c(N,g,T,"ß","\\ss",!0);c(N,g,T,"æ","\\ae",!0);c(N,g,T,"œ","\\oe",!0);c(N,g,T,"ø","\\o",!0);c(N,g,T,"Æ","\\AE",!0);c(N,g,T,"Œ","\\OE",!0);c(N,g,T,"Ø","\\O",!0);c(N,g,ge,"ˊ","\\'");c(N,g,ge,"ˋ","\\`");c(N,g,ge,"ˆ","\\^");c(N,g,ge,"˜","\\~");c(N,g,ge,"ˉ","\\=");c(N,g,ge,"˘","\\u");c(N,g,ge,"˙","\\.");c(N,g,ge,"¸","\\c");c(N,g,ge,"˚","\\r");c(N,g,ge,"ˇ","\\v");c(N,g,ge,"¨",'\\"');c(N,g,ge,"˝","\\H");c(N,g,ge,"◯","\\textcircled");var Ql={"--":!0,"---":!0,"``":!0,"''":!0};c(N,g,T,"–","--",!0);c(N,g,T,"–","\\textendash");c(N,g,T,"—","---",!0);c(N,g,T,"—","\\textemdash");c(N,g,T,"‘","`",!0);c(N,g,T,"‘","\\textquoteleft");c(N,g,T,"’","'",!0);c(N,g,T,"’","\\textquoteright");c(N,g,T,"“","``",!0);c(N,g,T,"“","\\textquotedblleft");c(N,g,T,"”","''",!0);c(N,g,T,"”","\\textquotedblright");c(f,g,T,"°","\\degree",!0);c(N,g,T,"°","\\degree");c(N,g,T,"°","\\textdegree",!0);c(f,g,T,"£","\\pounds");c(f,g,T,"£","\\mathsterling",!0);c(N,g,T,"£","\\pounds");c(N,g,T,"£","\\textsterling",!0);c(f,b,T,"✠","\\maltese");c(N,b,T,"✠","\\maltese");var ea='0123456789/@."';for(var Ln=0;Ln0)return nt(a,u,i,r,l.concat(h));if(o){var m,d;if(o==="boldsymbol"){var p=ff(a,i,r,l,n);m=p.fontName,d=[p.fontClass]}else s?(m=ts[o].fontName,d=[o]):(m=Or(o,r.fontWeight,r.fontShape),d=[o,r.fontWeight,r.fontShape]);if(on(a,m,i).metrics)return nt(a,m,i,r,l.concat(d));if(Ql.hasOwnProperty(a)&&m.slice(0,10)==="Typewriter"){for(var y=[],w=0;w{if(Ct(e.classes)!==Ct(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(e.classes.length===1){var r=e.classes[0];if(r==="mbin"||r==="mord")return!1}for(var n in e.style)if(e.style.hasOwnProperty(n)&&e.style[n]!==t.style[n])return!1;for(var i in t.style)if(t.style.hasOwnProperty(i)&&e.style[i]!==t.style[i])return!1;return!0},gf=e=>{for(var t=0;tr&&(r=l.height),l.depth>n&&(n=l.depth),l.maxFontSize>i&&(i=l.maxFontSize)}t.height=r,t.depth=n,t.maxFontSize=i},Oe=function(t,r,n,i){var a=new Cr(t,r,n,i);return q0(a),a},Jl=(e,t,r,n)=>new Cr(e,t,r,n),vf=function(t,r,n){var i=Oe([t],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=P(i.height),i.maxFontSize=1,i},yf=function(t,r,n,i){var a=new O0(t,r,n,i);return q0(a),a},es=function(t){var r=new Mr(t);return q0(r),r},bf=function(t,r){return t instanceof Mr?Oe([],[t],r):t},xf=function(t){if(t.positionType==="individualShift"){for(var r=t.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,a=i,l=1;l{var r=Oe(["mspace"],[],t),n=ye(e,t);return r.style.marginRight=P(n),r},Or=function(t,r,n){var i="";switch(t){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=t}var a;return r==="textbf"&&n==="textit"?a="BoldItalic":r==="textbf"?a="Bold":r==="textit"?a="Italic":a="Regular",i+"-"+a},ts={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},rs={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Sf=function(t,r){var[n,i,a]=rs[t],l=new Et(n),s=new bt([l],{width:P(i),height:P(a),style:"width:"+P(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),o=Jl(["overlay"],[s],r);return o.height=a,o.style.height=P(a),o.style.width=P(i),o},C={fontMap:ts,makeSymbol:nt,mathsym:mf,makeSpan:Oe,makeSvgSpan:Jl,makeLineSpan:vf,makeAnchor:yf,makeFragment:es,wrapFragment:bf,makeVList:wf,makeOrd:pf,makeGlue:kf,staticSvg:Sf,svgData:rs,tryCombineChars:gf},ve={number:3,unit:"mu"},Pt={number:4,unit:"mu"},dt={number:5,unit:"mu"},Af={mord:{mop:ve,mbin:Pt,mrel:dt,minner:ve},mop:{mord:ve,mop:ve,mrel:dt,minner:ve},mbin:{mord:Pt,mop:Pt,mopen:Pt,minner:Pt},mrel:{mord:dt,mop:dt,mopen:dt,minner:dt},mopen:{},mclose:{mop:ve,mbin:Pt,mrel:dt,minner:ve},mpunct:{mord:ve,mop:ve,mrel:dt,mopen:ve,mclose:ve,mpunct:ve,minner:ve},minner:{mord:ve,mop:ve,mbin:Pt,mrel:dt,mopen:ve,mpunct:ve,minner:ve}},Tf={mord:{mop:ve},mop:{mord:ve,mop:ve},mbin:{},mrel:{},mopen:{},mclose:{mop:ve},mpunct:{},minner:{mop:ve}},ns={},Qr={},Jr={};function _(e){for(var{type:t,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:l}=e,s={type:t,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},o=0;o{var M=w.classes[0],S=y.classes[0];M==="mbin"&&Mf.includes(S)?w.classes[0]="mord":S==="mbin"&&zf.includes(M)&&(y.classes[0]="mord")},{node:m},d,p),aa(a,(y,w)=>{var M=c0(w),S=c0(y),z=M&&S?y.hasClass("mtight")?Tf[M][S]:Af[M][S]:null;if(z)return C.makeGlue(z,u)},{node:m},d,p),a},aa=function e(t,r,n,i,a){i&&t.push(i);for(var l=0;ld=>{t.splice(m+1,0,d),l++})(l)}i&&t.pop()},is=function(t){return t instanceof Mr||t instanceof O0||t instanceof Cr&&t.hasClass("enclosing")?t:null},Df=function e(t,r){var n=is(t);if(n){var i=n.children;if(i.length){if(r==="right")return e(i[i.length-1],"right");if(r==="left")return e(i[0],"left")}}return t},c0=function(t,r){return t?(r&&(t=Df(t,r)),Ef[t.classes[0]]||null):null},kr=function(t,r){var n=["nulldelimiter"].concat(t.baseSizingClasses());return xt(r.concat(n))},oe=function(t,r,n){if(!t)return xt();if(Qr[t.type]){var i=Qr[t.type](t,r);if(n&&r.size!==n.size){i=xt(r.sizingClasses(n),[i],r);var a=r.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new L("Got group of unknown type: '"+t.type+"'")};function qr(e,t){var r=xt(["base"],e,t),n=xt(["strut"]);return n.style.height=P(r.height+r.depth),r.depth&&(n.style.verticalAlign=P(-r.depth)),r.children.unshift(n),r}function h0(e,t){var r=null;e.length===1&&e[0].type==="tag"&&(r=e[0].tag,e=e[0].body);var n=ze(e,t,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var a=[],l=[],s=0;s0&&(a.push(qr(l,t)),l=[]),a.push(n[s]));l.length>0&&a.push(qr(l,t));var u;r?(u=qr(ze(r,t,!0)),u.classes=["tag"],a.push(u)):i&&a.push(i);var h=xt(["katex-html"],a);if(h.setAttribute("aria-hidden","true"),u){var m=u.children[0];m.style.height=P(h.height+h.depth),h.depth&&(m.style.verticalAlign=P(-h.depth))}return h}function as(e){return new Mr(e)}class _e{constructor(t,r,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=r||[],this.classes=n||[]}setAttribute(t,r){this.attributes[t]=r}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&t.setAttribute(r,this.attributes[r]);this.classes.length>0&&(t.className=Ct(this.classes));for(var n=0;n0&&(t+=' class ="'+ue.escape(Ct(this.classes))+'"'),t+=">";for(var n=0;n",t}toText(){return this.children.map(t=>t.toText()).join("")}}class ot{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return ue.escape(this.toText())}toText(){return this.text}}class If{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character="  ":t>=-.05556&&t<=-.05555?this.character=" ⁣":t>=-.1667&&t<=-.1666?this.character=" ⁣":t>=-.2223&&t<=-.2222?this.character=" ⁣":t>=-.2778&&t<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",P(this.width)),t}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var F={MathNode:_e,TextNode:ot,SpaceNode:If,newDocumentFragment:as},Je=function(t,r,n){return de[r][t]&&de[r][t].replace&&t.charCodeAt(0)!==55349&&!(Ql.hasOwnProperty(t)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(t=de[r][t].replace),new F.TextNode(t)},H0=function(t){return t.length===1?t[0]:new F.MathNode("mrow",t)},V0=function(t,r){if(r.fontFamily==="texttt")return"monospace";if(r.fontFamily==="textsf")return r.fontShape==="textit"&&r.fontWeight==="textbf"?"sans-serif-bold-italic":r.fontShape==="textit"?"sans-serif-italic":r.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(r.fontShape==="textit"&&r.fontWeight==="textbf")return"bold-italic";if(r.fontShape==="textit")return"italic";if(r.fontWeight==="textbf")return"bold";var n=r.font;if(!n||n==="mathnormal")return null;var i=t.mode;if(n==="mathit")return"italic";if(n==="boldsymbol")return t.type==="textord"?"bold":"bold-italic";if(n==="mathbf")return"bold";if(n==="mathbb")return"double-struck";if(n==="mathsfit")return"sans-serif-italic";if(n==="mathfrak")return"fraktur";if(n==="mathscr"||n==="mathcal")return"script";if(n==="mathsf")return"sans-serif";if(n==="mathtt")return"monospace";var a=t.text;if(["\\imath","\\jmath"].includes(a))return null;de[i][a]&&de[i][a].replace&&(a=de[i][a].replace);var l=C.fontMap[n].fontName;return P0(a,l,i)?C.fontMap[n].variant:null};function qn(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof ot&&t.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var r=e.children[0];return r instanceof ot&&r.text===","}else return!1}var Ve=function(t,r,n){if(t.length===1){var i=me(t[0],r);return n&&i instanceof _e&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],l,s=0;s=1&&(l.type==="mn"||qn(l))){var u=o.children[0];u instanceof _e&&u.type==="mn"&&(u.children=[...l.children,...u.children],a.pop())}else if(l.type==="mi"&&l.children.length===1){var h=l.children[0];if(h instanceof ot&&h.text==="̸"&&(o.type==="mo"||o.type==="mi"||o.type==="mn")){var m=o.children[0];m instanceof ot&&m.text.length>0&&(m.text=m.text.slice(0,1)+"̸"+m.text.slice(1),a.pop())}}}a.push(o),l=o}return a},Dt=function(t,r,n){return H0(Ve(t,r,n))},me=function(t,r){if(!t)return new F.MathNode("mrow");if(Jr[t.type]){var n=Jr[t.type](t,r);return n}else throw new L("Got group of unknown type: '"+t.type+"'")};function la(e,t,r,n,i){var a=Ve(e,r),l;a.length===1&&a[0]instanceof _e&&["mrow","mtable"].includes(a[0].type)?l=a[0]:l=new F.MathNode("mrow",a);var s=new F.MathNode("annotation",[new F.TextNode(t)]);s.setAttribute("encoding","application/x-tex");var o=new F.MathNode("semantics",[l,s]),u=new F.MathNode("math",[o]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var h=i?"katex":"katex-mathml";return C.makeSpan([h],[u])}var ls=function(t){return new gt({style:t.displayMode?Q.DISPLAY:Q.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},ss=function(t,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),t=C.makeSpan(n,[t])}return t},Bf=function(t,r,n){var i=ls(n),a;if(n.output==="mathml")return la(t,r,i,n.displayMode,!0);if(n.output==="html"){var l=h0(t,i);a=C.makeSpan(["katex"],[l])}else{var s=la(t,r,i,n.displayMode,!1),o=h0(t,i);a=C.makeSpan(["katex"],[s,o])}return ss(a,n)},Nf=function(t,r,n){var i=ls(n),a=h0(t,i),l=C.makeSpan(["katex"],[a]);return ss(l,n)},Ff={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Lf=function(t){var r=new F.MathNode("mo",[new F.TextNode(Ff[t.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},Rf={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Pf=function(t){return t.type==="ordgroup"?t.body.length:1},Of=function(t,r){function n(){var s=4e5,o=t.label.slice(1);if(["widehat","widecheck","widetilde","utilde"].includes(o)){var u=t,h=Pf(u.base),m,d,p;if(h>5)o==="widehat"||o==="widecheck"?(m=420,s=2364,p=.42,d=o+"4"):(m=312,s=2340,p=.34,d="tilde4");else{var y=[1,1,2,2,3,3][h];o==="widehat"||o==="widecheck"?(s=[0,1062,2364,2364,2364][y],m=[0,239,300,360,420][y],p=[0,.24,.3,.3,.36,.42][y],d=o+y):(s=[0,600,1033,2339,2340][y],m=[0,260,286,306,312][y],p=[0,.26,.286,.3,.306,.34][y],d="tilde"+y)}var w=new Et(d),M=new bt([w],{width:"100%",height:P(p),viewBox:"0 0 "+s+" "+m,preserveAspectRatio:"none"});return{span:C.makeSvgSpan([],[M],r),minWidth:0,height:p}}else{var S=[],z=Rf[o],[I,V,O]=z,E=O/1e3,G=I.length,K,U;if(G===1){var D=z[3];K=["hide-tail"],U=[D]}else if(G===2)K=["halfarrow-left","halfarrow-right"],U=["xMinYMin","xMaxYMin"];else if(G===3)K=["brace-left","brace-center","brace-right"],U=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+G+" children.");for(var $=0;$0&&(i.style.minWidth=P(a)),i},qf=function(t,r,n,i,a){var l,s=t.height+t.depth+n+i;if(/fbox|color|angl/.test(r)){if(l=C.makeSpan(["stretchy",r],[],a),r==="fbox"){var o=a.color&&a.getColor();o&&(l.style.borderColor=o)}}else{var u=[];/^[bx]cancel$/.test(r)&&u.push(new o0({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new o0({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new bt(u,{width:"100%",height:P(s)});l=C.makeSvgSpan([],[h],a)}return l.height=s,l.style.height=P(s),l},wt={encloseSpan:qf,mathMLnode:Lf,svgSpan:Of};function re(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function j0(e){var t=un(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function un(e){return e&&(e.type==="atom"||cf.hasOwnProperty(e.type))?e:null}var $0=(e,t)=>{var r,n,i;e&&e.type==="supsub"?(n=re(e.base,"accent"),r=n.base,e.base=r,i=of(oe(e,t)),e.base=n):(n=re(e,"accent"),r=n.base);var a=oe(r,t.havingCrampedStyle()),l=n.isShifty&&ue.isCharacterBox(r),s=0;if(l){var o=ue.getBaseElem(r),u=oe(o,t.havingCrampedStyle());s=Ji(u).skew}var h=n.label==="\\c",m=h?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),d;if(n.isStretchy)d=wt.svgSpan(n,t),d=C.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:d,wrapperClasses:["svg-align"],wrapperStyle:s>0?{width:"calc(100% - "+P(2*s)+")",marginLeft:P(2*s)}:void 0}]},t);else{var p,y;n.label==="\\vec"?(p=C.staticSvg("vec",t),y=C.svgData.vec[1]):(p=C.makeOrd({mode:n.mode,text:n.label},t,"textord"),p=Ji(p),p.italic=0,y=p.width,h&&(m+=p.depth)),d=C.makeSpan(["accent-body"],[p]);var w=n.label==="\\textcircled";w&&(d.classes.push("accent-full"),m=a.height);var M=s;w||(M-=y/2),d.style.left=P(M),n.label==="\\textcircled"&&(d.style.top=".2em"),d=C.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-m},{type:"elem",elem:d}]},t)}var S=C.makeSpan(["mord","accent"],[d],t);return i?(i.children[0]=S,i.height=Math.max(S.height,i.height),i.classes[0]="mord",i):S},os=(e,t)=>{var r=e.isStretchy?wt.mathMLnode(e.label):new F.MathNode("mo",[Je(e.label,e.mode)]),n=new F.MathNode("mover",[me(e.base,t),r]);return n.setAttribute("accent","true"),n},Hf=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));_({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var r=en(t[0]),n=!Hf.test(e.funcName),i=!n||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:n,isShifty:i,base:r}},htmlBuilder:$0,mathmlBuilder:os});_({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var r=t[0],n=e.parser.mode;return n==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:e.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:$0,mathmlBuilder:os});_({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:r,funcName:n}=e,i=t[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},htmlBuilder:(e,t)=>{var r=oe(e.base,t),n=wt.svgSpan(e,t),i=e.label==="\\utilde"?.12:0,a=C.makeVList({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]},t);return C.makeSpan(["mord","accentunder"],[a],t)},mathmlBuilder:(e,t)=>{var r=wt.mathMLnode(e.label),n=new F.MathNode("munder",[me(e.base,t),r]);return n.setAttribute("accentunder","true"),n}});var Hr=e=>{var t=new F.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};_({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,r){var{parser:n,funcName:i}=e;return{type:"xArrow",mode:n.mode,label:i,body:t[0],below:r[0]}},htmlBuilder(e,t){var r=t.style,n=t.havingStyle(r.sup()),i=C.wrapFragment(oe(e.body,n,t),t),a=e.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var l;e.below&&(n=t.havingStyle(r.sub()),l=C.wrapFragment(oe(e.below,n,t),t),l.classes.push(a+"-arrow-pad"));var s=wt.svgSpan(e,t),o=-t.fontMetrics().axisHeight+.5*s.height,u=-t.fontMetrics().axisHeight-.5*s.height-.111;(i.depth>.25||e.label==="\\xleftequilibrium")&&(u-=i.depth);var h;if(l){var m=-t.fontMetrics().axisHeight+l.height+.5*s.height+.111;h=C.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:s,shift:o},{type:"elem",elem:l,shift:m}]},t)}else h=C.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:s,shift:o}]},t);return h.children[0].children[0].children[1].classes.push("svg-align"),C.makeSpan(["mrel","x-arrow"],[h],t)},mathmlBuilder(e,t){var r=wt.mathMLnode(e.label);r.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(e.body){var i=Hr(me(e.body,t));if(e.below){var a=Hr(me(e.below,t));n=new F.MathNode("munderover",[r,a,i])}else n=new F.MathNode("mover",[r,i])}else if(e.below){var l=Hr(me(e.below,t));n=new F.MathNode("munder",[r,l])}else n=Hr(),n=new F.MathNode("mover",[r,n]);return n}});var Vf=C.makeSpan;function us(e,t){var r=ze(e.body,t,!0);return Vf([e.mclass],r,t)}function cs(e,t){var r,n=Ve(e.body,t);return e.mclass==="minner"?r=new F.MathNode("mpadded",n):e.mclass==="mord"?e.isCharacterBox?(r=n[0],r.type="mi"):r=new F.MathNode("mi",n):(e.isCharacterBox?(r=n[0],r.type="mo"):r=new F.MathNode("mo",n),e.mclass==="mbin"?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):e.mclass==="mpunct"?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(r.attributes.lspace="0em",r.attributes.rspace="0em"):e.mclass==="minner"&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}_({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:r,funcName:n}=e,i=t[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:we(i),isCharacterBox:ue.isCharacterBox(i)}},htmlBuilder:us,mathmlBuilder:cs});var cn=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};_({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:r}=e;return{type:"mclass",mode:r.mode,mclass:cn(t[0]),body:we(t[1]),isCharacterBox:ue.isCharacterBox(t[1])}}});_({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:r,funcName:n}=e,i=t[1],a=t[0],l;n!=="\\stackrel"?l=cn(i):l="mrel";var s={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:we(i)},o={type:"supsub",mode:a.mode,base:s,sup:n==="\\underset"?null:a,sub:n==="\\underset"?a:null};return{type:"mclass",mode:r.mode,mclass:l,body:[o],isCharacterBox:ue.isCharacterBox(o)}},htmlBuilder:us,mathmlBuilder:cs});_({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:r}=e;return{type:"pmb",mode:r.mode,mclass:cn(t[0]),body:we(t[0])}},htmlBuilder(e,t){var r=ze(e.body,t,!0),n=C.makeSpan([e.mclass],r,t);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(e,t){var r=Ve(e.body,t),n=new F.MathNode("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var jf={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},sa=()=>({type:"styling",body:[],mode:"math",style:"display"}),oa=e=>e.type==="textord"&&e.text==="@",$f=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function Uf(e,t,r){var n=jf[e];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var i=r.callFunction("\\\\cdleft",[t[0]],[]),a={type:"atom",text:n,mode:"math",family:"rel"},l=r.callFunction("\\Big",[a],[]),s=r.callFunction("\\\\cdright",[t[1]],[]),o={type:"ordgroup",mode:"math",body:[i,l,s]};return r.callFunction("\\\\cdparent",[o],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function _f(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var r=e.fetch().text;if(r==="&"||r==="\\\\")e.consume();else if(r==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new L("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var n=[],i=[n],a=0;a-1))if("<>AV".indexOf(u)>-1)for(var m=0;m<2;m++){for(var d=!0,p=o+1;pAV=|." after @',l[o]);var y=Uf(u,h,e),w={type:"styling",body:[y],mode:"math",style:"display"};n.push(w),s=sa()}a%2===0?n.push(s):n.shift(),n=[],i.push(n)}e.gullet.endGroup(),e.gullet.endGroup();var M=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:M,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}_({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:r,funcName:n}=e;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:t[0]}},htmlBuilder(e,t){var r=t.havingStyle(t.style.sup()),n=C.wrapFragment(oe(e.label,r,t),t);return n.classes.push("cd-label-"+e.side),n.style.bottom=P(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(e,t){var r=new F.MathNode("mrow",[me(e.label,t)]);return r=new F.MathNode("mpadded",[r]),r.setAttribute("width","0"),e.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new F.MathNode("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}});_({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:r}=e;return{type:"cdlabelparent",mode:r.mode,fragment:t[0]}},htmlBuilder(e,t){var r=C.wrapFragment(oe(e.fragment,t),t);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(e,t){return new F.MathNode("mrow",[me(e.fragment,t)])}});_({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:r}=e,n=re(t[0],"ordgroup"),i=n.body,a="",l=0;l=1114111)throw new L("\\@char with invalid code point "+a);return o<=65535?u=String.fromCharCode(o):(o-=65536,u=String.fromCharCode((o>>10)+55296,(o&1023)+56320)),{type:"textord",mode:r.mode,text:u}}});var hs=(e,t)=>{var r=ze(e.body,t.withColor(e.color),!1);return C.makeFragment(r)},ms=(e,t)=>{var r=Ve(e.body,t.withColor(e.color)),n=new F.MathNode("mstyle",r);return n.setAttribute("mathcolor",e.color),n};_({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:r}=e,n=re(t[0],"color-token").color,i=t[1];return{type:"color",mode:r.mode,color:n,body:we(i)}},htmlBuilder:hs,mathmlBuilder:ms});_({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:r,breakOnTokenText:n}=e,i=re(t[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var a=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:a}},htmlBuilder:hs,mathmlBuilder:ms});_({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,r){var{parser:n}=e,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,a=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:a,size:i&&re(i,"size").value}},htmlBuilder(e,t){var r=C.makeSpan(["mspace"],[],t);return e.newLine&&(r.classes.push("newline"),e.size&&(r.style.marginTop=P(ye(e.size,t)))),r},mathmlBuilder(e,t){var r=new F.MathNode("mspace");return e.newLine&&(r.setAttribute("linebreak","newline"),e.size&&r.setAttribute("height",P(ye(e.size,t)))),r}});var m0={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},fs=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new L("Expected a control sequence",e);return t},Gf=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},ps=(e,t,r,n)=>{var i=e.gullet.macros.get(r.text);i==null&&(r.noexpand=!0,i={tokens:[r],numArgs:0,unexpandable:!e.gullet.isExpandable(r.text)}),e.gullet.macros.set(t,i,n)};_({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:r}=e;t.consumeSpaces();var n=t.fetch();if(m0[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=m0[n.text]),re(t.parseFunction(),"internal");throw new L("Invalid token after macro prefix",n)}});_({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:r}=e,n=t.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new L("Expected a control sequence",n);for(var a=0,l,s=[[]];t.gullet.future().text!=="{";)if(n=t.gullet.popToken(),n.text==="#"){if(t.gullet.future().text==="{"){l=t.gullet.future(),s[a].push("{");break}if(n=t.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new L('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new L('Argument number "'+n.text+'" out of order');a++,s.push([])}else{if(n.text==="EOF")throw new L("Expected a macro definition");s[a].push(n.text)}var{tokens:o}=t.gullet.consumeArg();return l&&o.unshift(l),(r==="\\edef"||r==="\\xdef")&&(o=t.gullet.expandTokens(o),o.reverse()),t.gullet.macros.set(i,{tokens:o,numArgs:a,delimiters:s},r===m0[r]),{type:"internal",mode:t.mode}}});_({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:r}=e,n=fs(t.gullet.popToken());t.gullet.consumeSpaces();var i=Gf(t);return ps(t,n,i,r==="\\\\globallet"),{type:"internal",mode:t.mode}}});_({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:r}=e,n=fs(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return ps(t,n,a,r==="\\\\globalfuture"),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:"internal",mode:t.mode}}});var fr=function(t,r,n){var i=de.math[t]&&de.math[t].replace,a=P0(i||t,r,n);if(!a)throw new Error("Unsupported symbol "+t+" and font size "+r+".");return a},U0=function(t,r,n,i){var a=n.havingBaseStyle(r),l=C.makeSpan(i.concat(a.sizingClasses(n)),[t],n),s=a.sizeMultiplier/n.sizeMultiplier;return l.height*=s,l.depth*=s,l.maxFontSize=a.sizeMultiplier,l},ds=function(t,r,n){var i=r.havingBaseStyle(n),a=(1-r.sizeMultiplier/i.sizeMultiplier)*r.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=P(a),t.height-=a,t.depth+=a},Wf=function(t,r,n,i,a,l){var s=C.makeSymbol(t,"Main-Regular",a,i),o=U0(s,r,i,l);return n&&ds(o,i,r),o},Yf=function(t,r,n,i){return C.makeSymbol(t,"Size"+r+"-Regular",n,i)},gs=function(t,r,n,i,a,l){var s=Yf(t,r,a,i),o=U0(C.makeSpan(["delimsizing","size"+r],[s],i),Q.TEXT,i,l);return n&&ds(o,i,Q.TEXT),o},Hn=function(t,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=C.makeSpan(["delimsizinginner",i],[C.makeSpan([],[C.makeSymbol(t,r,n)])]);return{type:"elem",elem:a}},Vn=function(t,r,n){var i=st["Size4-Regular"][t.charCodeAt(0)]?st["Size4-Regular"][t.charCodeAt(0)][4]:st["Size1-Regular"][t.charCodeAt(0)][4],a=new Et("inner",Qm(t,Math.round(1e3*r))),l=new bt([a],{width:P(i),height:P(r),style:"width:"+P(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),s=C.makeSvgSpan([],[l],n);return s.height=r,s.style.height=P(r),s.style.width=P(i),{type:"elem",elem:s}},f0=.008,Vr={type:"kern",size:-1*f0},Xf=["|","\\lvert","\\rvert","\\vert"],Kf=["\\|","\\lVert","\\rVert","\\Vert"],vs=function(t,r,n,i,a,l){var s,o,u,h,m="",d=0;s=u=h=t,o=null;var p="Size1-Regular";t==="\\uparrow"?u=h="⏐":t==="\\Uparrow"?u=h="‖":t==="\\downarrow"?s=u="⏐":t==="\\Downarrow"?s=u="‖":t==="\\updownarrow"?(s="\\uparrow",u="⏐",h="\\downarrow"):t==="\\Updownarrow"?(s="\\Uparrow",u="‖",h="\\Downarrow"):Xf.includes(t)?(u="∣",m="vert",d=333):Kf.includes(t)?(u="∥",m="doublevert",d=556):t==="["||t==="\\lbrack"?(s="⎡",u="⎢",h="⎣",p="Size4-Regular",m="lbrack",d=667):t==="]"||t==="\\rbrack"?(s="⎤",u="⎥",h="⎦",p="Size4-Regular",m="rbrack",d=667):t==="\\lfloor"||t==="⌊"?(u=s="⎢",h="⎣",p="Size4-Regular",m="lfloor",d=667):t==="\\lceil"||t==="⌈"?(s="⎡",u=h="⎢",p="Size4-Regular",m="lceil",d=667):t==="\\rfloor"||t==="⌋"?(u=s="⎥",h="⎦",p="Size4-Regular",m="rfloor",d=667):t==="\\rceil"||t==="⌉"?(s="⎤",u=h="⎥",p="Size4-Regular",m="rceil",d=667):t==="("||t==="\\lparen"?(s="⎛",u="⎜",h="⎝",p="Size4-Regular",m="lparen",d=875):t===")"||t==="\\rparen"?(s="⎞",u="⎟",h="⎠",p="Size4-Regular",m="rparen",d=875):t==="\\{"||t==="\\lbrace"?(s="⎧",o="⎨",h="⎩",u="⎪",p="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(s="⎫",o="⎬",h="⎭",u="⎪",p="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(s="⎧",h="⎩",u="⎪",p="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(s="⎫",h="⎭",u="⎪",p="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(s="⎧",h="⎭",u="⎪",p="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(s="⎫",h="⎩",u="⎪",p="Size4-Regular");var y=fr(s,p,a),w=y.height+y.depth,M=fr(u,p,a),S=M.height+M.depth,z=fr(h,p,a),I=z.height+z.depth,V=0,O=1;if(o!==null){var E=fr(o,p,a);V=E.height+E.depth,O=2}var G=w+I+V,K=Math.max(0,Math.ceil((r-G)/(O*S))),U=G+K*O*S,D=i.fontMetrics().axisHeight;n&&(D*=i.sizeMultiplier);var $=U/2-D,j=[];if(m.length>0){var ie=U-w-I,Y=Math.round(U*1e3),q=Jm(m,Math.round(ie*1e3)),ae=new Et(m,q),fe=(d/1e3).toFixed(3)+"em",Me=(Y/1e3).toFixed(3)+"em",je=new bt([ae],{width:fe,height:Me,viewBox:"0 0 "+d+" "+Y}),k=C.makeSvgSpan([],[je],i);k.height=Y/1e3,k.style.width=fe,k.style.height=Me,j.push({type:"elem",elem:k})}else{if(j.push(Hn(h,p,a)),j.push(Vr),o===null){var ke=U-w-I+2*f0;j.push(Vn(u,ke,i))}else{var be=(U-w-I-V)/2+2*f0;j.push(Vn(u,be,i)),j.push(Vr),j.push(Hn(o,p,a)),j.push(Vr),j.push(Vn(u,be,i))}j.push(Vr),j.push(Hn(s,p,a))}var A=i.havingBaseStyle(Q.TEXT),De=C.makeVList({positionType:"bottom",positionData:$,children:j},A);return U0(C.makeSpan(["delimsizing","mult"],[De],A),Q.TEXT,i,l)},jn=80,$n=.08,Un=function(t,r,n,i,a){var l=Zm(t,i,n),s=new Et(t,l),o=new bt([s],{width:"400em",height:P(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return C.makeSvgSpan(["hide-tail"],[o],a)},Zf=function(t,r){var n=r.havingBaseSizing(),i=ws("\\surd",t*n.sizeMultiplier,xs,n),a=n.sizeMultiplier,l=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),s,o=0,u=0,h=0,m;return i.type==="small"?(h=1e3+1e3*l+jn,t<1?a=1:t<1.4&&(a=.7),o=(1+l+$n)/a,u=(1+l)/a,s=Un("sqrtMain",o,h,l,r),s.style.minWidth="0.853em",m=.833/a):i.type==="large"?(h=(1e3+jn)*vr[i.size],u=(vr[i.size]+l)/a,o=(vr[i.size]+l+$n)/a,s=Un("sqrtSize"+i.size,o,h,l,r),s.style.minWidth="1.02em",m=1/a):(o=t+l+$n,u=t+l,h=Math.floor(1e3*t+l)+jn,s=Un("sqrtTall",o,h,l,r),s.style.minWidth="0.742em",m=1.056),s.height=u,s.style.height=P(o),{span:s,advanceWidth:m,ruleWidth:(r.fontMetrics().sqrtRuleThickness+l)*a}},ys=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],Qf=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],bs=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],vr=[0,1.2,1.8,2.4,3],Jf=function(t,r,n,i,a){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),ys.includes(t)||bs.includes(t))return gs(t,r,!1,n,i,a);if(Qf.includes(t))return vs(t,vr[r],!1,n,i,a);throw new L("Illegal delimiter: '"+t+"'")},e2=[{type:"small",style:Q.SCRIPTSCRIPT},{type:"small",style:Q.SCRIPT},{type:"small",style:Q.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],t2=[{type:"small",style:Q.SCRIPTSCRIPT},{type:"small",style:Q.SCRIPT},{type:"small",style:Q.TEXT},{type:"stack"}],xs=[{type:"small",style:Q.SCRIPTSCRIPT},{type:"small",style:Q.SCRIPT},{type:"small",style:Q.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],r2=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+t.type+"' here.")},ws=function(t,r,n,i){for(var a=Math.min(2,3-i.style.size),l=a;lr)return n[l]}return n[n.length-1]},ks=function(t,r,n,i,a,l){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var s;bs.includes(t)?s=e2:ys.includes(t)?s=xs:s=t2;var o=ws(t,r,s,i);return o.type==="small"?Wf(t,o.style,n,i,a,l):o.type==="large"?gs(t,o.size,n,i,a,l):vs(t,r,n,i,a,l)},n2=function(t,r,n,i,a,l){var s=i.fontMetrics().axisHeight*i.sizeMultiplier,o=901,u=5/i.fontMetrics().ptPerEm,h=Math.max(r-s,n+s),m=Math.max(h/500*o,2*h-u);return ks(t,m,!0,i,a,l)},yt={sqrtImage:Zf,sizedDelim:Jf,sizeToMaxHeight:vr,customSizedDelim:ks,leftRightDelim:n2},ua={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},i2=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function hn(e,t){var r=un(e);if(r&&i2.includes(r.text))return r;throw r?new L("Invalid delimiter '"+r.text+"' after '"+t.funcName+"'",e):new L("Invalid delimiter type '"+e.type+"'",e)}_({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var r=hn(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:ua[e.funcName].size,mclass:ua[e.funcName].mclass,delim:r.text}},htmlBuilder:(e,t)=>e.delim==="."?C.makeSpan([e.mclass]):yt.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(Je(e.delim,e.mode));var r=new F.MathNode("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=P(yt.sizeToMaxHeight[e.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function ca(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}_({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var r=e.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new L("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:hn(t[0],e).text,color:r}}});_({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var r=hn(t[0],e),n=e.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=re(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{ca(e);for(var r=ze(e.body,t,!0,["mopen","mclose"]),n=0,i=0,a=!1,l=0;l{ca(e);var r=Ve(e.body,t);if(e.left!=="."){var n=new F.MathNode("mo",[Je(e.left,e.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(e.right!=="."){var i=new F.MathNode("mo",[Je(e.right,e.mode)]);i.setAttribute("fence","true"),e.rightColor&&i.setAttribute("mathcolor",e.rightColor),r.push(i)}return H0(r)}});_({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var r=hn(t[0],e);if(!e.parser.leftrightDepth)throw new L("\\middle without preceding \\left",r);return{type:"middle",mode:e.parser.mode,delim:r.text}},htmlBuilder:(e,t)=>{var r;if(e.delim===".")r=kr(t,[]);else{r=yt.sizedDelim(e.delim,1,t,e.mode,[]);var n={delim:e.delim,options:t};r.isMiddle=n}return r},mathmlBuilder:(e,t)=>{var r=e.delim==="\\vert"||e.delim==="|"?Je("|","text"):Je(e.delim,e.mode),n=new F.MathNode("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var _0=(e,t)=>{var r=C.wrapFragment(oe(e.body,t),t),n=e.label.slice(1),i=t.sizeMultiplier,a,l=0,s=ue.isCharacterBox(e.body);if(n==="sout")a=C.makeSpan(["stretchy","sout"]),a.height=t.fontMetrics().defaultRuleThickness/i,l=-.5*t.fontMetrics().xHeight;else if(n==="phase"){var o=ye({number:.6,unit:"pt"},t),u=ye({number:.35,unit:"ex"},t),h=t.havingBaseSizing();i=i/h.sizeMultiplier;var m=r.height+r.depth+o+u;r.style.paddingLeft=P(m/2+o);var d=Math.floor(1e3*m*i),p=Xm(d),y=new bt([new Et("phase",p)],{width:"400em",height:P(d/1e3),viewBox:"0 0 400000 "+d,preserveAspectRatio:"xMinYMin slice"});a=C.makeSvgSpan(["hide-tail"],[y],t),a.style.height=P(m),l=r.depth+o+u}else{/cancel/.test(n)?s||r.classes.push("cancel-pad"):n==="angl"?r.classes.push("anglpad"):r.classes.push("boxpad");var w=0,M=0,S=0;/box/.test(n)?(S=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),w=t.fontMetrics().fboxsep+(n==="colorbox"?0:S),M=w):n==="angl"?(S=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),w=4*S,M=Math.max(0,.25-r.depth)):(w=s?.2:0,M=w),a=wt.encloseSpan(r,n,w,M,t),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=P(S)):n==="angl"&&S!==.049&&(a.style.borderTopWidth=P(S),a.style.borderRightWidth=P(S)),l=r.depth+M,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var z;if(e.backgroundColor)z=C.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:l},{type:"elem",elem:r,shift:0}]},t);else{var I=/cancel|phase/.test(n)?["svg-align"]:[];z=C.makeVList({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:l,wrapperClasses:I}]},t)}return/cancel/.test(n)&&(z.height=r.height,z.depth=r.depth),/cancel/.test(n)&&!s?C.makeSpan(["mord","cancel-lap"],[z],t):C.makeSpan(["mord"],[z],t)},G0=(e,t)=>{var r=0,n=new F.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[me(e.body,t)]);switch(e.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),e.label==="\\fcolorbox"){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);n.setAttribute("style","border: "+i+"em solid "+String(e.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&n.setAttribute("mathbackground",e.backgroundColor),n};_({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,r){var{parser:n,funcName:i}=e,a=re(t[0],"color-token").color,l=t[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:l}},htmlBuilder:_0,mathmlBuilder:G0});_({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,r){var{parser:n,funcName:i}=e,a=re(t[0],"color-token").color,l=re(t[1],"color-token").color,s=t[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:l,borderColor:a,body:s}},htmlBuilder:_0,mathmlBuilder:G0});_({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:r}=e;return{type:"enclose",mode:r.mode,label:"\\fbox",body:t[0]}}});_({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:r,funcName:n}=e,i=t[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:_0,mathmlBuilder:G0});_({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:r}=e;return{type:"enclose",mode:r.mode,label:"\\angl",body:t[0]}}});var Ss={};function ct(e){for(var{type:t,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:l}=e,s={type:t,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},o=0;o{var t=e.parser.settings;if(!t.displayMode)throw new L("{"+e.envName+"} can be used only in display mode.")};function W0(e){if(e.indexOf("ed")===-1)return e.indexOf("*")===-1}function Bt(e,t,r){var{hskipBeforeAndAfter:n,addJot:i,cols:a,arraystretch:l,colSeparationType:s,autoTag:o,singleRow:u,emptySingleRow:h,maxNumCols:m,leqno:d}=t;if(e.gullet.beginGroup(),u||e.gullet.macros.set("\\cr","\\\\\\relax"),!l){var p=e.gullet.expandMacroAsText("\\arraystretch");if(p==null)l=1;else if(l=parseFloat(p),!l||l<0)throw new L("Invalid \\arraystretch: "+p)}e.gullet.beginGroup();var y=[],w=[y],M=[],S=[],z=o!=null?[]:void 0;function I(){o&&e.gullet.macros.set("\\@eqnsw","1",!0)}function V(){z&&(e.gullet.macros.get("\\df@tag")?(z.push(e.subparse([new We("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):z.push(!!o&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(I(),S.push(ha(e));;){var O=e.parseExpression(!1,u?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),O={type:"ordgroup",mode:e.mode,body:O},r&&(O={type:"styling",mode:e.mode,style:r,body:[O]}),y.push(O);var E=e.fetch().text;if(E==="&"){if(m&&y.length===m){if(u||s)throw new L("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(E==="\\end"){V(),y.length===1&&O.type==="styling"&&O.body[0].body.length===0&&(w.length>1||!h)&&w.pop(),S.length0&&(I+=.25),u.push({pos:I,isDashed:Ut[Nt]})}for(V(l[0]),n=0;n0&&($+=z,G<$&&(G=$),$=0)),t.addJot&&(G+=w),K.height=E,K.depth=G,I+=E,K.pos=I,I+=G+$,o[n]=K,V(l[n+1])}var j=I/2+r.fontMetrics().axisHeight,ie=t.cols||[],Y=[],q,ae,fe=[];if(t.tags&&t.tags.some(Ut=>Ut))for(n=0;n=s)){var Xe=void 0;(i>0||t.hskipBeforeAndAfter)&&(Xe=ue.deflt(be.pregap,d),Xe!==0&&(q=C.makeSpan(["arraycolsep"],[]),q.style.width=P(Xe),Y.push(q)));var Ie=[];for(n=0;n0){for(var pn=C.makeLineSpan("hline",r,h),dn=C.makeLineSpan("hdashline",r,h),ir=[{type:"elem",elem:o,shift:0}];u.length>0;){var ar=u.pop(),lr=ar.pos-j;ar.isDashed?ir.push({type:"elem",elem:dn,shift:lr}):ir.push({type:"elem",elem:pn,shift:lr})}o=C.makeVList({positionType:"individualShift",children:ir},r)}if(fe.length===0)return C.makeSpan(["mord"],[o],r);var $t=C.makeVList({positionType:"individualShift",children:fe},r);return $t=C.makeSpan(["tag"],[$t],r),C.makeFragment([o,$t])},a2={c:"center ",l:"left ",r:"right "},mt=function(t,r){for(var n=[],i=new F.MathNode("mtd",[],["mtr-glue"]),a=new F.MathNode("mtd",[],["mml-eqn-num"]),l=0;l0){var y=t.cols,w="",M=!1,S=0,z=y.length;y[0].type==="separator"&&(d+="top ",S=1),y[y.length-1].type==="separator"&&(d+="bottom ",z-=1);for(var I=S;I0?"left ":"",d+=K[K.length-1].length>0?"right ":"";for(var U=1;U-1?"alignat":"align",a=t.envName==="split",l=Bt(t.parser,{cols:n,addJot:!0,autoTag:a?void 0:W0(t.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:a?2:void 0,leqno:t.parser.settings.leqno},"display"),s,o=0,u={type:"ordgroup",mode:t.mode,body:[]};if(r[0]&&r[0].type==="ordgroup"){for(var h="",m=0;m0&&p&&(M=1),n[y]={type:"align",align:w,pregap:M,postgap:0}}return l.colSeparationType=p?"align":"alignat",l};ct({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var r=un(t[0]),n=r?[t[0]]:re(t[0],"ordgroup").body,i=n.map(function(l){var s=j0(l),o=s.text;if("lcr".indexOf(o)!==-1)return{type:"align",align:o};if(o==="|")return{type:"separator",separator:"|"};if(o===":")return{type:"separator",separator:":"};throw new L("Unknown column alignment: "+o,l)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return Bt(e.parser,a,Y0(e.envName))},htmlBuilder:ht,mathmlBuilder:mt});ct({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if(e.envName.charAt(e.envName.length-1)==="*"){var i=e.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,"lcr".indexOf(r)===-1)throw new L("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var a=Bt(e.parser,n,Y0(e.envName)),l=Math.max(0,...a.body.map(s=>s.length));return a.cols=new Array(l).fill({type:"align",align:r}),t?{type:"leftright",mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:ht,mathmlBuilder:mt});ct({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},r=Bt(e.parser,t,"script");return r.colSeparationType="small",r},htmlBuilder:ht,mathmlBuilder:mt});ct({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var r=un(t[0]),n=r?[t[0]]:re(t[0],"ordgroup").body,i=n.map(function(l){var s=j0(l),o=s.text;if("lc".indexOf(o)!==-1)return{type:"align",align:o};throw new L("Unknown column alignment: "+o,l)});if(i.length>1)throw new L("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5};if(a=Bt(e.parser,a,"script"),a.body.length>0&&a.body[0].length>1)throw new L("{subarray} can contain only one column");return a},htmlBuilder:ht,mathmlBuilder:mt});ct({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},r=Bt(e.parser,t,Y0(e.envName));return{type:"leftright",mode:e.mode,body:[r],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:ht,mathmlBuilder:mt});ct({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Ts,htmlBuilder:ht,mathmlBuilder:mt});ct({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){["gather","gather*"].includes(e.envName)&&mn(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:W0(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Bt(e.parser,t,"display")},htmlBuilder:ht,mathmlBuilder:mt});ct({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Ts,htmlBuilder:ht,mathmlBuilder:mt});ct({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){mn(e);var t={autoTag:W0(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Bt(e.parser,t,"display")},htmlBuilder:ht,mathmlBuilder:mt});ct({type:"array",names:["CD"],props:{numArgs:0},handler(e){return mn(e),_f(e.parser)},htmlBuilder:ht,mathmlBuilder:mt});v("\\nonumber","\\gdef\\@eqnsw{0}");v("\\notag","\\nonumber");_({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new L(e.funcName+" valid only within array environment")}});var ma=Ss;_({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:r,funcName:n}=e,i=t[0];if(i.type!=="ordgroup")throw new L("Invalid environment name",i);for(var a="",l=0;l{var r=e.font,n=t.withFont(r);return oe(e.body,n)},Ms=(e,t)=>{var r=e.font,n=t.withFont(r);return me(e.body,n)},fa={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};_({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:r,funcName:n}=e,i=en(t[0]),a=n;return a in fa&&(a=fa[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},htmlBuilder:zs,mathmlBuilder:Ms});_({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:r}=e,n=t[0],i=ue.isCharacterBox(n);return{type:"mclass",mode:r.mode,mclass:cn(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:i}}});_({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:r,funcName:n,breakOnTokenText:i}=e,{mode:a}=r,l=r.parseExpression(!0,i),s="math"+n.slice(1);return{type:"font",mode:a,font:s,body:{type:"ordgroup",mode:r.mode,body:l}}},htmlBuilder:zs,mathmlBuilder:Ms});var Cs=(e,t)=>{var r=t;return e==="display"?r=r.id>=Q.SCRIPT.id?r.text():Q.DISPLAY:e==="text"&&r.size===Q.DISPLAY.size?r=Q.TEXT:e==="script"?r=Q.SCRIPT:e==="scriptscript"&&(r=Q.SCRIPTSCRIPT),r},X0=(e,t)=>{var r=Cs(e.size,t.style),n=r.fracNum(),i=r.fracDen(),a;a=t.havingStyle(n);var l=oe(e.numer,a,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,o=3.5/t.fontMetrics().ptPerEm;l.height=l.height0?y=3*d:y=7*d,w=t.fontMetrics().denom1):(m>0?(p=t.fontMetrics().num2,y=d):(p=t.fontMetrics().num3,y=3*d),w=t.fontMetrics().denom2);var M;if(h){var z=t.fontMetrics().axisHeight;p-l.depth-(z+.5*m){var r=new F.MathNode("mfrac",[me(e.numer,t),me(e.denom,t)]);if(!e.hasBarLine)r.setAttribute("linethickness","0px");else if(e.barSize){var n=ye(e.barSize,t);r.setAttribute("linethickness",P(n))}var i=Cs(e.size,t.style);if(i.size!==t.style.size){r=new F.MathNode("mstyle",[r]);var a=i.size===Q.DISPLAY.size?"true":"false";r.setAttribute("displaystyle",a),r.setAttribute("scriptlevel","0")}if(e.leftDelim!=null||e.rightDelim!=null){var l=[];if(e.leftDelim!=null){var s=new F.MathNode("mo",[new F.TextNode(e.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),l.push(s)}if(l.push(r),e.rightDelim!=null){var o=new F.MathNode("mo",[new F.TextNode(e.rightDelim.replace("\\",""))]);o.setAttribute("fence","true"),l.push(o)}return H0(l)}return r};_({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:r,funcName:n}=e,i=t[0],a=t[1],l,s=null,o=null,u="auto";switch(n){case"\\dfrac":case"\\frac":case"\\tfrac":l=!0;break;case"\\\\atopfrac":l=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":l=!1,s="(",o=")";break;case"\\\\bracefrac":l=!1,s="\\{",o="\\}";break;case"\\\\brackfrac":l=!1,s="[",o="]";break;default:throw new Error("Unrecognized genfrac command")}switch(n){case"\\dfrac":case"\\dbinom":u="display";break;case"\\tfrac":case"\\tbinom":u="text";break}return{type:"genfrac",mode:r.mode,continued:!1,numer:i,denom:a,hasBarLine:l,leftDelim:s,rightDelim:o,size:u,barSize:null}},htmlBuilder:X0,mathmlBuilder:K0});_({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:r,funcName:n}=e,i=t[0],a=t[1];return{type:"genfrac",mode:r.mode,continued:!0,numer:i,denom:a,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});_({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:r,token:n}=e,i;switch(r){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:i,token:n}}});var pa=["display","text","script","scriptscript"],da=function(t){var r=null;return t.length>0&&(r=t,r=r==="."?null:r),r};_({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:r}=e,n=t[4],i=t[5],a=en(t[0]),l=a.type==="atom"&&a.family==="open"?da(a.text):null,s=en(t[1]),o=s.type==="atom"&&s.family==="close"?da(s.text):null,u=re(t[2],"size"),h,m=null;u.isBlank?h=!0:(m=u.value,h=m.number>0);var d="auto",p=t[3];if(p.type==="ordgroup"){if(p.body.length>0){var y=re(p.body[0],"textord");d=pa[Number(y.text)]}}else p=re(p,"textord"),d=pa[Number(p.text)];return{type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:m,leftDelim:l,rightDelim:o,size:d}},htmlBuilder:X0,mathmlBuilder:K0});_({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:r,funcName:n,token:i}=e;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:re(t[0],"size").value,token:i}}});_({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:r,funcName:n}=e,i=t[0],a=Fm(re(t[1],"infix").size),l=t[2],s=a.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:l,continued:!1,hasBarLine:s,barSize:a,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:X0,mathmlBuilder:K0});var Es=(e,t)=>{var r=t.style,n,i;e.type==="supsub"?(n=e.sup?oe(e.sup,t.havingStyle(r.sup()),t):oe(e.sub,t.havingStyle(r.sub()),t),i=re(e.base,"horizBrace")):i=re(e,"horizBrace");var a=oe(i.base,t.havingBaseStyle(Q.DISPLAY)),l=wt.svgSpan(i,t),s;if(i.isOver?(s=C.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:l}]},t),s.children[0].children[0].children[1].classes.push("svg-align")):(s=C.makeVList({positionType:"bottom",positionData:a.depth+.1+l.height,children:[{type:"elem",elem:l},{type:"kern",size:.1},{type:"elem",elem:a}]},t),s.children[0].children[0].children[0].classes.push("svg-align")),n){var o=C.makeSpan(["mord",i.isOver?"mover":"munder"],[s],t);i.isOver?s=C.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:.2},{type:"elem",elem:n}]},t):s=C.makeVList({positionType:"bottom",positionData:o.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:o}]},t)}return C.makeSpan(["mord",i.isOver?"mover":"munder"],[s],t)},l2=(e,t)=>{var r=wt.mathMLnode(e.label);return new F.MathNode(e.isOver?"mover":"munder",[me(e.base,t),r])};_({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:r,funcName:n}=e;return{type:"horizBrace",mode:r.mode,label:n,isOver:/^\\over/.test(n),base:t[0]}},htmlBuilder:Es,mathmlBuilder:l2});_({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:r}=e,n=t[1],i=re(t[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:we(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var r=ze(e.body,t,!1);return C.makeAnchor(e.href,[],r,t)},mathmlBuilder:(e,t)=>{var r=Dt(e.body,t);return r instanceof _e||(r=new _e("mrow",[r])),r.setAttribute("href",e.href),r}});_({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:r}=e,n=re(t[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],a=0;a{var{parser:r,funcName:n,token:i}=e,a=re(t[0],"raw").string,l=t[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var s,o={};switch(n){case"\\htmlClass":o.class=a,s={command:"\\htmlClass",class:a};break;case"\\htmlId":o.id=a,s={command:"\\htmlId",id:a};break;case"\\htmlStyle":o.style=a,s={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var u=a.split(","),h=0;h{var r=ze(e.body,t,!1),n=["enclosing"];e.attributes.class&&n.push(...e.attributes.class.trim().split(/\s+/));var i=C.makeSpan(n,r,t);for(var a in e.attributes)a!=="class"&&e.attributes.hasOwnProperty(a)&&i.setAttribute(a,e.attributes[a]);return i},mathmlBuilder:(e,t)=>Dt(e.body,t)});_({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:r}=e;return{type:"htmlmathml",mode:r.mode,html:we(t[0]),mathml:we(t[1])}},htmlBuilder:(e,t)=>{var r=ze(e.html,t,!1);return C.makeFragment(r)},mathmlBuilder:(e,t)=>Dt(e.mathml,t)});var _n=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!r)throw new L("Invalid size: '"+t+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!Yl(n))throw new L("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};_({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,r)=>{var{parser:n}=e,i={number:0,unit:"em"},a={number:.9,unit:"em"},l={number:0,unit:"em"},s="";if(r[0])for(var o=re(r[0],"raw").string,u=o.split(","),h=0;h{var r=ye(e.height,t),n=0;e.totalheight.number>0&&(n=ye(e.totalheight,t)-r);var i=0;e.width.number>0&&(i=ye(e.width,t));var a={height:P(r+n)};i>0&&(a.width=P(i)),n>0&&(a.verticalAlign=P(-n));var l=new lf(e.src,e.alt,a);return l.height=r,l.depth=n,l},mathmlBuilder:(e,t)=>{var r=new F.MathNode("mglyph",[]);r.setAttribute("alt",e.alt);var n=ye(e.height,t),i=0;if(e.totalheight.number>0&&(i=ye(e.totalheight,t)-n,r.setAttribute("valign",P(-i))),r.setAttribute("height",P(n+i)),e.width.number>0){var a=ye(e.width,t);r.setAttribute("width",P(a))}return r.setAttribute("src",e.src),r}});_({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:r,funcName:n}=e,i=re(t[0],"size");if(r.settings.strict){var a=n[1]==="m",l=i.value.unit==="mu";a?(l||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),r.mode!=="math"&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):l&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:i.value}},htmlBuilder(e,t){return C.makeGlue(e.dimension,t)},mathmlBuilder(e,t){var r=ye(e.dimension,t);return new F.SpaceNode(r)}});_({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:r,funcName:n}=e,i=t[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}},htmlBuilder:(e,t)=>{var r;e.alignment==="clap"?(r=C.makeSpan([],[oe(e.body,t)]),r=C.makeSpan(["inner"],[r],t)):r=C.makeSpan(["inner"],[oe(e.body,t)]);var n=C.makeSpan(["fix"],[]),i=C.makeSpan([e.alignment],[r,n],t),a=C.makeSpan(["strut"]);return a.style.height=P(i.height+i.depth),i.depth&&(a.style.verticalAlign=P(-i.depth)),i.children.unshift(a),i=C.makeSpan(["thinbox"],[i],t),C.makeSpan(["mord","vbox"],[i],t)},mathmlBuilder:(e,t)=>{var r=new F.MathNode("mpadded",[me(e.body,t)]);if(e.alignment!=="rlap"){var n=e.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}});_({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:r,parser:n}=e,i=n.mode;n.switchMode("math");var a=r==="\\("?"\\)":"$",l=n.parseExpression(!1,a);return n.expect(a),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",body:l}}});_({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new L("Mismatched "+e.funcName)}});var ga=(e,t)=>{switch(t.style.size){case Q.DISPLAY.size:return e.display;case Q.TEXT.size:return e.text;case Q.SCRIPT.size:return e.script;case Q.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};_({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:r}=e;return{type:"mathchoice",mode:r.mode,display:we(t[0]),text:we(t[1]),script:we(t[2]),scriptscript:we(t[3])}},htmlBuilder:(e,t)=>{var r=ga(e,t),n=ze(r,t,!1);return C.makeFragment(n)},mathmlBuilder:(e,t)=>{var r=ga(e,t);return Dt(r,t)}});var Ds=(e,t,r,n,i,a,l)=>{e=C.makeSpan([],[e]);var s=r&&ue.isCharacterBox(r),o,u;if(t){var h=oe(t,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var m=oe(r,n.havingStyle(i.sub()),n);o={elem:m,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-m.height)}}var d;if(u&&o){var p=n.fontMetrics().bigOpSpacing5+o.elem.height+o.elem.depth+o.kern+e.depth+l;d=C.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:o.elem,marginLeft:P(-a)},{type:"kern",size:o.kern},{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:P(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(o){var y=e.height-l;d=C.makeVList({positionType:"top",positionData:y,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:o.elem,marginLeft:P(-a)},{type:"kern",size:o.kern},{type:"elem",elem:e}]},n)}else if(u){var w=e.depth+l;d=C.makeVList({positionType:"bottom",positionData:w,children:[{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:P(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else return e;var M=[d];if(o&&a!==0&&!s){var S=C.makeSpan(["mspace"],[],n);S.style.marginRight=P(a),M.unshift(S)}return C.makeSpan(["mop","op-limits"],M,n)},Is=["\\smallint"],nr=(e,t)=>{var r,n,i=!1,a;e.type==="supsub"?(r=e.sup,n=e.sub,a=re(e.base,"op"),i=!0):a=re(e,"op");var l=t.style,s=!1;l.size===Q.DISPLAY.size&&a.symbol&&!Is.includes(a.name)&&(s=!0);var o;if(a.symbol){var u=s?"Size2-Regular":"Size1-Regular",h="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(h=a.name.slice(1),a.name=h==="oiint"?"\\iint":"\\iiint"),o=C.makeSymbol(a.name,u,"math",t,["mop","op-symbol",s?"large-op":"small-op"]),h.length>0){var m=o.italic,d=C.staticSvg(h+"Size"+(s?"2":"1"),t);o=C.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:d,shift:s?.08:0}]},t),a.name="\\"+h,o.classes.unshift("mop"),o.italic=m}}else if(a.body){var p=ze(a.body,t,!0);p.length===1&&p[0]instanceof Qe?(o=p[0],o.classes[0]="mop"):o=C.makeSpan(["mop"],p,t)}else{for(var y=[],w=1;w{var r;if(e.symbol)r=new _e("mo",[Je(e.name,e.mode)]),Is.includes(e.name)&&r.setAttribute("largeop","false");else if(e.body)r=new _e("mo",Ve(e.body,t));else{r=new _e("mi",[new ot(e.name.slice(1))]);var n=new _e("mo",[Je("⁡","text")]);e.parentIsSupSub?r=new _e("mrow",[r,n]):r=as([r,n])}return r},s2={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};_({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:r,funcName:n}=e,i=n;return i.length===1&&(i=s2[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:nr,mathmlBuilder:Er});_({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:r}=e,n=t[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:we(n)}},htmlBuilder:nr,mathmlBuilder:Er});var o2={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};_({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:r}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:nr,mathmlBuilder:Er});_({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:r}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:nr,mathmlBuilder:Er});_({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){var{parser:t,funcName:r}=e,n=r;return n.length===1&&(n=o2[n]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:nr,mathmlBuilder:Er});var Bs=(e,t)=>{var r,n,i=!1,a;e.type==="supsub"?(r=e.sup,n=e.sub,a=re(e.base,"operatorname"),i=!0):a=re(e,"operatorname");var l;if(a.body.length>0){for(var s=a.body.map(m=>{var d=m.text;return typeof d=="string"?{type:"textord",mode:m.mode,text:d}:m}),o=ze(s,t.withFont("mathrm"),!0),u=0;u{for(var r=Ve(e.body,t.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new F.TextNode(s)]}var o=new F.MathNode("mi",r);o.setAttribute("mathvariant","normal");var u=new F.MathNode("mo",[Je("⁡","text")]);return e.parentIsSupSub?new F.MathNode("mrow",[o,u]):F.newDocumentFragment([o,u])};_({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:r,funcName:n}=e,i=t[0];return{type:"operatorname",mode:r.mode,body:we(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:Bs,mathmlBuilder:u2});v("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Ht({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?C.makeFragment(ze(e.body,t,!1)):C.makeSpan(["mord"],ze(e.body,t,!0),t)},mathmlBuilder(e,t){return Dt(e.body,t,!0)}});_({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:r}=e,n=t[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(e,t){var r=oe(e.body,t.havingCrampedStyle()),n=C.makeLineSpan("overline-line",t),i=t.fontMetrics().defaultRuleThickness,a=C.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]},t);return C.makeSpan(["mord","overline"],[a],t)},mathmlBuilder(e,t){var r=new F.MathNode("mo",[new F.TextNode("‾")]);r.setAttribute("stretchy","true");var n=new F.MathNode("mover",[me(e.body,t),r]);return n.setAttribute("accent","true"),n}});_({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:r}=e,n=t[0];return{type:"phantom",mode:r.mode,body:we(n)}},htmlBuilder:(e,t)=>{var r=ze(e.body,t.withPhantom(),!1);return C.makeFragment(r)},mathmlBuilder:(e,t)=>{var r=Ve(e.body,t);return new F.MathNode("mphantom",r)}});_({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:r}=e,n=t[0];return{type:"hphantom",mode:r.mode,body:n}},htmlBuilder:(e,t)=>{var r=C.makeSpan([],[oe(e.body,t.withPhantom())]);if(r.height=0,r.depth=0,r.children)for(var n=0;n{var r=Ve(we(e.body),t),n=new F.MathNode("mphantom",r),i=new F.MathNode("mpadded",[n]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}});_({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:r}=e,n=t[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(e,t)=>{var r=C.makeSpan(["inner"],[oe(e.body,t.withPhantom())]),n=C.makeSpan(["fix"],[]);return C.makeSpan(["mord","rlap"],[r,n],t)},mathmlBuilder:(e,t)=>{var r=Ve(we(e.body),t),n=new F.MathNode("mphantom",r),i=new F.MathNode("mpadded",[n]);return i.setAttribute("width","0px"),i}});_({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:r}=e,n=re(t[0],"size").value,i=t[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(e,t){var r=oe(e.body,t),n=ye(e.dy,t);return C.makeVList({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]},t)},mathmlBuilder(e,t){var r=new F.MathNode("mpadded",[me(e.body,t)]),n=e.dy.number+e.dy.unit;return r.setAttribute("voffset",n),r}});_({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});_({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,r){var{parser:n}=e,i=r[0],a=re(t[0],"size"),l=re(t[1],"size");return{type:"rule",mode:n.mode,shift:i&&re(i,"size").value,width:a.value,height:l.value}},htmlBuilder(e,t){var r=C.makeSpan(["mord","rule"],[],t),n=ye(e.width,t),i=ye(e.height,t),a=e.shift?ye(e.shift,t):0;return r.style.borderRightWidth=P(n),r.style.borderTopWidth=P(i),r.style.bottom=P(a),r.width=n,r.height=i+a,r.depth=-a,r.maxFontSize=i*1.125*t.sizeMultiplier,r},mathmlBuilder(e,t){var r=ye(e.width,t),n=ye(e.height,t),i=e.shift?ye(e.shift,t):0,a=t.color&&t.getColor()||"black",l=new F.MathNode("mspace");l.setAttribute("mathbackground",a),l.setAttribute("width",P(r)),l.setAttribute("height",P(n));var s=new F.MathNode("mpadded",[l]);return i>=0?s.setAttribute("height",P(i)):(s.setAttribute("height",P(i)),s.setAttribute("depth",P(-i))),s.setAttribute("voffset",P(i)),s}});function Ns(e,t,r){for(var n=ze(e,t,!1),i=t.sizeMultiplier/r.sizeMultiplier,a=0;a{var r=t.havingSize(e.size);return Ns(e.body,r,t)};_({type:"sizing",names:va,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:r,funcName:n,parser:i}=e,a=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:va.indexOf(n)+1,body:a}},htmlBuilder:c2,mathmlBuilder:(e,t)=>{var r=t.havingSize(e.size),n=Ve(e.body,r),i=new F.MathNode("mstyle",n);return i.setAttribute("mathsize",P(r.sizeMultiplier)),i}});_({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,r)=>{var{parser:n}=e,i=!1,a=!1,l=r[0]&&re(r[0],"ordgroup");if(l)for(var s="",o=0;o{var r=C.makeSpan([],[oe(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return r;if(e.smashHeight&&(r.height=0,r.children))for(var n=0;n{var r=new F.MathNode("mpadded",[me(e.body,t)]);return e.smashHeight&&r.setAttribute("height","0px"),e.smashDepth&&r.setAttribute("depth","0px"),r}});_({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,r){var{parser:n}=e,i=r[0],a=t[0];return{type:"sqrt",mode:n.mode,body:a,index:i}},htmlBuilder(e,t){var r=oe(e.body,t.havingCrampedStyle());r.height===0&&(r.height=t.fontMetrics().xHeight),r=C.wrapFragment(r,t);var n=t.fontMetrics(),i=n.defaultRuleThickness,a=i;t.style.idr.height+r.depth+l&&(l=(l+m-r.height-r.depth)/2);var d=o.height-r.height-l-u;r.style.paddingLeft=P(h);var p=C.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+d)},{type:"elem",elem:o},{type:"kern",size:u}]},t);if(e.index){var y=t.havingStyle(Q.SCRIPTSCRIPT),w=oe(e.index,y,t),M=.6*(p.height-p.depth),S=C.makeVList({positionType:"shift",positionData:-M,children:[{type:"elem",elem:w}]},t),z=C.makeSpan(["root"],[S]);return C.makeSpan(["mord","sqrt"],[z,p],t)}else return C.makeSpan(["mord","sqrt"],[p],t)},mathmlBuilder(e,t){var{body:r,index:n}=e;return n?new F.MathNode("mroot",[me(r,t),me(n,t)]):new F.MathNode("msqrt",[me(r,t)])}});var ya={display:Q.DISPLAY,text:Q.TEXT,script:Q.SCRIPT,scriptscript:Q.SCRIPTSCRIPT};_({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:r,funcName:n,parser:i}=e,a=i.parseExpression(!0,r),l=n.slice(1,n.length-5);return{type:"styling",mode:i.mode,style:l,body:a}},htmlBuilder(e,t){var r=ya[e.style],n=t.havingStyle(r).withFont("");return Ns(e.body,n,t)},mathmlBuilder(e,t){var r=ya[e.style],n=t.havingStyle(r),i=Ve(e.body,n),a=new F.MathNode("mstyle",i),l={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},s=l[e.style];return a.setAttribute("scriptlevel",s[0]),a.setAttribute("displaystyle",s[1]),a}});var h2=function(t,r){var n=t.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===Q.DISPLAY.size||n.alwaysHandleSupSub);return i?nr:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===Q.DISPLAY.size||n.limits);return a?Bs:null}else{if(n.type==="accent")return ue.isCharacterBox(n.base)?$0:null;if(n.type==="horizBrace"){var l=!t.sub;return l===n.isOver?Es:null}else return null}else return null};Ht({type:"supsub",htmlBuilder(e,t){var r=h2(e,t);if(r)return r(e,t);var{base:n,sup:i,sub:a}=e,l=oe(n,t),s,o,u=t.fontMetrics(),h=0,m=0,d=n&&ue.isCharacterBox(n);if(i){var p=t.havingStyle(t.style.sup());s=oe(i,p,t),d||(h=l.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(a){var y=t.havingStyle(t.style.sub());o=oe(a,y,t),d||(m=l.depth+y.fontMetrics().subDrop*y.sizeMultiplier/t.sizeMultiplier)}var w;t.style===Q.DISPLAY?w=u.sup1:t.style.cramped?w=u.sup3:w=u.sup2;var M=t.sizeMultiplier,S=P(.5/u.ptPerEm/M),z=null;if(o){var I=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");(l instanceof Qe||I)&&(z=P(-l.italic))}var V;if(s&&o){h=Math.max(h,w,s.depth+.25*u.xHeight),m=Math.max(m,u.sub2);var O=u.defaultRuleThickness,E=4*O;if(h-s.depth-(o.height-m)0&&(h+=G,m-=G)}var K=[{type:"elem",elem:o,shift:m,marginRight:S,marginLeft:z},{type:"elem",elem:s,shift:-h,marginRight:S}];V=C.makeVList({positionType:"individualShift",children:K},t)}else if(o){m=Math.max(m,u.sub1,o.height-.8*u.xHeight);var U=[{type:"elem",elem:o,marginLeft:z,marginRight:S}];V=C.makeVList({positionType:"shift",positionData:m,children:U},t)}else if(s)h=Math.max(h,w,s.depth+.25*u.xHeight),V=C.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:s,marginRight:S}]},t);else throw new Error("supsub must have either sup or sub.");var D=c0(l,"right")||"mord";return C.makeSpan([D],[l,C.makeSpan(["msupsub"],[V])],t)},mathmlBuilder(e,t){var r=!1,n,i;e.base&&e.base.type==="horizBrace"&&(i=!!e.sup,i===e.base.isOver&&(r=!0,n=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var a=[me(e.base,t)];e.sub&&a.push(me(e.sub,t)),e.sup&&a.push(me(e.sup,t));var l;if(r)l=n?"mover":"munder";else if(e.sub)if(e.sup){var u=e.base;u&&u.type==="op"&&u.limits&&t.style===Q.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(t.style===Q.DISPLAY||u.limits)?l="munderover":l="msubsup"}else{var o=e.base;o&&o.type==="op"&&o.limits&&(t.style===Q.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||t.style===Q.DISPLAY)?l="munder":l="msub"}else{var s=e.base;s&&s.type==="op"&&s.limits&&(t.style===Q.DISPLAY||s.alwaysHandleSupSub)||s&&s.type==="operatorname"&&s.alwaysHandleSupSub&&(s.limits||t.style===Q.DISPLAY)?l="mover":l="msup"}return new F.MathNode(l,a)}});Ht({type:"atom",htmlBuilder(e,t){return C.mathsym(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var r=new F.MathNode("mo",[Je(e.text,e.mode)]);if(e.family==="bin"){var n=V0(e,t);n==="bold-italic"&&r.setAttribute("mathvariant",n)}else e.family==="punct"?r.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&r.setAttribute("stretchy","false");return r}});var Fs={mi:"italic",mn:"normal",mtext:"normal"};Ht({type:"mathord",htmlBuilder(e,t){return C.makeOrd(e,t,"mathord")},mathmlBuilder(e,t){var r=new F.MathNode("mi",[Je(e.text,e.mode,t)]),n=V0(e,t)||"italic";return n!==Fs[r.type]&&r.setAttribute("mathvariant",n),r}});Ht({type:"textord",htmlBuilder(e,t){return C.makeOrd(e,t,"textord")},mathmlBuilder(e,t){var r=Je(e.text,e.mode,t),n=V0(e,t)||"normal",i;return e.mode==="text"?i=new F.MathNode("mtext",[r]):/[0-9]/.test(e.text)?i=new F.MathNode("mn",[r]):e.text==="\\prime"?i=new F.MathNode("mo",[r]):i=new F.MathNode("mi",[r]),n!==Fs[i.type]&&i.setAttribute("mathvariant",n),i}});var Gn={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Wn={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Ht({type:"spacing",htmlBuilder(e,t){if(Wn.hasOwnProperty(e.text)){var r=Wn[e.text].className||"";if(e.mode==="text"){var n=C.makeOrd(e,t,"textord");return n.classes.push(r),n}else return C.makeSpan(["mspace",r],[C.mathsym(e.text,e.mode,t)],t)}else{if(Gn.hasOwnProperty(e.text))return C.makeSpan(["mspace",Gn[e.text]],[],t);throw new L('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var r;if(Wn.hasOwnProperty(e.text))r=new F.MathNode("mtext",[new F.TextNode(" ")]);else{if(Gn.hasOwnProperty(e.text))return new F.MathNode("mspace");throw new L('Unknown type of space "'+e.text+'"')}return r}});var ba=()=>{var e=new F.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};Ht({type:"tag",mathmlBuilder(e,t){var r=new F.MathNode("mtable",[new F.MathNode("mtr",[ba(),new F.MathNode("mtd",[Dt(e.body,t)]),ba(),new F.MathNode("mtd",[Dt(e.tag,t)])])]);return r.setAttribute("width","100%"),r}});var xa={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},wa={"\\textbf":"textbf","\\textmd":"textmd"},m2={"\\textit":"textit","\\textup":"textup"},ka=(e,t)=>{var r=e.font;if(r){if(xa[r])return t.withTextFontFamily(xa[r]);if(wa[r])return t.withTextFontWeight(wa[r]);if(r==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(m2[r])};_({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:r,funcName:n}=e,i=t[0];return{type:"text",mode:r.mode,body:we(i),font:n}},htmlBuilder(e,t){var r=ka(e,t),n=ze(e.body,r,!0);return C.makeSpan(["mord","text"],n,r)},mathmlBuilder(e,t){var r=ka(e,t);return Dt(e.body,r)}});_({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:r}=e;return{type:"underline",mode:r.mode,body:t[0]}},htmlBuilder(e,t){var r=oe(e.body,t),n=C.makeLineSpan("underline-line",t),i=t.fontMetrics().defaultRuleThickness,a=C.makeVList({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]},t);return C.makeSpan(["mord","underline"],[a],t)},mathmlBuilder(e,t){var r=new F.MathNode("mo",[new F.TextNode("‾")]);r.setAttribute("stretchy","true");var n=new F.MathNode("munder",[me(e.body,t),r]);return n.setAttribute("accentunder","true"),n}});_({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:r}=e;return{type:"vcenter",mode:r.mode,body:t[0]}},htmlBuilder(e,t){var r=oe(e.body,t),n=t.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return C.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]},t)},mathmlBuilder(e,t){return new F.MathNode("mpadded",[me(e.body,t)],["vcenter"])}});_({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,r){throw new L("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var r=Sa(e),n=[],i=t.havingStyle(t.style.text()),a=0;ae.body.replace(/ /g,e.star?"␣":" "),Mt=ns,Ls=`[ \r + ]`,f2="\\\\[a-zA-Z@]+",p2="\\\\[^\uD800-\uDFFF]",d2="("+f2+")"+Ls+"*",g2=`\\\\( +|[ \r ]+ +?)[ \r ]*`,p0="[̀-ͯ]",v2=new RegExp(p0+"+$"),y2="("+Ls+"+)|"+(g2+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(p0+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(p0+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+d2)+("|"+p2+")");class Aa{constructor(t,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=r,this.tokenRegex=new RegExp(y2,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,r){this.catcodes[t]=r}lex(){var t=this.input,r=this.tokenRegex.lastIndex;if(r===t.length)return new We("EOF",new qe(this,r,r));var n=this.tokenRegex.exec(t);if(n===null||n.index!==r)throw new L("Unexpected character: '"+t[r]+"'",new We(t[r],new qe(this,r,r+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=t.indexOf(` +`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new We(i,new qe(this,r,this.tokenRegex.lastIndex))}}class b2{constructor(t,r){t===void 0&&(t={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new L("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var r in t)t.hasOwnProperty(r)&&(t[r]==null?delete this.current[r]:this.current[r]=t[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,r,n){if(n===void 0&&(n=!1),n){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][t]=r)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(t)&&(a[t]=this.current[t])}r==null?delete this.current[t]:this.current[t]=r}}var x2=As;v("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});v("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});v("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});v("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});v("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var r=e.future();return t[0].length===1&&t[0][0].text===r.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});v("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");v("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var Ta={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};v("\\char",function(e){var t=e.popToken(),r,n="";if(t.text==="'")r=8,t=e.popToken();else if(t.text==='"')r=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")n=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new L("\\char` missing argument");n=t.text.charCodeAt(0)}else r=10;if(r){if(n=Ta[t.text],n==null||n>=r)throw new L("Invalid base-"+r+" digit "+t.text);for(var i;(i=Ta[e.future().text])!=null&&i{var i=e.consumeArg().tokens;if(i.length!==1)throw new L("\\newcommand's first argument must be a macro name");var a=i[0].text,l=e.isDefined(a);if(l&&!t)throw new L("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!l&&!r)throw new L("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var o="",u=e.expandNextToken();u.text!=="]"&&u.text!=="EOF";)o+=u.text,u=e.expandNextToken();if(!o.match(/^\s*[0-9]+\s*$/))throw new L("Invalid number of arguments: "+o);s=parseInt(o),i=e.consumeArg().tokens}return l&&n||e.macros.set(a,{tokens:i,numArgs:s}),""};v("\\newcommand",e=>Z0(e,!1,!0,!1));v("\\renewcommand",e=>Z0(e,!0,!1,!1));v("\\providecommand",e=>Z0(e,!0,!0,!0));v("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(r=>r.text).join("")),""});v("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(r=>r.text).join("")),""});v("\\show",e=>{var t=e.popToken(),r=t.text;return console.log(t,e.macros.get(r),Mt[r],de.math[r],de.text[r]),""});v("\\bgroup","{");v("\\egroup","}");v("~","\\nobreakspace");v("\\lq","`");v("\\rq","'");v("\\aa","\\r a");v("\\AA","\\r A");v("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");v("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");v("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");v("ℬ","\\mathscr{B}");v("ℰ","\\mathscr{E}");v("ℱ","\\mathscr{F}");v("ℋ","\\mathscr{H}");v("ℐ","\\mathscr{I}");v("ℒ","\\mathscr{L}");v("ℳ","\\mathscr{M}");v("ℛ","\\mathscr{R}");v("ℭ","\\mathfrak{C}");v("ℌ","\\mathfrak{H}");v("ℨ","\\mathfrak{Z}");v("\\Bbbk","\\Bbb{k}");v("·","\\cdotp");v("\\llap","\\mathllap{\\textrm{#1}}");v("\\rlap","\\mathrlap{\\textrm{#1}}");v("\\clap","\\mathclap{\\textrm{#1}}");v("\\mathstrut","\\vphantom{(}");v("\\underbar","\\underline{\\text{#1}}");v("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');v("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");v("\\ne","\\neq");v("≠","\\neq");v("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");v("∉","\\notin");v("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");v("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");v("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");v("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");v("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");v("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");v("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");v("⟂","\\perp");v("‼","\\mathclose{!\\mkern-0.8mu!}");v("∌","\\notni");v("⌜","\\ulcorner");v("⌝","\\urcorner");v("⌞","\\llcorner");v("⌟","\\lrcorner");v("©","\\copyright");v("®","\\textregistered");v("️","\\textregistered");v("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');v("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');v("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');v("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');v("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");v("⋮","\\vdots");v("\\varGamma","\\mathit{\\Gamma}");v("\\varDelta","\\mathit{\\Delta}");v("\\varTheta","\\mathit{\\Theta}");v("\\varLambda","\\mathit{\\Lambda}");v("\\varXi","\\mathit{\\Xi}");v("\\varPi","\\mathit{\\Pi}");v("\\varSigma","\\mathit{\\Sigma}");v("\\varUpsilon","\\mathit{\\Upsilon}");v("\\varPhi","\\mathit{\\Phi}");v("\\varPsi","\\mathit{\\Psi}");v("\\varOmega","\\mathit{\\Omega}");v("\\substack","\\begin{subarray}{c}#1\\end{subarray}");v("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");v("\\boxed","\\fbox{$\\displaystyle{#1}$}");v("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");v("\\implies","\\DOTSB\\;\\Longrightarrow\\;");v("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");v("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");v("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var za={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};v("\\dots",function(e){var t="\\dotso",r=e.expandAfterFuture().text;return r in za?t=za[r]:(r.slice(0,4)==="\\not"||r in de.math&&["bin","rel"].includes(de.math[r].group))&&(t="\\dotsb"),t});var Q0={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};v("\\dotso",function(e){var t=e.future().text;return t in Q0?"\\ldots\\,":"\\ldots"});v("\\dotsc",function(e){var t=e.future().text;return t in Q0&&t!==","?"\\ldots\\,":"\\ldots"});v("\\cdots",function(e){var t=e.future().text;return t in Q0?"\\@cdots\\,":"\\@cdots"});v("\\dotsb","\\cdots");v("\\dotsm","\\cdots");v("\\dotsi","\\!\\cdots");v("\\dotsx","\\ldots\\,");v("\\DOTSI","\\relax");v("\\DOTSB","\\relax");v("\\DOTSX","\\relax");v("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");v("\\,","\\tmspace+{3mu}{.1667em}");v("\\thinspace","\\,");v("\\>","\\mskip{4mu}");v("\\:","\\tmspace+{4mu}{.2222em}");v("\\medspace","\\:");v("\\;","\\tmspace+{5mu}{.2777em}");v("\\thickspace","\\;");v("\\!","\\tmspace-{3mu}{.1667em}");v("\\negthinspace","\\!");v("\\negmedspace","\\tmspace-{4mu}{.2222em}");v("\\negthickspace","\\tmspace-{5mu}{.277em}");v("\\enspace","\\kern.5em ");v("\\enskip","\\hskip.5em\\relax");v("\\quad","\\hskip1em\\relax");v("\\qquad","\\hskip2em\\relax");v("\\tag","\\@ifstar\\tag@literal\\tag@paren");v("\\tag@paren","\\tag@literal{({#1})}");v("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new L("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});v("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");v("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");v("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");v("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");v("\\newline","\\\\\\relax");v("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Rs=P(st["Main-Regular"][84][1]-.7*st["Main-Regular"][65][1]);v("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+Rs+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");v("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+Rs+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");v("\\hspace","\\@ifstar\\@hspacer\\@hspace");v("\\@hspace","\\hskip #1\\relax");v("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");v("\\ordinarycolon",":");v("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");v("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');v("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');v("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');v("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');v("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');v("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');v("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');v("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');v("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');v("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');v("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');v("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');v("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');v("∷","\\dblcolon");v("∹","\\eqcolon");v("≔","\\coloneqq");v("≕","\\eqqcolon");v("⩴","\\Coloneqq");v("\\ratio","\\vcentcolon");v("\\coloncolon","\\dblcolon");v("\\colonequals","\\coloneqq");v("\\coloncolonequals","\\Coloneqq");v("\\equalscolon","\\eqqcolon");v("\\equalscoloncolon","\\Eqqcolon");v("\\colonminus","\\coloneq");v("\\coloncolonminus","\\Coloneq");v("\\minuscolon","\\eqcolon");v("\\minuscoloncolon","\\Eqcolon");v("\\coloncolonapprox","\\Colonapprox");v("\\coloncolonsim","\\Colonsim");v("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");v("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");v("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");v("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");v("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");v("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");v("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");v("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");v("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");v("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");v("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");v("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");v("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");v("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");v("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");v("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");v("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");v("\\nleqq","\\html@mathml{\\@nleqq}{≰}");v("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");v("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");v("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");v("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");v("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");v("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");v("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");v("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");v("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");v("\\imath","\\html@mathml{\\@imath}{ı}");v("\\jmath","\\html@mathml{\\@jmath}{ȷ}");v("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");v("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");v("⟦","\\llbracket");v("⟧","\\rrbracket");v("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");v("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");v("⦃","\\lBrace");v("⦄","\\rBrace");v("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");v("⦵","\\minuso");v("\\darr","\\downarrow");v("\\dArr","\\Downarrow");v("\\Darr","\\Downarrow");v("\\lang","\\langle");v("\\rang","\\rangle");v("\\uarr","\\uparrow");v("\\uArr","\\Uparrow");v("\\Uarr","\\Uparrow");v("\\N","\\mathbb{N}");v("\\R","\\mathbb{R}");v("\\Z","\\mathbb{Z}");v("\\alef","\\aleph");v("\\alefsym","\\aleph");v("\\Alpha","\\mathrm{A}");v("\\Beta","\\mathrm{B}");v("\\bull","\\bullet");v("\\Chi","\\mathrm{X}");v("\\clubs","\\clubsuit");v("\\cnums","\\mathbb{C}");v("\\Complex","\\mathbb{C}");v("\\Dagger","\\ddagger");v("\\diamonds","\\diamondsuit");v("\\empty","\\emptyset");v("\\Epsilon","\\mathrm{E}");v("\\Eta","\\mathrm{H}");v("\\exist","\\exists");v("\\harr","\\leftrightarrow");v("\\hArr","\\Leftrightarrow");v("\\Harr","\\Leftrightarrow");v("\\hearts","\\heartsuit");v("\\image","\\Im");v("\\infin","\\infty");v("\\Iota","\\mathrm{I}");v("\\isin","\\in");v("\\Kappa","\\mathrm{K}");v("\\larr","\\leftarrow");v("\\lArr","\\Leftarrow");v("\\Larr","\\Leftarrow");v("\\lrarr","\\leftrightarrow");v("\\lrArr","\\Leftrightarrow");v("\\Lrarr","\\Leftrightarrow");v("\\Mu","\\mathrm{M}");v("\\natnums","\\mathbb{N}");v("\\Nu","\\mathrm{N}");v("\\Omicron","\\mathrm{O}");v("\\plusmn","\\pm");v("\\rarr","\\rightarrow");v("\\rArr","\\Rightarrow");v("\\Rarr","\\Rightarrow");v("\\real","\\Re");v("\\reals","\\mathbb{R}");v("\\Reals","\\mathbb{R}");v("\\Rho","\\mathrm{P}");v("\\sdot","\\cdot");v("\\sect","\\S");v("\\spades","\\spadesuit");v("\\sub","\\subset");v("\\sube","\\subseteq");v("\\supe","\\supseteq");v("\\Tau","\\mathrm{T}");v("\\thetasym","\\vartheta");v("\\weierp","\\wp");v("\\Zeta","\\mathrm{Z}");v("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");v("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");v("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");v("\\bra","\\mathinner{\\langle{#1}|}");v("\\ket","\\mathinner{|{#1}\\rangle}");v("\\braket","\\mathinner{\\langle{#1}\\rangle}");v("\\Bra","\\left\\langle#1\\right|");v("\\Ket","\\left|#1\\right\\rangle");var Ps=e=>t=>{var r=t.consumeArg().tokens,n=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,l=t.macros.get("|"),s=t.macros.get("\\|");t.macros.beginGroup();var o=m=>d=>{e&&(d.macros.set("|",l),i.length&&d.macros.set("\\|",s));var p=m;if(!m&&i.length){var y=d.future();y.text==="|"&&(d.popToken(),p=!0)}return{tokens:p?i:n,numArgs:0}};t.macros.set("|",o(!1)),i.length&&t.macros.set("\\|",o(!0));var u=t.consumeArg().tokens,h=t.expandTokens([...a,...u,...r]);return t.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};v("\\bra@ket",Ps(!1));v("\\bra@set",Ps(!0));v("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");v("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");v("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");v("\\angln","{\\angl n}");v("\\blue","\\textcolor{##6495ed}{#1}");v("\\orange","\\textcolor{##ffa500}{#1}");v("\\pink","\\textcolor{##ff00af}{#1}");v("\\red","\\textcolor{##df0030}{#1}");v("\\green","\\textcolor{##28ae7b}{#1}");v("\\gray","\\textcolor{gray}{#1}");v("\\purple","\\textcolor{##9d38bd}{#1}");v("\\blueA","\\textcolor{##ccfaff}{#1}");v("\\blueB","\\textcolor{##80f6ff}{#1}");v("\\blueC","\\textcolor{##63d9ea}{#1}");v("\\blueD","\\textcolor{##11accd}{#1}");v("\\blueE","\\textcolor{##0c7f99}{#1}");v("\\tealA","\\textcolor{##94fff5}{#1}");v("\\tealB","\\textcolor{##26edd5}{#1}");v("\\tealC","\\textcolor{##01d1c1}{#1}");v("\\tealD","\\textcolor{##01a995}{#1}");v("\\tealE","\\textcolor{##208170}{#1}");v("\\greenA","\\textcolor{##b6ffb0}{#1}");v("\\greenB","\\textcolor{##8af281}{#1}");v("\\greenC","\\textcolor{##74cf70}{#1}");v("\\greenD","\\textcolor{##1fab54}{#1}");v("\\greenE","\\textcolor{##0d923f}{#1}");v("\\goldA","\\textcolor{##ffd0a9}{#1}");v("\\goldB","\\textcolor{##ffbb71}{#1}");v("\\goldC","\\textcolor{##ff9c39}{#1}");v("\\goldD","\\textcolor{##e07d10}{#1}");v("\\goldE","\\textcolor{##a75a05}{#1}");v("\\redA","\\textcolor{##fca9a9}{#1}");v("\\redB","\\textcolor{##ff8482}{#1}");v("\\redC","\\textcolor{##f9685d}{#1}");v("\\redD","\\textcolor{##e84d39}{#1}");v("\\redE","\\textcolor{##bc2612}{#1}");v("\\maroonA","\\textcolor{##ffbde0}{#1}");v("\\maroonB","\\textcolor{##ff92c6}{#1}");v("\\maroonC","\\textcolor{##ed5fa6}{#1}");v("\\maroonD","\\textcolor{##ca337c}{#1}");v("\\maroonE","\\textcolor{##9e034e}{#1}");v("\\purpleA","\\textcolor{##ddd7ff}{#1}");v("\\purpleB","\\textcolor{##c6b9fc}{#1}");v("\\purpleC","\\textcolor{##aa87ff}{#1}");v("\\purpleD","\\textcolor{##7854ab}{#1}");v("\\purpleE","\\textcolor{##543b78}{#1}");v("\\mintA","\\textcolor{##f5f9e8}{#1}");v("\\mintB","\\textcolor{##edf2df}{#1}");v("\\mintC","\\textcolor{##e0e5cc}{#1}");v("\\grayA","\\textcolor{##f6f7f7}{#1}");v("\\grayB","\\textcolor{##f0f1f2}{#1}");v("\\grayC","\\textcolor{##e3e5e6}{#1}");v("\\grayD","\\textcolor{##d6d8da}{#1}");v("\\grayE","\\textcolor{##babec2}{#1}");v("\\grayF","\\textcolor{##888d93}{#1}");v("\\grayG","\\textcolor{##626569}{#1}");v("\\grayH","\\textcolor{##3b3e40}{#1}");v("\\grayI","\\textcolor{##21242c}{#1}");v("\\kaBlue","\\textcolor{##314453}{#1}");v("\\kaGreen","\\textcolor{##71B307}{#1}");var Os={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class w2{constructor(t,r,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=r,this.expansionCount=0,this.feed(t),this.macros=new b2(x2,r.macros),this.mode=n,this.stack=[]}feed(t){this.lexer=new Aa(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var r,n,i;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:r,end:n}=this.consumeArg());return this.pushToken(new We("EOF",n.loc)),this.pushTokens(i),new We("",qe.range(r,n))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var r=[],n=t&&t.length>0;n||this.consumeSpaces();var i=this.future(),a,l=0,s=0;do{if(a=this.popToken(),r.push(a),a.text==="{")++l;else if(a.text==="}"){if(--l,l===-1)throw new L("Extra }",a)}else if(a.text==="EOF")throw new L("Unexpected end of input in a macro argument, expected '"+(t&&n?t[s]:"}")+"'",a);if(t&&n)if((l===0||l===1&&t[s]==="{")&&a.text===t[s]){if(++s,s===t.length){r.splice(-s,s);break}}else s=0}while(l!==0||n);return i.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:i,end:a}}consumeArgs(t,r){if(r){if(r.length!==t+1)throw new L("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new L("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var r=this.popToken(),n=r.text,i=r.noexpand?null:this._getExpansion(n);if(i==null||t&&i.unexpandable){if(t&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new L("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var a=i.tokens,l=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var s=a.length-1;s>=0;--s){var o=a[s];if(o.text==="#"){if(s===0)throw new L("Incomplete placeholder at end of macro body",o);if(o=a[--s],o.text==="#")a.splice(s+1,1);else if(/^[1-9]$/.test(o.text))a.splice(s,2,...l[+o.text-1]);else throw new L("Not a valid argument number",o)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}throw new Error}expandMacro(t){return this.macros.has(t)?this.expandTokens([new We(t)]):void 0}expandTokens(t){var r=[],n=this.stack.length;for(this.pushTokens(t);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),r.push(i)}return this.countExpansion(r.length),r}expandMacroAsText(t){var r=this.expandMacro(t);return r&&r.map(n=>n.text).join("")}_getExpansion(t){var r=this.macros.get(t);if(r==null)return r;if(t.length===1){var n=this.lexer.catcodes[t];if(n!=null&&n!==13)return}var i=typeof r=="function"?r(this):r;if(typeof i=="string"){var a=0;if(i.indexOf("#")!==-1)for(var l=i.replace(/##/g,"");l.indexOf("#"+(a+1))!==-1;)++a;for(var s=new Aa(i,this.settings),o=[],u=s.lex();u.text!=="EOF";)o.push(u),u=s.lex();o.reverse();var h={tokens:o,numArgs:a};return h}return i}isDefined(t){return this.macros.has(t)||Mt.hasOwnProperty(t)||de.math.hasOwnProperty(t)||de.text.hasOwnProperty(t)||Os.hasOwnProperty(t)}isExpandable(t){var r=this.macros.get(t);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:Mt.hasOwnProperty(t)&&!Mt[t].primitive}}var Ma=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,jr=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Yn={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Ca={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class fn{constructor(t,r){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new w2(t,r,this.mode),this.settings=r,this.leftrightDepth=0}expect(t,r){if(r===void 0&&(r=!0),this.fetch().text!==t)throw new L("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());r&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var r=this.nextToken;this.consume(),this.gullet.pushToken(new We("}")),this.gullet.pushTokens(t);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=r,n}parseExpression(t,r){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(fn.endOfExpression.indexOf(i.text)!==-1||r&&i.text===r||t&&Mt[i.text]&&Mt[i.text].infix)break;var a=this.parseAtom(r);if(a){if(a.type==="internal")continue}else break;n.push(a)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(t){for(var r=-1,n,i=0;i=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+r[0]+'" used in math mode',t);var s=de[this.mode][r].group,o=qe.range(t),u;if(uf.hasOwnProperty(s)){var h=s;u={type:"atom",mode:this.mode,family:h,loc:o,text:r}}else u={type:s,mode:this.mode,loc:o,text:r};l=u}else if(r.charCodeAt(0)>=128)this.settings.strict&&(Wl(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),t)),l={type:"textord",mode:"text",loc:qe.range(t),text:r};else return null;if(this.consume(),a)for(var m=0;mu&&(u=h):h&&(u!==void 0&&u>-1&&o.push(` +`.repeat(u)||" "),u=-1,o.push(h))}return o.join("")}function _s(e,t,r){return e.type==="element"?Z2(e,t,r):e.type==="text"?r.whitespace==="normal"?Gs(e,r):Q2(e):[]}function Z2(e,t,r){const n=Ws(e,r),i=e.children||[];let a=-1,l=[];if(X2(e))return l;let s,o;for(g0(e)||Pa(e)&&Na(t,e,Pa)?o=` +`:Y2(e)?(s=2,o=2):Us(e)&&(s=1,o=1);++a=0;)c=Qt(e,t,n,r,u+1,i+1,a),c>f&&(u===o?c*=Sn:xi.test(e.charAt(u-1))?(c*=ki,p=e.slice(o,u-1).match(Ni),p&&o>0&&(c*=Math.pow(Ht,p.length))):Pi.test(e.charAt(u-1))?(c*=Ei,h=e.slice(o,u-1).match(ur),h&&o>0&&(c*=Math.pow(Ht,h.length))):(c*=Ci,o>0&&(c*=Math.pow(Ht,u-o))),e.charAt(u)!==t.charAt(i)&&(c*=Ti)),(c<$t&&n.charAt(u-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(u-1)!==r.charAt(i))&&(d=Qt(e,t,n,r,u+1,i+2,a),d*$t>c&&(c=d*$t)),c>f&&(f=c),u=n.indexOf(l,u+1);return a[s]=f,f}function En(e){return e.toLowerCase().replace(ur," ")}function Di(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Qt(e,t,En(e),En(t),0,0,{})}var Ii=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_e=Ii.reduce((e,t)=>{const n=Lo(`Primitive.${t}`),r=b.forwardRef((o,i)=>{const{asChild:a,...s}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),zo.jsx(l,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),nt='[cmdk-group=""]',Ut='[cmdk-group-items=""]',Ri='[cmdk-group-heading=""]',fr='[cmdk-item=""]',kn=`${fr}:not([aria-disabled="true"])`,en="cmdk-item-select",qe="data-value",Wi=(e,t,n)=>Di(e,t,n),dr=b.createContext(void 0),dt=()=>b.useContext(dr),pr=b.createContext(void 0),cn=()=>b.useContext(pr),hr=b.createContext(void 0),mr=b.forwardRef((e,t)=>{let n=Ge(()=>{var k,W;return{search:"",value:(W=(k=e.value)!=null?k:e.defaultValue)!=null?W:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Ge(()=>new Set),o=Ge(()=>new Map),i=Ge(()=>new Map),a=Ge(()=>new Set),s=yr(e),{label:l,children:u,value:f,onValueChange:c,filter:d,shouldFilter:p,loop:h,disablePointerSelection:v=!1,vimBindings:O=!0,...y}=e,m=Ve(),S=Ve(),D=Ve(),E=b.useRef(null),C=Yi();Be(()=>{if(f!==void 0){let k=f.trim();n.current.value=k,M.emit()}},[f]),Be(()=>{C(6,Me)},[]);let M=b.useMemo(()=>({subscribe:k=>(a.current.add(k),()=>a.current.delete(k)),snapshot:()=>n.current,setState:(k,W,F)=>{var R,U,G,ee;if(!Object.is(n.current[k],W)){if(n.current[k]=W,k==="search")re(),Y(),C(1,Q);else if(k==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let X=document.getElementById(D);X?X.focus():(R=document.getElementById(m))==null||R.focus()}if(C(7,()=>{var X;n.current.selectedItemId=(X=le())==null?void 0:X.id,M.emit()}),F||C(5,Me),((U=s.current)==null?void 0:U.value)!==void 0){let X=W??"";(ee=(G=s.current).onValueChange)==null||ee.call(G,X);return}}M.emit()}},emit:()=>{a.current.forEach(k=>k())}}),[]),j=b.useMemo(()=>({value:(k,W,F)=>{var R;W!==((R=i.current.get(k))==null?void 0:R.value)&&(i.current.set(k,{value:W,keywords:F}),n.current.filtered.items.set(k,J(W,F)),C(2,()=>{Y(),M.emit()}))},item:(k,W)=>(r.current.add(k),W&&(o.current.has(W)?o.current.get(W).add(k):o.current.set(W,new Set([k]))),C(3,()=>{re(),Y(),n.current.value||Q(),M.emit()}),()=>{i.current.delete(k),r.current.delete(k),n.current.filtered.items.delete(k);let F=le();C(4,()=>{re(),F?.getAttribute("id")===k&&Q(),M.emit()})}),group:k=>(o.current.has(k)||o.current.set(k,new Set),()=>{i.current.delete(k),o.current.delete(k)}),filter:()=>s.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:m,inputId:D,labelId:S,listInnerRef:E}),[]);function J(k,W){var F,R;let U=(R=(F=s.current)==null?void 0:F.filter)!=null?R:Wi;return k?U(k,n.current.search,W):0}function Y(){if(!n.current.search||s.current.shouldFilter===!1)return;let k=n.current.filtered.items,W=[];n.current.filtered.groups.forEach(R=>{let U=o.current.get(R),G=0;U.forEach(ee=>{let X=k.get(ee);G=Math.max(X,G)}),W.push([R,G])});let F=E.current;de().sort((R,U)=>{var G,ee;let X=R.getAttribute("id"),ze=U.getAttribute("id");return((G=k.get(ze))!=null?G:0)-((ee=k.get(X))!=null?ee:0)}).forEach(R=>{let U=R.closest(Ut);U?U.appendChild(R.parentElement===U?R:R.closest(`${Ut} > *`)):F.appendChild(R.parentElement===F?R:R.closest(`${Ut} > *`))}),W.sort((R,U)=>U[1]-R[1]).forEach(R=>{var U;let G=(U=E.current)==null?void 0:U.querySelector(`${nt}[${qe}="${encodeURIComponent(R[0])}"]`);G?.parentElement.appendChild(G)})}function Q(){let k=de().find(F=>F.getAttribute("aria-disabled")!=="true"),W=k?.getAttribute(qe);M.setState("value",W||void 0)}function re(){var k,W,F,R;if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let U=0;for(let G of r.current){let ee=(W=(k=i.current.get(G))==null?void 0:k.value)!=null?W:"",X=(R=(F=i.current.get(G))==null?void 0:F.keywords)!=null?R:[],ze=J(ee,X);n.current.filtered.items.set(G,ze),ze>0&&U++}for(let[G,ee]of o.current)for(let X of ee)if(n.current.filtered.items.get(X)>0){n.current.filtered.groups.add(G);break}n.current.filtered.count=U}function Me(){var k,W,F;let R=le();R&&(((k=R.parentElement)==null?void 0:k.firstChild)===R&&((F=(W=R.closest(nt))==null?void 0:W.querySelector(Ri))==null||F.scrollIntoView({block:"nearest"})),R.scrollIntoView({block:"nearest"}))}function le(){var k;return(k=E.current)==null?void 0:k.querySelector(`${fr}[aria-selected="true"]`)}function de(){var k;return Array.from(((k=E.current)==null?void 0:k.querySelectorAll(kn))||[])}function Ie(k){let W=de()[k];W&&M.setState("value",W.getAttribute(qe))}function je(k){var W;let F=le(),R=de(),U=R.findIndex(ee=>ee===F),G=R[U+k];(W=s.current)!=null&&W.loop&&(G=U+k<0?R[R.length-1]:U+k===R.length?R[0]:R[U+k]),G&&M.setState("value",G.getAttribute(qe))}function ie(k){let W=le(),F=W?.closest(nt),R;for(;F&&!R;)F=k>0?Ui(F,nt):zi(F,nt),R=F?.querySelector(kn);R?M.setState("value",R.getAttribute(qe)):je(k)}let se=()=>Ie(de().length-1),pe=k=>{k.preventDefault(),k.metaKey?se():k.altKey?ie(1):je(1)},Ue=k=>{k.preventDefault(),k.metaKey?Ie(0):k.altKey?ie(-1):je(-1)};return b.createElement(_e.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:k=>{var W;(W=y.onKeyDown)==null||W.call(y,k);let F=k.nativeEvent.isComposing||k.keyCode===229;if(!(k.defaultPrevented||F))switch(k.key){case"n":case"j":{O&&k.ctrlKey&&pe(k);break}case"ArrowDown":{pe(k);break}case"p":case"k":{O&&k.ctrlKey&&Ue(k);break}case"ArrowUp":{Ue(k);break}case"Home":{k.preventDefault(),Ie(0);break}case"End":{k.preventDefault(),se();break}case"Enter":{k.preventDefault();let R=le();if(R){let U=new Event(en);R.dispatchEvent(U)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:j.inputId,id:j.labelId,style:Gi},l),It(e,k=>b.createElement(pr.Provider,{value:M},b.createElement(dr.Provider,{value:j},k))))}),Ai=b.forwardRef((e,t)=>{var n,r;let o=Ve(),i=b.useRef(null),a=b.useContext(hr),s=dt(),l=yr(e),u=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:a?.forceMount;Be(()=>{if(!u)return s.item(o,a?.id)},[u]);let f=vr(o,i,[e.value,e.children,i],e.keywords),c=cn(),d=We(C=>C.value&&C.value===f.current),p=We(C=>u||s.filter()===!1?!0:C.search?C.filtered.items.get(o)>0:!0);b.useEffect(()=>{let C=i.current;if(!(!C||e.disabled))return C.addEventListener(en,h),()=>C.removeEventListener(en,h)},[p,e.onSelect,e.disabled]);function h(){var C,M;v(),(M=(C=l.current).onSelect)==null||M.call(C,f.current)}function v(){c.setState("value",f.current,!0)}if(!p)return null;let{disabled:O,value:y,onSelect:m,forceMount:S,keywords:D,...E}=e;return b.createElement(_e.div,{ref:ct(i,t),...E,id:o,"cmdk-item":"",role:"option","aria-disabled":!!O,"aria-selected":!!d,"data-disabled":!!O,"data-selected":!!d,onPointerMove:O||s.getDisablePointerSelection()?void 0:v,onClick:O?void 0:h},e.children)}),_i=b.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...i}=e,a=Ve(),s=b.useRef(null),l=b.useRef(null),u=Ve(),f=dt(),c=We(p=>o||f.filter()===!1?!0:p.search?p.filtered.groups.has(a):!0);Be(()=>f.group(a),[]),vr(a,s,[e.value,e.heading,l]);let d=b.useMemo(()=>({id:a,forceMount:o}),[o]);return b.createElement(_e.div,{ref:ct(s,t),...i,"cmdk-group":"",role:"presentation",hidden:c?void 0:!0},n&&b.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),It(e,p=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},b.createElement(hr.Provider,{value:d},p))))}),ji=b.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=b.useRef(null),i=We(a=>!a.search);return!n&&!i?null:b.createElement(_e.div,{ref:ct(o,t),...r,"cmdk-separator":"",role:"separator"})}),Fi=b.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=cn(),a=We(u=>u.search),s=We(u=>u.selectedItemId),l=dt();return b.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),b.createElement(_e.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":s,id:l.inputId,type:"text",value:o?e.value:a,onChange:u=>{o||i.setState("search",u.target.value),n?.(u.target.value)}})}),Li=b.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,i=b.useRef(null),a=b.useRef(null),s=We(u=>u.selectedItemId),l=dt();return b.useEffect(()=>{if(a.current&&i.current){let u=a.current,f=i.current,c,d=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let p=u.offsetHeight;f.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return d.observe(u),()=>{cancelAnimationFrame(c),d.unobserve(u)}}},[]),b.createElement(_e.div,{ref:ct(i,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:l.listId},It(e,u=>b.createElement("div",{ref:ct(a,l.listInnerRef),"cmdk-list-sizer":""},u)))}),Bi=b.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:i,container:a,...s}=e;return b.createElement(Bo,{open:n,onOpenChange:r},b.createElement($o,{container:a},b.createElement(Ho,{"cmdk-overlay":"",className:o}),b.createElement(Uo,{"aria-label":e.label,"cmdk-dialog":"",className:i},b.createElement(mr,{ref:t,...s}))))}),$i=b.forwardRef((e,t)=>We(n=>n.filtered.count===0)?b.createElement(_e.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Hi=b.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...i}=e;return b.createElement(_e.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},It(e,a=>b.createElement("div",{"aria-hidden":!0},a)))}),ou=Object.assign(mr,{List:Li,Item:Ai,Input:Fi,Group:_i,Separator:ji,Dialog:Bi,Empty:$i,Loading:Hi});function Ui(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function zi(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function yr(e){let t=b.useRef(e);return Be(()=>{t.current=e}),t}var Be=typeof window>"u"?b.useEffect:b.useLayoutEffect;function Ge(e){let t=b.useRef();return t.current===void 0&&(t.current=e()),t}function We(e){let t=cn(),n=()=>e(t.snapshot());return b.useSyncExternalStore(t.subscribe,n,n)}function vr(e,t,n,r=[]){let o=b.useRef(),i=dt();return Be(()=>{var a;let s=(()=>{var u;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(u=f.current.textContent)==null?void 0:u.trim():o.current}})(),l=r.map(u=>u.trim());i.value(e,s,l),(a=t.current)==null||a.setAttribute(qe,s),o.current=s}),o}var Yi=()=>{let[e,t]=b.useState(),n=Ge(()=>new Map);return Be(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function qi(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function It({asChild:e,children:t},n){return e&&b.isValidElement(t)?b.cloneElement(qi(t),{ref:t.ref},n(t.props.children)):n(t)}var Gi={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function gr(e){return t=>typeof t===e}var Vi=gr("function"),Ki=e=>e===null,Cn=e=>Object.prototype.toString.call(e).slice(8,-1)==="RegExp",Tn=e=>!Zi(e)&&!Ki(e)&&(Vi(e)||typeof e=="object"),Zi=gr("undefined");function Ji(e,t){const{length:n}=e;if(n!==t.length)return!1;for(let r=n;r--!==0;)if(!oe(e[r],t[r]))return!1;return!0}function Xi(e,t){if(e.byteLength!==t.byteLength)return!1;const n=new DataView(e.buffer),r=new DataView(t.buffer);let o=e.byteLength;for(;o--;)if(n.getUint8(o)!==r.getUint8(o))return!1;return!0}function Qi(e,t){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;for(const n of e.entries())if(!oe(n[1],t.get(n[0])))return!1;return!0}function es(e,t){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;return!0}function oe(e,t){if(e===t)return!0;if(e&&Tn(e)&&t&&Tn(t)){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)&&Array.isArray(t))return Ji(e,t);if(e instanceof Map&&t instanceof Map)return Qi(e,t);if(e instanceof Set&&t instanceof Set)return es(e,t);if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return Xi(e,t);if(Cn(e)&&Cn(t))return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o=n.length;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,n[o]))return!1;for(let o=n.length;o--!==0;){const i=n[o];if(!(i==="_owner"&&e.$$typeof)&&!oe(e[i],t[i]))return!1}return!0}return Number.isNaN(e)&&Number.isNaN(t)?!0:e===t}var ts=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","WeakMap","WeakSet"],ns=["bigint","boolean","null","number","string","symbol","undefined"];function Rt(e){const t=Object.prototype.toString.call(e).slice(8,-1);if(/HTML\w+Element/.test(t))return"HTMLElement";if(rs(t))return t}function ge(e){return t=>Rt(t)===e}function rs(e){return ts.includes(e)}function Qe(e){return t=>typeof t===e}function os(e){return ns.includes(e)}var is=["innerHTML","ownerDocument","style","attributes","nodeValue"];function x(e){if(e===null)return"null";switch(typeof e){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(x.array(e))return"Array";if(x.plainFunction(e))return"Function";const t=Rt(e);return t||"Object"}x.array=Array.isArray;x.arrayOf=(e,t)=>!x.array(e)&&!x.function(t)?!1:e.every(n=>t(n));x.asyncGeneratorFunction=e=>Rt(e)==="AsyncGeneratorFunction";x.asyncFunction=ge("AsyncFunction");x.bigint=Qe("bigint");x.boolean=e=>e===!0||e===!1;x.date=ge("Date");x.defined=e=>!x.undefined(e);x.domElement=e=>x.object(e)&&!x.plainObject(e)&&e.nodeType===1&&x.string(e.nodeName)&&is.every(t=>t in e);x.empty=e=>x.string(e)&&e.length===0||x.array(e)&&e.length===0||x.object(e)&&!x.map(e)&&!x.set(e)&&Object.keys(e).length===0||x.set(e)&&e.size===0||x.map(e)&&e.size===0;x.error=ge("Error");x.function=Qe("function");x.generator=e=>x.iterable(e)&&x.function(e.next)&&x.function(e.throw);x.generatorFunction=ge("GeneratorFunction");x.instanceOf=(e,t)=>!e||!t?!1:Object.getPrototypeOf(e)===t.prototype;x.iterable=e=>!x.nullOrUndefined(e)&&x.function(e[Symbol.iterator]);x.map=ge("Map");x.nan=e=>Number.isNaN(e);x.null=e=>e===null;x.nullOrUndefined=e=>x.null(e)||x.undefined(e);x.number=e=>Qe("number")(e)&&!x.nan(e);x.numericString=e=>x.string(e)&&e.length>0&&!Number.isNaN(Number(e));x.object=e=>!x.nullOrUndefined(e)&&(x.function(e)||typeof e=="object");x.oneOf=(e,t)=>x.array(e)?e.indexOf(t)>-1:!1;x.plainFunction=ge("Function");x.plainObject=e=>{if(Rt(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})};x.primitive=e=>x.null(e)||os(typeof e);x.promise=ge("Promise");x.propertyOf=(e,t,n)=>{if(!x.object(e)||!t)return!1;const r=e[t];return x.function(n)?n(r):x.defined(r)};x.regexp=ge("RegExp");x.set=ge("Set");x.string=Qe("string");x.symbol=Qe("symbol");x.undefined=Qe("undefined");x.weakMap=ge("WeakMap");x.weakSet=ge("WeakSet");var N=x;function ss(...e){return e.every(t=>N.string(t)||N.array(t)||N.plainObject(t))}function as(e,t,n){return br(e,t)?[e,t].every(N.array)?!e.some(Dn(n))&&t.some(Dn(n)):[e,t].every(N.plainObject)?!Object.entries(e).some(Pn(n))&&Object.entries(t).some(Pn(n)):t===n:!1}function Mn(e,t,n){const{actual:r,key:o,previous:i,type:a}=n,s=Ee(e,o),l=Ee(t,o);let u=[s,l].every(N.number)&&(a==="increased"?sl);return N.undefined(r)||(u=u&&l===r),N.undefined(i)||(u=u&&s===i),u}function xn(e,t,n){const{key:r,type:o,value:i}=n,a=Ee(e,r),s=Ee(t,r),l=o==="added"?a:s,u=o==="added"?s:a;if(!N.nullOrUndefined(i)){if(N.defined(l)){if(N.array(l)||N.plainObject(l))return as(l,u,i)}else return oe(u,i);return!1}return[a,s].every(N.array)?!u.every(un(l)):[a,s].every(N.plainObject)?ls(Object.keys(l),Object.keys(u)):![a,s].every(f=>N.primitive(f)&&N.defined(f))&&(o==="added"?!N.defined(a)&&N.defined(s):N.defined(a)&&!N.defined(s))}function Nn(e,t,{key:n}={}){let r=Ee(e,n),o=Ee(t,n);if(!br(r,o))throw new TypeError("Inputs have different types");if(!ss(r,o))throw new TypeError("Inputs don't have length");return[r,o].every(N.plainObject)&&(r=Object.keys(r),o=Object.keys(o)),[r,o]}function Pn(e){return([t,n])=>N.array(e)?oe(e,n)||e.some(r=>oe(r,n)||N.array(n)&&un(n)(r)):N.plainObject(e)&&e[t]?!!e[t]&&oe(e[t],n):oe(e,n)}function ls(e,t){return t.some(n=>!e.includes(n))}function Dn(e){return t=>N.array(e)?e.some(n=>oe(n,t)||N.array(t)&&un(t)(n)):oe(e,t)}function rt(e,t){return N.array(e)?e.some(n=>oe(n,t)):oe(e,t)}function un(e){return t=>e.some(n=>oe(n,t))}function br(...e){return e.every(N.array)||e.every(N.number)||e.every(N.plainObject)||e.every(N.string)}function Ee(e,t){return N.plainObject(e)||N.array(e)?N.string(t)?t.split(".").reduce((r,o)=>r&&r[o],e):N.number(t)?e[t]:e:e}function Mt(e,t){if([e,t].some(N.nullOrUndefined))throw new Error("Missing required parameters");if(![e,t].every(f=>N.plainObject(f)||N.array(f)))throw new Error("Expected plain objects or array");return{added:(f,c)=>{try{return xn(e,t,{key:f,type:"added",value:c})}catch{return!1}},changed:(f,c,d)=>{try{const p=Ee(e,f),h=Ee(t,f),v=N.defined(c),O=N.defined(d);if(v||O){const y=O?rt(d,p):!rt(c,p),m=rt(c,h);return y&&m}return[p,h].every(N.array)||[p,h].every(N.plainObject)?!oe(p,h):p!==h}catch{return!1}},changedFrom:(f,c,d)=>{if(!N.defined(f))return!1;try{const p=Ee(e,f),h=Ee(t,f),v=N.defined(d);return rt(c,p)&&(v?rt(d,h):!v)}catch{return!1}},decreased:(f,c,d)=>{if(!N.defined(f))return!1;try{return Mn(e,t,{key:f,actual:c,previous:d,type:"decreased"})}catch{return!1}},emptied:f=>{try{const[c,d]=Nn(e,t,{key:f});return!!c.length&&!d.length}catch{return!1}},filled:f=>{try{const[c,d]=Nn(e,t,{key:f});return!c.length&&!!d.length}catch{return!1}},increased:(f,c,d)=>{if(!N.defined(f))return!1;try{return Mn(e,t,{key:f,actual:c,previous:d,type:"increased"})}catch{return!1}},removed:(f,c)=>{try{return xn(e,t,{key:f,type:"removed",value:c})}catch{return!1}}}}var zt,In;function cs(){if(In)return zt;In=1;var e=new Error("Element already at target scroll position"),t=new Error("Scroll cancelled"),n=Math.min,r=Date.now;zt={left:o("scrollLeft"),top:o("scrollTop")};function o(s){return function(u,f,c,d){c=c||{},typeof c=="function"&&(d=c,c={}),typeof d!="function"&&(d=a);var p=r(),h=u[s],v=c.ease||i,O=isNaN(c.duration)?350:+c.duration,y=!1;return h===f?d(e,u[s]):requestAnimationFrame(S),m;function m(){y=!0}function S(D){if(y)return d(t,u[s]);var E=r(),C=n(1,(E-p)/O),M=v(C);u[s]=M*(f-h)+h,C<1?requestAnimationFrame(S):requestAnimationFrame(function(){d(null,u[s])})}}}function i(s){return .5*(1-Math.cos(Math.PI*s))}function a(){}return zt}var us=cs();const fs=Dt(us);var Ct={exports:{}},ds=Ct.exports,Rn;function ps(){return Rn||(Rn=1,(function(e){(function(t,n){e.exports?e.exports=n():t.Scrollparent=n()})(ds,function(){function t(r){var o=getComputedStyle(r,null).getPropertyValue("overflow");return o.indexOf("scroll")>-1||o.indexOf("auto")>-1}function n(r){if(r instanceof HTMLElement||r instanceof SVGElement){for(var o=r.parentNode;o.parentNode;){if(t(o))return o;o=o.parentNode}return document.scrollingElement||document.documentElement}}return n})})(Ct)),Ct.exports}var hs=ps();const wr=Dt(hs);var Yt,Wn;function ms(){if(Wn)return Yt;Wn=1;var e=function(r){return Object.prototype.hasOwnProperty.call(r,"props")},t=function(r,o){return r+n(o)},n=function(r){return r===null||typeof r=="boolean"||typeof r>"u"?"":typeof r=="number"?r.toString():typeof r=="string"?r:Array.isArray(r)?r.reduce(t,""):e(r)&&Object.prototype.hasOwnProperty.call(r.props,"children")?n(r.props.children):""};return n.default=n,Yt=n,Yt}var ys=ms();const An=Dt(ys);var qt,_n;function vs(){if(_n)return qt;_n=1;var e=function(m){return t(m)&&!n(m)};function t(y){return!!y&&typeof y=="object"}function n(y){var m=Object.prototype.toString.call(y);return m==="[object RegExp]"||m==="[object Date]"||i(y)}var r=typeof Symbol=="function"&&Symbol.for,o=r?Symbol.for("react.element"):60103;function i(y){return y.$$typeof===o}function a(y){return Array.isArray(y)?[]:{}}function s(y,m){return m.clone!==!1&&m.isMergeableObject(y)?v(a(y),y,m):y}function l(y,m,S){return y.concat(m).map(function(D){return s(D,S)})}function u(y,m){if(!m.customMerge)return v;var S=m.customMerge(y);return typeof S=="function"?S:v}function f(y){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(y).filter(function(m){return Object.propertyIsEnumerable.call(y,m)}):[]}function c(y){return Object.keys(y).concat(f(y))}function d(y,m){try{return m in y}catch{return!1}}function p(y,m){return d(y,m)&&!(Object.hasOwnProperty.call(y,m)&&Object.propertyIsEnumerable.call(y,m))}function h(y,m,S){var D={};return S.isMergeableObject(y)&&c(y).forEach(function(E){D[E]=s(y[E],S)}),c(m).forEach(function(E){p(y,E)||(d(y,E)&&S.isMergeableObject(m[E])?D[E]=u(E,S)(y[E],m[E],S):D[E]=s(m[E],S))}),D}function v(y,m,S){S=S||{},S.arrayMerge=S.arrayMerge||l,S.isMergeableObject=S.isMergeableObject||e,S.cloneUnlessOtherwiseSpecified=s;var D=Array.isArray(m),E=Array.isArray(y),C=D===E;return C?D?S.arrayMerge(y,m,S):h(y,m,S):s(m,S)}v.all=function(m,S){if(!Array.isArray(m))throw new Error("first argument should be an array");return m.reduce(function(D,E){return v(D,E,S)},{})};var O=v;return qt=O,qt}var gs=vs();const ye=Dt(gs);var pt=typeof window<"u"&&typeof document<"u"&&typeof navigator<"u",bs=(function(){for(var e=["Edge","Trident","Firefox"],t=0;t=0)return 1;return 0})();function ws(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}function Os(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},bs))}}var Ss=pt&&window.Promise,Es=Ss?ws:Os;function Or(e){var t={};return e&&t.toString.call(e)==="[object Function]"}function He(e,t){if(e.nodeType!==1)return[];var n=e.ownerDocument.defaultView,r=n.getComputedStyle(e,null);return t?r[t]:r}function fn(e){return e.nodeName==="HTML"?e:e.parentNode||e.host}function ht(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=He(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/(auto|scroll|overlay)/.test(n+o+r)?e:ht(fn(e))}function Sr(e){return e&&e.referenceNode?e.referenceNode:e}var jn=pt&&!!(window.MSInputMethodContext&&document.documentMode),Fn=pt&&/MSIE 10/.test(navigator.userAgent);function et(e){return e===11?jn:e===10?Fn:jn||Fn}function Ke(e){if(!e)return document.documentElement;for(var t=et(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return!r||r==="BODY"||r==="HTML"?e?e.ownerDocument.documentElement:document.documentElement:["TH","TD","TABLE"].indexOf(n.nodeName)!==-1&&He(n,"position")==="static"?Ke(n):n}function ks(e){var t=e.nodeName;return t==="BODY"?!1:t==="HTML"||Ke(e.firstElementChild)===e}function tn(e){return e.parentNode!==null?tn(e.parentNode):e}function xt(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,o=n?t:e,i=document.createRange();i.setStart(r,0),i.setEnd(o,0);var a=i.commonAncestorContainer;if(e!==a&&t!==a||r.contains(o))return ks(a)?a:Ke(a);var s=tn(e);return s.host?xt(s.host,t):xt(e,tn(t).host)}function Ze(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"top",n=t==="top"?"scrollTop":"scrollLeft",r=e.nodeName;if(r==="BODY"||r==="HTML"){var o=e.ownerDocument.documentElement,i=e.ownerDocument.scrollingElement||o;return i[n]}return e[n]}function Cs(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=Ze(t,"top"),o=Ze(t,"left"),i=n?-1:1;return e.top+=r*i,e.bottom+=r*i,e.left+=o*i,e.right+=o*i,e}function Ln(e,t){var n=t==="x"?"Left":"Top",r=n==="Left"?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+r+"Width"])}function Bn(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],et(10)?parseInt(n["offset"+e])+parseInt(r["margin"+(e==="Height"?"Top":"Left")])+parseInt(r["margin"+(e==="Height"?"Bottom":"Right")]):0)}function Er(e){var t=e.body,n=e.documentElement,r=et(10)&&getComputedStyle(n);return{height:Bn("Height",t,n,r),width:Bn("Width",t,n,r)}}var Ts=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Ms=(function(){function e(t,n){for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!1,r=et(10),o=t.nodeName==="HTML",i=nn(e),a=nn(t),s=ht(e),l=He(t),u=parseFloat(l.borderTopWidth),f=parseFloat(l.borderLeftWidth);n&&o&&(a.top=Math.max(a.top,0),a.left=Math.max(a.left,0));var c=Ae({top:i.top-a.top-u,left:i.left-a.left-f,width:i.width,height:i.height});if(c.marginTop=0,c.marginLeft=0,!r&&o){var d=parseFloat(l.marginTop),p=parseFloat(l.marginLeft);c.top-=u-d,c.bottom-=u-d,c.left-=f-p,c.right-=f-p,c.marginTop=d,c.marginLeft=p}return(r&&!n?t.contains(s):t===s&&s.nodeName!=="BODY")&&(c=Cs(c,t)),c}function xs(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=e.ownerDocument.documentElement,r=dn(e,n),o=Math.max(n.clientWidth,window.innerWidth||0),i=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:Ze(n),s=t?0:Ze(n,"left"),l={top:a-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:o,height:i};return Ae(l)}function kr(e){var t=e.nodeName;if(t==="BODY"||t==="HTML")return!1;if(He(e,"position")==="fixed")return!0;var n=fn(e);return n?kr(n):!1}function Cr(e){if(!e||!e.parentElement||et())return document.documentElement;for(var t=e.parentElement;t&&He(t,"transform")==="none";)t=t.parentElement;return t||document.documentElement}function pn(e,t,n,r){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,i={top:0,left:0},a=o?Cr(e):xt(e,Sr(t));if(r==="viewport")i=xs(a,o);else{var s=void 0;r==="scrollParent"?(s=ht(fn(t)),s.nodeName==="BODY"&&(s=e.ownerDocument.documentElement)):r==="window"?s=e.ownerDocument.documentElement:s=r;var l=dn(s,a,o);if(s.nodeName==="HTML"&&!kr(a)){var u=Er(e.ownerDocument),f=u.height,c=u.width;i.top+=l.top-l.marginTop,i.bottom=f+l.top,i.left+=l.left-l.marginLeft,i.right=c+l.left}else i=l}n=n||0;var d=typeof n=="number";return i.left+=d?n:n.left||0,i.top+=d?n:n.top||0,i.right-=d?n:n.right||0,i.bottom-=d?n:n.bottom||0,i}function Ns(e){var t=e.width,n=e.height;return t*n}function Tr(e,t,n,r,o){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0;if(e.indexOf("auto")===-1)return e;var a=pn(n,r,i,o),s={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},l=Object.keys(s).map(function(d){return he({key:d},s[d],{area:Ns(s[d])})}).sort(function(d,p){return p.area-d.area}),u=l.filter(function(d){var p=d.width,h=d.height;return p>=n.clientWidth&&h>=n.clientHeight}),f=u.length>0?u[0].key:l[0].key,c=e.split("-")[1];return f+(c?"-"+c:"")}function Mr(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,o=r?Cr(t):xt(t,Sr(n));return dn(n,o,r)}function xr(e){var t=e.ownerDocument.defaultView,n=t.getComputedStyle(e),r=parseFloat(n.marginTop||0)+parseFloat(n.marginBottom||0),o=parseFloat(n.marginLeft||0)+parseFloat(n.marginRight||0),i={width:e.offsetWidth+o,height:e.offsetHeight+r};return i}function Nt(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(n){return t[n]})}function Nr(e,t,n){n=n.split("-")[0];var r=xr(e),o={width:r.width,height:r.height},i=["right","left"].indexOf(n)!==-1,a=i?"top":"left",s=i?"left":"top",l=i?"height":"width",u=i?"width":"height";return o[a]=t[a]+t[l]/2-r[l]/2,n===s?o[s]=t[s]-r[u]:o[s]=t[Nt(s)],o}function mt(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function Ps(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(o){return o[t]===n});var r=mt(e,function(o){return o[t]===n});return e.indexOf(r)}function Pr(e,t,n){var r=n===void 0?e:e.slice(0,Ps(e,"name",n));return r.forEach(function(o){o.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var i=o.function||o.fn;o.enabled&&Or(i)&&(t.offsets.popper=Ae(t.offsets.popper),t.offsets.reference=Ae(t.offsets.reference),t=i(t,o))}),t}function Ds(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=Mr(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=Tr(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=Nr(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=Pr(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function Dr(e,t){return e.some(function(n){var r=n.name,o=n.enabled;return o&&r===t})}function hn(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;ra[p]&&(e.offsets.popper[c]+=s[c]+h-a[p]),e.offsets.popper=Ae(e.offsets.popper);var v=s[c]+s[u]/2-h/2,O=He(e.instance.popper),y=parseFloat(O["margin"+f]),m=parseFloat(O["border"+f+"Width"]),S=v-e.offsets.popper[c]-y-m;return S=Math.max(Math.min(a[u]-h,S),0),e.arrowElement=r,e.offsets.arrow=(n={},Je(n,c,Math.round(S)),Je(n,d,""),n),e}function zs(e){return e==="end"?"start":e==="start"?"end":e}var Ar=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],Gt=Ar.slice(3);function $n(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=Gt.indexOf(e),r=Gt.slice(n+1).concat(Gt.slice(0,n));return t?r.reverse():r}var Vt={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function Ys(e,t){if(Dr(e.instance.modifiers,"inner")||e.flipped&&e.placement===e.originalPlacement)return e;var n=pn(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],o=Nt(r),i=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case Vt.FLIP:a=[r,o];break;case Vt.CLOCKWISE:a=$n(r);break;case Vt.COUNTERCLOCKWISE:a=$n(r,!0);break;default:a=t.behavior}return a.forEach(function(s,l){if(r!==s||a.length===l+1)return e;r=e.placement.split("-")[0],o=Nt(r);var u=e.offsets.popper,f=e.offsets.reference,c=Math.floor,d=r==="left"&&c(u.right)>c(f.left)||r==="right"&&c(u.left)c(f.top)||r==="bottom"&&c(u.top)c(n.right),v=c(u.top)c(n.bottom),y=r==="left"&&p||r==="right"&&h||r==="top"&&v||r==="bottom"&&O,m=["top","bottom"].indexOf(r)!==-1,S=!!t.flipVariations&&(m&&i==="start"&&p||m&&i==="end"&&h||!m&&i==="start"&&v||!m&&i==="end"&&O),D=!!t.flipVariationsByContent&&(m&&i==="start"&&h||m&&i==="end"&&p||!m&&i==="start"&&O||!m&&i==="end"&&v),E=S||D;(d||y||E)&&(e.flipped=!0,(d||y)&&(r=a[l+1]),E&&(i=zs(i)),e.placement=r+(i?"-"+i:""),e.offsets.popper=he({},e.offsets.popper,Nr(e.instance.popper,e.offsets.reference,e.placement)),e=Pr(e.instance.modifiers,e,"flip"))}),e}function qs(e){var t=e.offsets,n=t.popper,r=t.reference,o=e.placement.split("-")[0],i=Math.floor,a=["top","bottom"].indexOf(o)!==-1,s=a?"right":"bottom",l=a?"left":"top",u=a?"width":"height";return n[s]i(r[s])&&(e.offsets.popper[l]=i(r[s])),e}function Gs(e,t,n,r){var o=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),i=+o[1],a=o[2];if(!i)return e;if(a.indexOf("%")===0){var s=void 0;switch(a){case"%p":s=n;break;case"%":case"%r":default:s=r}var l=Ae(s);return l[t]/100*i}else if(a==="vh"||a==="vw"){var u=void 0;return a==="vh"?u=Math.max(document.documentElement.clientHeight,window.innerHeight||0):u=Math.max(document.documentElement.clientWidth,window.innerWidth||0),u/100*i}else return i}function Vs(e,t,n,r){var o=[0,0],i=["right","left"].indexOf(r)!==-1,a=e.split(/(\+|\-)/).map(function(f){return f.trim()}),s=a.indexOf(mt(a,function(f){return f.search(/,|\s/)!==-1}));a[s]&&a[s].indexOf(",")===-1&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,u=s!==-1?[a.slice(0,s).concat([a[s].split(l)[0]]),[a[s].split(l)[1]].concat(a.slice(s+1))]:[a];return u=u.map(function(f,c){var d=(c===1?!i:i)?"height":"width",p=!1;return f.reduce(function(h,v){return h[h.length-1]===""&&["+","-"].indexOf(v)!==-1?(h[h.length-1]=v,p=!0,h):p?(h[h.length-1]+=v,p=!1,h):h.concat(v)},[]).map(function(h){return Gs(h,d,t,n)})}),u.forEach(function(f,c){f.forEach(function(d,p){mn(d)&&(o[c]+=d*(f[p-1]==="-"?-1:1))})}),o}function Ks(e,t){var n=t.offset,r=e.placement,o=e.offsets,i=o.popper,a=o.reference,s=r.split("-")[0],l=void 0;return mn(+n)?l=[+n,0]:l=Vs(n,i,a,s),s==="left"?(i.top+=l[0],i.left-=l[1]):s==="right"?(i.top+=l[0],i.left+=l[1]):s==="top"?(i.left+=l[0],i.top-=l[1]):s==="bottom"&&(i.left+=l[0],i.top+=l[1]),e.popper=i,e}function Zs(e,t){var n=t.boundariesElement||Ke(e.instance.popper);e.instance.reference===n&&(n=Ke(n));var r=hn("transform"),o=e.instance.popper.style,i=o.top,a=o.left,s=o[r];o.top="",o.left="",o[r]="";var l=pn(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);o.top=i,o.left=a,o[r]=s,t.boundaries=l;var u=t.priority,f=e.offsets.popper,c={primary:function(p){var h=f[p];return f[p]l[p]&&!t.escapeWithReference&&(v=Math.min(f[h],l[p]-(p==="right"?f.width:f.height))),Je({},h,v)}};return u.forEach(function(d){var p=["left","top"].indexOf(d)!==-1?"primary":"secondary";f=he({},f,c[p](d))}),e.offsets.popper=f,e}function Js(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var o=e.offsets,i=o.reference,a=o.popper,s=["bottom","top"].indexOf(n)!==-1,l=s?"left":"top",u=s?"width":"height",f={start:Je({},l,i[l]),end:Je({},l,i[l]+i[u]-a[u])};e.offsets.popper=he({},a,f[r])}return e}function Xs(e){if(!Wr(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=mt(e.instance.modifiers,function(r){return r.name==="preventOverflow"}).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right2&&arguments[2]!==void 0?arguments[2]:{};Ts(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=Es(this.update.bind(this)),this.options=he({},e.Defaults,o),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(he({},e.Defaults.modifiers,o.modifiers)).forEach(function(a){r.options.modifiers[a]=he({},e.Defaults.modifiers[a]||{},o.modifiers?o.modifiers[a]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(a){return he({name:a},r.options.modifiers[a])}).sort(function(a,s){return a.order-s.order}),this.modifiers.forEach(function(a){a.enabled&&Or(a.onLoad)&&a.onLoad(r.reference,r.popper,r.options,a,r.state)}),this.update();var i=this.options.eventsEnabled;i&&this.enableEventListeners(),this.state.eventsEnabled=i}return Ms(e,[{key:"update",value:function(){return Ds.call(this)}},{key:"destroy",value:function(){return Is.call(this)}},{key:"enableEventListeners",value:function(){return Ws.call(this)}},{key:"disableEventListeners",value:function(){return _s.call(this)}}]),e})();ut.Utils=(typeof window<"u"?window:global).PopperUtils;ut.placements=Ar;ut.Defaults=ta;var na=["innerHTML","ownerDocument","style","attributes","nodeValue"],ra=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","WeakMap","WeakSet"],oa=["bigint","boolean","null","number","string","symbol","undefined"];function Wt(e){var t=Object.prototype.toString.call(e).slice(8,-1);if(/HTML\w+Element/.test(t))return"HTMLElement";if(ia(t))return t}function be(e){return function(t){return Wt(t)===e}}function ia(e){return ra.includes(e)}function tt(e){return function(t){return typeof t===e}}function sa(e){return oa.includes(e)}function g(e){if(e===null)return"null";switch(typeof e){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(g.array(e))return"Array";if(g.plainFunction(e))return"Function";var t=Wt(e);return t||"Object"}g.array=Array.isArray;g.arrayOf=function(e,t){return!g.array(e)&&!g.function(t)?!1:e.every(function(n){return t(n)})};g.asyncGeneratorFunction=function(e){return Wt(e)==="AsyncGeneratorFunction"};g.asyncFunction=be("AsyncFunction");g.bigint=tt("bigint");g.boolean=function(e){return e===!0||e===!1};g.date=be("Date");g.defined=function(e){return!g.undefined(e)};g.domElement=function(e){return g.object(e)&&!g.plainObject(e)&&e.nodeType===1&&g.string(e.nodeName)&&na.every(function(t){return t in e})};g.empty=function(e){return g.string(e)&&e.length===0||g.array(e)&&e.length===0||g.object(e)&&!g.map(e)&&!g.set(e)&&Object.keys(e).length===0||g.set(e)&&e.size===0||g.map(e)&&e.size===0};g.error=be("Error");g.function=tt("function");g.generator=function(e){return g.iterable(e)&&g.function(e.next)&&g.function(e.throw)};g.generatorFunction=be("GeneratorFunction");g.instanceOf=function(e,t){return!e||!t?!1:Object.getPrototypeOf(e)===t.prototype};g.iterable=function(e){return!g.nullOrUndefined(e)&&g.function(e[Symbol.iterator])};g.map=be("Map");g.nan=function(e){return Number.isNaN(e)};g.null=function(e){return e===null};g.nullOrUndefined=function(e){return g.null(e)||g.undefined(e)};g.number=function(e){return tt("number")(e)&&!g.nan(e)};g.numericString=function(e){return g.string(e)&&e.length>0&&!Number.isNaN(Number(e))};g.object=function(e){return!g.nullOrUndefined(e)&&(g.function(e)||typeof e=="object")};g.oneOf=function(e,t){return g.array(e)?e.indexOf(t)>-1:!1};g.plainFunction=be("Function");g.plainObject=function(e){if(Wt(e)!=="Object")return!1;var t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})};g.primitive=function(e){return g.null(e)||sa(typeof e)};g.promise=be("Promise");g.propertyOf=function(e,t,n){if(!g.object(e)||!t)return!1;var r=e[t];return g.function(n)?n(r):g.defined(r)};g.regexp=be("RegExp");g.set=be("Set");g.string=tt("string");g.symbol=tt("symbol");g.undefined=tt("undefined");g.weakMap=be("WeakMap");g.weakSet=be("WeakSet");function _r(e){return function(t){return typeof t===e}}var aa=_r("function"),la=function(e){return e===null},Hn=function(e){return Object.prototype.toString.call(e).slice(8,-1)==="RegExp"},Un=function(e){return!ca(e)&&!la(e)&&(aa(e)||typeof e=="object")},ca=_r("undefined"),on=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function ua(e,t){var n=e.length;if(n!==t.length)return!1;for(var r=n;r--!==0;)if(!ae(e[r],t[r]))return!1;return!0}function fa(e,t){if(e.byteLength!==t.byteLength)return!1;for(var n=new DataView(e.buffer),r=new DataView(t.buffer),o=e.byteLength;o--;)if(n.getUint8(o)!==r.getUint8(o))return!1;return!0}function da(e,t){var n,r,o,i;if(e.size!==t.size)return!1;try{for(var a=on(e.entries()),s=a.next();!s.done;s=a.next()){var l=s.value;if(!t.has(l[0]))return!1}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}try{for(var u=on(e.entries()),f=u.next();!f.done;f=u.next()){var l=f.value;if(!ae(l[1],t.get(l[0])))return!1}}catch(c){o={error:c}}finally{try{f&&!f.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}return!0}function pa(e,t){var n,r;if(e.size!==t.size)return!1;try{for(var o=on(e.entries()),i=o.next();!i.done;i=o.next()){var a=i.value;if(!t.has(a[0]))return!1}}catch(s){n={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!0}function ae(e,t){if(e===t)return!0;if(e&&Un(e)&&t&&Un(t)){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)&&Array.isArray(t))return ua(e,t);if(e instanceof Map&&t instanceof Map)return da(e,t);if(e instanceof Set&&t instanceof Set)return pa(e,t);if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return fa(e,t);if(Hn(e)&&Hn(t))return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=n.length;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,n[o]))return!1;for(var o=n.length;o--!==0;){var i=n[o];if(!(i==="_owner"&&e.$$typeof)&&!ae(e[i],t[i]))return!1}return!0}return Number.isNaN(e)&&Number.isNaN(t)?!0:e===t}function ha(){for(var e=[],t=0;tl);return g.undefined(r)||(u=u&&l===r),g.undefined(i)||(u=u&&s===i),u}function Yn(e,t,n){var r=n.key,o=n.type,i=n.value,a=ke(e,r),s=ke(t,r),l=o==="added"?a:s,u=o==="added"?s:a;if(!g.nullOrUndefined(i)){if(g.defined(l)){if(g.array(l)||g.plainObject(l))return ma(l,u,i)}else return ae(u,i);return!1}return[a,s].every(g.array)?!u.every(yn(l)):[a,s].every(g.plainObject)?ya(Object.keys(l),Object.keys(u)):![a,s].every(function(f){return g.primitive(f)&&g.defined(f)})&&(o==="added"?!g.defined(a)&&g.defined(s):g.defined(a)&&!g.defined(s))}function qn(e,t,n){var r=n===void 0?{}:n,o=r.key,i=ke(e,o),a=ke(t,o);if(!jr(i,a))throw new TypeError("Inputs have different types");if(!ha(i,a))throw new TypeError("Inputs don't have length");return[i,a].every(g.plainObject)&&(i=Object.keys(i),a=Object.keys(a)),[i,a]}function Gn(e){return function(t){var n=t[0],r=t[1];return g.array(e)?ae(e,r)||e.some(function(o){return ae(o,r)||g.array(r)&&yn(r)(o)}):g.plainObject(e)&&e[n]?!!e[n]&&ae(e[n],r):ae(e,r)}}function ya(e,t){return t.some(function(n){return!e.includes(n)})}function Vn(e){return function(t){return g.array(e)?e.some(function(n){return ae(n,t)||g.array(t)&&yn(t)(n)}):ae(e,t)}}function ot(e,t){return g.array(e)?e.some(function(n){return ae(n,t)}):ae(e,t)}function yn(e){return function(t){return e.some(function(n){return ae(n,t)})}}function jr(){for(var e=[],t=0;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function wa(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function Fr(e,t){if(e==null)return{};var n=wa(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Oa(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xe(e)}function bt(e){var t=ba();return function(){var r=Pt(e),o;if(t){var i=Pt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Oa(this,o)}}function Sa(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Lr(e){var t=Sa(e,"string");return typeof t=="symbol"?t:String(t)}var Ea={flip:{padding:20},preventOverflow:{padding:10}},ka="The typeValidator argument must be a function with the signature function(props, propName, componentName).",Ca="The error message is optional, but must be a string if provided.";function Ta(e,t,n,r){return typeof e=="boolean"?e:typeof e=="function"?e(t,n,r):e?!!e:!1}function Ma(e,t){return Object.hasOwnProperty.call(e,t)}function xa(e,t,n,r){return new Error("Required ".concat(e[t]," `").concat(t,"` was not specified in `").concat(n,"`."))}function Na(e,t){if(typeof e!="function")throw new TypeError(ka);if(t&&typeof t!="string")throw new TypeError(Ca)}function Zn(e,t,n){return Na(e,n),function(r,o,i){for(var a=arguments.length,s=new Array(a>3?a-3:0),l=3;l3&&arguments[3]!==void 0?arguments[3]:!1;e.addEventListener(t,n,r)}function Da(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;e.removeEventListener(t,n,r)}function Ia(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o;o=function(a){n(a),Da(e,t,o)},Pa(e,t,o,r)}function Jn(){}var Br=(function(e){gt(n,e);var t=bt(n);function n(){return yt(this,n),t.apply(this,arguments)}return vt(n,[{key:"componentDidMount",value:function(){Oe()&&(this.node||this.appendNode(),it||this.renderPortal())}},{key:"componentDidUpdate",value:function(){Oe()&&(it||this.renderPortal())}},{key:"componentWillUnmount",value:function(){!Oe()||!this.node||(it||Et.unmountComponentAtNode(this.node),this.node&&this.node.parentNode===document.body&&(document.body.removeChild(this.node),this.node=void 0))}},{key:"appendNode",value:function(){var o=this.props,i=o.id,a=o.zIndex;this.node||(this.node=document.createElement("div"),i&&(this.node.id=i),a&&(this.node.style.zIndex=a),document.body.appendChild(this.node))}},{key:"renderPortal",value:function(){if(!Oe())return null;var o=this.props,i=o.children,a=o.setRef;if(this.node||this.appendNode(),it)return Et.createPortal(i,this.node);var s=Et.unstable_renderSubtreeIntoContainer(this,i.length>1?w.createElement("div",null,i):i[0],this.node);return a(s),null}},{key:"renderReact16",value:function(){var o=this.props,i=o.hasChildren,a=o.placement,s=o.target;return i?this.renderPortal():s||a==="center"?this.renderPortal():null}},{key:"render",value:function(){return it?this.renderReact16():null}}]),n})(w.Component);ne(Br,"propTypes",{children:T.oneOfType([T.element,T.array]),hasChildren:T.bool,id:T.oneOfType([T.string,T.number]),placement:T.string,setRef:T.func.isRequired,target:T.oneOfType([T.object,T.string]),zIndex:T.number});var $r=(function(e){gt(n,e);var t=bt(n);function n(){return yt(this,n),t.apply(this,arguments)}return vt(n,[{key:"parentStyle",get:function(){var o=this.props,i=o.placement,a=o.styles,s=a.arrow.length,l={pointerEvents:"none",position:"absolute",width:"100%"};return i.startsWith("top")?(l.bottom=0,l.left=0,l.right=0,l.height=s):i.startsWith("bottom")?(l.left=0,l.right=0,l.top=0,l.height=s):i.startsWith("left")?(l.right=0,l.top=0,l.bottom=0):i.startsWith("right")&&(l.left=0,l.top=0),l}},{key:"render",value:function(){var o=this.props,i=o.placement,a=o.setArrowRef,s=o.styles,l=s.arrow,u=l.color,f=l.display,c=l.length,d=l.margin,p=l.position,h=l.spread,v={display:f,position:p},O,y=h,m=c;return i.startsWith("top")?(O="0,0 ".concat(y/2,",").concat(m," ").concat(y,",0"),v.bottom=0,v.marginLeft=d,v.marginRight=d):i.startsWith("bottom")?(O="".concat(y,",").concat(m," ").concat(y/2,",0 0,").concat(m),v.top=0,v.marginLeft=d,v.marginRight=d):i.startsWith("left")?(m=h,y=c,O="0,0 ".concat(y,",").concat(m/2," 0,").concat(m),v.right=0,v.marginTop=d,v.marginBottom=d):i.startsWith("right")&&(m=h,y=c,O="".concat(y,",").concat(m," ").concat(y,",0 0,").concat(m/2),v.left=0,v.marginTop=d,v.marginBottom=d),w.createElement("div",{className:"__floater__arrow",style:this.parentStyle},w.createElement("span",{ref:a,style:v},w.createElement("svg",{width:y,height:m,version:"1.1",xmlns:"http://www.w3.org/2000/svg"},w.createElement("polygon",{points:O,fill:u}))))}}]),n})(w.Component);ne($r,"propTypes",{placement:T.string.isRequired,setArrowRef:T.func.isRequired,styles:T.object.isRequired});var Ra=["color","height","width"];function Hr(e){var t=e.handleClick,n=e.styles,r=n.color,o=n.height,i=n.width,a=Fr(n,Ra);return w.createElement("button",{"aria-label":"close",onClick:t,style:a,type:"button"},w.createElement("svg",{width:"".concat(i,"px"),height:"".concat(o,"px"),viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid"},w.createElement("g",null,w.createElement("path",{d:"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z",fill:r}))))}Hr.propTypes={handleClick:T.func.isRequired,styles:T.object.isRequired};function Ur(e){var t=e.content,n=e.footer,r=e.handleClick,o=e.open,i=e.positionWrapper,a=e.showCloseButton,s=e.title,l=e.styles,u={content:w.isValidElement(t)?t:w.createElement("div",{className:"__floater__content",style:l.content},t)};return s&&(u.title=w.isValidElement(s)?s:w.createElement("div",{className:"__floater__title",style:l.title},s)),n&&(u.footer=w.isValidElement(n)?n:w.createElement("div",{className:"__floater__footer",style:l.footer},n)),(a||i)&&!g.boolean(o)&&(u.close=w.createElement(Hr,{styles:l.close,handleClick:r})),w.createElement("div",{className:"__floater__container",style:l.container},u.close,u.title,u.content,u.footer)}Ur.propTypes={content:T.node.isRequired,footer:T.node,handleClick:T.func.isRequired,open:T.bool,positionWrapper:T.bool.isRequired,showCloseButton:T.bool.isRequired,styles:T.object.isRequired,title:T.node};var zr=(function(e){gt(n,e);var t=bt(n);function n(){return yt(this,n),t.apply(this,arguments)}return vt(n,[{key:"style",get:function(){var o=this.props,i=o.disableAnimation,a=o.component,s=o.placement,l=o.hideArrow,u=o.status,f=o.styles,c=f.arrow.length,d=f.floater,p=f.floaterCentered,h=f.floaterClosing,v=f.floaterOpening,O=f.floaterWithAnimation,y=f.floaterWithComponent,m={};return l||(s.startsWith("top")?m.padding="0 0 ".concat(c,"px"):s.startsWith("bottom")?m.padding="".concat(c,"px 0 0"):s.startsWith("left")?m.padding="0 ".concat(c,"px 0 0"):s.startsWith("right")&&(m.padding="0 0 0 ".concat(c,"px"))),[$.OPENING,$.OPEN].indexOf(u)!==-1&&(m=K(K({},m),v)),u===$.CLOSING&&(m=K(K({},m),h)),u===$.OPEN&&!i&&(m=K(K({},m),O)),s==="center"&&(m=K(K({},m),p)),a&&(m=K(K({},m),y)),K(K({},d),m)}},{key:"render",value:function(){var o=this.props,i=o.component,a=o.handleClick,s=o.hideArrow,l=o.setFloaterRef,u=o.status,f={},c=["__floater"];return i?w.isValidElement(i)?f.content=w.cloneElement(i,{closeFn:a}):f.content=i({closeFn:a}):f.content=w.createElement(Ur,this.props),u===$.OPEN&&c.push("__floater__open"),s||(f.arrow=w.createElement($r,this.props)),w.createElement("div",{ref:l,className:c.join(" "),style:this.style},w.createElement("div",{className:"__floater__body"},f.content,f.arrow))}}]),n})(w.Component);ne(zr,"propTypes",{component:T.oneOfType([T.func,T.element]),content:T.node,disableAnimation:T.bool.isRequired,footer:T.node,handleClick:T.func.isRequired,hideArrow:T.bool.isRequired,open:T.bool,placement:T.string.isRequired,positionWrapper:T.bool.isRequired,setArrowRef:T.func.isRequired,setFloaterRef:T.func.isRequired,showCloseButton:T.bool,status:T.string.isRequired,styles:T.object.isRequired,title:T.node});var Yr=(function(e){gt(n,e);var t=bt(n);function n(){return yt(this,n),t.apply(this,arguments)}return vt(n,[{key:"render",value:function(){var o=this.props,i=o.children,a=o.handleClick,s=o.handleMouseEnter,l=o.handleMouseLeave,u=o.setChildRef,f=o.setWrapperRef,c=o.style,d=o.styles,p;if(i)if(w.Children.count(i)===1)if(!w.isValidElement(i))p=w.createElement("span",null,i);else{var h=g.function(i.type)?"innerRef":"ref";p=w.cloneElement(w.Children.only(i),ne({},h,u))}else p=i;return p?w.createElement("span",{ref:f,style:K(K({},d),c),onClick:a,onMouseEnter:s,onMouseLeave:l},p):null}}]),n})(w.Component);ne(Yr,"propTypes",{children:T.node,handleClick:T.func.isRequired,handleMouseEnter:T.func.isRequired,handleMouseLeave:T.func.isRequired,setChildRef:T.func.isRequired,setWrapperRef:T.func.isRequired,style:T.object,styles:T.object.isRequired});var Wa={zIndex:100};function Aa(e){var t=ye(Wa,e.options||{});return{wrapper:{cursor:"help",display:"inline-flex",flexDirection:"column",zIndex:t.zIndex},wrapperPosition:{left:-1e3,position:"absolute",top:-1e3,visibility:"hidden"},floater:{display:"inline-block",filter:"drop-shadow(0 0 3px rgba(0, 0, 0, 0.3))",maxWidth:300,opacity:0,position:"relative",transition:"opacity 0.3s",visibility:"hidden",zIndex:t.zIndex},floaterOpening:{opacity:1,visibility:"visible"},floaterWithAnimation:{opacity:1,transition:"opacity 0.3s, transform 0.2s",visibility:"visible"},floaterWithComponent:{maxWidth:"100%"},floaterClosing:{opacity:0,visibility:"visible"},floaterCentered:{left:"50%",position:"fixed",top:"50%",transform:"translate(-50%, -50%)"},container:{backgroundColor:"#fff",color:"#666",minHeight:60,minWidth:200,padding:20,position:"relative",zIndex:10},title:{borderBottom:"1px solid #555",color:"#555",fontSize:18,marginBottom:5,paddingBottom:6,paddingRight:18},content:{fontSize:15},close:{backgroundColor:"transparent",border:0,borderRadius:0,color:"#555",fontSize:0,height:15,outline:"none",padding:10,position:"absolute",right:0,top:0,width:15,WebkitAppearance:"none"},footer:{borderTop:"1px solid #ccc",fontSize:13,marginTop:10,paddingTop:5},arrow:{color:"#fff",display:"inline-flex",length:16,margin:8,position:"absolute",spread:32},options:t}}var _a=["arrow","flip","offset"],ja=["position","top","right","bottom","left"],vn=(function(e){gt(n,e);var t=bt(n);function n(r){var o;return yt(this,n),o=t.call(this,r),ne(xe(o),"setArrowRef",function(i){o.arrowRef=i}),ne(xe(o),"setChildRef",function(i){o.childRef=i}),ne(xe(o),"setFloaterRef",function(i){o.floaterRef=i}),ne(xe(o),"setWrapperRef",function(i){o.wrapperRef=i}),ne(xe(o),"handleTransitionEnd",function(){var i=o.state.status,a=o.props.callback;o.wrapperPopper&&o.wrapperPopper.instance.update(),o.setState({status:i===$.OPENING?$.OPEN:$.IDLE},function(){var s=o.state.status;a(s===$.OPEN?"open":"close",o.props)})}),ne(xe(o),"handleClick",function(){var i=o.props,a=i.event,s=i.open;if(!g.boolean(s)){var l=o.state,u=l.positionWrapper,f=l.status;(o.event==="click"||o.event==="hover"&&u)&&(St({title:"click",data:[{event:a,status:f===$.OPEN?"closing":"opening"}],debug:o.debug}),o.toggle())}}),ne(xe(o),"handleMouseEnter",function(){var i=o.props,a=i.event,s=i.open;if(!(g.boolean(s)||Kt())){var l=o.state.status;o.event==="hover"&&l===$.IDLE&&(St({title:"mouseEnter",data:[{key:"originalEvent",value:a}],debug:o.debug}),clearTimeout(o.eventDelayTimeout),o.toggle())}}),ne(xe(o),"handleMouseLeave",function(){var i=o.props,a=i.event,s=i.eventDelay,l=i.open;if(!(g.boolean(l)||Kt())){var u=o.state,f=u.status,c=u.positionWrapper;o.event==="hover"&&(St({title:"mouseLeave",data:[{key:"originalEvent",value:a}],debug:o.debug}),s?[$.OPENING,$.OPEN].indexOf(f)!==-1&&!c&&!o.eventDelayTimeout&&(o.eventDelayTimeout=setTimeout(function(){delete o.eventDelayTimeout,o.toggle()},s*1e3)):o.toggle($.IDLE))}}),o.state={currentPlacement:r.placement,needsUpdate:!1,positionWrapper:r.wrapperOptions.position&&!!r.target,status:$.INIT,statusWrapper:$.INIT},o._isMounted=!1,o.hasMounted=!1,Oe()&&window.addEventListener("load",function(){o.popper&&o.popper.instance.update(),o.wrapperPopper&&o.wrapperPopper.instance.update()}),o}return vt(n,[{key:"componentDidMount",value:function(){if(Oe()){var o=this.state.positionWrapper,i=this.props,a=i.children,s=i.open,l=i.target;this._isMounted=!0,St({title:"init",data:{hasChildren:!!a,hasTarget:!!l,isControlled:g.boolean(s),positionWrapper:o,target:this.target,floater:this.floaterRef},debug:this.debug}),this.hasMounted||(this.initPopper(),this.hasMounted=!0),!a&&l&&g.boolean(s)}}},{key:"componentDidUpdate",value:function(o,i){if(Oe()){var a=this.props,s=a.autoOpen,l=a.open,u=a.target,f=a.wrapperOptions,c=va(i,this.state),d=c.changedFrom,p=c.changed;if(o.open!==l){var h;g.boolean(l)&&(h=l?$.OPENING:$.CLOSING),this.toggle(h)}(o.wrapperOptions.position!==f.position||o.target!==u)&&this.changeWrapperPosition(this.props),p("status",$.IDLE)&&l?this.toggle($.OPEN):d("status",$.INIT,$.IDLE)&&s&&this.toggle($.OPEN),this.popper&&p("status",$.OPENING)&&this.popper.instance.update(),this.floaterRef&&(p("status",$.OPENING)||p("status",$.CLOSING))&&Ia(this.floaterRef,"transitionend",this.handleTransitionEnd),p("needsUpdate",!0)&&this.rebuildPopper()}}},{key:"componentWillUnmount",value:function(){Oe()&&(this._isMounted=!1,this.popper&&this.popper.instance.destroy(),this.wrapperPopper&&this.wrapperPopper.instance.destroy())}},{key:"initPopper",value:function(){var o=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.target,a=this.state.positionWrapper,s=this.props,l=s.disableFlip,u=s.getPopper,f=s.hideArrow,c=s.offset,d=s.placement,p=s.wrapperOptions,h=d==="top"||d==="bottom"?"flip":["right","bottom-end","top-end","left","top-start","bottom-start"];if(d==="center")this.setState({status:$.IDLE});else if(i&&this.floaterRef){var v=this.options,O=v.arrow,y=v.flip,m=v.offset,S=Fr(v,_a);new ut(i,this.floaterRef,{placement:d,modifiers:K({arrow:K({enabled:!f,element:this.arrowRef},O),flip:K({enabled:!l,behavior:h},y),offset:K({offset:"0, ".concat(c,"px")},m)},S),onCreate:function(C){var M;if(o.popper=C,!((M=o.floaterRef)!==null&&M!==void 0&&M.isConnected)){o.setState({needsUpdate:!0});return}u(C,"floater"),o._isMounted&&o.setState({currentPlacement:C.placement,status:$.IDLE}),d!==C.placement&&setTimeout(function(){C.instance.update()},1)},onUpdate:function(C){o.popper=C;var M=o.state.currentPlacement;o._isMounted&&C.placement!==M&&o.setState({currentPlacement:C.placement})}})}if(a){var D=g.undefined(p.offset)?0:p.offset;new ut(this.target,this.wrapperRef,{placement:p.placement||d,modifiers:{arrow:{enabled:!1},offset:{offset:"0, ".concat(D,"px")},flip:{enabled:!1}},onCreate:function(C){o.wrapperPopper=C,o._isMounted&&o.setState({statusWrapper:$.IDLE}),u(C,"wrapper"),d!==C.placement&&setTimeout(function(){C.instance.update()},1)}})}}},{key:"rebuildPopper",value:function(){var o=this;this.floaterRefInterval=setInterval(function(){var i;(i=o.floaterRef)!==null&&i!==void 0&&i.isConnected&&(clearInterval(o.floaterRefInterval),o.setState({needsUpdate:!1}),o.initPopper())},50)}},{key:"changeWrapperPosition",value:function(o){var i=o.target,a=o.wrapperOptions;this.setState({positionWrapper:a.position&&!!i})}},{key:"toggle",value:function(o){var i=this.state.status,a=i===$.OPEN?$.CLOSING:$.OPENING;g.undefined(o)||(a=o),this.setState({status:a})}},{key:"debug",get:function(){var o=this.props.debug;return o||Oe()&&"ReactFloaterDebug"in window&&!!window.ReactFloaterDebug}},{key:"event",get:function(){var o=this.props,i=o.disableHoverToClick,a=o.event;return a==="hover"&&Kt()&&!i?"click":a}},{key:"options",get:function(){var o=this.props.options;return ye(Ea,o||{})}},{key:"styles",get:function(){var o=this,i=this.state,a=i.status,s=i.positionWrapper,l=i.statusWrapper,u=this.props.styles,f=ye(Aa(u),u);if(s){var c;[$.IDLE].indexOf(a)===-1||[$.IDLE].indexOf(l)===-1?c=f.wrapperPosition:c=this.wrapperPopper.styles,f.wrapper=K(K({},f.wrapper),c)}if(this.target){var d=window.getComputedStyle(this.target);this.wrapperStyles?f.wrapper=K(K({},f.wrapper),this.wrapperStyles):["relative","static"].indexOf(d.position)===-1&&(this.wrapperStyles={},s||(ja.forEach(function(p){o.wrapperStyles[p]=d[p]}),f.wrapper=K(K({},f.wrapper),this.wrapperStyles),this.target.style.position="relative",this.target.style.top="auto",this.target.style.right="auto",this.target.style.bottom="auto",this.target.style.left="auto"))}return f}},{key:"target",get:function(){if(!Oe())return null;var o=this.props.target;return o?g.domElement(o)?o:document.querySelector(o):this.childRef||this.wrapperRef}},{key:"render",value:function(){var o=this.state,i=o.currentPlacement,a=o.positionWrapper,s=o.status,l=this.props,u=l.children,f=l.component,c=l.content,d=l.disableAnimation,p=l.footer,h=l.hideArrow,v=l.id,O=l.open,y=l.showCloseButton,m=l.style,S=l.target,D=l.title,E=w.createElement(Yr,{handleClick:this.handleClick,handleMouseEnter:this.handleMouseEnter,handleMouseLeave:this.handleMouseLeave,setChildRef:this.setChildRef,setWrapperRef:this.setWrapperRef,style:m,styles:this.styles.wrapper},u),C={};return a?C.wrapperInPortal=E:C.wrapperAsChildren=E,w.createElement("span",null,w.createElement(Br,{hasChildren:!!u,id:v,placement:i,setRef:this.setFloaterRef,target:S,zIndex:this.styles.options.zIndex},w.createElement(zr,{component:f,content:c,disableAnimation:d,footer:p,handleClick:this.handleClick,hideArrow:h||i==="center",open:O,placement:i,positionWrapper:a,setArrowRef:this.setArrowRef,setFloaterRef:this.setFloaterRef,showCloseButton:y,status:s,styles:this.styles,title:D}),C.wrapperInPortal),C.wrapperAsChildren)}}]),n})(w.Component);ne(vn,"propTypes",{autoOpen:T.bool,callback:T.func,children:T.node,component:Zn(T.oneOfType([T.func,T.element]),function(e){return!e.content}),content:Zn(T.node,function(e){return!e.component}),debug:T.bool,disableAnimation:T.bool,disableFlip:T.bool,disableHoverToClick:T.bool,event:T.oneOf(["hover","click"]),eventDelay:T.number,footer:T.node,getPopper:T.func,hideArrow:T.bool,id:T.oneOfType([T.string,T.number]),offset:T.number,open:T.bool,options:T.object,placement:T.oneOf(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end","auto","center"]),showCloseButton:T.bool,style:T.object,styles:T.object,target:T.oneOfType([T.object,T.string]),title:T.node,wrapperOptions:T.shape({offset:T.number,placement:T.oneOf(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end","auto"]),position:T.bool})});ne(vn,"defaultProps",{autoOpen:!1,callback:Jn,debug:!1,disableAnimation:!1,disableFlip:!1,disableHoverToClick:!1,event:"click",eventDelay:.4,getPopper:Jn,hideArrow:!1,offset:15,placement:"bottom",showCloseButton:!1,styles:{},target:null,wrapperOptions:{position:!1}});var Fa=Object.defineProperty,La=(e,t,n)=>t in e?Fa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t,n)=>La(e,typeof t!="symbol"?t+"":t,n),z={INIT:"init",START:"start",STOP:"stop",RESET:"reset",PREV:"prev",NEXT:"next",GO:"go",CLOSE:"close",SKIP:"skip",UPDATE:"update"},me={TOUR_START:"tour:start",STEP_BEFORE:"step:before",BEACON:"beacon",TOOLTIP:"tooltip",STEP_AFTER:"step:after",TOUR_END:"tour:end",TOUR_STATUS:"tour:status",TARGET_NOT_FOUND:"error:target_not_found"},A={INIT:"init",READY:"ready",BEACON:"beacon",TOOLTIP:"tooltip",COMPLETE:"complete",ERROR:"error"},B={IDLE:"idle",READY:"ready",WAITING:"waiting",RUNNING:"running",PAUSED:"paused",SKIPPED:"skipped",FINISHED:"finished"};function Re(){var e;return!!(typeof window<"u"&&((e=window.document)!=null&&e.createElement))}function qr(e){return e?e.getBoundingClientRect():null}function Ba(e=!1){const{body:t,documentElement:n}=document;if(!t||!n)return 0;if(e){const r=[t.scrollHeight,t.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight].sort((i,a)=>i-a),o=Math.floor(r.length/2);return r.length%2===0?(r[o-1]+r[o])/2:r[o]}return Math.max(t.scrollHeight,t.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight)}function Ne(e){if(typeof e=="string")try{return document.querySelector(e)}catch{return null}return e}function $a(e){return!e||e.nodeType!==1?null:getComputedStyle(e)}function ft(e,t,n){if(!e)return Fe();const r=wr(e);if(r){if(r.isSameNode(Fe()))return n?document:Fe();if(!(r.scrollHeight>r.offsetHeight)&&!t)return r.style.overflow="initial",Fe()}return r}function At(e,t){if(!e)return!1;const n=ft(e,t);return n?!n.isSameNode(Fe()):!1}function Ha(e){return e.offsetParent!==document.body}function Xe(e,t="fixed"){if(!e||!(e instanceof HTMLElement))return!1;const{nodeName:n}=e,r=$a(e);return n==="BODY"||n==="HTML"?!1:r&&r.position===t?!0:e.parentNode?Xe(e.parentNode,t):!1}function Ua(e){var t;if(!e)return!1;let n=e;for(;n&&n!==document.body;){if(n instanceof HTMLElement){const{display:r,visibility:o}=getComputedStyle(n);if(r==="none"||o==="hidden")return!1}n=(t=n.parentElement)!=null?t:null}return!0}function za(e,t,n){var r,o,i;const a=qr(e),s=ft(e,n),l=At(e,n),u=Xe(e);let f=0,c=(r=a?.top)!=null?r:0;if(l&&u){const d=(o=e?.offsetTop)!=null?o:0,p=(i=s?.scrollTop)!=null?i:0;c=d-p}else s instanceof HTMLElement&&(f=s.scrollTop,!l&&!Xe(e)&&(c+=f),s.isSameNode(Fe())||(c+=Fe().scrollTop));return Math.floor(c-t)}function Ya(e,t,n){var r;if(!e)return 0;const{offsetTop:o=0,scrollTop:i=0}=(r=wr(e))!=null?r:{};let a=e.getBoundingClientRect().top+i;o&&(At(e,n)||Ha(e))&&(a-=o);const s=Math.floor(a-t);return s<0?0:s}function Fe(){var e;return(e=document.scrollingElement)!=null?e:document.documentElement}function qa(e,t){const{duration:n,element:r}=t;return new Promise((o,i)=>{const{scrollTop:a}=r,s=e>a?e-a:a-e;fs.top(r,e,{duration:s<100?50:n},l=>l&&l.message!=="Element already at target scroll position"?i(l):o())})}var st=kt.createPortal!==void 0;function Gr(e=navigator.userAgent){let t=e;return typeof window>"u"?t="node":document.documentMode?t="ie":/Edge/.test(e)?t="edge":window.opera||e.includes(" OPR/")?t="opera":typeof window.InstallTrigger<"u"?t="firefox":window.chrome?t="chrome":/(Version\/([\d._]+).*Safari|CriOS|FxiOS| Mobile\/)/.test(e)&&(t="safari"),t}function Tt(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function Se(e,t={}){const{defaultValue:n,step:r,steps:o}=t;let i=An(e);if(i)(i.includes("{step}")||i.includes("{steps}"))&&r&&o&&(i=i.replace("{step}",r.toString()).replace("{steps}",o.toString()));else if(b.isValidElement(e)&&!Object.values(e.props).length&&Tt(e.type)==="function"){const a=e.type({});i=Se(a,t)}else i=An(n);return i}function Ga(e,t){return!N.plainObject(e)||!N.array(t)?!1:Object.keys(e).every(n=>t.includes(n))}function Va(e){const t=/^#?([\da-f])([\da-f])([\da-f])$/i,n=e.replace(t,(o,i,a,s)=>i+i+a+a+s+s),r=/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(n);return r?[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)]:[]}function Xn(e){return e.disableBeacon||e.placement==="center"}function Qn(){return!["chrome","safari","firefox","opera"].includes(Gr())}function $e({data:e,debug:t=!1,title:n,warn:r=!1}){const o=r?console.warn||console.error:console.log;t&&(n&&e?(console.groupCollapsed(`%creact-joyride: ${n}`,"color: #ff0044; font-weight: bold; font-size: 12px;"),Array.isArray(e)?e.forEach(i=>{N.plainObject(i)&&i.key?o.apply(console,[i.key,i.value]):o.apply(console,[i])}):o.apply(console,[e]),console.groupEnd()):console.error("Missing title or data props"))}function Ka(e){return Object.keys(e)}function Vr(e,...t){if(!N.plainObject(e))throw new TypeError("Expected an object");const n={};for(const r in e)({}).hasOwnProperty.call(e,r)&&(t.includes(r)||(n[r]=e[r]));return n}function Za(e,...t){if(!N.plainObject(e))throw new TypeError("Expected an object");if(!t.length)return e;const n={};for(const r in e)({}).hasOwnProperty.call(e,r)&&t.includes(r)&&(n[r]=e[r]);return n}function an(e,t,n){const r=i=>i.replace("{step}",String(t)).replace("{steps}",String(n));if(Tt(e)==="string")return r(e);if(!b.isValidElement(e))return e;const{children:o}=e.props;if(Tt(o)==="string"&&o.includes("{step}"))return b.cloneElement(e,{children:r(o)});if(Array.isArray(o))return b.cloneElement(e,{children:o.map(i=>typeof i=="string"?r(i):an(i,t,n))});if(Tt(e.type)==="function"&&!Object.values(e.props).length){const i=e.type({});return an(i,t,n)}return e}function Ja(e){const{isFirstStep:t,lifecycle:n,previousLifecycle:r,scrollToFirstStep:o,step:i,target:a}=e;return!i.disableScrolling&&(!t||o||n===A.TOOLTIP)&&i.placement!=="center"&&(!i.isFixed||!Xe(a))&&r!==n&&[A.BEACON,A.TOOLTIP].includes(n)}var Xa={options:{preventOverflow:{boundariesElement:"scrollParent"}},wrapperOptions:{offset:-18,position:!0}},Kr={back:"Back",close:"Close",last:"Last",next:"Next",nextLabelWithProgress:"Next (Step {step} of {steps})",open:"Open the dialog",skip:"Skip"},Qa={event:"click",placement:"bottom",offset:10,disableBeacon:!1,disableCloseOnEsc:!1,disableOverlay:!1,disableOverlayClose:!1,disableScrollParentFix:!1,disableScrolling:!1,hideBackButton:!1,hideCloseButton:!1,hideFooter:!1,isFixed:!1,locale:Kr,showProgress:!1,showSkipButton:!1,spotlightClicks:!1,spotlightPadding:10},el={continuous:!1,debug:!1,disableCloseOnEsc:!1,disableOverlay:!1,disableOverlayClose:!1,disableScrolling:!1,disableScrollParentFix:!1,getHelpers:void 0,hideBackButton:!1,run:!0,scrollOffset:20,scrollDuration:300,scrollToFirstStep:!1,showSkipButton:!1,showProgress:!1,spotlightClicks:!1,spotlightPadding:10,steps:[]},tl={arrowColor:"#fff",backgroundColor:"#fff",beaconSize:36,overlayColor:"rgba(0, 0, 0, 0.5)",primaryColor:"#f04",spotlightShadow:"0 0 15px rgba(0, 0, 0, 0.5)",textColor:"#333",width:380,zIndex:100},at={backgroundColor:"transparent",border:0,borderRadius:0,color:"#555",cursor:"pointer",fontSize:16,lineHeight:1,padding:8,WebkitAppearance:"none"},er={borderRadius:4,position:"absolute"};function nl(e,t){var n,r,o,i,a;const{floaterProps:s,styles:l}=e,u=ye((n=t.floaterProps)!=null?n:{},s??{}),f=ye(l??{},(r=t.styles)!=null?r:{}),c=ye(tl,f.options||{}),d=t.placement==="center"||t.disableBeacon;let{width:p}=c;window.innerWidth>480&&(p=380),"width"in c&&(p=typeof c.width=="number"&&window.innerWidthZr(n,t)):($e({title:"validateSteps",data:"steps must be an array",warn:!0,debug:t}),!1)}var Jr={action:"init",controlled:!1,index:0,lifecycle:A.INIT,origin:null,size:0,status:B.IDLE},nr=Ka(Vr(Jr,"controlled","size")),ol=class{constructor(e){P(this,"beaconPopper"),P(this,"tooltipPopper"),P(this,"data",new Map),P(this,"listener"),P(this,"store",new Map),P(this,"addListener",o=>{this.listener=o}),P(this,"setSteps",o=>{const{size:i,status:a}=this.getState(),s={size:o.length,status:a};this.data.set("steps",o),a===B.WAITING&&!i&&o.length&&(s.status=B.RUNNING),this.setState(s)}),P(this,"getPopper",o=>o==="beacon"?this.beaconPopper:this.tooltipPopper),P(this,"setPopper",(o,i)=>{o==="beacon"?this.beaconPopper=i:this.tooltipPopper=i}),P(this,"cleanupPoppers",()=>{this.beaconPopper=null,this.tooltipPopper=null}),P(this,"close",(o=null)=>{const{index:i,status:a}=this.getState();a===B.RUNNING&&this.setState({...this.getNextState({action:z.CLOSE,index:i+1,origin:o})})}),P(this,"go",o=>{const{controlled:i,status:a}=this.getState();if(i||a!==B.RUNNING)return;const s=this.getSteps()[o];this.setState({...this.getNextState({action:z.GO,index:o}),status:s?a:B.FINISHED})}),P(this,"info",()=>this.getState()),P(this,"next",()=>{const{index:o,status:i}=this.getState();i===B.RUNNING&&this.setState(this.getNextState({action:z.NEXT,index:o+1}))}),P(this,"open",()=>{const{status:o}=this.getState();o===B.RUNNING&&this.setState({...this.getNextState({action:z.UPDATE,lifecycle:A.TOOLTIP})})}),P(this,"prev",()=>{const{index:o,status:i}=this.getState();i===B.RUNNING&&this.setState({...this.getNextState({action:z.PREV,index:o-1})})}),P(this,"reset",(o=!1)=>{const{controlled:i}=this.getState();i||this.setState({...this.getNextState({action:z.RESET,index:0}),status:o?B.RUNNING:B.READY})}),P(this,"skip",()=>{const{status:o}=this.getState();o===B.RUNNING&&this.setState({action:z.SKIP,lifecycle:A.INIT,status:B.SKIPPED})}),P(this,"start",o=>{const{index:i,size:a}=this.getState();this.setState({...this.getNextState({action:z.START,index:N.number(o)?o:i},!0),status:a?B.RUNNING:B.WAITING})}),P(this,"stop",(o=!1)=>{const{index:i,status:a}=this.getState();[B.FINISHED,B.SKIPPED].includes(a)||this.setState({...this.getNextState({action:z.STOP,index:i+(o?1:0)}),status:B.PAUSED})}),P(this,"update",o=>{var i,a;if(!Ga(o,nr))throw new Error(`State is not valid. Valid keys: ${nr.join(", ")}`);this.setState({...this.getNextState({...this.getState(),...o,action:(i=o.action)!=null?i:z.UPDATE,origin:(a=o.origin)!=null?a:null},!0)})});const{continuous:t=!1,stepIndex:n,steps:r=[]}=e??{};this.setState({action:z.INIT,controlled:N.number(n),continuous:t,index:N.number(n)?n:0,lifecycle:A.INIT,origin:null,status:r.length?B.READY:B.IDLE},!0),this.beaconPopper=null,this.tooltipPopper=null,this.listener=null,this.setSteps(r)}getState(){return this.store.size?{action:this.store.get("action")||"",controlled:this.store.get("controlled")||!1,index:parseInt(this.store.get("index"),10),lifecycle:this.store.get("lifecycle")||"",origin:this.store.get("origin")||null,size:this.store.get("size")||0,status:this.store.get("status")||""}:{...Jr}}getNextState(e,t=!1){var n,r,o,i,a;const{action:s,controlled:l,index:u,size:f,status:c}=this.getState(),d=N.number(e.index)?e.index:u,p=l&&!t?u:Math.min(Math.max(d,0),f);return{action:(n=e.action)!=null?n:s,controlled:l,index:p,lifecycle:(r=e.lifecycle)!=null?r:A.INIT,origin:(o=e.origin)!=null?o:null,size:(i=e.size)!=null?i:f,status:p===f?B.FINISHED:(a=e.status)!=null?a:c}}getSteps(){const e=this.data.get("steps");return Array.isArray(e)?e:[]}hasUpdatedState(e){const t=JSON.stringify(e),n=JSON.stringify(this.getState());return t!==n}setState(e,t=!1){const n=this.getState(),{action:r,index:o,lifecycle:i,origin:a=null,size:s,status:l}={...n,...e};this.store.set("action",r),this.store.set("index",o),this.store.set("lifecycle",i),this.store.set("origin",a),this.store.set("size",s),this.store.set("status",l),t&&(this.store.set("controlled",e.controlled),this.store.set("continuous",e.continuous)),this.listener&&this.hasUpdatedState(n)&&this.listener(this.getState())}getHelpers(){return{close:this.close,go:this.go,info:this.info,next:this.next,open:this.open,prev:this.prev,reset:this.reset,skip:this.skip}}};function il(e){return new ol(e)}function sl({styles:e}){return b.createElement("div",{key:"JoyrideSpotlight",className:"react-joyride__spotlight","data-test-id":"spotlight",style:e})}var al=sl,ll=class extends b.Component{constructor(){super(...arguments),P(this,"isActive",!1),P(this,"resizeTimeout"),P(this,"scrollTimeout"),P(this,"scrollParent"),P(this,"state",{isScrolling:!1,mouseOverSpotlight:!1,showSpotlight:!0}),P(this,"hideSpotlight",()=>{const{continuous:e,disableOverlay:t,lifecycle:n}=this.props,r=[A.INIT,A.BEACON,A.COMPLETE,A.ERROR];return t||(e?r.includes(n):n!==A.TOOLTIP)}),P(this,"handleMouseMove",e=>{const{mouseOverSpotlight:t}=this.state,{height:n,left:r,position:o,top:i,width:a}=this.spotlightStyles,s=o==="fixed"?e.clientY:e.pageY,l=o==="fixed"?e.clientX:e.pageX,u=s>=i&&s<=i+n,c=l>=r&&l<=r+a&&u;c!==t&&this.updateState({mouseOverSpotlight:c})}),P(this,"handleScroll",()=>{const{target:e}=this.props,t=Ne(e);if(this.scrollParent!==document){const{isScrolling:n}=this.state;n||this.updateState({isScrolling:!0,showSpotlight:!1}),clearTimeout(this.scrollTimeout),this.scrollTimeout=window.setTimeout(()=>{this.updateState({isScrolling:!1,showSpotlight:!0})},50)}else Xe(t,"sticky")&&this.updateState({})}),P(this,"handleResize",()=>{clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(()=>{this.isActive&&this.forceUpdate()},100)})}componentDidMount(){const{debug:e,disableScrolling:t,disableScrollParentFix:n=!1,target:r}=this.props,o=Ne(r);this.scrollParent=ft(o??document.body,n,!0),this.isActive=!0,window.addEventListener("resize",this.handleResize)}componentDidUpdate(e){var t;const{disableScrollParentFix:n,lifecycle:r,spotlightClicks:o,target:i}=this.props,{changed:a}=Mt(e,this.props);if(a("target")||a("disableScrollParentFix")){const s=Ne(i);this.scrollParent=ft(s??document.body,n,!0)}a("lifecycle",A.TOOLTIP)&&((t=this.scrollParent)==null||t.addEventListener("scroll",this.handleScroll,{passive:!0}),setTimeout(()=>{const{isScrolling:s}=this.state;s||this.updateState({showSpotlight:!0})},100)),(a("spotlightClicks")||a("disableOverlay")||a("lifecycle"))&&(o&&r===A.TOOLTIP?window.addEventListener("mousemove",this.handleMouseMove,!1):r!==A.TOOLTIP&&window.removeEventListener("mousemove",this.handleMouseMove))}componentWillUnmount(){var e;this.isActive=!1,window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("resize",this.handleResize),clearTimeout(this.resizeTimeout),clearTimeout(this.scrollTimeout),(e=this.scrollParent)==null||e.removeEventListener("scroll",this.handleScroll)}get overlayStyles(){const{mouseOverSpotlight:e}=this.state,{disableOverlayClose:t,placement:n,styles:r}=this.props;let o=r.overlay;return Qn()&&(o=n==="center"?r.overlayLegacyCenter:r.overlayLegacy),{cursor:t?"default":"pointer",height:Ba(),pointerEvents:e?"none":"auto",...o}}get spotlightStyles(){var e,t,n;const{showSpotlight:r}=this.state,{disableScrollParentFix:o=!1,spotlightClicks:i,spotlightPadding:a=0,styles:s,target:l}=this.props,u=Ne(l),f=qr(u),c=Xe(u),d=za(u,a,o);return{...Qn()?s.spotlightLegacy:s.spotlight,height:Math.round(((e=f?.height)!=null?e:0)+a*2),left:Math.round(((t=f?.left)!=null?t:0)-a),opacity:r?1:0,pointerEvents:i?"none":"auto",position:c?"fixed":"absolute",top:d,transition:"opacity 0.2s",width:Math.round(((n=f?.width)!=null?n:0)+a*2)}}updateState(e){this.isActive&&this.setState(t=>({...t,...e}))}render(){const{showSpotlight:e}=this.state,{onClickOverlay:t,placement:n}=this.props,{hideSpotlight:r,overlayStyles:o,spotlightStyles:i}=this;if(r())return null;let a=n!=="center"&&e&&b.createElement(al,{styles:i});if(Gr()==="safari"){const{mixBlendMode:s,zIndex:l,...u}=o;a=b.createElement("div",{style:{...u}},a),delete o.backgroundColor}return b.createElement("div",{className:"react-joyride__overlay","data-test-id":"overlay",onClick:t,role:"presentation",style:o},a)}},cl=class extends b.Component{constructor(){super(...arguments),P(this,"node",null)}componentDidMount(){const{id:e}=this.props;Re()&&(this.node=document.createElement("div"),this.node.id=e,document.body.appendChild(this.node),st||this.renderReact15())}componentDidUpdate(){Re()&&(st||this.renderReact15())}componentWillUnmount(){!Re()||!this.node||(st||kt.unmountComponentAtNode(this.node),this.node.parentNode===document.body&&(document.body.removeChild(this.node),this.node=null))}renderReact15(){if(!Re())return;const{children:e}=this.props;this.node&&kt.unstable_renderSubtreeIntoContainer(this,e,this.node)}renderReact16(){if(!Re()||!st)return null;const{children:e}=this.props;return this.node?kt.createPortal(e,this.node):null}render(){return st?this.renderReact16():null}},ul=class{constructor(e,t){if(P(this,"element"),P(this,"options"),P(this,"canBeTabbed",n=>{const{tabIndex:r}=n;return r===null||r<0?!1:this.canHaveFocus(n)}),P(this,"canHaveFocus",n=>{const r=/input|select|textarea|button|object/,o=n.nodeName.toLowerCase();return(r.test(o)&&!n.getAttribute("disabled")||o==="a"&&!!n.getAttribute("href"))&&this.isVisible(n)}),P(this,"findValidTabElements",()=>[].slice.call(this.element.querySelectorAll("*"),0).filter(this.canBeTabbed)),P(this,"handleKeyDown",n=>{const{code:r="Tab"}=this.options;n.code===r&&this.interceptTab(n)}),P(this,"interceptTab",n=>{n.preventDefault();const r=this.findValidTabElements(),{shiftKey:o}=n;if(!r.length)return;let i=document.activeElement?r.indexOf(document.activeElement):0;i===-1||!o&&i+1===r.length?i=0:o&&i===0?i=r.length-1:i+=o?-1:1,r[i].focus()}),P(this,"isHidden",n=>{const r=n.offsetWidth<=0&&n.offsetHeight<=0,o=window.getComputedStyle(n);return r&&!n.innerHTML?!0:r&&o.getPropertyValue("overflow")!=="visible"||o.getPropertyValue("display")==="none"}),P(this,"isVisible",n=>{let r=n;for(;r;)if(r instanceof HTMLElement){if(r===document.body)break;if(this.isHidden(r))return!1;r=r.parentNode}return!0}),P(this,"removeScope",()=>{window.removeEventListener("keydown",this.handleKeyDown)}),P(this,"checkFocus",n=>{document.activeElement!==n&&(n.focus(),window.requestAnimationFrame(()=>this.checkFocus(n)))}),P(this,"setFocus",()=>{const{selector:n}=this.options;if(!n)return;const r=this.element.querySelector(n);r&&window.requestAnimationFrame(()=>this.checkFocus(r))}),!(e instanceof HTMLElement))throw new TypeError("Invalid parameter: element must be an HTMLElement");this.element=e,this.options=t,window.addEventListener("keydown",this.handleKeyDown,!1),this.setFocus()}},fl=class extends b.Component{constructor(e){if(super(e),P(this,"beacon",null),P(this,"setBeaconRef",o=>{this.beacon=o}),e.beaconComponent)return;const t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.id="joyride-beacon-animation",e.nonce&&n.setAttribute("nonce",e.nonce),n.appendChild(document.createTextNode(` + @keyframes joyride-beacon-inner { + 20% { + opacity: 0.9; + } + + 90% { + opacity: 0.7; + } + } + + @keyframes joyride-beacon-outer { + 0% { + transform: scale(1); + } + + 45% { + opacity: 0.7; + transform: scale(0.75); + } + + 100% { + opacity: 0.9; + transform: scale(1); + } + } + `)),t.appendChild(n)}componentDidMount(){const{shouldFocus:e}=this.props;setTimeout(()=>{N.domElement(this.beacon)&&e&&this.beacon.focus()},0)}componentWillUnmount(){const e=document.getElementById("joyride-beacon-animation");e?.parentNode&&e.parentNode.removeChild(e)}render(){const{beaconComponent:e,continuous:t,index:n,isLastStep:r,locale:o,onClickOrHover:i,size:a,step:s,styles:l}=this.props,u=Se(o.open),f={"aria-label":u,onClick:i,onMouseEnter:i,ref:this.setBeaconRef,title:u};let c;if(e){const d=e;c=b.createElement(d,{continuous:t,index:n,isLastStep:r,size:a,step:s,...f})}else c=b.createElement("button",{key:"JoyrideBeacon",className:"react-joyride__beacon","data-test-id":"button-beacon",style:l.beacon,type:"button",...f},b.createElement("span",{style:l.beaconInner}),b.createElement("span",{style:l.beaconOuter}));return c}};function dl({styles:e,...t}){const{color:n,height:r,width:o,...i}=e;return w.createElement("button",{style:i,type:"button",...t},w.createElement("svg",{height:typeof r=="number"?`${r}px`:r,preserveAspectRatio:"xMidYMid",version:"1.1",viewBox:"0 0 18 18",width:typeof o=="number"?`${o}px`:o,xmlns:"http://www.w3.org/2000/svg"},w.createElement("g",null,w.createElement("path",{d:"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z",fill:n}))))}var pl=dl;function hl(e){const{backProps:t,closeProps:n,index:r,isLastStep:o,primaryProps:i,skipProps:a,step:s,tooltipProps:l}=e,{content:u,hideBackButton:f,hideCloseButton:c,hideFooter:d,showSkipButton:p,styles:h,title:v}=s,O={};return O.primary=b.createElement("button",{"data-test-id":"button-primary",style:h.buttonNext,type:"button",...i}),p&&!o&&(O.skip=b.createElement("button",{"aria-live":"off","data-test-id":"button-skip",style:h.buttonSkip,type:"button",...a})),!f&&r>0&&(O.back=b.createElement("button",{"data-test-id":"button-back",style:h.buttonBack,type:"button",...t})),O.close=!c&&b.createElement(pl,{"data-test-id":"button-close",styles:h.buttonClose,...n}),b.createElement("div",{key:"JoyrideTooltip","aria-label":Se(v??u),className:"react-joyride__tooltip",style:h.tooltip,...l},b.createElement("div",{style:h.tooltipContainer},v&&b.createElement("h1",{"aria-label":Se(v),style:h.tooltipTitle},v),b.createElement("div",{style:h.tooltipContent},u)),!d&&b.createElement("div",{style:h.tooltipFooter},b.createElement("div",{style:h.tooltipFooterSpacer},O.skip),O.back,O.primary),O.close)}var ml=hl,yl=class extends b.Component{constructor(){super(...arguments),P(this,"handleClickBack",e=>{e.preventDefault();const{helpers:t}=this.props;t.prev()}),P(this,"handleClickClose",e=>{e.preventDefault();const{helpers:t}=this.props;t.close("button_close")}),P(this,"handleClickPrimary",e=>{e.preventDefault();const{continuous:t,helpers:n}=this.props;if(!t){n.close("button_primary");return}n.next()}),P(this,"handleClickSkip",e=>{e.preventDefault();const{helpers:t}=this.props;t.skip()}),P(this,"getElementsProps",()=>{const{continuous:e,index:t,isLastStep:n,setTooltipRef:r,size:o,step:i}=this.props,{back:a,close:s,last:l,next:u,nextLabelWithProgress:f,skip:c}=i.locale,d=Se(a),p=Se(s),h=Se(l),v=Se(u),O=Se(c);let y=s,m=p;if(e){if(y=u,m=v,i.showProgress&&!n){const S=Se(f,{step:t+1,steps:o});y=an(f,t+1,o),m=S}n&&(y=l,m=h)}return{backProps:{"aria-label":d,children:a,"data-action":"back",onClick:this.handleClickBack,role:"button",title:d},closeProps:{"aria-label":p,children:s,"data-action":"close",onClick:this.handleClickClose,role:"button",title:p},primaryProps:{"aria-label":m,children:y,"data-action":"primary",onClick:this.handleClickPrimary,role:"button",title:m},skipProps:{"aria-label":O,children:c,"data-action":"skip",onClick:this.handleClickSkip,role:"button",title:O},tooltipProps:{"aria-modal":!0,ref:r,role:"alertdialog"}}})}render(){const{continuous:e,index:t,isLastStep:n,setTooltipRef:r,size:o,step:i}=this.props,{beaconComponent:a,tooltipComponent:s,...l}=i;let u;if(s){const f={...this.getElementsProps(),continuous:e,index:t,isLastStep:n,size:o,step:l,setTooltipRef:r},c=s;u=b.createElement(c,{...f})}else u=b.createElement(ml,{...this.getElementsProps(),continuous:e,index:t,isLastStep:n,size:o,step:i});return u}},vl=class extends b.Component{constructor(){super(...arguments),P(this,"scope",null),P(this,"tooltip",null),P(this,"handleClickHoverBeacon",e=>{const{step:t,store:n}=this.props;e.type==="mouseenter"&&t.event!=="hover"||n.update({lifecycle:A.TOOLTIP})}),P(this,"setTooltipRef",e=>{this.tooltip=e}),P(this,"setPopper",(e,t)=>{var n;const{action:r,lifecycle:o,step:i,store:a}=this.props;t==="wrapper"?a.setPopper("beacon",e):a.setPopper("tooltip",e),a.getPopper("beacon")&&(a.getPopper("tooltip")||i.placement==="center")&&o===A.INIT&&a.update({action:r,lifecycle:A.READY}),(n=i.floaterProps)!=null&&n.getPopper&&i.floaterProps.getPopper(e,t)}),P(this,"renderTooltip",e=>{const{continuous:t,helpers:n,index:r,size:o,step:i}=this.props;return b.createElement(yl,{continuous:t,helpers:n,index:r,isLastStep:r+1===o,setTooltipRef:this.setTooltipRef,size:o,step:i,...e})})}componentDidMount(){const{debug:e,index:t}=this.props;$e({title:`step:${t}`,data:[{key:"props",value:this.props}],debug:e})}componentDidUpdate(e){var t;const{action:n,callback:r,continuous:o,controlled:i,debug:a,helpers:s,index:l,lifecycle:u,shouldScroll:f,status:c,step:d,store:p}=this.props,{changed:h,changedFrom:v}=Mt(e,this.props),O=s.info(),y=o&&n!==z.CLOSE&&(l>0||n===z.PREV),m=h("action")||h("index")||h("lifecycle")||h("status"),S=v("lifecycle",[A.TOOLTIP,A.INIT],A.INIT),D=h("action",[z.NEXT,z.PREV,z.SKIP,z.CLOSE]),E=i&&l===e.index;if(D&&(S||E)&&r({...O,index:e.index,lifecycle:A.COMPLETE,step:e.step,type:me.STEP_AFTER}),d.placement==="center"&&c===B.RUNNING&&h("index")&&n!==z.START&&u===A.INIT&&p.update({lifecycle:A.READY}),m){const C=Ne(d.target),M=!!C;M&&Ua(C)?(v("status",B.READY,B.RUNNING)||v("lifecycle",A.INIT,A.READY))&&r({...O,step:d,type:me.STEP_BEFORE}):(console.warn(M?"Target not visible":"Target not mounted",d),r({...O,type:me.TARGET_NOT_FOUND,step:d}),i||p.update({index:l+(n===z.PREV?-1:1)}))}v("lifecycle",A.INIT,A.READY)&&p.update({lifecycle:Xn(d)||y?A.TOOLTIP:A.BEACON}),h("index")&&$e({title:`step:${u}`,data:[{key:"props",value:this.props}],debug:a}),h("lifecycle",A.BEACON)&&r({...O,step:d,type:me.BEACON}),h("lifecycle",A.TOOLTIP)&&(r({...O,step:d,type:me.TOOLTIP}),f&&this.tooltip&&(this.scope=new ul(this.tooltip,{selector:"[data-action=primary]"}),this.scope.setFocus())),v("lifecycle",[A.TOOLTIP,A.INIT],A.INIT)&&((t=this.scope)==null||t.removeScope(),p.cleanupPoppers())}componentWillUnmount(){var e;(e=this.scope)==null||e.removeScope()}get open(){const{lifecycle:e,step:t}=this.props;return Xn(t)||e===A.TOOLTIP}render(){const{continuous:e,debug:t,index:n,nonce:r,shouldScroll:o,size:i,step:a}=this.props,s=Ne(a.target);return!Zr(a)||!N.domElement(s)?null:b.createElement("div",{key:`JoyrideStep-${n}`,className:"react-joyride__step"},b.createElement(vn,{...a.floaterProps,component:this.renderTooltip,debug:t,getPopper:this.setPopper,id:`react-joyride-step-${n}`,open:this.open,placement:a.placement,target:a.target},b.createElement(fl,{beaconComponent:a.beaconComponent,continuous:e,index:n,isLastStep:n+1===i,locale:a.locale,nonce:r,onClickOrHover:this.handleClickHoverBeacon,shouldFocus:o,size:i,step:a,styles:a.styles})))}},Xr=class extends b.Component{constructor(e){super(e),P(this,"helpers"),P(this,"store"),P(this,"callback",a=>{const{callback:s}=this.props;N.function(s)&&s(a)}),P(this,"handleKeyboard",a=>{const{index:s,lifecycle:l}=this.state,{steps:u}=this.props,f=u[s];l===A.TOOLTIP&&a.code==="Escape"&&f&&!f.disableCloseOnEsc&&this.store.close("keyboard")}),P(this,"handleClickOverlay",()=>{const{index:a}=this.state,{steps:s}=this.props;Ye(this.props,s[a]).disableOverlayClose||this.helpers.close("overlay")}),P(this,"syncState",a=>{this.setState(a)});const{debug:t,getHelpers:n,run:r=!0,stepIndex:o}=e;this.store=il({...e,controlled:r&&N.number(o)}),this.helpers=this.store.getHelpers();const{addListener:i}=this.store;$e({title:"init",data:[{key:"props",value:this.props},{key:"state",value:this.state}],debug:t}),i(this.syncState),n&&n(this.helpers),this.state=this.store.getState()}componentDidMount(){if(!Re())return;const{debug:e,disableCloseOnEsc:t,run:n,steps:r}=this.props,{start:o}=this.store;tr(r,e)&&n&&o(),t||document.body.addEventListener("keydown",this.handleKeyboard,{passive:!0})}componentDidUpdate(e,t){if(!Re())return;const{action:n,controlled:r,index:o,status:i}=this.state,{debug:a,run:s,stepIndex:l,steps:u}=this.props,{stepIndex:f,steps:c}=e,{reset:d,setSteps:p,start:h,stop:v,update:O}=this.store,{changed:y}=Mt(e,this.props),{changed:m,changedFrom:S}=Mt(t,this.state),D=Ye(this.props,u[o]),E=!oe(c,u),C=N.number(l)&&y("stepIndex"),M=Ne(D.target);if(E&&(tr(u,a)?p(u):console.warn("Steps are not valid",u)),y("run")&&(s?h(l):v()),C){let Y=N.number(f)&&f=0?v:0,r===B.RUNNING&&qa(v,{element:h,duration:a}).then(()=>{setTimeout(()=>{var m;(m=this.store.getPopper("tooltip"))==null||m.instance.update()},10)})}}render(){if(!Re())return null;const{index:e,lifecycle:t,status:n}=this.state,{continuous:r=!1,debug:o=!1,nonce:i,scrollToFirstStep:a=!1,steps:s}=this.props,l=n===B.RUNNING,u={};if(l&&s[e]){const f=Ye(this.props,s[e]);u.step=b.createElement(vl,{...this.state,callback:this.callback,continuous:r,debug:o,helpers:this.helpers,nonce:i,shouldScroll:!f.disableScrolling&&(e!==0||a),step:f,store:this.store}),u.overlay=b.createElement(cl,{id:"react-joyride-portal"},b.createElement(ll,{...f,continuous:r,debug:o,lifecycle:t,onClickOverlay:this.handleClickOverlay}))}return b.createElement("div",{className:"react-joyride"},u.step,u.overlay)}};P(Xr,"defaultProps",el);var iu=Xr;function gl(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const bl={},lt={};function Le(e,t){try{const r=(bl[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];return r in lt?lt[r]:rr(r,r.split(":"))}catch{if(e in lt)return lt[e];const n=e?.match(wl);return n?rr(e,n.slice(1)):NaN}}const wl=/([+-]\d\d):?(\d\d)?/;function rr(e,t){const n=+(t[0]||0),r=+(t[1]||0),o=+(t[2]||0)/60;return lt[e]=n*60+r>0?n*60+r+o:n*60-r-o}class Ce extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Le(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),Qr(this),ln(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new Ce(...n,t):new Ce(Date.now(),t)}withTimeZone(t){return new Ce(+this,t)}getTimezoneOffset(){const t=-Le(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),ln(this),+this}[Symbol.for("constructDateFrom")](t){return new Ce(+new Date(t),this.timeZone)}}const or=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!or.test(e))return;const t=e.replace(or,"$1UTC");Ce.prototype[t]&&(e.startsWith("get")?Ce.prototype[e]=function(){return this.internal[t]()}:(Ce.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),Ol(this),+this},Ce.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),ln(this),+this}))});function ln(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-Le(e.timeZone,e)*60))}function Ol(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),Qr(e)}function Qr(e){const t=Le(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const o=-new Date(+e).getTimezoneOffset(),i=-new Date(+r).getTimezoneOffset(),a=o-i,s=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&s&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);const l=o-n;l&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+l);const u=new Date(+e);u.setUTCSeconds(0);const f=o>0?u.getSeconds():(u.getSeconds()-60)%60,c=Math.round(-(Le(e.timeZone,e)*60))%60;(c||f)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+c),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+c+f));const d=Le(e.timeZone,e),p=d>0?Math.floor(d):Math.ceil(d),v=-new Date(+e).getTimezoneOffset()-p,O=p!==n,y=v-l;if(O&&y){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+y);const m=Le(e.timeZone,e),S=m>0?Math.floor(m):Math.ceil(m),D=p-S;D&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+D),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+D))}}class te extends Ce{static tz(t,...n){return n.length?new te(...n,t):new te(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),o=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+o}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,o]=this.internal.toUTCString().split(" ");return`${t?.slice(0,-1)} ${r} ${n} ${o}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,o]=this.tzComponents();return`${t} GMT${n}${r}${o} (${gl(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),o=String(Math.abs(t)%60).padStart(2,"0");return[n,r,o]}withTimeZone(t){return new te(+this,t)}[Symbol.for("constructDateFrom")](t){return new te(+new Date(t),this.timeZone)}}const ir=5,Sl=4;function El(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,o=t.addDays(e,-r+1),i=t.addDays(o,ir*7-1);return t.getMonth(e)===t.getMonth(i)?ir:Sl}function eo(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-6):t.addDays(n,-1*(r-1))}function kl(e,t){const n=eo(e,t),r=El(e,t);return t.addDays(n,r*7-1)}class fe{constructor(t,n){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?te.tz(this.options.timeZone):new this.Date,this.newDate=(r,o,i)=>this.overrides?.newDate?this.overrides.newDate(r,o,i):this.options.timeZone?new te(r,o,i,this.options.timeZone):new Date(r,o,i),this.addDays=(r,o)=>this.overrides?.addDays?this.overrides.addDays(r,o):Yo(r,o),this.addMonths=(r,o)=>this.overrides?.addMonths?this.overrides.addMonths(r,o):qo(r,o),this.addWeeks=(r,o)=>this.overrides?.addWeeks?this.overrides.addWeeks(r,o):Go(r,o),this.addYears=(r,o)=>this.overrides?.addYears?this.overrides.addYears(r,o):Vo(r,o),this.differenceInCalendarDays=(r,o)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,o):Ko(r,o),this.differenceInCalendarMonths=(r,o)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,o):Zo(r,o),this.eachMonthOfInterval=r=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):Jo(r),this.eachYearOfInterval=r=>{const o=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(r):Xo(r),i=new Set(o.map(s=>this.getYear(s)));if(i.size===o.length)return o;const a=[];return i.forEach(s=>{a.push(new Date(s,0,1))}),a},this.endOfBroadcastWeek=r=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):kl(r,this),this.endOfISOWeek=r=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(r):Qo(r),this.endOfMonth=r=>this.overrides?.endOfMonth?this.overrides.endOfMonth(r):ei(r),this.endOfWeek=(r,o)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(r,o):ti(r,this.options),this.endOfYear=r=>this.overrides?.endOfYear?this.overrides.endOfYear(r):ni(r),this.format=(r,o,i)=>{const a=this.overrides?.format?this.overrides.format(r,o,this.options):ri(r,o,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(a):a},this.getISOWeek=r=>this.overrides?.getISOWeek?this.overrides.getISOWeek(r):oi(r),this.getMonth=(r,o)=>this.overrides?.getMonth?this.overrides.getMonth(r,this.options):ii(r,this.options),this.getYear=(r,o)=>this.overrides?.getYear?this.overrides.getYear(r,this.options):si(r,this.options),this.getWeek=(r,o)=>this.overrides?.getWeek?this.overrides.getWeek(r,this.options):ai(r,this.options),this.isAfter=(r,o)=>this.overrides?.isAfter?this.overrides.isAfter(r,o):li(r,o),this.isBefore=(r,o)=>this.overrides?.isBefore?this.overrides.isBefore(r,o):ci(r,o),this.isDate=r=>this.overrides?.isDate?this.overrides.isDate(r):ui(r),this.isSameDay=(r,o)=>this.overrides?.isSameDay?this.overrides.isSameDay(r,o):fi(r,o),this.isSameMonth=(r,o)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(r,o):di(r,o),this.isSameYear=(r,o)=>this.overrides?.isSameYear?this.overrides.isSameYear(r,o):pi(r,o),this.max=r=>this.overrides?.max?this.overrides.max(r):hi(r),this.min=r=>this.overrides?.min?this.overrides.min(r):mi(r),this.setMonth=(r,o)=>this.overrides?.setMonth?this.overrides.setMonth(r,o):yi(r,o),this.setYear=(r,o)=>this.overrides?.setYear?this.overrides.setYear(r,o):vi(r,o),this.startOfBroadcastWeek=(r,o)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):eo(r,this),this.startOfDay=r=>this.overrides?.startOfDay?this.overrides.startOfDay(r):gi(r),this.startOfISOWeek=r=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(r):bi(r),this.startOfMonth=r=>this.overrides?.startOfMonth?this.overrides.startOfMonth(r):wi(r),this.startOfWeek=(r,o)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(r,this.options):Oi(r,this.options),this.startOfYear=r=>this.overrides?.startOfYear?this.overrides.startOfYear(r):Si(r),this.options={locale:cr,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let o=0;o<10;o++)r[o.toString()]=n.format(o);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){const t=this.options.locale?.code;return t&&fe.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:r,numerals:o}=this.options,i=n?.code;if(i&&fe.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:r,numberingSystem:o}).format(t)}catch{}const a=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,a)}}fe.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Te=new fe;class to{constructor(t,n,r=Te){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class Cl{constructor(t,n){this.date=t,this.weeks=n}}class Tl{constructor(t,n){this.days=n,this.weekNumber=t}}function Ml(e){return w.createElement("button",{...e})}function xl(e){return w.createElement("span",{...e})}function Nl(e){const{size:t=24,orientation:n="left",className:r}=e;return w.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&w.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&w.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&w.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&w.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function Pl(e){const{day:t,modifiers:n,...r}=e;return w.createElement("td",{...r})}function Dl(e){const{day:t,modifiers:n,...r}=e,o=w.useRef(null);return w.useEffect(()=>{n.focused&&o.current?.focus()},[n.focused]),w.createElement("button",{ref:o,...r})}var I;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(I||(I={}));var Z;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(Z||(Z={}));var ve;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(ve||(ve={}));var ue;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(ue||(ue={}));function Il(e){const{options:t,className:n,components:r,classNames:o,...i}=e,a=[o[I.Dropdown],n].join(" "),s=t?.find(({value:l})=>l===i.value);return w.createElement("span",{"data-disabled":i.disabled,className:o[I.DropdownRoot]},w.createElement(r.Select,{className:a,...i},t?.map(({value:l,label:u,disabled:f})=>w.createElement(r.Option,{key:l,value:l,disabled:f},u))),w.createElement("span",{className:o[I.CaptionLabel],"aria-hidden":!0},s?.label,w.createElement(r.Chevron,{orientation:"down",size:18,className:o[I.Chevron]})))}function Rl(e){return w.createElement("div",{...e})}function Wl(e){return w.createElement("div",{...e})}function Al(e){const{calendarMonth:t,displayIndex:n,...r}=e;return w.createElement("div",{...r},e.children)}function _l(e){const{calendarMonth:t,displayIndex:n,...r}=e;return w.createElement("div",{...r})}function jl(e){return w.createElement("table",{...e})}function Fl(e){return w.createElement("div",{...e})}const no=b.createContext(void 0);function wt(){const e=b.useContext(no);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function Ll(e){const{components:t}=wt();return w.createElement(t.Dropdown,{...e})}function Bl(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:o,...i}=e,{components:a,classNames:s,labels:{labelPrevious:l,labelNext:u}}=wt(),f=b.useCallback(d=>{o&&n?.(d)},[o,n]),c=b.useCallback(d=>{r&&t?.(d)},[r,t]);return w.createElement("nav",{...i},w.createElement(a.PreviousMonthButton,{type:"button",className:s[I.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":l(r),onClick:c},w.createElement(a.Chevron,{disabled:r?void 0:!0,className:s[I.Chevron],orientation:"left"})),w.createElement(a.NextMonthButton,{type:"button",className:s[I.NextMonthButton],tabIndex:o?void 0:-1,"aria-disabled":o?void 0:!0,"aria-label":u(o),onClick:f},w.createElement(a.Chevron,{disabled:o?void 0:!0,orientation:"right",className:s[I.Chevron]})))}function $l(e){const{components:t}=wt();return w.createElement(t.Button,{...e})}function Hl(e){return w.createElement("option",{...e})}function Ul(e){const{components:t}=wt();return w.createElement(t.Button,{...e})}function zl(e){const{rootRef:t,...n}=e;return w.createElement("div",{...n,ref:t})}function Yl(e){return w.createElement("select",{...e})}function ql(e){const{week:t,...n}=e;return w.createElement("tr",{...n})}function Gl(e){return w.createElement("th",{...e})}function Vl(e){return w.createElement("thead",{"aria-hidden":!0},w.createElement("tr",{...e}))}function Kl(e){const{week:t,...n}=e;return w.createElement("th",{...n})}function Zl(e){return w.createElement("th",{...e})}function Jl(e){return w.createElement("tbody",{...e})}function Xl(e){const{components:t}=wt();return w.createElement(t.Dropdown,{...e})}const Ql=Object.freeze(Object.defineProperty({__proto__:null,Button:Ml,CaptionLabel:xl,Chevron:Nl,Day:Pl,DayButton:Dl,Dropdown:Il,DropdownNav:Rl,Footer:Wl,Month:Al,MonthCaption:_l,MonthGrid:jl,Months:Fl,MonthsDropdown:Ll,Nav:Bl,NextMonthButton:$l,Option:Hl,PreviousMonthButton:Ul,Root:zl,Select:Yl,Week:ql,WeekNumber:Kl,WeekNumberHeader:Zl,Weekday:Gl,Weekdays:Vl,Weeks:Jl,YearsDropdown:Xl},Symbol.toStringTag,{value:"Module"}));function Pe(e,t,n=!1,r=Te){let{from:o,to:i}=e;const{differenceInCalendarDays:a,isSameDay:s}=r;return o&&i?(a(i,o)<0&&([o,i]=[i,o]),a(t,o)>=(n?1:0)&&a(i,t)>=(n?1:0)):!n&&i?s(i,t):!n&&o?s(o,t):!1}function ro(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function gn(e){return!!(e&&typeof e=="object"&&"from"in e)}function oo(e){return!!(e&&typeof e=="object"&&"after"in e)}function io(e){return!!(e&&typeof e=="object"&&"before"in e)}function so(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function ao(e,t){return Array.isArray(e)&&e.every(t.isDate)}function De(e,t,n=Te){const r=Array.isArray(t)?t:[t],{isSameDay:o,differenceInCalendarDays:i,isAfter:a}=n;return r.some(s=>{if(typeof s=="boolean")return s;if(n.isDate(s))return o(e,s);if(ao(s,n))return s.includes(e);if(gn(s))return Pe(s,e,!1,n);if(so(s))return Array.isArray(s.dayOfWeek)?s.dayOfWeek.includes(e.getDay()):s.dayOfWeek===e.getDay();if(ro(s)){const l=i(s.before,e),u=i(s.after,e),f=l>0,c=u<0;return a(s.before,s.after)?c&&f:f||c}return oo(s)?i(e,s.after)>0:io(s)?i(s.before,e)>0:typeof s=="function"?s(e):!1})}function ec(e,t,n,r,o){const{disabled:i,hidden:a,modifiers:s,showOutsideDays:l,broadcastCalendar:u,today:f}=t,{isSameDay:c,isSameMonth:d,startOfMonth:p,isBefore:h,endOfMonth:v,isAfter:O}=o,y=n&&p(n),m=r&&v(r),S={[Z.focused]:[],[Z.outside]:[],[Z.disabled]:[],[Z.hidden]:[],[Z.today]:[]},D={};for(const E of e){const{date:C,displayMonth:M}=E,j=!!(M&&!d(C,M)),J=!!(y&&h(C,y)),Y=!!(m&&O(C,m)),Q=!!(i&&De(C,i,o)),re=!!(a&&De(C,a,o))||J||Y||!u&&!l&&j||u&&l===!1&&j,Me=c(C,f??o.today());j&&S.outside.push(E),Q&&S.disabled.push(E),re&&S.hidden.push(E),Me&&S.today.push(E),s&&Object.keys(s).forEach(le=>{const de=s?.[le];de&&De(C,de,o)&&(D[le]?D[le].push(E):D[le]=[E])})}return E=>{const C={[Z.focused]:!1,[Z.disabled]:!1,[Z.hidden]:!1,[Z.outside]:!1,[Z.today]:!1},M={};for(const j in S){const J=S[j];C[j]=J.some(Y=>Y===E)}for(const j in D)M[j]=D[j].some(J=>J===E);return{...C,...M}}}function tc(e,t,n={}){return Object.entries(e).filter(([,o])=>o===!0).reduce((o,[i])=>(n[i]?o.push(n[i]):t[Z[i]]?o.push(t[Z[i]]):t[ve[i]]&&o.push(t[ve[i]]),o),[t[I.Day]])}function nc(e){return{...Ql,...e}}function rc(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function oc(){const e={};for(const t in I)e[I[t]]=`rdp-${I[t]}`;for(const t in Z)e[Z[t]]=`rdp-${Z[t]}`;for(const t in ve)e[ve[t]]=`rdp-${ve[t]}`;for(const t in ue)e[ue[t]]=`rdp-${ue[t]}`;return e}function lo(e,t,n){return(n??new fe(t)).formatMonthYear(e)}const ic=lo;function sc(e,t,n){return(n??new fe(t)).format(e,"d")}function ac(e,t=Te){return t.format(e,"LLLL")}function lc(e,t,n){return(n??new fe(t)).format(e,"cccccc")}function cc(e,t=Te){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function uc(){return""}function co(e,t=Te){return t.format(e,"yyyy")}const fc=co,dc=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:lo,formatDay:sc,formatMonthCaption:ic,formatMonthDropdown:ac,formatWeekNumber:cc,formatWeekNumberHeader:uc,formatWeekdayName:lc,formatYearCaption:fc,formatYearDropdown:co},Symbol.toStringTag,{value:"Module"}));function pc(e){return e?.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e?.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...dc,...e}}function hc(e,t,n,r,o){const{startOfMonth:i,startOfYear:a,endOfYear:s,eachMonthOfInterval:l,getMonth:u}=o;return l({start:a(e),end:s(e)}).map(d=>{const p=r.formatMonthDropdown(d,o),h=u(d),v=t&&di(n)||!1;return{value:h,label:p,disabled:v}})}function mc(e,t={},n={}){let r={...t?.[I.Day]};return Object.entries(e).filter(([,o])=>o===!0).forEach(([o])=>{r={...r,...n?.[o]}}),r}function yc(e,t,n){const r=e.today(),o=t?e.startOfISOWeek(r):e.startOfWeek(r),i=[];for(let a=0;a<7;a++){const s=e.addDays(o,a);i.push(s)}return i}function vc(e,t,n,r,o=!1){if(!e||!t)return;const{startOfYear:i,endOfYear:a,eachYearOfInterval:s,getYear:l}=r,u=i(e),f=a(t),c=s({start:u,end:f});return o&&c.reverse(),c.map(d=>{const p=n.formatYearDropdown(d,r);return{value:l(d),label:p,disabled:!1}})}function uo(e,t,n,r){let o=(r??new fe(n)).format(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o}const gc=uo;function fo(e,t,n){return(n??new fe(t)).formatMonthYear(e)}const bc=fo;function wc(e,t,n,r){let o=(r??new fe(n)).format(e,"PPPP");return t?.today&&(o=`Today, ${o}`),o}function Oc(e){return"Choose the Month"}function Sc(){return""}function Ec(e){return"Go to the Next Month"}function kc(e){return"Go to the Previous Month"}function Cc(e,t,n){return(n??new fe(t)).format(e,"cccc")}function Tc(e,t){return`Week ${e}`}function Mc(e){return"Week Number"}function xc(e){return"Choose the Year"}const Nc=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:bc,labelDay:gc,labelDayButton:uo,labelGrid:fo,labelGridcell:wc,labelMonthDropdown:Oc,labelNav:Sc,labelNext:Ec,labelPrevious:kc,labelWeekNumber:Tc,labelWeekNumberHeader:Mc,labelWeekday:Cc,labelYearDropdown:xc},Symbol.toStringTag,{value:"Module"})),Ot=e=>e instanceof HTMLElement?e:null,Zt=e=>[...e.querySelectorAll("[data-animated-month]")??[]],Pc=e=>Ot(e.querySelector("[data-animated-month]")),Jt=e=>Ot(e.querySelector("[data-animated-caption]")),Xt=e=>Ot(e.querySelector("[data-animated-weeks]")),Dc=e=>Ot(e.querySelector("[data-animated-nav]")),Ic=e=>Ot(e.querySelector("[data-animated-weekdays]"));function Rc(e,t,{classNames:n,months:r,focused:o,dateLib:i}){const a=b.useRef(null),s=b.useRef(r),l=b.useRef(!1);b.useLayoutEffect(()=>{const u=s.current;if(s.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||u.length===0||r.length!==u.length)return;const f=i.isSameMonth(r[0].date,u[0].date),c=i.isAfter(r[0].date,u[0].date),d=c?n[ue.caption_after_enter]:n[ue.caption_before_enter],p=c?n[ue.weeks_after_enter]:n[ue.weeks_before_enter],h=a.current,v=e.current.cloneNode(!0);if(v instanceof HTMLElement?(Zt(v).forEach(S=>{if(!(S instanceof HTMLElement))return;const D=Pc(S);D&&S.contains(D)&&S.removeChild(D);const E=Jt(S);E&&E.classList.remove(d);const C=Xt(S);C&&C.classList.remove(p)}),a.current=v):a.current=null,l.current||f||o)return;const O=h instanceof HTMLElement?Zt(h):[],y=Zt(e.current);if(y?.every(m=>m instanceof HTMLElement)&&O&&O.every(m=>m instanceof HTMLElement)){l.current=!0,e.current.style.isolation="isolate";const m=Dc(e.current);m&&(m.style.zIndex="1"),y.forEach((S,D)=>{const E=O[D];if(!E)return;S.style.position="relative",S.style.overflow="hidden";const C=Jt(S);C&&C.classList.add(d);const M=Xt(S);M&&M.classList.add(p);const j=()=>{l.current=!1,e.current&&(e.current.style.isolation=""),m&&(m.style.zIndex=""),C&&C.classList.remove(d),M&&M.classList.remove(p),S.style.position="",S.style.overflow="",S.contains(E)&&S.removeChild(E)};E.style.pointerEvents="none",E.style.position="absolute",E.style.overflow="hidden",E.setAttribute("aria-hidden","true");const J=Ic(E);J&&(J.style.opacity="0");const Y=Jt(E);Y&&(Y.classList.add(c?n[ue.caption_before_exit]:n[ue.caption_after_exit]),Y.addEventListener("animationend",j));const Q=Xt(E);Q&&Q.classList.add(c?n[ue.weeks_before_exit]:n[ue.weeks_after_exit]),S.insertBefore(E,S.firstChild)})}})}function Wc(e,t,n,r){const o=e[0],i=e[e.length-1],{ISOWeek:a,fixedWeeks:s,broadcastCalendar:l}=n??{},{addDays:u,differenceInCalendarDays:f,differenceInCalendarMonths:c,endOfBroadcastWeek:d,endOfISOWeek:p,endOfMonth:h,endOfWeek:v,isAfter:O,startOfBroadcastWeek:y,startOfISOWeek:m,startOfWeek:S}=r,D=l?y(o,r):a?m(o):S(o),E=l?d(i):a?p(h(i)):v(h(i)),C=f(E,D),M=c(i,o)+1,j=[];for(let Q=0;Q<=C;Q++){const re=u(D,Q);if(t&&O(re,t))break;j.push(re)}const Y=(l?35:42)*M;if(s&&j.length{const o=r.weeks.reduce((i,a)=>i.concat(a.days.slice()),t.slice());return n.concat(o.slice())},t.slice())}function _c(e,t,n,r){const{numberOfMonths:o=1}=n,i=[];for(let a=0;at)break;i.push(s)}return i}function sr(e,t,n,r){const{month:o,defaultMonth:i,today:a=r.today(),numberOfMonths:s=1}=e;let l=o||i||a;const{differenceInCalendarMonths:u,addMonths:f,startOfMonth:c}=r;if(n&&u(n,l){const y=n.broadcastCalendar?c(O,r):n.ISOWeek?d(O):p(O),m=n.broadcastCalendar?i(O):n.ISOWeek?a(s(O)):l(s(O)),S=t.filter(M=>M>=y&&M<=m),D=n.broadcastCalendar?35:42;if(n.fixedWeeks&&S.length{const J=D-S.length;return j>m&&j<=o(m,J)});S.push(...M)}const E=S.reduce((M,j)=>{const J=n.ISOWeek?u(j):f(j),Y=M.find(re=>re.weekNumber===J),Q=new to(j,O,r);return Y?Y.days.push(Q):M.push(new Tl(J,[Q])),M},[]),C=new Cl(O,E);return v.push(C),v},[]);return n.reverseMonths?h.reverse():h}function Fc(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:o,startOfDay:i,startOfMonth:a,endOfMonth:s,addYears:l,endOfYear:u,newDate:f,today:c}=t,{fromYear:d,toYear:p,fromMonth:h,toMonth:v}=e;!n&&h&&(n=h),!n&&d&&(n=t.newDate(d,0,1)),!r&&v&&(r=v),!r&&p&&(r=f(p,11,31));const O=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=a(n):d?n=f(d,0,1):!n&&O&&(n=o(l(e.today??c(),-100))),r?r=s(r):p?r=f(p,11,31):!r&&O&&(r=u(e.today??c())),[n&&i(n),r&&i(r)]}function Lc(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:i=1}=n,{startOfMonth:a,addMonths:s,differenceInCalendarMonths:l}=r,u=o?i:1,f=a(e);if(!t)return s(f,u);if(!(l(t,e)n.concat(r.weeks.slice()),t.slice())}function _t(e,t){const[n,r]=b.useState(e);return[t===void 0?n:t,r]}function Hc(e,t){const[n,r]=Fc(e,t),{startOfMonth:o,endOfMonth:i}=t,a=sr(e,n,r,t),[s,l]=_t(a,e.month?a:void 0);b.useEffect(()=>{const C=sr(e,n,r,t);l(C)},[e.timeZone]);const u=_c(s,r,e,t),f=Wc(u,e.endMonth?i(e.endMonth):void 0,e,t),c=jc(u,f,e,t),d=$c(c),p=Ac(c),h=Bc(s,n,e,t),v=Lc(s,r,e,t),{disableNavigation:O,onMonthChange:y}=e,m=C=>d.some(M=>M.days.some(j=>j.isEqualTo(C))),S=C=>{if(O)return;let M=o(C);n&&Mo(r)&&(M=o(r)),l(M),y?.(M)};return{months:c,weeks:d,days:p,navStart:n,navEnd:r,previousMonth:h,nextMonth:v,goToMonth:S,goToDay:C=>{m(C)||S(C.date)}}}var we;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(we||(we={}));function ar(e){return!e[Z.disabled]&&!e[Z.hidden]&&!e[Z.outside]}function Uc(e,t,n,r){let o,i=-1;for(const a of e){const s=t(a);ar(s)&&(s[Z.focused]&&iar(t(a)))),o}function zc(e,t,n,r,o,i,a){const{ISOWeek:s,broadcastCalendar:l}=i,{addDays:u,addMonths:f,addWeeks:c,addYears:d,endOfBroadcastWeek:p,endOfISOWeek:h,endOfWeek:v,max:O,min:y,startOfBroadcastWeek:m,startOfISOWeek:S,startOfWeek:D}=a;let C={day:u,week:c,month:f,year:d,startOfWeek:M=>l?m(M,a):s?S(M):D(M),endOfWeek:M=>l?p(M):s?h(M):v(M)}[e](n,t==="after"?1:-1);return t==="before"&&r?C=O([r,C]):t==="after"&&o&&(C=y([o,C])),C}function po(e,t,n,r,o,i,a,s=0){if(s>365)return;const l=zc(e,t,n.date,r,o,i,a),u=!!(i.disabled&&De(l,i.disabled,a)),f=!!(i.hidden&&De(l,i.hidden,a)),c=l,d=new to(l,c,a);return!u&&!f?d:po(e,t,d,r,o,i,a,s+1)}function Yc(e,t,n,r,o){const{autoFocus:i}=e,[a,s]=b.useState(),l=Uc(t.days,n,r||(()=>!1),a),[u,f]=b.useState(i?l:void 0);return{isFocusTarget:v=>!!l?.isEqualTo(v),setFocused:f,focused:u,blur:()=>{s(u),f(void 0)},moveFocus:(v,O)=>{if(!u)return;const y=po(v,O,u,t.navStart,t.navEnd,e,o);y&&(e.disableNavigation&&!t.days.some(S=>S.isEqualTo(y))||(t.goToDay(y),f(y)))}}}function qc(e,t){const{selected:n,required:r,onSelect:o}=e,[i,a]=_t(n,o?n:void 0),s=o?n:i,{isSameDay:l}=t,u=p=>s?.some(h=>l(h,p))??!1,{min:f,max:c}=e;return{selected:s,select:(p,h,v)=>{let O=[...s??[]];if(u(p)){if(s?.length===f||r&&s?.length===1)return;O=s?.filter(y=>!l(y,p))}else s?.length===c?O=[p]:O=[...O,p];return o||a(O),o?.(O,p,h,v),O},isSelected:u}}function Gc(e,t,n=0,r=0,o=!1,i=Te){const{from:a,to:s}=t||{},{isSameDay:l,isAfter:u,isBefore:f}=i;let c;if(!a&&!s)c={from:e,to:n>0?void 0:e};else if(a&&!s)l(a,e)?n===0?c={from:a,to:e}:o?c={from:a,to:void 0}:c=void 0:f(e,a)?c={from:e,to:a}:c={from:a,to:e};else if(a&&s)if(l(a,e)&&l(s,e))o?c={from:a,to:s}:c=void 0;else if(l(a,e))c={from:a,to:n>0?void 0:e};else if(l(s,e))c={from:e,to:n>0?void 0:e};else if(f(e,a))c={from:e,to:s};else if(u(e,a))c={from:a,to:e};else if(u(e,s))c={from:a,to:e};else throw new Error("Invalid range");if(c?.from&&c?.to){const d=i.differenceInCalendarDays(c.to,c.from);r>0&&d>r?c={from:e,to:void 0}:n>1&&dtypeof s!="function").some(s=>typeof s=="boolean"?s:n.isDate(s)?Pe(e,s,!1,n):ao(s,n)?s.some(l=>Pe(e,l,!1,n)):gn(s)?s.from&&s.to?lr(e,{from:s.from,to:s.to},n):!1:so(s)?Vc(e,s.dayOfWeek,n):ro(s)?n.isAfter(s.before,s.after)?lr(e,{from:n.addDays(s.after,1),to:n.addDays(s.before,-1)},n):De(e.from,s,n)||De(e.to,s,n):oo(s)||io(s)?De(e.from,s,n)||De(e.to,s,n):!1))return!0;const a=r.filter(s=>typeof s=="function");if(a.length){let s=e.from;const l=n.differenceInCalendarDays(e.to,e.from);for(let u=0;u<=l;u++){if(a.some(f=>f(s)))return!0;s=n.addDays(s,1)}}return!1}function Zc(e,t){const{disabled:n,excludeDisabled:r,selected:o,required:i,onSelect:a}=e,[s,l]=_t(o,a?o:void 0),u=a?o:s;return{selected:u,select:(d,p,h)=>{const{min:v,max:O}=e,y=d?Gc(d,u,v,O,i,t):void 0;return r&&n&&y?.from&&y.to&&Kc({from:y.from,to:y.to},n,t)&&(y.from=d,y.to=void 0),a||l(y),a?.(y,d,p,h),y},isSelected:d=>u&&Pe(u,d,!1,t)}}function Jc(e,t){const{selected:n,required:r,onSelect:o}=e,[i,a]=_t(n,o?n:void 0),s=o?n:i,{isSameDay:l}=t;return{selected:s,select:(c,d,p)=>{let h=c;return!r&&s&&s&&l(c,s)&&(h=void 0),o||a(h),o?.(h,c,d,p),h},isSelected:c=>s?l(s,c):!1}}function Xc(e,t){const n=Jc(e,t),r=qc(e,t),o=Zc(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return o;default:return}}function su(e){let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new te(t.today,t.timeZone)),t.month&&(t.month=new te(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new te(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new te(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new te(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new te(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=t.selected?.map(L=>new te(L,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new te(t.selected.from,t.timeZone):void 0,to:t.selected.to?new te(t.selected.to,t.timeZone):void 0}));const{components:n,formatters:r,labels:o,dateLib:i,locale:a,classNames:s}=b.useMemo(()=>{const L={...cr,...t.locale};return{dateLib:new fe({locale:L,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:nc(t.components),formatters:pc(t.formatters),labels:{...Nc,...t.labels},locale:L,classNames:{...oc(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]),{captionLayout:l,mode:u,navLayout:f,numberOfMonths:c=1,onDayBlur:d,onDayClick:p,onDayFocus:h,onDayKeyDown:v,onDayMouseEnter:O,onDayMouseLeave:y,onNextClick:m,onPrevClick:S,showWeekNumber:D,styles:E}=t,{formatCaption:C,formatDay:M,formatMonthDropdown:j,formatWeekNumber:J,formatWeekNumberHeader:Y,formatWeekdayName:Q,formatYearDropdown:re}=r,Me=Hc(t,i),{days:le,months:de,navStart:Ie,navEnd:je,previousMonth:ie,nextMonth:se,goToMonth:pe}=Me,Ue=ec(le,t,Ie,je,i),{isSelected:k,select:W,selected:F}=Xc(t,i)??{},{blur:R,focused:U,isFocusTarget:G,moveFocus:ee,setFocused:X}=Yc(t,Me,Ue,k??(()=>!1),i),{labelDayButton:ze,labelGridcell:ho,labelGrid:mo,labelMonthDropdown:yo,labelNav:bn,labelPrevious:vo,labelNext:go,labelWeekday:bo,labelWeekNumber:wo,labelWeekNumberHeader:Oo,labelYearDropdown:So}=o,Eo=b.useMemo(()=>yc(i,t.ISOWeek),[i,t.ISOWeek]),wn=u!==void 0||p!==void 0,jt=b.useCallback(()=>{ie&&(pe(ie),S?.(ie))},[ie,pe,S]),Ft=b.useCallback(()=>{se&&(pe(se),m?.(se))},[pe,se,m]),ko=b.useCallback((L,V)=>_=>{_.preventDefault(),_.stopPropagation(),X(L),W?.(L.date,V,_),p?.(L.date,V,_)},[W,p,X]),Co=b.useCallback((L,V)=>_=>{X(L),h?.(L.date,V,_)},[h,X]),To=b.useCallback((L,V)=>_=>{R(),d?.(L.date,V,_)},[R,d]),Mo=b.useCallback((L,V)=>_=>{const q={ArrowLeft:[_.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[_.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[_.shiftKey?"year":"week","after"],ArrowUp:[_.shiftKey?"year":"week","before"],PageUp:[_.shiftKey?"year":"month","before"],PageDown:[_.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(q[_.key]){_.preventDefault(),_.stopPropagation();const[ce,H]=q[_.key];ee(ce,H)}v?.(L.date,V,_)},[ee,v,t.dir]),xo=b.useCallback((L,V)=>_=>{O?.(L.date,V,_)},[O]),No=b.useCallback((L,V)=>_=>{y?.(L.date,V,_)},[y]),Po=b.useCallback(L=>V=>{const _=Number(V.target.value),q=i.setMonth(i.startOfMonth(L),_);pe(q)},[i,pe]),Do=b.useCallback(L=>V=>{const _=Number(V.target.value),q=i.setYear(i.startOfMonth(L),_);pe(q)},[i,pe]),{className:Io,style:Ro}=b.useMemo(()=>({className:[s[I.Root],t.className].filter(Boolean).join(" "),style:{...E?.[I.Root],...t.style}}),[s,t.className,t.style,E]),Wo=rc(t),On=b.useRef(null);Rc(On,!!t.animate,{classNames:s,months:de,focused:U,dateLib:i});const Ao={dayPickerProps:t,selected:F,select:W,isSelected:k,months:de,nextMonth:se,previousMonth:ie,goToMonth:pe,getModifiers:Ue,components:n,classNames:s,styles:E,labels:o,formatters:r};return w.createElement(no.Provider,{value:Ao},w.createElement(n.Root,{rootRef:t.animate?On:void 0,className:Io,style:Ro,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...Wo},w.createElement(n.Months,{className:s[I.Months],style:E?.[I.Months]},!t.hideNavigation&&!f&&w.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:s[I.Nav],style:E?.[I.Nav],"aria-label":bn(),onPreviousClick:jt,onNextClick:Ft,previousMonth:ie,nextMonth:se}),de.map((L,V)=>w.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:s[I.Month],style:E?.[I.Month],key:V,displayIndex:V,calendarMonth:L},f==="around"&&!t.hideNavigation&&V===0&&w.createElement(n.PreviousMonthButton,{type:"button",className:s[I.PreviousMonthButton],tabIndex:ie?void 0:-1,"aria-disabled":ie?void 0:!0,"aria-label":vo(ie),onClick:jt,"data-animated-button":t.animate?"true":void 0},w.createElement(n.Chevron,{disabled:ie?void 0:!0,className:s[I.Chevron],orientation:t.dir==="rtl"?"right":"left"})),w.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:s[I.MonthCaption],style:E?.[I.MonthCaption],calendarMonth:L,displayIndex:V},l?.startsWith("dropdown")?w.createElement(n.DropdownNav,{className:s[I.Dropdowns],style:E?.[I.Dropdowns]},(()=>{const _=l==="dropdown"||l==="dropdown-months"?w.createElement(n.MonthsDropdown,{key:"month",className:s[I.MonthsDropdown],"aria-label":yo(),classNames:s,components:n,disabled:!!t.disableNavigation,onChange:Po(L.date),options:hc(L.date,Ie,je,r,i),style:E?.[I.Dropdown],value:i.getMonth(L.date)}):w.createElement("span",{key:"month"},j(L.date,i)),q=l==="dropdown"||l==="dropdown-years"?w.createElement(n.YearsDropdown,{key:"year",className:s[I.YearsDropdown],"aria-label":So(i.options),classNames:s,components:n,disabled:!!t.disableNavigation,onChange:Do(L.date),options:vc(Ie,je,r,i,!!t.reverseYears),style:E?.[I.Dropdown],value:i.getYear(L.date)}):w.createElement("span",{key:"year"},re(L.date,i));return i.getMonthYearOrder()==="year-first"?[q,_]:[_,q]})(),w.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},C(L.date,i.options,i))):w.createElement(n.CaptionLabel,{className:s[I.CaptionLabel],role:"status","aria-live":"polite"},C(L.date,i.options,i))),f==="around"&&!t.hideNavigation&&V===c-1&&w.createElement(n.NextMonthButton,{type:"button",className:s[I.NextMonthButton],tabIndex:se?void 0:-1,"aria-disabled":se?void 0:!0,"aria-label":go(se),onClick:Ft,"data-animated-button":t.animate?"true":void 0},w.createElement(n.Chevron,{disabled:se?void 0:!0,className:s[I.Chevron],orientation:t.dir==="rtl"?"left":"right"})),V===c-1&&f==="after"&&!t.hideNavigation&&w.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:s[I.Nav],style:E?.[I.Nav],"aria-label":bn(),onPreviousClick:jt,onNextClick:Ft,previousMonth:ie,nextMonth:se}),w.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":u==="multiple"||u==="range","aria-label":mo(L.date,i.options,i)||void 0,className:s[I.MonthGrid],style:E?.[I.MonthGrid]},!t.hideWeekdays&&w.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:s[I.Weekdays],style:E?.[I.Weekdays]},D&&w.createElement(n.WeekNumberHeader,{"aria-label":Oo(i.options),className:s[I.WeekNumberHeader],style:E?.[I.WeekNumberHeader],scope:"col"},Y()),Eo.map(_=>w.createElement(n.Weekday,{"aria-label":bo(_,i.options,i),className:s[I.Weekday],key:String(_),style:E?.[I.Weekday],scope:"col"},Q(_,i.options,i)))),w.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:s[I.Weeks],style:E?.[I.Weeks]},L.weeks.map(_=>w.createElement(n.Week,{className:s[I.Week],key:_.weekNumber,style:E?.[I.Week],week:_},D&&w.createElement(n.WeekNumber,{week:_,style:E?.[I.WeekNumber],"aria-label":wo(_.weekNumber,{locale:a}),className:s[I.WeekNumber],scope:"row",role:"rowheader"},J(_.weekNumber,i)),_.days.map(q=>{const{date:ce}=q,H=Ue(q);if(H[Z.focused]=!H.hidden&&!!U?.isEqualTo(q),H[ve.selected]=k?.(ce)||H.selected,gn(F)){const{from:Lt,to:Bt}=F;H[ve.range_start]=!!(Lt&&Bt&&i.isSameDay(ce,Lt)),H[ve.range_end]=!!(Lt&&Bt&&i.isSameDay(ce,Bt)),H[ve.range_middle]=Pe(F,ce,!0,i)}const _o=mc(H,E,t.modifiersStyles),jo=tc(H,s,t.modifiersClassNames),Fo=!wn&&!H.hidden?ho(ce,H,i.options,i):void 0;return w.createElement(n.Day,{key:`${i.format(ce,"yyyy-MM-dd")}_${i.format(q.displayMonth,"yyyy-MM")}`,day:q,modifiers:H,className:jo.join(" "),style:_o,role:"gridcell","aria-selected":H.selected||void 0,"aria-label":Fo,"data-day":i.format(ce,"yyyy-MM-dd"),"data-month":q.outside?i.format(ce,"yyyy-MM"):void 0,"data-selected":H.selected||void 0,"data-disabled":H.disabled||void 0,"data-hidden":H.hidden||void 0,"data-outside":q.outside||void 0,"data-focused":H.focused||void 0,"data-today":H.today||void 0},!H.hidden&&wn?w.createElement(n.DayButton,{className:s[I.DayButton],style:E?.[I.DayButton],type:"button",day:q,modifiers:H,disabled:H.disabled||void 0,tabIndex:G(q)?0:-1,"aria-label":ze(ce,H,i.options,i),onClick:ko(q,H),onBlur:To(q,H),onFocus:Co(q,H),onKeyDown:Mo(q,H),onMouseEnter:xo(q,H),onMouseLeave:No(q,H)},M(ce,i.options,i)):!H.hidden&&M(q.date,i.options,i))})))))))),t.footer&&w.createElement(n.Footer,{className:s[I.Footer],style:E?.[I.Footer],role:"status","aria-live":"polite"},t.footer)))}export{su as D,ou as _,iu as c,oc as g}; diff --git a/webui/dist/assets/radix-core-BlBHu_Lw.js b/webui/dist/assets/radix-core-BlBHu_Lw.js new file mode 100644 index 00000000..2195079c --- /dev/null +++ b/webui/dist/assets/radix-core-BlBHu_Lw.js @@ -0,0 +1,45 @@ +import{r as i,j as v,R as Ee,a as sn,b as Ye,c as ds}from"./router-CWhjJi2n.js";function N(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function fs(e,t){const n=i.createContext(t),o=s=>{const{children:a,...c}=s,l=i.useMemo(()=>c,Object.values(c));return v.jsx(n.Provider,{value:l,children:a})};o.displayName=e+"Provider";function r(s){const a=i.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[o,r]}function Oe(e,t=[]){let n=[];function o(s,a){const c=i.createContext(a),l=n.length;n=[...n,a];const u=p=>{const{scope:y,children:h,...x}=p,d=y?.[e]?.[l]||c,m=i.useMemo(()=>x,Object.values(x));return v.jsx(d.Provider,{value:m,children:h})};u.displayName=s+"Provider";function f(p,y){const h=y?.[e]?.[l]||c,x=i.useContext(h);if(x)return x;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[u,f]}const r=()=>{const s=n.map(a=>i.createContext(a));return function(c){const l=c?.[e]||s;return i.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return r.scopeName=e,[o,ps(r,...t)]}function ps(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const a=o.reduce((c,{useScope:l,scopeName:u})=>{const p=l(s)[`__scope${u}`];return{...c,...p}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Pn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function $e(...e){return t=>{let n=!1;const o=e.map(r=>{const s=Pn(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;r{const{children:s,...a}=o,c=i.Children.toArray(s),l=c.find(vs);if(l){const u=l.props.children,f=c.map(p=>p===l?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:p);return v.jsx(t,{...a,ref:r,children:i.isValidElement(u)?i.cloneElement(u,void 0,f):null})}return v.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function ms(e){const t=i.forwardRef((n,o)=>{const{children:r,...s}=n;if(i.isValidElement(r)){const a=ys(r),c=gs(s,r.props);return r.type!==i.Fragment&&(c.ref=o?$e(o,a):a),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hs=Symbol("radix.slottable");function vs(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hs}function gs(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function ys(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function eo(e){const t=e+"CollectionProvider",[n,o]=Oe(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=d=>{const{scope:m,children:w}=d,g=Ee.useRef(null),C=Ee.useRef(new Map).current;return v.jsx(r,{scope:m,itemMap:C,collectionRef:g,children:w})};a.displayName=t;const c=e+"CollectionSlot",l=An(c),u=Ee.forwardRef((d,m)=>{const{scope:w,children:g}=d,C=s(c,w),b=B(m,C.collectionRef);return v.jsx(l,{ref:b,children:g})});u.displayName=c;const f=e+"CollectionItemSlot",p="data-radix-collection-item",y=An(f),h=Ee.forwardRef((d,m)=>{const{scope:w,children:g,...C}=d,b=Ee.useRef(null),E=B(m,b),R=s(f,w);return Ee.useEffect(()=>(R.itemMap.set(b,{ref:b,...C}),()=>void R.itemMap.delete(b))),v.jsx(y,{[p]:"",ref:E,children:g})});h.displayName=f;function x(d){const m=s(e+"CollectionConsumer",d);return Ee.useCallback(()=>{const g=m.collectionRef.current;if(!g)return[];const C=Array.from(g.querySelectorAll(`[${p}]`));return Array.from(m.itemMap.values()).sort((R,S)=>C.indexOf(R.ref.current)-C.indexOf(S.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:a,Slot:u,ItemSlot:h},x,o]}var z=globalThis?.document?i.useLayoutEffect:()=>{},ws=sn[" useId ".trim().toString()]||(()=>{}),xs=0;function Se(e){const[t,n]=i.useState(ws());return z(()=>{n(o=>o??String(xs++))},[e]),t?`radix-${t}`:""}function Cs(e){const t=bs(e),n=i.forwardRef((o,r)=>{const{children:s,...a}=o,c=i.Children.toArray(s),l=c.find(Ss);if(l){const u=l.props.children,f=c.map(p=>p===l?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:p);return v.jsx(t,{...a,ref:r,children:i.isValidElement(u)?i.cloneElement(u,void 0,f):null})}return v.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function bs(e){const t=i.forwardRef((n,o)=>{const{children:r,...s}=n;if(i.isValidElement(r)){const a=Rs(r),c=Ts(s,r.props);return r.type!==i.Fragment&&(c.ref=o?$e(o,a):a),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Es=Symbol("radix.slottable");function Ss(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Es}function Ts(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function Rs(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ps=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],D=Ps.reduce((e,t)=>{const n=Cs(`Primitive.${t}`),o=i.forwardRef((r,s)=>{const{asChild:a,...c}=r,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(l,{...c,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function to(e,t){e&&Ye.flushSync(()=>e.dispatchEvent(t))}function ee(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...n)=>t.current?.(...n),[])}var As=sn[" useInsertionEffect ".trim().toString()]||z;function ke({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,s,a]=Os({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:r;{const f=i.useRef(e!==void 0);i.useEffect(()=>{const p=f.current;p!==c&&console.warn(`${o} is changing from ${p?"controlled":"uncontrolled"} to ${c?"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.`),f.current=c},[c,o])}const u=i.useCallback(f=>{if(c){const p=Is(f)?f(e):f;p!==e&&a.current?.(p)}else s(f)},[c,e,s,a]);return[l,u]}function Os({defaultProp:e,onChange:t}){const[n,o]=i.useState(e),r=i.useRef(n),s=i.useRef(t);return As(()=>{s.current=t},[t]),i.useEffect(()=>{r.current!==n&&(s.current?.(n),r.current=n)},[n,r]),[n,o,s]}function Is(e){return typeof e=="function"}var Ns=i.createContext(void 0);function _s(e){const t=i.useContext(Ns);return e||t||"ltr"}function Ds(e,t){return i.useReducer((n,o)=>t[n][o]??n,e)}var ye=e=>{const{present:t,children:n}=e,o=Ms(t),r=typeof n=="function"?n({present:o.isPresent}):i.Children.only(n),s=B(o.ref,Ls(r));return typeof n=="function"||o.isPresent?i.cloneElement(r,{ref:s}):null};ye.displayName="Presence";function Ms(e){const[t,n]=i.useState(),o=i.useRef(null),r=i.useRef(e),s=i.useRef("none"),a=e?"mounted":"unmounted",[c,l]=Ds(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const u=Je(o.current);s.current=c==="mounted"?u:"none"},[c]),z(()=>{const u=o.current,f=r.current;if(f!==e){const y=s.current,h=Je(u);e?l("MOUNT"):h==="none"||u?.display==="none"?l("UNMOUNT"):l(f&&y!==h?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),z(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,p=h=>{const d=Je(o.current).includes(CSS.escape(h.animationName));if(h.target===t&&d&&(l("ANIMATION_END"),!r.current)){const m=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=m)})}},y=h=>{h.target===t&&(s.current=Je(o.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:i.useCallback(u=>{o.current=u?getComputedStyle(u):null,n(u)},[])}}function Je(e){return e?.animationName||"none"}function Ls(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function On(e,[t,n]){return Math.min(n,Math.max(t,e))}var ks=Symbol.for("react.lazy"),lt=sn[" use ".trim().toString()];function js(e){return typeof e=="object"&&e!==null&&"then"in e}function no(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===ks&&"_payload"in e&&js(e._payload)}function oo(e){const t=Fs(e),n=i.forwardRef((o,r)=>{let{children:s,...a}=o;no(s)&&typeof lt=="function"&&(s=lt(s._payload));const c=i.Children.toArray(s),l=c.find(Ws);if(l){const u=l.props.children,f=c.map(p=>p===l?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:p);return v.jsx(t,{...a,ref:r,children:i.isValidElement(u)?i.cloneElement(u,void 0,f):null})}return v.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}var Ul=oo("Slot");function Fs(e){const t=i.forwardRef((n,o)=>{let{children:r,...s}=n;if(no(r)&&typeof lt=="function"&&(r=lt(r._payload)),i.isValidElement(r)){const a=Vs(r),c=Bs(s,r.props);return r.type!==i.Fragment&&(c.ref=o?$e(o,a):a),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $s=Symbol("radix.slottable");function Ws(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$s}function Bs(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function Vs(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ro(e){const t=i.useRef({value:e,previous:e});return i.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function so(e){const[t,n]=i.useState(void 0);return z(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let a,c;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,c=u.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var Hs=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Us=Hs.reduce((e,t)=>{const n=oo(`Primitive.${t}`),o=i.forwardRef((r,s)=>{const{asChild:a,...c}=r,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(l,{...c,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Ks="Label",io=i.forwardRef((e,t)=>v.jsx(Us.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));io.displayName=Ks;var Kl=io;function zs(e,t=globalThis?.document){const n=ee(e);i.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var Ys="DismissableLayer",Ut="dismissableLayer.update",Xs="dismissableLayer.pointerDownOutside",Gs="dismissableLayer.focusOutside",In,ao=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Xe=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:s,onInteractOutside:a,onDismiss:c,...l}=e,u=i.useContext(ao),[f,p]=i.useState(null),y=f?.ownerDocument??globalThis?.document,[,h]=i.useState({}),x=B(t,S=>p(S)),d=Array.from(u.layers),[m]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=d.indexOf(m),g=f?d.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,b=g>=w,E=Zs(S=>{const O=S.target,M=[...u.branches].some(L=>L.contains(O));!b||M||(r?.(S),a?.(S),S.defaultPrevented||c?.())},y),R=Qs(S=>{const O=S.target;[...u.branches].some(L=>L.contains(O))||(s?.(S),a?.(S),S.defaultPrevented||c?.())},y);return zs(S=>{g===u.layers.size-1&&(o?.(S),!S.defaultPrevented&&c&&(S.preventDefault(),c()))},y),i.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(In=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Nn(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=In)}},[f,y,n,u]),i.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Nn())},[f,u]),i.useEffect(()=>{const S=()=>h({});return document.addEventListener(Ut,S),()=>document.removeEventListener(Ut,S)},[]),v.jsx(D.div,{...l,ref:x,style:{pointerEvents:C?b?"auto":"none":void 0,...e.style},onFocusCapture:N(e.onFocusCapture,R.onFocusCapture),onBlurCapture:N(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:N(e.onPointerDownCapture,E.onPointerDownCapture)})});Xe.displayName=Ys;var qs="DismissableLayerBranch",co=i.forwardRef((e,t)=>{const n=i.useContext(ao),o=i.useRef(null),r=B(t,o);return i.useEffect(()=>{const s=o.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),v.jsx(D.div,{...e,ref:r})});co.displayName=qs;function Zs(e,t=globalThis?.document){const n=ee(e),o=i.useRef(!1),r=i.useRef(()=>{});return i.useEffect(()=>{const s=c=>{if(c.target&&!o.current){let l=function(){lo(Xs,n,u,{discrete:!0})};const u={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=l,t.addEventListener("click",r.current,{once:!0})):l()}else t.removeEventListener("click",r.current);o.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function Qs(e,t=globalThis?.document){const n=ee(e),o=i.useRef(!1);return i.useEffect(()=>{const r=s=>{s.target&&!o.current&&lo(Gs,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Nn(){const e=new CustomEvent(Ut);document.dispatchEvent(e)}function lo(e,t,n,{discrete:o}){const r=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?to(r,s):r.dispatchEvent(s)}var Js=Xe,ei=co,Mt="focusScope.autoFocusOnMount",Lt="focusScope.autoFocusOnUnmount",_n={bubbles:!1,cancelable:!0},ti="FocusScope",an=i.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:s,...a}=e,[c,l]=i.useState(null),u=ee(r),f=ee(s),p=i.useRef(null),y=B(t,d=>l(d)),h=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(o){let d=function(C){if(h.paused||!c)return;const b=C.target;c.contains(b)?p.current=b:me(p.current,{select:!0})},m=function(C){if(h.paused||!c)return;const b=C.relatedTarget;b!==null&&(c.contains(b)||me(p.current,{select:!0}))},w=function(C){if(document.activeElement===document.body)for(const E of C)E.removedNodes.length>0&&me(c)};document.addEventListener("focusin",d),document.addEventListener("focusout",m);const g=new MutationObserver(w);return c&&g.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",d),document.removeEventListener("focusout",m),g.disconnect()}}},[o,c,h.paused]),i.useEffect(()=>{if(c){Mn.add(h);const d=document.activeElement;if(!c.contains(d)){const w=new CustomEvent(Mt,_n);c.addEventListener(Mt,u),c.dispatchEvent(w),w.defaultPrevented||(ni(ai(uo(c)),{select:!0}),document.activeElement===d&&me(c))}return()=>{c.removeEventListener(Mt,u),setTimeout(()=>{const w=new CustomEvent(Lt,_n);c.addEventListener(Lt,f),c.dispatchEvent(w),w.defaultPrevented||me(d??document.body,{select:!0}),c.removeEventListener(Lt,f),Mn.remove(h)},0)}}},[c,u,f,h]);const x=i.useCallback(d=>{if(!n&&!o||h.paused)return;const m=d.key==="Tab"&&!d.altKey&&!d.ctrlKey&&!d.metaKey,w=document.activeElement;if(m&&w){const g=d.currentTarget,[C,b]=oi(g);C&&b?!d.shiftKey&&w===b?(d.preventDefault(),n&&me(C,{select:!0})):d.shiftKey&&w===C&&(d.preventDefault(),n&&me(b,{select:!0})):w===g&&d.preventDefault()}},[n,o,h.paused]);return v.jsx(D.div,{tabIndex:-1,...a,ref:y,onKeyDown:x})});an.displayName=ti;function ni(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(me(o,{select:t}),document.activeElement!==n)return}function oi(e){const t=uo(e),n=Dn(t,e),o=Dn(t.reverse(),e);return[n,o]}function uo(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Dn(e,t){for(const n of e)if(!ri(n,{upTo:t}))return n}function ri(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 si(e){return e instanceof HTMLInputElement&&"select"in e}function me(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&si(e)&&t&&e.select()}}var Mn=ii();function ii(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Ln(e,t),e.unshift(t)},remove(t){e=Ln(e,t),e[0]?.resume()}}}function Ln(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function ai(e){return e.filter(t=>t.tagName!=="A")}var ci="Portal",Ge=i.forwardRef((e,t)=>{const{container:n,...o}=e,[r,s]=i.useState(!1);z(()=>s(!0),[]);const a=n||r&&globalThis?.document?.body;return a?ds.createPortal(v.jsx(D.div,{...o,ref:t}),a):null});Ge.displayName=ci;var kt=0;function fo(){i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??kn()),document.body.insertAdjacentElement("beforeend",e[1]??kn()),kt++,()=>{kt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),kt--}},[])}function kn(){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 se=function(){return se=Object.assign||function(t){for(var n,o=1,r=arguments.length;o"u")return Ti;var t=Ri(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},Ai=vo(),Me="data-scroll-locked",Oi=function(e,t,n,o){var r=e.left,s=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),` + .`.concat(ui,` { + overflow: hidden `).concat(o,`; + padding-right: `).concat(c,"px ").concat(o,`; + } + body[`).concat(Me,`] { + overflow: hidden `).concat(o,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&` + padding-left: `.concat(r,`px; + padding-top: `).concat(s,`px; + padding-right: `).concat(a,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(c,"px ").concat(o,`; + `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(o,";")].filter(Boolean).join(""),` + } + + .`).concat(it,` { + right: `).concat(c,"px ").concat(o,`; + } + + .`).concat(at,` { + margin-right: `).concat(c,"px ").concat(o,`; + } + + .`).concat(it," .").concat(it,` { + right: 0 `).concat(o,`; + } + + .`).concat(at," .").concat(at,` { + margin-right: 0 `).concat(o,`; + } + + body[`).concat(Me,`] { + `).concat(di,": ").concat(c,`px; + } +`)},Fn=function(){var e=parseInt(document.body.getAttribute(Me)||"0",10);return isFinite(e)?e:0},Ii=function(){i.useEffect(function(){return document.body.setAttribute(Me,(Fn()+1).toString()),function(){var e=Fn()-1;e<=0?document.body.removeAttribute(Me):document.body.setAttribute(Me,e.toString())}},[])},Ni=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o;Ii();var s=i.useMemo(function(){return Pi(r)},[r]);return i.createElement(Ai,{styles:Oi(s,!t,r,n?"":"!important")})},Kt=!1;if(typeof window<"u")try{var et=Object.defineProperty({},"passive",{get:function(){return Kt=!0,!0}});window.addEventListener("test",et,et),window.removeEventListener("test",et,et)}catch{Kt=!1}var Ne=Kt?{passive:!1}:!1,_i=function(e){return e.tagName==="TEXTAREA"},go=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!_i(e)&&n[t]==="visible")},Di=function(e){return go(e,"overflowY")},Mi=function(e){return go(e,"overflowX")},$n=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var r=yo(e,o);if(r){var s=wo(e,o),a=s[1],c=s[2];if(a>c)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},Li=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},ki=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},yo=function(e,t){return e==="v"?Di(t):Mi(t)},wo=function(e,t){return e==="v"?Li(t):ki(t)},ji=function(e,t){return e==="h"&&t==="rtl"?-1:1},Fi=function(e,t,n,o,r){var s=ji(e,window.getComputedStyle(t).direction),a=s*o,c=n.target,l=t.contains(c),u=!1,f=a>0,p=0,y=0;do{if(!c)break;var h=wo(e,c),x=h[0],d=h[1],m=h[2],w=d-m-s*x;(x||w)&&yo(e,c)&&(p+=w,y+=x);var g=c.parentNode;c=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!l&&c!==document.body||l&&(t.contains(c)||t===c));return(f&&Math.abs(p)<1||!f&&Math.abs(y)<1)&&(u=!0),u},tt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Wn=function(e){return[e.deltaX,e.deltaY]},Bn=function(e){return e&&"current"in e?e.current:e},$i=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Wi=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},Bi=0,_e=[];function Vi(e){var t=i.useRef([]),n=i.useRef([0,0]),o=i.useRef(),r=i.useState(Bi++)[0],s=i.useState(vo)[0],a=i.useRef(e);i.useEffect(function(){a.current=e},[e]),i.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var d=li([e.lockRef.current],(e.shards||[]).map(Bn),!0).filter(Boolean);return d.forEach(function(m){return m.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),d.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var c=i.useCallback(function(d,m){if("touches"in d&&d.touches.length===2||d.type==="wheel"&&d.ctrlKey)return!a.current.allowPinchZoom;var w=tt(d),g=n.current,C="deltaX"in d?d.deltaX:g[0]-w[0],b="deltaY"in d?d.deltaY:g[1]-w[1],E,R=d.target,S=Math.abs(C)>Math.abs(b)?"h":"v";if("touches"in d&&S==="h"&&R.type==="range")return!1;var O=$n(S,R);if(!O)return!0;if(O?E=S:(E=S==="v"?"h":"v",O=$n(S,R)),!O)return!1;if(!o.current&&"changedTouches"in d&&(C||b)&&(o.current=E),!E)return!0;var M=o.current||E;return Fi(M,m,d,M==="h"?C:b)},[]),l=i.useCallback(function(d){var m=d;if(!(!_e.length||_e[_e.length-1]!==s)){var w="deltaY"in m?Wn(m):tt(m),g=t.current.filter(function(E){return E.name===m.type&&(E.target===m.target||m.target===E.shadowParent)&&$i(E.delta,w)})[0];if(g&&g.should){m.cancelable&&m.preventDefault();return}if(!g){var C=(a.current.shards||[]).map(Bn).filter(Boolean).filter(function(E){return E.contains(m.target)}),b=C.length>0?c(m,C[0]):!a.current.noIsolation;b&&m.cancelable&&m.preventDefault()}}},[]),u=i.useCallback(function(d,m,w,g){var C={name:d,delta:m,target:w,should:g,shadowParent:Hi(w)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(b){return b!==C})},1)},[]),f=i.useCallback(function(d){n.current=tt(d),o.current=void 0},[]),p=i.useCallback(function(d){u(d.type,Wn(d),d.target,c(d,e.lockRef.current))},[]),y=i.useCallback(function(d){u(d.type,tt(d),d.target,c(d,e.lockRef.current))},[]);i.useEffect(function(){return _e.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:y}),document.addEventListener("wheel",l,Ne),document.addEventListener("touchmove",l,Ne),document.addEventListener("touchstart",f,Ne),function(){_e=_e.filter(function(d){return d!==s}),document.removeEventListener("wheel",l,Ne),document.removeEventListener("touchmove",l,Ne),document.removeEventListener("touchstart",f,Ne)}},[]);var h=e.removeScrollBar,x=e.inert;return i.createElement(i.Fragment,null,x?i.createElement(s,{styles:Wi(r)}):null,h?i.createElement(Ni,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Hi(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ui=yi(ho,Vi);var cn=i.forwardRef(function(e,t){return i.createElement(vt,se({},e,{ref:t,sideCar:Ui}))});cn.classNames=vt.classNames;var Ki=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},De=new WeakMap,nt=new WeakMap,ot={},Wt=0,xo=function(e){return e&&(e.host||xo(e.parentNode))},zi=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=xo(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Yi=function(e,t,n,o){var r=zi(t,Array.isArray(e)?e:[e]);ot[n]||(ot[n]=new WeakMap);var s=ot[n],a=[],c=new Set,l=new Set(r),u=function(p){!p||c.has(p)||(c.add(p),u(p.parentNode))};r.forEach(u);var f=function(p){!p||l.has(p)||Array.prototype.forEach.call(p.children,function(y){if(c.has(y))f(y);else try{var h=y.getAttribute(o),x=h!==null&&h!=="false",d=(De.get(y)||0)+1,m=(s.get(y)||0)+1;De.set(y,d),s.set(y,m),a.push(y),d===1&&x&&nt.set(y,!0),m===1&&y.setAttribute(n,"true"),x||y.setAttribute(o,"true")}catch(w){console.error("aria-hidden: cannot operate on ",y,w)}})};return f(t),c.clear(),Wt++,function(){a.forEach(function(p){var y=De.get(p)-1,h=s.get(p)-1;De.set(p,y),s.set(p,h),y||(nt.has(p)||p.removeAttribute(o),nt.delete(p)),h||p.removeAttribute(n)}),Wt--,Wt||(De=new WeakMap,De=new WeakMap,nt=new WeakMap,ot={})}},Co=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=Ki(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),Yi(o,r,n,"aria-hidden")):function(){return null}};function Xi(e){const t=Gi(e),n=i.forwardRef((o,r)=>{const{children:s,...a}=o,c=i.Children.toArray(s),l=c.find(Zi);if(l){const u=l.props.children,f=c.map(p=>p===l?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:p);return v.jsx(t,{...a,ref:r,children:i.isValidElement(u)?i.cloneElement(u,void 0,f):null})}return v.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function Gi(e){const t=i.forwardRef((n,o)=>{const{children:r,...s}=n;if(i.isValidElement(r)){const a=Ji(r),c=Qi(s,r.props);return r.type!==i.Fragment&&(c.ref=o?$e(o,a):a),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var qi=Symbol("radix.slottable");function Zi(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qi}function Qi(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function Ji(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var gt="Dialog",[bo,zl]=Oe(gt),[ea,oe]=bo(gt),Eo=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:r,onOpenChange:s,modal:a=!0}=e,c=i.useRef(null),l=i.useRef(null),[u,f]=ke({prop:o,defaultProp:r??!1,onChange:s,caller:gt});return v.jsx(ea,{scope:t,triggerRef:c,contentRef:l,contentId:Se(),titleId:Se(),descriptionId:Se(),open:u,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(p=>!p),[f]),modal:a,children:n})};Eo.displayName=gt;var So="DialogTrigger",To=i.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(So,n),s=B(t,r.triggerRef);return v.jsx(D.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":dn(r.open),...o,ref:s,onClick:N(e.onClick,r.onOpenToggle)})});To.displayName=So;var ln="DialogPortal",[ta,Ro]=bo(ln,{forceMount:void 0}),Po=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:r}=e,s=oe(ln,t);return v.jsx(ta,{scope:t,forceMount:n,children:i.Children.map(o,a=>v.jsx(ye,{present:n||s.open,children:v.jsx(Ge,{asChild:!0,container:r,children:a})}))})};Po.displayName=ln;var ut="DialogOverlay",Ao=i.forwardRef((e,t)=>{const n=Ro(ut,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,s=oe(ut,e.__scopeDialog);return s.modal?v.jsx(ye,{present:o||s.open,children:v.jsx(oa,{...r,ref:t})}):null});Ao.displayName=ut;var na=Xi("DialogOverlay.RemoveScroll"),oa=i.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(ut,n);return v.jsx(cn,{as:na,allowPinchZoom:!0,shards:[r.contentRef],children:v.jsx(D.div,{"data-state":dn(r.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),Te="DialogContent",Oo=i.forwardRef((e,t)=>{const n=Ro(Te,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,s=oe(Te,e.__scopeDialog);return v.jsx(ye,{present:o||s.open,children:s.modal?v.jsx(ra,{...r,ref:t}):v.jsx(sa,{...r,ref:t})})});Oo.displayName=Te;var ra=i.forwardRef((e,t)=>{const n=oe(Te,e.__scopeDialog),o=i.useRef(null),r=B(t,n.contentRef,o);return i.useEffect(()=>{const s=o.current;if(s)return Co(s)},[]),v.jsx(Io,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:N(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:N(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&s.preventDefault()}),onFocusOutside:N(e.onFocusOutside,s=>s.preventDefault())})}),sa=i.forwardRef((e,t)=>{const n=oe(Te,e.__scopeDialog),o=i.useRef(!1),r=i.useRef(!1);return v.jsx(Io,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(o.current||n.triggerRef.current?.focus(),s.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(o.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const a=s.target;n.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),Io=i.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:s,...a}=e,c=oe(Te,n),l=i.useRef(null),u=B(t,l);return fo(),v.jsxs(v.Fragment,{children:[v.jsx(an,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:s,children:v.jsx(Xe,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":dn(c.open),...a,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),v.jsxs(v.Fragment,{children:[v.jsx(ia,{titleId:c.titleId}),v.jsx(ca,{contentRef:l,descriptionId:c.descriptionId})]})]})}),un="DialogTitle",No=i.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(un,n);return v.jsx(D.h2,{id:r.titleId,...o,ref:t})});No.displayName=un;var _o="DialogDescription",Do=i.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(_o,n);return v.jsx(D.p,{id:r.descriptionId,...o,ref:t})});Do.displayName=_o;var Mo="DialogClose",Lo=i.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(Mo,n);return v.jsx(D.button,{type:"button",...o,ref:t,onClick:N(e.onClick,()=>r.onOpenChange(!1))})});Lo.displayName=Mo;function dn(e){return e?"open":"closed"}var ko="DialogTitleWarning",[Yl,jo]=fs(ko,{contentName:Te,titleName:un,docsSlug:"dialog"}),ia=({titleId:e})=>{const t=jo(ko),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return i.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},aa="DialogDescriptionWarning",ca=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${jo(aa).contentName}}.`;return i.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},Xl=Eo,Gl=To,ql=Po,Zl=Ao,Ql=Oo,Jl=No,eu=Do,tu=Lo;const la=["top","right","bottom","left"],ve=Math.min,G=Math.max,dt=Math.round,rt=Math.floor,ae=e=>({x:e,y:e}),ua={left:"right",right:"left",bottom:"top",top:"bottom"},da={start:"end",end:"start"};function zt(e,t,n){return G(e,ve(t,n))}function fe(e,t){return typeof e=="function"?e(t):e}function pe(e){return e.split("-")[0]}function We(e){return e.split("-")[1]}function fn(e){return e==="x"?"y":"x"}function pn(e){return e==="y"?"height":"width"}const fa=new Set(["top","bottom"]);function ie(e){return fa.has(pe(e))?"y":"x"}function mn(e){return fn(ie(e))}function pa(e,t,n){n===void 0&&(n=!1);const o=We(e),r=mn(e),s=pn(r);let a=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=ft(a)),[a,ft(a)]}function ma(e){const t=ft(e);return[Yt(e),t,Yt(t)]}function Yt(e){return e.replace(/start|end/g,t=>da[t])}const Vn=["left","right"],Hn=["right","left"],ha=["top","bottom"],va=["bottom","top"];function ga(e,t,n){switch(e){case"top":case"bottom":return n?t?Hn:Vn:t?Vn:Hn;case"left":case"right":return t?ha:va;default:return[]}}function ya(e,t,n,o){const r=We(e);let s=ga(pe(e),n==="start",o);return r&&(s=s.map(a=>a+"-"+r),t&&(s=s.concat(s.map(Yt)))),s}function ft(e){return e.replace(/left|right|bottom|top/g,t=>ua[t])}function wa(e){return{top:0,right:0,bottom:0,left:0,...e}}function Fo(e){return typeof e!="number"?wa(e):{top:e,right:e,bottom:e,left:e}}function pt(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Un(e,t,n){let{reference:o,floating:r}=e;const s=ie(t),a=mn(t),c=pn(a),l=pe(t),u=s==="y",f=o.x+o.width/2-r.width/2,p=o.y+o.height/2-r.height/2,y=o[c]/2-r[c]/2;let h;switch(l){case"top":h={x:f,y:o.y-r.height};break;case"bottom":h={x:f,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:p};break;case"left":h={x:o.x-r.width,y:p};break;default:h={x:o.x,y:o.y}}switch(We(t)){case"start":h[a]-=y*(n&&u?-1:1);break;case"end":h[a]+=y*(n&&u?-1:1);break}return h}const xa=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:a}=n,c=s.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:p}=Un(u,o,l),y=o,h={},x=0;for(let d=0;d({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:a,elements:c,middlewareData:l}=t,{element:u,padding:f=0}=fe(e,t)||{};if(u==null)return{};const p=Fo(f),y={x:n,y:o},h=mn(r),x=pn(h),d=await a.getDimensions(u),m=h==="y",w=m?"top":"left",g=m?"bottom":"right",C=m?"clientHeight":"clientWidth",b=s.reference[x]+s.reference[h]-y[h]-s.floating[x],E=y[h]-s.reference[h],R=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let S=R?R[C]:0;(!S||!await(a.isElement==null?void 0:a.isElement(R)))&&(S=c.floating[C]||s.floating[x]);const O=b/2-E/2,M=S/2-d[x]/2-1,L=ve(p[w],M),k=ve(p[g],M),$=L,F=S-d[x]-k,T=S/2-d[x]/2+O,j=zt($,T,F),I=!l.arrow&&We(r)!=null&&T!==j&&s.reference[x]/2-(T<$?L:k)-d[x]/2<0,_=I?T<$?T-$:T-F:0;return{[h]:y[h]+_,data:{[h]:j,centerOffset:T-j-_,...I&&{alignmentOffset:_}},reset:I}}}),ba=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:a,initialPlacement:c,platform:l,elements:u}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:y,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:d=!0,...m}=fe(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=pe(r),g=ie(c),C=pe(c)===c,b=await(l.isRTL==null?void 0:l.isRTL(u.floating)),E=y||(C||!d?[ft(c)]:ma(c)),R=x!=="none";!y&&R&&E.push(...ya(c,d,x,b));const S=[c,...E],O=await Ue(t,m),M=[];let L=((o=s.flip)==null?void 0:o.overflows)||[];if(f&&M.push(O[w]),p){const T=pa(r,a,b);M.push(O[T[0]],O[T[1]])}if(L=[...L,{placement:r,overflows:M}],!M.every(T=>T<=0)){var k,$;const T=(((k=s.flip)==null?void 0:k.index)||0)+1,j=S[T];if(j&&(!(p==="alignment"?g!==ie(j):!1)||L.every(P=>ie(P.placement)===g?P.overflows[0]>0:!0)))return{data:{index:T,overflows:L},reset:{placement:j}};let I=($=L.filter(_=>_.overflows[0]<=0).sort((_,P)=>_.overflows[1]-P.overflows[1])[0])==null?void 0:$.placement;if(!I)switch(h){case"bestFit":{var F;const _=(F=L.filter(P=>{if(R){const W=ie(P.placement);return W===g||W==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(W=>W>0).reduce((W,Y)=>W+Y,0)]).sort((P,W)=>P[1]-W[1])[0])==null?void 0:F[0];_&&(I=_);break}case"initialPlacement":I=c;break}if(r!==I)return{reset:{placement:I}}}return{}}}};function Kn(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zn(e){return la.some(t=>e[t]>=0)}const Ea=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=fe(e,t);switch(o){case"referenceHidden":{const s=await Ue(t,{...r,elementContext:"reference"}),a=Kn(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:zn(a)}}}case"escaped":{const s=await Ue(t,{...r,altBoundary:!0}),a=Kn(s,n.floating);return{data:{escapedOffsets:a,escaped:zn(a)}}}default:return{}}}}},$o=new Set(["left","top"]);async function Sa(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),a=pe(n),c=We(n),l=ie(n)==="y",u=$o.has(a)?-1:1,f=s&&l?-1:1,p=fe(t,e);let{mainAxis:y,crossAxis:h,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof x=="number"&&(h=c==="end"?x*-1:x),l?{x:h*f,y:y*u}:{x:y*u,y:h*f}}const Ta=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:a,middlewareData:c}=t,l=await Sa(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:s+l.y,data:{...l,placement:a}}}}},Ra=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:m=>{let{x:w,y:g}=m;return{x:w,y:g}}},...l}=fe(e,t),u={x:n,y:o},f=await Ue(t,l),p=ie(pe(r)),y=fn(p);let h=u[y],x=u[p];if(s){const m=y==="y"?"top":"left",w=y==="y"?"bottom":"right",g=h+f[m],C=h-f[w];h=zt(g,h,C)}if(a){const m=p==="y"?"top":"left",w=p==="y"?"bottom":"right",g=x+f[m],C=x-f[w];x=zt(g,x,C)}const d=c.fn({...t,[y]:h,[p]:x});return{...d,data:{x:d.x-n,y:d.y-o,enabled:{[y]:s,[p]:a}}}}}},Pa=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:a}=t,{offset:c=0,mainAxis:l=!0,crossAxis:u=!0}=fe(e,t),f={x:n,y:o},p=ie(r),y=fn(p);let h=f[y],x=f[p];const d=fe(c,t),m=typeof d=="number"?{mainAxis:d,crossAxis:0}:{mainAxis:0,crossAxis:0,...d};if(l){const C=y==="y"?"height":"width",b=s.reference[y]-s.floating[C]+m.mainAxis,E=s.reference[y]+s.reference[C]-m.mainAxis;hE&&(h=E)}if(u){var w,g;const C=y==="y"?"width":"height",b=$o.has(pe(r)),E=s.reference[p]-s.floating[C]+(b&&((w=a.offset)==null?void 0:w[p])||0)+(b?0:m.crossAxis),R=s.reference[p]+s.reference[C]+(b?0:((g=a.offset)==null?void 0:g[p])||0)-(b?m.crossAxis:0);xR&&(x=R)}return{[y]:h,[p]:x}}}},Aa=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:a,elements:c}=t,{apply:l=()=>{},...u}=fe(e,t),f=await Ue(t,u),p=pe(r),y=We(r),h=ie(r)==="y",{width:x,height:d}=s.floating;let m,w;p==="top"||p==="bottom"?(m=p,w=y===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(w=p,m=y==="end"?"top":"bottom");const g=d-f.top-f.bottom,C=x-f.left-f.right,b=ve(d-f[m],g),E=ve(x-f[w],C),R=!t.middlewareData.shift;let S=b,O=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=C),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(S=g),R&&!y){const L=G(f.left,0),k=G(f.right,0),$=G(f.top,0),F=G(f.bottom,0);h?O=x-2*(L!==0||k!==0?L+k:G(f.left,f.right)):S=d-2*($!==0||F!==0?$+F:G(f.top,f.bottom))}await l({...t,availableWidth:O,availableHeight:S});const M=await a.getDimensions(c.floating);return x!==M.width||d!==M.height?{reset:{rects:!0}}:{}}}};function yt(){return typeof window<"u"}function Be(e){return Wo(e)?(e.nodeName||"").toLowerCase():"#document"}function q(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function le(e){var t;return(t=(Wo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Wo(e){return yt()?e instanceof Node||e instanceof q(e).Node:!1}function te(e){return yt()?e instanceof Element||e instanceof q(e).Element:!1}function ce(e){return yt()?e instanceof HTMLElement||e instanceof q(e).HTMLElement:!1}function Yn(e){return!yt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof q(e).ShadowRoot}const Oa=new Set(["inline","contents"]);function qe(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=ne(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!Oa.has(r)}const Ia=new Set(["table","td","th"]);function Na(e){return Ia.has(Be(e))}const _a=[":popover-open",":modal"];function wt(e){return _a.some(t=>{try{return e.matches(t)}catch{return!1}})}const Da=["transform","translate","scale","rotate","perspective"],Ma=["transform","translate","scale","rotate","perspective","filter"],La=["paint","layout","strict","content"];function hn(e){const t=vn(),n=te(e)?ne(e):e;return Da.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Ma.some(o=>(n.willChange||"").includes(o))||La.some(o=>(n.contain||"").includes(o))}function ka(e){let t=ge(e);for(;ce(t)&&!je(t);){if(hn(t))return t;if(wt(t))return null;t=ge(t)}return null}function vn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ja=new Set(["html","body","#document"]);function je(e){return ja.has(Be(e))}function ne(e){return q(e).getComputedStyle(e)}function xt(e){return te(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ge(e){if(Be(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Yn(e)&&e.host||le(e);return Yn(t)?t.host:t}function Bo(e){const t=ge(e);return je(t)?e.ownerDocument?e.ownerDocument.body:e.body:ce(t)&&qe(t)?t:Bo(t)}function Ke(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Bo(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),a=q(r);if(s){const c=Xt(a);return t.concat(a,a.visualViewport||[],qe(r)?r:[],c&&n?Ke(c):[])}return t.concat(r,Ke(r,[],n))}function Xt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Vo(e){const t=ne(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=ce(e),s=r?e.offsetWidth:n,a=r?e.offsetHeight:o,c=dt(n)!==s||dt(o)!==a;return c&&(n=s,o=a),{width:n,height:o,$:c}}function gn(e){return te(e)?e:e.contextElement}function Le(e){const t=gn(e);if(!ce(t))return ae(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=Vo(t);let a=(s?dt(n.width):n.width)/o,c=(s?dt(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const Fa=ae(0);function Ho(e){const t=q(e);return!vn()||!t.visualViewport?Fa:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $a(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==q(e)?!1:t}function Re(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=gn(e);let a=ae(1);t&&(o?te(o)&&(a=Le(o)):a=Le(e));const c=$a(s,n,o)?Ho(s):ae(0);let l=(r.left+c.x)/a.x,u=(r.top+c.y)/a.y,f=r.width/a.x,p=r.height/a.y;if(s){const y=q(s),h=o&&te(o)?q(o):o;let x=y,d=Xt(x);for(;d&&o&&h!==x;){const m=Le(d),w=d.getBoundingClientRect(),g=ne(d),C=w.left+(d.clientLeft+parseFloat(g.paddingLeft))*m.x,b=w.top+(d.clientTop+parseFloat(g.paddingTop))*m.y;l*=m.x,u*=m.y,f*=m.x,p*=m.y,l+=C,u+=b,x=q(d),d=Xt(x)}}return pt({width:f,height:p,x:l,y:u})}function Ct(e,t){const n=xt(e).scrollLeft;return t?t.left+n:Re(le(e)).left+n}function Uo(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Ct(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Wa(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",a=le(o),c=t?wt(t.floating):!1;if(o===a||c&&s)return n;let l={scrollLeft:0,scrollTop:0},u=ae(1);const f=ae(0),p=ce(o);if((p||!p&&!s)&&((Be(o)!=="body"||qe(a))&&(l=xt(o)),ce(o))){const h=Re(o);u=Le(o),f.x=h.x+o.clientLeft,f.y=h.y+o.clientTop}const y=a&&!p&&!s?Uo(a,l):ae(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+y.x,y:n.y*u.y-l.scrollTop*u.y+f.y+y.y}}function Ba(e){return Array.from(e.getClientRects())}function Va(e){const t=le(e),n=xt(e),o=e.ownerDocument.body,r=G(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=G(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+Ct(e);const c=-n.scrollTop;return ne(o).direction==="rtl"&&(a+=G(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:a,y:c}}const Xn=25;function Ha(e,t){const n=q(e),o=le(e),r=n.visualViewport;let s=o.clientWidth,a=o.clientHeight,c=0,l=0;if(r){s=r.width,a=r.height;const f=vn();(!f||f&&t==="fixed")&&(c=r.offsetLeft,l=r.offsetTop)}const u=Ct(o);if(u<=0){const f=o.ownerDocument,p=f.body,y=getComputedStyle(p),h=f.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,x=Math.abs(o.clientWidth-p.clientWidth-h);x<=Xn&&(s-=x)}else u<=Xn&&(s+=u);return{width:s,height:a,x:c,y:l}}const Ua=new Set(["absolute","fixed"]);function Ka(e,t){const n=Re(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=ce(e)?Le(e):ae(1),a=e.clientWidth*s.x,c=e.clientHeight*s.y,l=r*s.x,u=o*s.y;return{width:a,height:c,x:l,y:u}}function Gn(e,t,n){let o;if(t==="viewport")o=Ha(e,n);else if(t==="document")o=Va(le(e));else if(te(t))o=Ka(t,n);else{const r=Ho(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return pt(o)}function Ko(e,t){const n=ge(e);return n===t||!te(n)||je(n)?!1:ne(n).position==="fixed"||Ko(n,t)}function za(e,t){const n=t.get(e);if(n)return n;let o=Ke(e,[],!1).filter(c=>te(c)&&Be(c)!=="body"),r=null;const s=ne(e).position==="fixed";let a=s?ge(e):e;for(;te(a)&&!je(a);){const c=ne(a),l=hn(a);!l&&c.position==="fixed"&&(r=null),(s?!l&&!r:!l&&c.position==="static"&&!!r&&Ua.has(r.position)||qe(a)&&!l&&Ko(e,a))?o=o.filter(f=>f!==a):r=c,a=ge(a)}return t.set(e,o),o}function Ya(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a=[...n==="clippingAncestors"?wt(t)?[]:za(t,this._c):[].concat(n),o],c=a[0],l=a.reduce((u,f)=>{const p=Gn(t,f,r);return u.top=G(p.top,u.top),u.right=ve(p.right,u.right),u.bottom=ve(p.bottom,u.bottom),u.left=G(p.left,u.left),u},Gn(t,c,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Xa(e){const{width:t,height:n}=Vo(e);return{width:t,height:n}}function Ga(e,t,n){const o=ce(t),r=le(t),s=n==="fixed",a=Re(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const l=ae(0);function u(){l.x=Ct(r)}if(o||!o&&!s)if((Be(t)!=="body"||qe(r))&&(c=xt(t)),o){const h=Re(t,!0,s,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else r&&u();s&&!o&&r&&u();const f=r&&!o&&!s?Uo(r,c):ae(0),p=a.left+c.scrollLeft-l.x-f.x,y=a.top+c.scrollTop-l.y-f.y;return{x:p,y,width:a.width,height:a.height}}function Bt(e){return ne(e).position==="static"}function qn(e,t){if(!ce(e)||ne(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return le(e)===n&&(n=n.ownerDocument.body),n}function zo(e,t){const n=q(e);if(wt(e))return n;if(!ce(e)){let r=ge(e);for(;r&&!je(r);){if(te(r)&&!Bt(r))return r;r=ge(r)}return n}let o=qn(e,t);for(;o&&Na(o)&&Bt(o);)o=qn(o,t);return o&&je(o)&&Bt(o)&&!hn(o)?n:o||ka(e)||n}const qa=async function(e){const t=this.getOffsetParent||zo,n=this.getDimensions,o=await n(e.floating);return{reference:Ga(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Za(e){return ne(e).direction==="rtl"}const Qa={convertOffsetParentRelativeRectToViewportRelativeRect:Wa,getDocumentElement:le,getClippingRect:Ya,getOffsetParent:zo,getElementRects:qa,getClientRects:Ba,getDimensions:Xa,getScale:Le,isElement:te,isRTL:Za};function Yo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ja(e,t){let n=null,o;const r=le(e);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function a(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:f,top:p,width:y,height:h}=u;if(c||t(),!y||!h)return;const x=rt(p),d=rt(r.clientWidth-(f+y)),m=rt(r.clientHeight-(p+h)),w=rt(f),C={rootMargin:-x+"px "+-d+"px "+-m+"px "+-w+"px",threshold:G(0,ve(1,l))||1};let b=!0;function E(R){const S=R[0].intersectionRatio;if(S!==l){if(!b)return a();S?a(!1,S):o=setTimeout(()=>{a(!1,1e-7)},1e3)}S===1&&!Yo(u,e.getBoundingClientRect())&&a(),b=!1}try{n=new IntersectionObserver(E,{...C,root:r.ownerDocument})}catch{n=new IntersectionObserver(E,C)}n.observe(e)}return a(!0),s}function ec(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,u=gn(e),f=r||s?[...u?Ke(u):[],...Ke(t)]:[];f.forEach(w=>{r&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const p=u&&c?Ja(u,n):null;let y=-1,h=null;a&&(h=new ResizeObserver(w=>{let[g]=w;g&&g.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var C;(C=h)==null||C.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let x,d=l?Re(e):null;l&&m();function m(){const w=Re(e);d&&!Yo(d,w)&&n(),d=w,x=requestAnimationFrame(m)}return n(),()=>{var w;f.forEach(g=>{r&&g.removeEventListener("scroll",n),s&&g.removeEventListener("resize",n)}),p?.(),(w=h)==null||w.disconnect(),h=null,l&&cancelAnimationFrame(x)}}const tc=Ta,nc=Ra,oc=ba,rc=Aa,sc=Ea,Zn=Ca,ic=Pa,ac=(e,t,n)=>{const o=new Map,r={platform:Qa,...n},s={...r.platform,_c:o};return xa(e,t,{...r,platform:s})};var cc=typeof document<"u",lc=function(){},ct=cc?i.useLayoutEffect:lc;function mt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!mt(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!mt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Xo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Qn(e,t){const n=Xo(e);return Math.round(t*n)/n}function Vt(e){const t=i.useRef(e);return ct(()=>{t.current=e}),t}function uc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:a}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[f,p]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,h]=i.useState(o);mt(y,o)||h(o);const[x,d]=i.useState(null),[m,w]=i.useState(null),g=i.useCallback(P=>{P!==R.current&&(R.current=P,d(P))},[]),C=i.useCallback(P=>{P!==S.current&&(S.current=P,w(P))},[]),b=s||x,E=a||m,R=i.useRef(null),S=i.useRef(null),O=i.useRef(f),M=l!=null,L=Vt(l),k=Vt(r),$=Vt(u),F=i.useCallback(()=>{if(!R.current||!S.current)return;const P={placement:t,strategy:n,middleware:y};k.current&&(P.platform=k.current),ac(R.current,S.current,P).then(W=>{const Y={...W,isPositioned:$.current!==!1};T.current&&!mt(O.current,Y)&&(O.current=Y,Ye.flushSync(()=>{p(Y)}))})},[y,t,n,k,$]);ct(()=>{u===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,p(P=>({...P,isPositioned:!1})))},[u]);const T=i.useRef(!1);ct(()=>(T.current=!0,()=>{T.current=!1}),[]),ct(()=>{if(b&&(R.current=b),E&&(S.current=E),b&&E){if(L.current)return L.current(b,E,F);F()}},[b,E,F,L,M]);const j=i.useMemo(()=>({reference:R,floating:S,setReference:g,setFloating:C}),[g,C]),I=i.useMemo(()=>({reference:b,floating:E}),[b,E]),_=i.useMemo(()=>{const P={position:n,left:0,top:0};if(!I.floating)return P;const W=Qn(I.floating,f.x),Y=Qn(I.floating,f.y);return c?{...P,transform:"translate("+W+"px, "+Y+"px)",...Xo(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:Y}},[n,c,I.floating,f.x,f.y]);return i.useMemo(()=>({...f,update:F,refs:j,elements:I,floatingStyles:_}),[f,F,j,I,_])}const dc=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?Zn({element:o.current,padding:r}).fn(n):{}:o?Zn({element:o,padding:r}).fn(n):{}}}},fc=(e,t)=>({...tc(e),options:[e,t]}),pc=(e,t)=>({...nc(e),options:[e,t]}),mc=(e,t)=>({...ic(e),options:[e,t]}),hc=(e,t)=>({...oc(e),options:[e,t]}),vc=(e,t)=>({...rc(e),options:[e,t]}),gc=(e,t)=>({...sc(e),options:[e,t]}),yc=(e,t)=>({...dc(e),options:[e,t]});var wc="Arrow",Go=i.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...s}=e;return v.jsx(D.svg,{...s,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});Go.displayName=wc;var xc=Go,yn="Popper",[qo,bt]=Oe(yn),[Cc,Zo]=qo(yn),Qo=e=>{const{__scopePopper:t,children:n}=e,[o,r]=i.useState(null);return v.jsx(Cc,{scope:t,anchor:o,onAnchorChange:r,children:n})};Qo.displayName=yn;var Jo="PopperAnchor",er=i.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,s=Zo(Jo,n),a=i.useRef(null),c=B(t,a),l=i.useRef(null);return i.useEffect(()=>{const u=l.current;l.current=o?.current||a.current,u!==l.current&&s.onAnchorChange(l.current)}),o?null:v.jsx(D.div,{...r,ref:c})});er.displayName=Jo;var wn="PopperContent",[bc,Ec]=qo(wn),tr=i.forwardRef((e,t)=>{const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:y=!1,updatePositionStrategy:h="optimized",onPlaced:x,...d}=e,m=Zo(wn,n),[w,g]=i.useState(null),C=B(t,A=>g(A)),[b,E]=i.useState(null),R=so(b),S=R?.width??0,O=R?.height??0,M=o+(s!=="center"?"-"+s:""),L=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},k=Array.isArray(u)?u:[u],$=k.length>0,F={padding:L,boundary:k.filter(Tc),altBoundary:$},{refs:T,floatingStyles:j,placement:I,isPositioned:_,middlewareData:P}=uc({strategy:"fixed",placement:M,whileElementsMounted:(...A)=>ec(...A,{animationFrame:h==="always"}),elements:{reference:m.anchor},middleware:[fc({mainAxis:r+O,alignmentAxis:a}),l&&pc({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?mc():void 0,...F}),l&&hc({...F}),vc({...F,apply:({elements:A,rects:U,availableWidth:X,availableHeight:V})=>{const{width:H,height:K}=U.reference,Z=A.floating.style;Z.setProperty("--radix-popper-available-width",`${X}px`),Z.setProperty("--radix-popper-available-height",`${V}px`),Z.setProperty("--radix-popper-anchor-width",`${H}px`),Z.setProperty("--radix-popper-anchor-height",`${K}px`)}}),b&&yc({element:b,padding:c}),Rc({arrowWidth:S,arrowHeight:O}),y&&gc({strategy:"referenceHidden",...F})]}),[W,Y]=rr(I),ue=ee(x);z(()=>{_&&ue?.()},[_,ue]);const de=P.arrow?.x,re=P.arrow?.y,Q=P.arrow?.centerOffset!==0,[Ie,Ce]=i.useState();return z(()=>{w&&Ce(window.getComputedStyle(w).zIndex)},[w]),v.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...j,transform:_?j.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ie,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(" "),...P.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:v.jsx(bc,{scope:n,placedSide:W,onArrowChange:E,arrowX:de,arrowY:re,shouldHideArrow:Q,children:v.jsx(D.div,{"data-side":W,"data-align":Y,...d,ref:C,style:{...d.style,animation:_?void 0:"none"}})})})});tr.displayName=wn;var nr="PopperArrow",Sc={top:"bottom",right:"left",bottom:"top",left:"right"},or=i.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,s=Ec(nr,o),a=Sc[s.placedSide];return v.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:v.jsx(xc,{...r,ref:n,style:{...r.style,display:"block"}})})});or.displayName=nr;function Tc(e){return e!==null}var Rc=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,a=r.arrow?.centerOffset!==0,c=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[u,f]=rr(n),p={start:"0%",center:"50%",end:"100%"}[f],y=(r.arrow?.x??0)+c/2,h=(r.arrow?.y??0)+l/2;let x="",d="";return u==="bottom"?(x=a?p:`${y}px`,d=`${-l}px`):u==="top"?(x=a?p:`${y}px`,d=`${o.floating.height+l}px`):u==="right"?(x=`${-l}px`,d=a?p:`${h}px`):u==="left"&&(x=`${o.floating.width+l}px`,d=a?p:`${h}px`),{data:{x,y:d}}}});function rr(e){const[t,n="center"]=e.split("-");return[t,n]}var sr=Qo,ir=er,ar=tr,cr=or;function Pc(e){const t=Ac(e),n=i.forwardRef((o,r)=>{const{children:s,...a}=o,c=i.Children.toArray(s),l=c.find(Ic);if(l){const u=l.props.children,f=c.map(p=>p===l?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:p);return v.jsx(t,{...a,ref:r,children:i.isValidElement(u)?i.cloneElement(u,void 0,f):null})}return v.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function Ac(e){const t=i.forwardRef((n,o)=>{const{children:r,...s}=n;if(i.isValidElement(r)){const a=_c(r),c=Nc(s,r.props);return r.type!==i.Fragment&&(c.ref=o?$e(o,a):a),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Oc=Symbol("radix.slottable");function Ic(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Oc}function Nc(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function _c(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lr=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Dc="VisuallyHidden",Et=i.forwardRef((e,t)=>v.jsx(D.span,{...e,ref:t,style:{...lr,...e.style}}));Et.displayName=Dc;var Mc=Et,Lc=[" ","Enter","ArrowUp","ArrowDown"],kc=[" ","Enter"],Pe="Select",[St,Tt,jc]=eo(Pe),[Ve]=Oe(Pe,[jc,bt]),Rt=bt(),[Fc,we]=Ve(Pe),[$c,Wc]=Ve(Pe),ur=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:s,value:a,defaultValue:c,onValueChange:l,dir:u,name:f,autoComplete:p,disabled:y,required:h,form:x}=e,d=Rt(t),[m,w]=i.useState(null),[g,C]=i.useState(null),[b,E]=i.useState(!1),R=_s(u),[S,O]=ke({prop:o,defaultProp:r??!1,onChange:s,caller:Pe}),[M,L]=ke({prop:a,defaultProp:c,onChange:l,caller:Pe}),k=i.useRef(null),$=m?x||!!m.closest("form"):!0,[F,T]=i.useState(new Set),j=Array.from(F).map(I=>I.props.value).join(";");return v.jsx(sr,{...d,children:v.jsxs(Fc,{required:h,scope:t,trigger:m,onTriggerChange:w,valueNode:g,onValueNodeChange:C,valueNodeHasChildren:b,onValueNodeHasChildrenChange:E,contentId:Se(),value:M,onValueChange:L,open:S,onOpenChange:O,dir:R,triggerPointerDownPosRef:k,disabled:y,children:[v.jsx(St.Provider,{scope:t,children:v.jsx($c,{scope:e.__scopeSelect,onNativeOptionAdd:i.useCallback(I=>{T(_=>new Set(_).add(I))},[]),onNativeOptionRemove:i.useCallback(I=>{T(_=>{const P=new Set(_);return P.delete(I),P})},[]),children:n})}),$?v.jsxs(Mr,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:p,value:M,onChange:I=>L(I.target.value),disabled:y,form:x,children:[M===void 0?v.jsx("option",{value:""}):null,Array.from(F)]},j):null]})})};ur.displayName=Pe;var dr="SelectTrigger",fr=i.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,s=Rt(n),a=we(dr,n),c=a.disabled||o,l=B(t,a.onTriggerChange),u=Tt(n),f=i.useRef("touch"),[p,y,h]=kr(d=>{const m=u().filter(C=>!C.disabled),w=m.find(C=>C.value===a.value),g=jr(m,d,w);g!==void 0&&a.onValueChange(g.value)}),x=d=>{c||(a.onOpenChange(!0),h()),d&&(a.triggerPointerDownPosRef.current={x:Math.round(d.pageX),y:Math.round(d.pageY)})};return v.jsx(ir,{asChild:!0,...s,children:v.jsx(D.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Lr(a.value)?"":void 0,...r,ref:l,onClick:N(r.onClick,d=>{d.currentTarget.focus(),f.current!=="mouse"&&x(d)}),onPointerDown:N(r.onPointerDown,d=>{f.current=d.pointerType;const m=d.target;m.hasPointerCapture(d.pointerId)&&m.releasePointerCapture(d.pointerId),d.button===0&&d.ctrlKey===!1&&d.pointerType==="mouse"&&(x(d),d.preventDefault())}),onKeyDown:N(r.onKeyDown,d=>{const m=p.current!=="";!(d.ctrlKey||d.altKey||d.metaKey)&&d.key.length===1&&y(d.key),!(m&&d.key===" ")&&Lc.includes(d.key)&&(x(),d.preventDefault())})})})});fr.displayName=dr;var pr="SelectValue",mr=i.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:s,placeholder:a="",...c}=e,l=we(pr,n),{onValueNodeHasChildrenChange:u}=l,f=s!==void 0,p=B(t,l.onValueNodeChange);return z(()=>{u(f)},[u,f]),v.jsx(D.span,{...c,ref:p,style:{pointerEvents:"none"},children:Lr(l.value)?v.jsx(v.Fragment,{children:a}):s})});mr.displayName=pr;var Bc="SelectIcon",hr=i.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return v.jsx(D.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});hr.displayName=Bc;var Vc="SelectPortal",vr=e=>v.jsx(Ge,{asChild:!0,...e});vr.displayName=Vc;var Ae="SelectContent",gr=i.forwardRef((e,t)=>{const n=we(Ae,e.__scopeSelect),[o,r]=i.useState();if(z(()=>{r(new DocumentFragment)},[]),!n.open){const s=o;return s?Ye.createPortal(v.jsx(yr,{scope:e.__scopeSelect,children:v.jsx(St.Slot,{scope:e.__scopeSelect,children:v.jsx("div",{children:e.children})})}),s):null}return v.jsx(wr,{...e,ref:t})});gr.displayName=Ae;var J=10,[yr,xe]=Ve(Ae),Hc="SelectContentImpl",Uc=Pc("SelectContent.RemoveScroll"),wr=i.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:a,side:c,sideOffset:l,align:u,alignOffset:f,arrowPadding:p,collisionBoundary:y,collisionPadding:h,sticky:x,hideWhenDetached:d,avoidCollisions:m,...w}=e,g=we(Ae,n),[C,b]=i.useState(null),[E,R]=i.useState(null),S=B(t,A=>b(A)),[O,M]=i.useState(null),[L,k]=i.useState(null),$=Tt(n),[F,T]=i.useState(!1),j=i.useRef(!1);i.useEffect(()=>{if(C)return Co(C)},[C]),fo();const I=i.useCallback(A=>{const[U,...X]=$().map(K=>K.ref.current),[V]=X.slice(-1),H=document.activeElement;for(const K of A)if(K===H||(K?.scrollIntoView({block:"nearest"}),K===U&&E&&(E.scrollTop=0),K===V&&E&&(E.scrollTop=E.scrollHeight),K?.focus(),document.activeElement!==H))return},[$,E]),_=i.useCallback(()=>I([O,C]),[I,O,C]);i.useEffect(()=>{F&&_()},[F,_]);const{onOpenChange:P,triggerPointerDownPosRef:W}=g;i.useEffect(()=>{if(C){let A={x:0,y:0};const U=V=>{A={x:Math.abs(Math.round(V.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(V.pageY)-(W.current?.y??0))}},X=V=>{A.x<=10&&A.y<=10?V.preventDefault():C.contains(V.target)||P(!1),document.removeEventListener("pointermove",U),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",U),document.addEventListener("pointerup",X,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",X,{capture:!0})}}},[C,P,W]),i.useEffect(()=>{const A=()=>P(!1);return window.addEventListener("blur",A),window.addEventListener("resize",A),()=>{window.removeEventListener("blur",A),window.removeEventListener("resize",A)}},[P]);const[Y,ue]=kr(A=>{const U=$().filter(H=>!H.disabled),X=U.find(H=>H.ref.current===document.activeElement),V=jr(U,A,X);V&&setTimeout(()=>V.ref.current.focus())}),de=i.useCallback((A,U,X)=>{const V=!j.current&&!X;(g.value!==void 0&&g.value===U||V)&&(M(A),V&&(j.current=!0))},[g.value]),re=i.useCallback(()=>C?.focus(),[C]),Q=i.useCallback((A,U,X)=>{const V=!j.current&&!X;(g.value!==void 0&&g.value===U||V)&&k(A)},[g.value]),Ie=o==="popper"?Gt:xr,Ce=Ie===Gt?{side:c,sideOffset:l,align:u,alignOffset:f,arrowPadding:p,collisionBoundary:y,collisionPadding:h,sticky:x,hideWhenDetached:d,avoidCollisions:m}:{};return v.jsx(yr,{scope:n,content:C,viewport:E,onViewportChange:R,itemRefCallback:de,selectedItem:O,onItemLeave:re,itemTextRefCallback:Q,focusSelectedItem:_,selectedItemText:L,position:o,isPositioned:F,searchRef:Y,children:v.jsx(cn,{as:Uc,allowPinchZoom:!0,children:v.jsx(an,{asChild:!0,trapped:g.open,onMountAutoFocus:A=>{A.preventDefault()},onUnmountAutoFocus:N(r,A=>{g.trigger?.focus({preventScroll:!0}),A.preventDefault()}),children:v.jsx(Xe,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:A=>A.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:v.jsx(Ie,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:A=>A.preventDefault(),...w,...Ce,onPlaced:()=>T(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:N(w.onKeyDown,A=>{const U=A.ctrlKey||A.altKey||A.metaKey;if(A.key==="Tab"&&A.preventDefault(),!U&&A.key.length===1&&ue(A.key),["ArrowUp","ArrowDown","Home","End"].includes(A.key)){let V=$().filter(H=>!H.disabled).map(H=>H.ref.current);if(["ArrowUp","End"].includes(A.key)&&(V=V.slice().reverse()),["ArrowUp","ArrowDown"].includes(A.key)){const H=A.target,K=V.indexOf(H);V=V.slice(K+1)}setTimeout(()=>I(V)),A.preventDefault()}})})})})})})});wr.displayName=Hc;var Kc="SelectItemAlignedPosition",xr=i.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,s=we(Ae,n),a=xe(Ae,n),[c,l]=i.useState(null),[u,f]=i.useState(null),p=B(t,S=>f(S)),y=Tt(n),h=i.useRef(!1),x=i.useRef(!0),{viewport:d,selectedItem:m,selectedItemText:w,focusSelectedItem:g}=a,C=i.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&u&&d&&m&&w){const S=s.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),M=s.valueNode.getBoundingClientRect(),L=w.getBoundingClientRect();if(s.dir!=="rtl"){const H=L.left-O.left,K=M.left-H,Z=S.left-K,be=S.width+Z,Nt=Math.max(be,O.width),_t=window.innerWidth-J,Dt=On(K,[J,Math.max(J,_t-Nt)]);c.style.minWidth=be+"px",c.style.left=Dt+"px"}else{const H=O.right-L.right,K=window.innerWidth-M.right-H,Z=window.innerWidth-S.right-K,be=S.width+Z,Nt=Math.max(be,O.width),_t=window.innerWidth-J,Dt=On(K,[J,Math.max(J,_t-Nt)]);c.style.minWidth=be+"px",c.style.right=Dt+"px"}const k=y(),$=window.innerHeight-J*2,F=d.scrollHeight,T=window.getComputedStyle(u),j=parseInt(T.borderTopWidth,10),I=parseInt(T.paddingTop,10),_=parseInt(T.borderBottomWidth,10),P=parseInt(T.paddingBottom,10),W=j+I+F+P+_,Y=Math.min(m.offsetHeight*5,W),ue=window.getComputedStyle(d),de=parseInt(ue.paddingTop,10),re=parseInt(ue.paddingBottom,10),Q=S.top+S.height/2-J,Ie=$-Q,Ce=m.offsetHeight/2,A=m.offsetTop+Ce,U=j+I+A,X=W-U;if(U<=Q){const H=k.length>0&&m===k[k.length-1].ref.current;c.style.bottom="0px";const K=u.clientHeight-d.offsetTop-d.offsetHeight,Z=Math.max(Ie,Ce+(H?re:0)+K+_),be=U+Z;c.style.height=be+"px"}else{const H=k.length>0&&m===k[0].ref.current;c.style.top="0px";const Z=Math.max(Q,j+d.offsetTop+(H?de:0)+Ce)+X;c.style.height=Z+"px",d.scrollTop=U-Q+d.offsetTop}c.style.margin=`${J}px 0`,c.style.minHeight=Y+"px",c.style.maxHeight=$+"px",o?.(),requestAnimationFrame(()=>h.current=!0)}},[y,s.trigger,s.valueNode,c,u,d,m,w,s.dir,o]);z(()=>C(),[C]);const[b,E]=i.useState();z(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const R=i.useCallback(S=>{S&&x.current===!0&&(C(),g?.(),x.current=!1)},[C,g]);return v.jsx(Yc,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:R,children:v.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:v.jsx(D.div,{...r,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});xr.displayName=Kc;var zc="SelectPopperPosition",Gt=i.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=J,...s}=e,a=Rt(n);return v.jsx(ar,{...a,...s,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Gt.displayName=zc;var[Yc,xn]=Ve(Ae,{}),qt="SelectViewport",Cr=i.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,s=xe(qt,n),a=xn(qt,n),c=B(t,s.onViewportChange),l=i.useRef(0);return v.jsxs(v.Fragment,{children:[v.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),v.jsx(St.Slot,{scope:n,children:v.jsx(D.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:N(r.onScroll,u=>{const f=u.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:y}=a;if(y?.current&&p){const h=Math.abs(l.current-f.scrollTop);if(h>0){const x=window.innerHeight-J*2,d=parseFloat(p.style.minHeight),m=parseFloat(p.style.height),w=Math.max(d,m);if(w0?b:0,p.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});Cr.displayName=qt;var br="SelectGroup",[Xc,Gc]=Ve(br),qc=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Se();return v.jsx(Xc,{scope:n,id:r,children:v.jsx(D.div,{role:"group","aria-labelledby":r,...o,ref:t})})});qc.displayName=br;var Er="SelectLabel",Sr=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Gc(Er,n);return v.jsx(D.div,{id:r.id,...o,ref:t})});Sr.displayName=Er;var ht="SelectItem",[Zc,Tr]=Ve(ht),Rr=i.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:s,...a}=e,c=we(ht,n),l=xe(ht,n),u=c.value===o,[f,p]=i.useState(s??""),[y,h]=i.useState(!1),x=B(t,g=>l.itemRefCallback?.(g,o,r)),d=Se(),m=i.useRef("touch"),w=()=>{r||(c.onValueChange(o),c.onOpenChange(!1))};if(o==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return v.jsx(Zc,{scope:n,value:o,disabled:r,textId:d,isSelected:u,onItemTextChange:i.useCallback(g=>{p(C=>C||(g?.textContent??"").trim())},[]),children:v.jsx(St.ItemSlot,{scope:n,value:o,disabled:r,textValue:f,children:v.jsx(D.div,{role:"option","aria-labelledby":d,"data-highlighted":y?"":void 0,"aria-selected":u&&y,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...a,ref:x,onFocus:N(a.onFocus,()=>h(!0)),onBlur:N(a.onBlur,()=>h(!1)),onClick:N(a.onClick,()=>{m.current!=="mouse"&&w()}),onPointerUp:N(a.onPointerUp,()=>{m.current==="mouse"&&w()}),onPointerDown:N(a.onPointerDown,g=>{m.current=g.pointerType}),onPointerMove:N(a.onPointerMove,g=>{m.current=g.pointerType,r?l.onItemLeave?.():m.current==="mouse"&&g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(a.onPointerLeave,g=>{g.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:N(a.onKeyDown,g=>{l.searchRef?.current!==""&&g.key===" "||(kc.includes(g.key)&&w(),g.key===" "&&g.preventDefault())})})})})});Rr.displayName=ht;var He="SelectItemText",Pr=i.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...s}=e,a=we(He,n),c=xe(He,n),l=Tr(He,n),u=Wc(He,n),[f,p]=i.useState(null),y=B(t,w=>p(w),l.onItemTextChange,w=>c.itemTextRefCallback?.(w,l.value,l.disabled)),h=f?.textContent,x=i.useMemo(()=>v.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:d,onNativeOptionRemove:m}=u;return z(()=>(d(x),()=>m(x)),[d,m,x]),v.jsxs(v.Fragment,{children:[v.jsx(D.span,{id:l.textId,...s,ref:y}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Ye.createPortal(s.children,a.valueNode):null]})});Pr.displayName=He;var Ar="SelectItemIndicator",Or=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return Tr(Ar,n).isSelected?v.jsx(D.span,{"aria-hidden":!0,...o,ref:t}):null});Or.displayName=Ar;var Zt="SelectScrollUpButton",Ir=i.forwardRef((e,t)=>{const n=xe(Zt,e.__scopeSelect),o=xn(Zt,e.__scopeSelect),[r,s]=i.useState(!1),a=B(t,o.onScrollButtonChange);return z(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollTop>0;s(u)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?v.jsx(_r,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop-l.offsetHeight)}}):null});Ir.displayName=Zt;var Qt="SelectScrollDownButton",Nr=i.forwardRef((e,t)=>{const n=xe(Qt,e.__scopeSelect),o=xn(Qt,e.__scopeSelect),[r,s]=i.useState(!1),a=B(t,o.onScrollButtonChange);return z(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?v.jsx(_r,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop+l.offsetHeight)}}):null});Nr.displayName=Qt;var _r=i.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,s=xe("SelectScrollButton",n),a=i.useRef(null),c=Tt(n),l=i.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return i.useEffect(()=>()=>l(),[l]),z(()=>{c().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),v.jsx(D.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:N(r.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(o,50))}),onPointerMove:N(r.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(o,50))}),onPointerLeave:N(r.onPointerLeave,()=>{l()})})}),Qc="SelectSeparator",Dr=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return v.jsx(D.div,{"aria-hidden":!0,...o,ref:t})});Dr.displayName=Qc;var Jt="SelectArrow",Jc=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Rt(n),s=we(Jt,n),a=xe(Jt,n);return s.open&&a.position==="popper"?v.jsx(cr,{...r,...o,ref:t}):null});Jc.displayName=Jt;var el="SelectBubbleInput",Mr=i.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=i.useRef(null),s=B(o,r),a=ro(t);return i.useEffect(()=>{const c=r.current;if(!c)return;const l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&f){const p=new Event("change",{bubbles:!0});f.call(c,t),c.dispatchEvent(p)}},[a,t]),v.jsx(D.select,{...n,style:{...lr,...n.style},ref:s,defaultValue:t})});Mr.displayName=el;function Lr(e){return e===""||e===void 0}function kr(e){const t=ee(e),n=i.useRef(""),o=i.useRef(0),r=i.useCallback(a=>{const c=n.current+a;t(c),(function l(u){n.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>l(""),1e3))})(c)},[t]),s=i.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,s]}function jr(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=tl(e,Math.max(s,0));r.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function tl(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var nu=ur,ou=fr,ru=mr,su=hr,iu=vr,au=gr,cu=Cr,lu=Sr,uu=Rr,du=Pr,fu=Or,pu=Ir,mu=Nr,hu=Dr,Pt="Checkbox",[nl]=Oe(Pt),[ol,Cn]=nl(Pt);function rl(e){const{__scopeCheckbox:t,checked:n,children:o,defaultChecked:r,disabled:s,form:a,name:c,onCheckedChange:l,required:u,value:f="on",internal_do_not_use_render:p}=e,[y,h]=ke({prop:n,defaultProp:r??!1,onChange:l,caller:Pt}),[x,d]=i.useState(null),[m,w]=i.useState(null),g=i.useRef(!1),C=x?!!a||!!x.closest("form"):!0,b={checked:y,disabled:s,setChecked:h,control:x,setControl:d,name:c,form:a,value:f,hasConsumerStoppedPropagationRef:g,required:u,defaultChecked:he(r)?!1:r,isFormControl:C,bubbleInput:m,setBubbleInput:w};return v.jsx(ol,{scope:t,...b,children:al(p)?p(b):o})}var Fr="CheckboxTrigger",$r=i.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...o},r)=>{const{control:s,value:a,disabled:c,checked:l,required:u,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:y,isFormControl:h,bubbleInput:x}=Cn(Fr,e),d=B(r,f),m=i.useRef(l);return i.useEffect(()=>{const w=s?.form;if(w){const g=()=>p(m.current);return w.addEventListener("reset",g),()=>w.removeEventListener("reset",g)}},[s,p]),v.jsx(D.button,{type:"button",role:"checkbox","aria-checked":he(l)?"mixed":l,"aria-required":u,"data-state":Hr(l),"data-disabled":c?"":void 0,disabled:c,value:a,...o,ref:d,onKeyDown:N(t,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:N(n,w=>{p(g=>he(g)?!0:!g),x&&h&&(y.current=w.isPropagationStopped(),y.current||w.stopPropagation())})})});$r.displayName=Fr;var sl=i.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:o,checked:r,defaultChecked:s,required:a,disabled:c,value:l,onCheckedChange:u,form:f,...p}=e;return v.jsx(rl,{__scopeCheckbox:n,checked:r,defaultChecked:s,disabled:c,required:a,onCheckedChange:u,name:o,form:f,value:l,internal_do_not_use_render:({isFormControl:y})=>v.jsxs(v.Fragment,{children:[v.jsx($r,{...p,ref:t,__scopeCheckbox:n}),y&&v.jsx(Vr,{__scopeCheckbox:n})]})})});sl.displayName=Pt;var Wr="CheckboxIndicator",il=i.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:o,...r}=e,s=Cn(Wr,n);return v.jsx(ye,{present:o||he(s.checked)||s.checked===!0,children:v.jsx(D.span,{"data-state":Hr(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});il.displayName=Wr;var Br="CheckboxBubbleInput",Vr=i.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:o,hasConsumerStoppedPropagationRef:r,checked:s,defaultChecked:a,required:c,disabled:l,name:u,value:f,form:p,bubbleInput:y,setBubbleInput:h}=Cn(Br,e),x=B(n,h),d=ro(s),m=so(o);i.useEffect(()=>{const g=y;if(!g)return;const C=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(C,"checked").set,R=!r.current;if(d!==s&&E){const S=new Event("click",{bubbles:R});g.indeterminate=he(s),E.call(g,he(s)?!1:s),g.dispatchEvent(S)}},[y,d,s,r]);const w=i.useRef(he(s)?!1:s);return v.jsx(D.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??w.current,required:c,disabled:l,name:u,value:f,form:p,...t,tabIndex:-1,ref:x,style:{...t.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Vr.displayName=Br;function al(e){return typeof e=="function"}function he(e){return e==="indeterminate"}function Hr(e){return he(e)?"indeterminate":e?"checked":"unchecked"}var cl=Symbol("radix.slottable");function ll(e){const t=({children:n})=>v.jsx(v.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=cl,t}var[At]=Oe("Tooltip",[bt]),Ot=bt(),Ur="TooltipProvider",ul=700,en="tooltip.open",[dl,bn]=At(Ur),Kr=e=>{const{__scopeTooltip:t,delayDuration:n=ul,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:s}=e,a=i.useRef(!0),c=i.useRef(!1),l=i.useRef(0);return i.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),v.jsx(dl,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:i.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:i.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:i.useCallback(u=>{c.current=u},[]),disableHoverableContent:r,children:s})};Kr.displayName=Ur;var ze="Tooltip",[fl,Ze]=At(ze),zr=e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:r,onOpenChange:s,disableHoverableContent:a,delayDuration:c}=e,l=bn(ze,e.__scopeTooltip),u=Ot(t),[f,p]=i.useState(null),y=Se(),h=i.useRef(0),x=a??l.disableHoverableContent,d=c??l.delayDuration,m=i.useRef(!1),[w,g]=ke({prop:o,defaultProp:r??!1,onChange:S=>{S?(l.onOpen(),document.dispatchEvent(new CustomEvent(en))):l.onClose(),s?.(S)},caller:ze}),C=i.useMemo(()=>w?m.current?"delayed-open":"instant-open":"closed",[w]),b=i.useCallback(()=>{window.clearTimeout(h.current),h.current=0,m.current=!1,g(!0)},[g]),E=i.useCallback(()=>{window.clearTimeout(h.current),h.current=0,g(!1)},[g]),R=i.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{m.current=!0,g(!0),h.current=0},d)},[d,g]);return i.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),v.jsx(sr,{...u,children:v.jsx(fl,{scope:t,contentId:y,open:w,stateAttribute:C,trigger:f,onTriggerChange:p,onTriggerEnter:i.useCallback(()=>{l.isOpenDelayedRef.current?R():b()},[l.isOpenDelayedRef,R,b]),onTriggerLeave:i.useCallback(()=>{x?E():(window.clearTimeout(h.current),h.current=0)},[E,x]),onOpen:b,onClose:E,disableHoverableContent:x,children:n})})};zr.displayName=ze;var tn="TooltipTrigger",Yr=i.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Ze(tn,n),s=bn(tn,n),a=Ot(n),c=i.useRef(null),l=B(t,c,r.onTriggerChange),u=i.useRef(!1),f=i.useRef(!1),p=i.useCallback(()=>u.current=!1,[]);return i.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),v.jsx(ir,{asChild:!0,...a,children:v.jsx(D.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:l,onPointerMove:N(e.onPointerMove,y=>{y.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(r.onTriggerEnter(),f.current=!0)}),onPointerLeave:N(e.onPointerLeave,()=>{r.onTriggerLeave(),f.current=!1}),onPointerDown:N(e.onPointerDown,()=>{r.open&&r.onClose(),u.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:N(e.onFocus,()=>{u.current||r.onOpen()}),onBlur:N(e.onBlur,r.onClose),onClick:N(e.onClick,r.onClose)})})});Yr.displayName=tn;var En="TooltipPortal",[pl,ml]=At(En,{forceMount:void 0}),Xr=e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,s=Ze(En,t);return v.jsx(pl,{scope:t,forceMount:n,children:v.jsx(ye,{present:n||s.open,children:v.jsx(Ge,{asChild:!0,container:r,children:o})})})};Xr.displayName=En;var Fe="TooltipContent",Gr=i.forwardRef((e,t)=>{const n=ml(Fe,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...s}=e,a=Ze(Fe,e.__scopeTooltip);return v.jsx(ye,{present:o||a.open,children:a.disableHoverableContent?v.jsx(qr,{side:r,...s,ref:t}):v.jsx(hl,{side:r,...s,ref:t})})}),hl=i.forwardRef((e,t)=>{const n=Ze(Fe,e.__scopeTooltip),o=bn(Fe,e.__scopeTooltip),r=i.useRef(null),s=B(t,r),[a,c]=i.useState(null),{trigger:l,onClose:u}=n,f=r.current,{onPointerInTransitChange:p}=o,y=i.useCallback(()=>{c(null),p(!1)},[p]),h=i.useCallback((x,d)=>{const m=x.currentTarget,w={x:x.clientX,y:x.clientY},g=xl(w,m.getBoundingClientRect()),C=Cl(w,g),b=bl(d.getBoundingClientRect()),E=Sl([...C,...b]);c(E),p(!0)},[p]);return i.useEffect(()=>()=>y(),[y]),i.useEffect(()=>{if(l&&f){const x=m=>h(m,f),d=m=>h(m,l);return l.addEventListener("pointerleave",x),f.addEventListener("pointerleave",d),()=>{l.removeEventListener("pointerleave",x),f.removeEventListener("pointerleave",d)}}},[l,f,h,y]),i.useEffect(()=>{if(a){const x=d=>{const m=d.target,w={x:d.clientX,y:d.clientY},g=l?.contains(m)||f?.contains(m),C=!El(w,a);g?y():C&&(y(),u())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,f,a,u,y]),v.jsx(qr,{...e,ref:s})}),[vl,gl]=At(ze,{isInside:!1}),yl=ll("TooltipContent"),qr=i.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:s,onPointerDownOutside:a,...c}=e,l=Ze(Fe,n),u=Ot(n),{onClose:f}=l;return i.useEffect(()=>(document.addEventListener(en,f),()=>document.removeEventListener(en,f)),[f]),i.useEffect(()=>{if(l.trigger){const p=y=>{y.target?.contains(l.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[l.trigger,f]),v.jsx(Xe,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:v.jsxs(ar,{"data-state":l.stateAttribute,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v.jsx(yl,{children:o}),v.jsx(vl,{scope:n,isInside:!0,children:v.jsx(Mc,{id:l.contentId,role:"tooltip",children:r||o})})]})})});Gr.displayName=Fe;var Zr="TooltipArrow",wl=i.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Ot(n);return gl(Zr,n).isInside?null:v.jsx(cr,{...r,...o,ref:t})});wl.displayName=Zr;function xl(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,o,r,s)){case s:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Cl(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function bl(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function El(e,t){const{x:n,y:o}=e;let r=!1;for(let s=0,a=t.length-1;so!=y>o&&n<(p-u)*(o-f)/(y-f)+u&&(r=!r)}return r}function Sl(e){const t=e.slice();return t.sort((n,o)=>n.xo.x?1:n.yo.y?1:0),Tl(t)}function Tl(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var vu=Kr,gu=zr,yu=Yr,wu=Xr,xu=Gr,Sn="ToastProvider",[Tn,Rl,Pl]=eo("Toast"),[Qr]=Oe("Toast",[Pl]),[Al,It]=Qr(Sn),Jr=e=>{const{__scopeToast:t,label:n="Notification",duration:o=5e3,swipeDirection:r="right",swipeThreshold:s=50,children:a}=e,[c,l]=i.useState(null),[u,f]=i.useState(0),p=i.useRef(!1),y=i.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Sn}\`. Expected non-empty \`string\`.`),v.jsx(Tn.Provider,{scope:t,children:v.jsx(Al,{scope:t,label:n,duration:o,swipeDirection:r,swipeThreshold:s,toastCount:u,viewport:c,onViewportChange:l,onToastAdd:i.useCallback(()=>f(h=>h+1),[]),onToastRemove:i.useCallback(()=>f(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:y,children:a})})};Jr.displayName=Sn;var es="ToastViewport",Ol=["F8"],nn="toast.viewportPause",on="toast.viewportResume",ts=i.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:o=Ol,label:r="Notifications ({hotkey})",...s}=e,a=It(es,n),c=Rl(n),l=i.useRef(null),u=i.useRef(null),f=i.useRef(null),p=i.useRef(null),y=B(t,p,a.onViewportChange),h=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=a.toastCount>0;i.useEffect(()=>{const m=w=>{o.length!==0&&o.every(C=>w[C]||w.code===C)&&p.current?.focus()};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[o]),i.useEffect(()=>{const m=l.current,w=p.current;if(x&&m&&w){const g=()=>{if(!a.isClosePausedRef.current){const R=new CustomEvent(nn);w.dispatchEvent(R),a.isClosePausedRef.current=!0}},C=()=>{if(a.isClosePausedRef.current){const R=new CustomEvent(on);w.dispatchEvent(R),a.isClosePausedRef.current=!1}},b=R=>{!m.contains(R.relatedTarget)&&C()},E=()=>{m.contains(document.activeElement)||C()};return m.addEventListener("focusin",g),m.addEventListener("focusout",b),m.addEventListener("pointermove",g),m.addEventListener("pointerleave",E),window.addEventListener("blur",g),window.addEventListener("focus",C),()=>{m.removeEventListener("focusin",g),m.removeEventListener("focusout",b),m.removeEventListener("pointermove",g),m.removeEventListener("pointerleave",E),window.removeEventListener("blur",g),window.removeEventListener("focus",C)}}},[x,a.isClosePausedRef]);const d=i.useCallback(({tabbingDirection:m})=>{const g=c().map(C=>{const b=C.ref.current,E=[b,...Vl(b)];return m==="forwards"?E:E.reverse()});return(m==="forwards"?g.reverse():g).flat()},[c]);return i.useEffect(()=>{const m=p.current;if(m){const w=g=>{const C=g.altKey||g.ctrlKey||g.metaKey;if(g.key==="Tab"&&!C){const E=document.activeElement,R=g.shiftKey;if(g.target===m&&R){u.current?.focus();return}const M=d({tabbingDirection:R?"backwards":"forwards"}),L=M.findIndex(k=>k===E);Ht(M.slice(L+1))?g.preventDefault():R?u.current?.focus():f.current?.focus()}};return m.addEventListener("keydown",w),()=>m.removeEventListener("keydown",w)}},[c,d]),v.jsxs(ei,{ref:l,role:"region","aria-label":r.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:x?void 0:"none"},children:[x&&v.jsx(rn,{ref:u,onFocusFromOutsideViewport:()=>{const m=d({tabbingDirection:"forwards"});Ht(m)}}),v.jsx(Tn.Slot,{scope:n,children:v.jsx(D.ol,{tabIndex:-1,...s,ref:y})}),x&&v.jsx(rn,{ref:f,onFocusFromOutsideViewport:()=>{const m=d({tabbingDirection:"backwards"});Ht(m)}})]})});ts.displayName=es;var ns="ToastFocusProxy",rn=i.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:o,...r}=e,s=It(ns,n);return v.jsx(Et,{tabIndex:0,...r,ref:t,style:{position:"fixed"},onFocus:a=>{const c=a.relatedTarget;!s.viewport?.contains(c)&&o()}})});rn.displayName=ns;var Qe="Toast",Il="toast.swipeStart",Nl="toast.swipeMove",_l="toast.swipeCancel",Dl="toast.swipeEnd",os=i.forwardRef((e,t)=>{const{forceMount:n,open:o,defaultOpen:r,onOpenChange:s,...a}=e,[c,l]=ke({prop:o,defaultProp:r??!0,onChange:s,caller:Qe});return v.jsx(ye,{present:n||c,children:v.jsx(kl,{open:c,...a,ref:t,onClose:()=>l(!1),onPause:ee(e.onPause),onResume:ee(e.onResume),onSwipeStart:N(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:N(e.onSwipeMove,u=>{const{x:f,y:p}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:N(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:N(e.onSwipeEnd,u=>{const{x:f,y:p}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),l(!1)})})})});os.displayName=Qe;var[Ml,Ll]=Qr(Qe,{onClose(){}}),kl=i.forwardRef((e,t)=>{const{__scopeToast:n,type:o="foreground",duration:r,open:s,onClose:a,onEscapeKeyDown:c,onPause:l,onResume:u,onSwipeStart:f,onSwipeMove:p,onSwipeCancel:y,onSwipeEnd:h,...x}=e,d=It(Qe,n),[m,w]=i.useState(null),g=B(t,T=>w(T)),C=i.useRef(null),b=i.useRef(null),E=r||d.duration,R=i.useRef(0),S=i.useRef(E),O=i.useRef(0),{onToastAdd:M,onToastRemove:L}=d,k=ee(()=>{m?.contains(document.activeElement)&&d.viewport?.focus(),a()}),$=i.useCallback(T=>{!T||T===1/0||(window.clearTimeout(O.current),R.current=new Date().getTime(),O.current=window.setTimeout(k,T))},[k]);i.useEffect(()=>{const T=d.viewport;if(T){const j=()=>{$(S.current),u?.()},I=()=>{const _=new Date().getTime()-R.current;S.current=S.current-_,window.clearTimeout(O.current),l?.()};return T.addEventListener(nn,I),T.addEventListener(on,j),()=>{T.removeEventListener(nn,I),T.removeEventListener(on,j)}}},[d.viewport,E,l,u,$]),i.useEffect(()=>{s&&!d.isClosePausedRef.current&&$(E)},[s,E,d.isClosePausedRef,$]),i.useEffect(()=>(M(),()=>L()),[M,L]);const F=i.useMemo(()=>m?us(m):null,[m]);return d.viewport?v.jsxs(v.Fragment,{children:[F&&v.jsx(jl,{__scopeToast:n,role:"status","aria-live":o==="foreground"?"assertive":"polite",children:F}),v.jsx(Ml,{scope:n,onClose:k,children:Ye.createPortal(v.jsx(Tn.ItemSlot,{scope:n,children:v.jsx(Js,{asChild:!0,onEscapeKeyDown:N(c,()=>{d.isFocusedToastEscapeKeyDownRef.current||k(),d.isFocusedToastEscapeKeyDownRef.current=!1}),children:v.jsx(D.li,{tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":d.swipeDirection,...x,ref:g,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:N(e.onKeyDown,T=>{T.key==="Escape"&&(c?.(T.nativeEvent),T.nativeEvent.defaultPrevented||(d.isFocusedToastEscapeKeyDownRef.current=!0,k()))}),onPointerDown:N(e.onPointerDown,T=>{T.button===0&&(C.current={x:T.clientX,y:T.clientY})}),onPointerMove:N(e.onPointerMove,T=>{if(!C.current)return;const j=T.clientX-C.current.x,I=T.clientY-C.current.y,_=!!b.current,P=["left","right"].includes(d.swipeDirection),W=["left","up"].includes(d.swipeDirection)?Math.min:Math.max,Y=P?W(0,j):0,ue=P?0:W(0,I),de=T.pointerType==="touch"?10:2,re={x:Y,y:ue},Q={originalEvent:T,delta:re};_?(b.current=re,st(Nl,p,Q,{discrete:!1})):Jn(re,d.swipeDirection,de)?(b.current=re,st(Il,f,Q,{discrete:!1}),T.target.setPointerCapture(T.pointerId)):(Math.abs(j)>de||Math.abs(I)>de)&&(C.current=null)}),onPointerUp:N(e.onPointerUp,T=>{const j=b.current,I=T.target;if(I.hasPointerCapture(T.pointerId)&&I.releasePointerCapture(T.pointerId),b.current=null,C.current=null,j){const _=T.currentTarget,P={originalEvent:T,delta:j};Jn(j,d.swipeDirection,d.swipeThreshold)?st(Dl,h,P,{discrete:!0}):st(_l,y,P,{discrete:!0}),_.addEventListener("click",W=>W.preventDefault(),{once:!0})}})})})}),d.viewport)})]}):null}),jl=e=>{const{__scopeToast:t,children:n,...o}=e,r=It(Qe,t),[s,a]=i.useState(!1),[c,l]=i.useState(!1);return Wl(()=>a(!0)),i.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),c?null:v.jsx(Ge,{asChild:!0,children:v.jsx(Et,{...o,children:s&&v.jsxs(v.Fragment,{children:[r.label," ",n]})})})},Fl="ToastTitle",rs=i.forwardRef((e,t)=>{const{__scopeToast:n,...o}=e;return v.jsx(D.div,{...o,ref:t})});rs.displayName=Fl;var $l="ToastDescription",ss=i.forwardRef((e,t)=>{const{__scopeToast:n,...o}=e;return v.jsx(D.div,{...o,ref:t})});ss.displayName=$l;var is="ToastAction",as=i.forwardRef((e,t)=>{const{altText:n,...o}=e;return n.trim()?v.jsx(ls,{altText:n,asChild:!0,children:v.jsx(Rn,{...o,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${is}\`. Expected non-empty \`string\`.`),null)});as.displayName=is;var cs="ToastClose",Rn=i.forwardRef((e,t)=>{const{__scopeToast:n,...o}=e,r=Ll(cs,n);return v.jsx(ls,{asChild:!0,children:v.jsx(D.button,{type:"button",...o,ref:t,onClick:N(e.onClick,r.onClose)})})});Rn.displayName=cs;var ls=i.forwardRef((e,t)=>{const{__scopeToast:n,altText:o,...r}=e;return v.jsx(D.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...r,ref:t})});function us(e){const t=[];return Array.from(e.childNodes).forEach(o=>{if(o.nodeType===o.TEXT_NODE&&o.textContent&&t.push(o.textContent),Bl(o)){const r=o.ariaHidden||o.hidden||o.style.display==="none",s=o.dataset.radixToastAnnounceExclude==="";if(!r)if(s){const a=o.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...us(o))}}),t}function st(e,t,n,{discrete:o}){const r=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?to(r,s):r.dispatchEvent(s)}var Jn=(e,t,n=0)=>{const o=Math.abs(e.x),r=Math.abs(e.y),s=o>r;return t==="left"||t==="right"?s&&o>n:!s&&r>n};function Wl(e=()=>{}){const t=ee(e);z(()=>{let n=0,o=0;return n=window.requestAnimationFrame(()=>o=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(o)}},[t])}function Bl(e){return e.nodeType===e.ELEMENT_NODE}function Vl(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ht(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var Cu=Jr,bu=ts,Eu=os,Su=rs,Tu=ss,Ru=as,Pu=Rn;export{ru as $,sr as A,ir as B,Ql as C,eu as D,cr as E,an as F,to as G,Kl as H,ou as I,su as J,pu as K,mu as L,iu as M,au as N,Zl as O,D as P,lu as Q,Xl as R,Ul as S,Jl as T,uu as U,cu as V,Yl as W,fu as X,du as Y,hu as Z,nu as _,eo as a,sl as a0,il as a1,wu as a2,xu as a3,vu as a4,gu as a5,yu as a6,bu as a7,Eu as a8,Ru as a9,Pu as aa,Su as ab,Tu as ac,Cu as ad,N as b,Oe as c,B as d,_s as e,ke as f,ee as g,ye as h,z as i,On as j,oo as k,ro as l,so as m,zl as n,ql as o,tu as p,Gl as q,$e as r,Ge as s,bt as t,Se as u,Co as v,cn as w,fo as x,Xe as y,ar as z}; diff --git a/webui/dist/assets/radix-extra-Cw1azsjZ.js b/webui/dist/assets/radix-extra-Cw1azsjZ.js new file mode 100644 index 00000000..d86d108d --- /dev/null +++ b/webui/dist/assets/radix-extra-Cw1azsjZ.js @@ -0,0 +1,12 @@ +import{r as a,j as l,d as nr}from"./router-CWhjJi2n.js";import{c as G,a as Ge,u as ne,P as _,b as g,d as A,e as pe,f as Q,g as k,h as B,i as ue,j as Ue,k as He,l as _t,m as Et,n as yt,O as rr,o as ar,W as sr,C as ir,T as cr,D as lr,p as Mt,R as ur,q as dr,r as We,s as At,t as _e,v as Tt,w as It,x as Nt,F as Dt,y as Ot,z as jt,A as ze,B as Ye,E as Lt,G as fr}from"./radix-core-BlBHu_Lw.js";var Fe="rovingFocusGroup.onEntryFocus",pr={bubbles:!1,cancelable:!0},ve="RovingFocusGroup",[$e,Ft,vr]=Ge(ve),[mr,Ee]=G(ve,[vr]),[hr,gr]=mr(ve),$t=a.forwardRef((e,t)=>l.jsx($e.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx($e.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(xr,{...e,ref:t})})}));$t.displayName=ve;var xr=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:o,orientation:n,loop:r=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:p,preventScrollOnEntryFocus:f=!1,...d}=e,v=a.useRef(null),m=A(t,v),h=pe(s),[C,x]=Q({prop:i,defaultProp:c??null,onChange:u,caller:ve}),[S,R]=a.useState(!1),w=k(p),P=Ft(o),I=a.useRef(!1),[j,N]=a.useState(0);return a.useEffect(()=>{const T=v.current;if(T)return T.addEventListener(Fe,w),()=>T.removeEventListener(Fe,w)},[w]),l.jsx(hr,{scope:o,orientation:n,dir:h,loop:r,currentTabStopId:C,onItemFocus:a.useCallback(T=>x(T),[x]),onItemShiftTab:a.useCallback(()=>R(!0),[]),onFocusableItemAdd:a.useCallback(()=>N(T=>T+1),[]),onFocusableItemRemove:a.useCallback(()=>N(T=>T-1),[]),children:l.jsx(_.div,{tabIndex:S||j===0?-1:0,"data-orientation":n,...d,ref:m,style:{outline:"none",...e.style},onMouseDown:g(e.onMouseDown,()=>{I.current=!0}),onFocus:g(e.onFocus,T=>{const E=!I.current;if(T.target===T.currentTarget&&E&&!S){const M=new CustomEvent(Fe,pr);if(T.currentTarget.dispatchEvent(M),!M.defaultPrevented){const y=P().filter(O=>O.focusable),L=y.find(O=>O.active),W=y.find(O=>O.id===C),Z=[L,W,...y].filter(Boolean).map(O=>O.ref.current);Bt(Z,f)}}I.current=!1}),onBlur:g(e.onBlur,()=>R(!1))})})}),kt="RovingFocusGroupItem",Vt=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:o,focusable:n=!0,active:r=!1,tabStopId:s,children:i,...c}=e,u=ne(),p=s||u,f=gr(kt,o),d=f.currentTabStopId===p,v=Ft(o),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:C}=f;return a.useEffect(()=>{if(n)return m(),()=>h()},[n,m,h]),l.jsx($e.ItemSlot,{scope:o,id:p,focusable:n,active:r,children:l.jsx(_.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...c,ref:t,onMouseDown:g(e.onMouseDown,x=>{n?f.onItemFocus(p):x.preventDefault()}),onFocus:g(e.onFocus,()=>f.onItemFocus(p)),onKeyDown:g(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){f.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const S=br(x,f.orientation,f.dir);if(S!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let w=v().filter(P=>P.focusable).map(P=>P.ref.current);if(S==="last")w.reverse();else if(S==="prev"||S==="next"){S==="prev"&&w.reverse();const P=w.indexOf(x.currentTarget);w=f.loop?wr(w,P+1):w.slice(P+1)}setTimeout(()=>Bt(w))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:C!=null}):i})})});Vt.displayName=kt;var Sr={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Cr(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function br(e,t,o){const n=Cr(e.key,o);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Sr[n]}function Bt(e,t=!1){const o=document.activeElement;for(const n of e)if(n===o||(n.focus({preventScroll:t}),document.activeElement!==o))return}function wr(e,t){return e.map((o,n)=>e[(t+n)%e.length])}var Kt=$t,Gt=Vt,ye="Tabs",[Pr]=G(ye,[Ee]),Ut=Ee(),[Rr,Xe]=Pr(ye),Ht=a.forwardRef((e,t)=>{const{__scopeTabs:o,value:n,onValueChange:r,defaultValue:s,orientation:i="horizontal",dir:c,activationMode:u="automatic",...p}=e,f=pe(c),[d,v]=Q({prop:n,onChange:r,defaultProp:s??"",caller:ye});return l.jsx(Rr,{scope:o,baseId:ne(),value:d,onValueChange:v,orientation:i,dir:f,activationMode:u,children:l.jsx(_.div,{dir:f,"data-orientation":i,...p,ref:t})})});Ht.displayName=ye;var Wt="TabsList",zt=a.forwardRef((e,t)=>{const{__scopeTabs:o,loop:n=!0,...r}=e,s=Xe(Wt,o),i=Ut(o);return l.jsx(Kt,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:n,children:l.jsx(_.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:t})})});zt.displayName=Wt;var Yt="TabsTrigger",Xt=a.forwardRef((e,t)=>{const{__scopeTabs:o,value:n,disabled:r=!1,...s}=e,i=Xe(Yt,o),c=Ut(o),u=Jt(i.baseId,n),p=Qt(i.baseId,n),f=n===i.value;return l.jsx(Gt,{asChild:!0,...c,focusable:!r,active:f,children:l.jsx(_.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":p,"data-state":f?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:u,...s,ref:t,onMouseDown:g(e.onMouseDown,d=>{!r&&d.button===0&&d.ctrlKey===!1?i.onValueChange(n):d.preventDefault()}),onKeyDown:g(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&i.onValueChange(n)}),onFocus:g(e.onFocus,()=>{const d=i.activationMode!=="manual";!f&&!r&&d&&i.onValueChange(n)})})})});Xt.displayName=Yt;var qt="TabsContent",Zt=a.forwardRef((e,t)=>{const{__scopeTabs:o,value:n,forceMount:r,children:s,...i}=e,c=Xe(qt,o),u=Jt(c.baseId,n),p=Qt(c.baseId,n),f=n===c.value,d=a.useRef(f);return a.useEffect(()=>{const v=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(v)},[]),l.jsx(B,{present:r||f,children:({present:v})=>l.jsx(_.div,{"data-state":f?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!v,id:p,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:v&&s})})});Zt.displayName=qt;function Jt(e,t){return`${e}-trigger-${t}`}function Qt(e,t){return`${e}-content-${t}`}var xi=Ht,Si=zt,Ci=Xt,bi=Zt;function _r(e,t){return a.useReducer((o,n)=>t[o][n]??o,e)}var qe="ScrollArea",[eo]=G(qe),[Er,K]=eo(qe),to=a.forwardRef((e,t)=>{const{__scopeScrollArea:o,type:n="hover",dir:r,scrollHideDelay:s=600,...i}=e,[c,u]=a.useState(null),[p,f]=a.useState(null),[d,v]=a.useState(null),[m,h]=a.useState(null),[C,x]=a.useState(null),[S,R]=a.useState(0),[w,P]=a.useState(0),[I,j]=a.useState(!1),[N,T]=a.useState(!1),E=A(t,y=>u(y)),M=pe(r);return l.jsx(Er,{scope:o,type:n,dir:M,scrollHideDelay:s,scrollArea:c,viewport:p,onViewportChange:f,content:d,onContentChange:v,scrollbarX:m,onScrollbarXChange:h,scrollbarXEnabled:I,onScrollbarXEnabledChange:j,scrollbarY:C,onScrollbarYChange:x,scrollbarYEnabled:N,onScrollbarYEnabledChange:T,onCornerWidthChange:R,onCornerHeightChange:P,children:l.jsx(_.div,{dir:M,...i,ref:E,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});to.displayName=qe;var oo="ScrollAreaViewport",no=a.forwardRef((e,t)=>{const{__scopeScrollArea:o,children:n,nonce:r,...s}=e,i=K(oo,o),c=a.useRef(null),u=A(t,c,i.onViewportChange);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),l.jsx(_.div,{"data-radix-scroll-area-viewport":"",...s,ref:u,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:l.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});no.displayName=oo;var U="ScrollAreaScrollbar",yr=a.forwardRef((e,t)=>{const{forceMount:o,...n}=e,r=K(U,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=r,c=e.orientation==="horizontal";return a.useEffect(()=>(c?s(!0):i(!0),()=>{c?s(!1):i(!1)}),[c,s,i]),r.type==="hover"?l.jsx(Mr,{...n,ref:t,forceMount:o}):r.type==="scroll"?l.jsx(Ar,{...n,ref:t,forceMount:o}):r.type==="auto"?l.jsx(ro,{...n,ref:t,forceMount:o}):r.type==="always"?l.jsx(Ze,{...n,ref:t}):null});yr.displayName=U;var Mr=a.forwardRef((e,t)=>{const{forceMount:o,...n}=e,r=K(U,e.__scopeScrollArea),[s,i]=a.useState(!1);return a.useEffect(()=>{const c=r.scrollArea;let u=0;if(c){const p=()=>{window.clearTimeout(u),i(!0)},f=()=>{u=window.setTimeout(()=>i(!1),r.scrollHideDelay)};return c.addEventListener("pointerenter",p),c.addEventListener("pointerleave",f),()=>{window.clearTimeout(u),c.removeEventListener("pointerenter",p),c.removeEventListener("pointerleave",f)}}},[r.scrollArea,r.scrollHideDelay]),l.jsx(B,{present:o||s,children:l.jsx(ro,{"data-state":s?"visible":"hidden",...n,ref:t})})}),Ar=a.forwardRef((e,t)=>{const{forceMount:o,...n}=e,r=K(U,e.__scopeScrollArea),s=e.orientation==="horizontal",i=Ae(()=>u("SCROLL_END"),100),[c,u]=_r("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return a.useEffect(()=>{if(c==="idle"){const p=window.setTimeout(()=>u("HIDE"),r.scrollHideDelay);return()=>window.clearTimeout(p)}},[c,r.scrollHideDelay,u]),a.useEffect(()=>{const p=r.viewport,f=s?"scrollLeft":"scrollTop";if(p){let d=p[f];const v=()=>{const m=p[f];d!==m&&(u("SCROLL"),i()),d=m};return p.addEventListener("scroll",v),()=>p.removeEventListener("scroll",v)}},[r.viewport,s,u,i]),l.jsx(B,{present:o||c!=="hidden",children:l.jsx(Ze,{"data-state":c==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:g(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:g(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),ro=a.forwardRef((e,t)=>{const o=K(U,e.__scopeScrollArea),{forceMount:n,...r}=e,[s,i]=a.useState(!1),c=e.orientation==="horizontal",u=Ae(()=>{if(o.viewport){const p=o.viewport.offsetWidth{const{orientation:o="vertical",...n}=e,r=K(U,e.__scopeScrollArea),s=a.useRef(null),i=a.useRef(0),[c,u]=a.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=co(c.viewport,c.content),f={...n,sizes:c,onSizesChange:u,hasThumb:p>0&&p<1,onThumbChange:v=>s.current=v,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:v=>i.current=v};function d(v,m){return Lr(v,i.current,c,m)}return o==="horizontal"?l.jsx(Tr,{...f,ref:t,onThumbPositionChange:()=>{if(r.viewport&&s.current){const v=r.viewport.scrollLeft,m=St(v,c,r.dir);s.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:v=>{r.viewport&&(r.viewport.scrollLeft=v)},onDragScroll:v=>{r.viewport&&(r.viewport.scrollLeft=d(v,r.dir))}}):o==="vertical"?l.jsx(Ir,{...f,ref:t,onThumbPositionChange:()=>{if(r.viewport&&s.current){const v=r.viewport.scrollTop,m=St(v,c);s.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:v=>{r.viewport&&(r.viewport.scrollTop=v)},onDragScroll:v=>{r.viewport&&(r.viewport.scrollTop=d(v))}}):null}),Tr=a.forwardRef((e,t)=>{const{sizes:o,onSizesChange:n,...r}=e,s=K(U,e.__scopeScrollArea),[i,c]=a.useState(),u=a.useRef(null),p=A(t,u,s.onScrollbarXChange);return a.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),l.jsx(so,{"data-orientation":"horizontal",...r,ref:p,sizes:o,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Me(o)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,d)=>{if(s.viewport){const v=s.viewport.scrollLeft+f.deltaX;e.onWheelScroll(v),uo(v,d)&&f.preventDefault()}},onResize:()=>{u.current&&s.viewport&&i&&n({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:be(i.paddingLeft),paddingEnd:be(i.paddingRight)}})}})}),Ir=a.forwardRef((e,t)=>{const{sizes:o,onSizesChange:n,...r}=e,s=K(U,e.__scopeScrollArea),[i,c]=a.useState(),u=a.useRef(null),p=A(t,u,s.onScrollbarYChange);return a.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),l.jsx(so,{"data-orientation":"vertical",...r,ref:p,sizes:o,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Me(o)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,d)=>{if(s.viewport){const v=s.viewport.scrollTop+f.deltaY;e.onWheelScroll(v),uo(v,d)&&f.preventDefault()}},onResize:()=>{u.current&&s.viewport&&i&&n({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:be(i.paddingTop),paddingEnd:be(i.paddingBottom)}})}})}),[Nr,ao]=eo(U),so=a.forwardRef((e,t)=>{const{__scopeScrollArea:o,sizes:n,hasThumb:r,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:c,onThumbPositionChange:u,onDragScroll:p,onWheelScroll:f,onResize:d,...v}=e,m=K(U,o),[h,C]=a.useState(null),x=A(t,E=>C(E)),S=a.useRef(null),R=a.useRef(""),w=m.viewport,P=n.content-n.viewport,I=k(f),j=k(u),N=Ae(d,10);function T(E){if(S.current){const M=E.clientX-S.current.left,y=E.clientY-S.current.top;p({x:M,y})}}return a.useEffect(()=>{const E=M=>{const y=M.target;h?.contains(y)&&I(M,P)};return document.addEventListener("wheel",E,{passive:!1}),()=>document.removeEventListener("wheel",E,{passive:!1})},[w,h,P,I]),a.useEffect(j,[n,j]),re(h,N),re(m.content,N),l.jsx(Nr,{scope:o,scrollbar:h,hasThumb:r,onThumbChange:k(s),onThumbPointerUp:k(i),onThumbPositionChange:j,onThumbPointerDown:k(c),children:l.jsx(_.div,{...v,ref:x,style:{position:"absolute",...v.style},onPointerDown:g(e.onPointerDown,E=>{E.button===0&&(E.target.setPointerCapture(E.pointerId),S.current=h.getBoundingClientRect(),R.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),T(E))}),onPointerMove:g(e.onPointerMove,T),onPointerUp:g(e.onPointerUp,E=>{const M=E.target;M.hasPointerCapture(E.pointerId)&&M.releasePointerCapture(E.pointerId),document.body.style.webkitUserSelect=R.current,m.viewport&&(m.viewport.style.scrollBehavior=""),S.current=null})})})}),Ce="ScrollAreaThumb",Dr=a.forwardRef((e,t)=>{const{forceMount:o,...n}=e,r=ao(Ce,e.__scopeScrollArea);return l.jsx(B,{present:o||r.hasThumb,children:l.jsx(Or,{ref:t,...n})})}),Or=a.forwardRef((e,t)=>{const{__scopeScrollArea:o,style:n,...r}=e,s=K(Ce,o),i=ao(Ce,o),{onThumbPositionChange:c}=i,u=A(t,d=>i.onThumbChange(d)),p=a.useRef(void 0),f=Ae(()=>{p.current&&(p.current(),p.current=void 0)},100);return a.useEffect(()=>{const d=s.viewport;if(d){const v=()=>{if(f(),!p.current){const m=Fr(d,c);p.current=m,c()}};return c(),d.addEventListener("scroll",v),()=>d.removeEventListener("scroll",v)}},[s.viewport,f,c]),l.jsx(_.div,{"data-state":i.hasThumb?"visible":"hidden",...r,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:g(e.onPointerDownCapture,d=>{const m=d.target.getBoundingClientRect(),h=d.clientX-m.left,C=d.clientY-m.top;i.onThumbPointerDown({x:h,y:C})}),onPointerUp:g(e.onPointerUp,i.onThumbPointerUp)})});Dr.displayName=Ce;var Je="ScrollAreaCorner",io=a.forwardRef((e,t)=>{const o=K(Je,e.__scopeScrollArea),n=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&n?l.jsx(jr,{...e,ref:t}):null});io.displayName=Je;var jr=a.forwardRef((e,t)=>{const{__scopeScrollArea:o,...n}=e,r=K(Je,o),[s,i]=a.useState(0),[c,u]=a.useState(0),p=!!(s&&c);return re(r.scrollbarX,()=>{const f=r.scrollbarX?.offsetHeight||0;r.onCornerHeightChange(f),u(f)}),re(r.scrollbarY,()=>{const f=r.scrollbarY?.offsetWidth||0;r.onCornerWidthChange(f),i(f)}),p?l.jsx(_.div,{...n,ref:t,style:{width:s,height:c,position:"absolute",right:r.dir==="ltr"?0:void 0,left:r.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function be(e){return e?parseInt(e,10):0}function co(e,t){const o=e/t;return isNaN(o)?0:o}function Me(e){const t=co(e.viewport,e.content),o=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-o)*t;return Math.max(n,18)}function Lr(e,t,o,n="ltr"){const r=Me(o),s=r/2,i=t||s,c=r-i,u=o.scrollbar.paddingStart+i,p=o.scrollbar.size-o.scrollbar.paddingEnd-c,f=o.content-o.viewport,d=n==="ltr"?[0,f]:[f*-1,0];return lo([u,p],d)(e)}function St(e,t,o="ltr"){const n=Me(t),r=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-r,i=t.content-t.viewport,c=s-n,u=o==="ltr"?[0,i]:[i*-1,0],p=Ue(e,u);return lo([0,i],[0,c])(p)}function lo(e,t){return o=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(o-e[0])}}function uo(e,t){return e>0&&e{})=>{let o={left:e.scrollLeft,top:e.scrollTop},n=0;return(function r(){const s={left:e.scrollLeft,top:e.scrollTop},i=o.left!==s.left,c=o.top!==s.top;(i||c)&&t(),o=s,n=window.requestAnimationFrame(r)})(),()=>window.cancelAnimationFrame(n)};function Ae(e,t){const o=k(e),n=a.useRef(0);return a.useEffect(()=>()=>window.clearTimeout(n.current),[]),a.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(o,t)},[o,t])}function re(e,t){const o=k(t);ue(()=>{let n=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(o)});return r.observe(e),()=>{window.cancelAnimationFrame(n),r.unobserve(e)}}},[e,o])}var wi=to,Pi=no,Ri=io;function $r(e,t=[]){let o=[];function n(s,i){const c=a.createContext(i);c.displayName=s+"Context";const u=o.length;o=[...o,i];const p=d=>{const{scope:v,children:m,...h}=d,C=v?.[e]?.[u]||c,x=a.useMemo(()=>h,Object.values(h));return l.jsx(C.Provider,{value:x,children:m})};p.displayName=s+"Provider";function f(d,v){const m=v?.[e]?.[u]||c,h=a.useContext(m);if(h)return h;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[p,f]}const r=()=>{const s=o.map(i=>a.createContext(i));return function(c){const u=c?.[e]||s;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return r.scopeName=e,[n,kr(r,...t)]}function kr(...e){const t=e[0];if(e.length===1)return t;const o=()=>{const n=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const i=n.reduce((c,{useScope:u,scopeName:p})=>{const d=u(s)[`__scope${p}`];return{...c,...d}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return o.scopeName=t.scopeName,o}var Vr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],fo=Vr.reduce((e,t)=>{const o=He(`Primitive.${t}`),n=a.forwardRef((r,s)=>{const{asChild:i,...c}=r,u=i?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(u,{...c,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Qe="Progress",et=100,[Br]=$r(Qe),[Kr,Gr]=Br(Qe),po=a.forwardRef((e,t)=>{const{__scopeProgress:o,value:n=null,max:r,getValueLabel:s=Ur,...i}=e;(r||r===0)&&!Ct(r)&&console.error(Hr(`${r}`,"Progress"));const c=Ct(r)?r:et;n!==null&&!bt(n,c)&&console.error(Wr(`${n}`,"Progress"));const u=bt(n,c)?n:null,p=we(u)?s(u,c):void 0;return l.jsx(Kr,{scope:o,value:u,max:c,children:l.jsx(fo.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":we(u)?u:void 0,"aria-valuetext":p,role:"progressbar","data-state":ho(u,c),"data-value":u??void 0,"data-max":c,...i,ref:t})})});po.displayName=Qe;var vo="ProgressIndicator",mo=a.forwardRef((e,t)=>{const{__scopeProgress:o,...n}=e,r=Gr(vo,o);return l.jsx(fo.div,{"data-state":ho(r.value,r.max),"data-value":r.value??void 0,"data-max":r.max,...n,ref:t})});mo.displayName=vo;function Ur(e,t){return`${Math.round(e/t*100)}%`}function ho(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function we(e){return typeof e=="number"}function Ct(e){return we(e)&&!isNaN(e)&&e>0}function bt(e,t){return we(e)&&!isNaN(e)&&e<=t&&e>=0}function Hr(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${et}\`.`}function Wr(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: + - a positive number + - less than the value passed to \`max\` (or ${et} if no \`max\` prop is set) + - \`null\` or \`undefined\` if the progress is indeterminate. + +Defaulting to \`null\`.`}var _i=po,Ei=mo,Te="Switch",[zr]=G(Te),[Yr,Xr]=zr(Te),go=a.forwardRef((e,t)=>{const{__scopeSwitch:o,name:n,checked:r,defaultChecked:s,required:i,disabled:c,value:u="on",onCheckedChange:p,form:f,...d}=e,[v,m]=a.useState(null),h=A(t,w=>m(w)),C=a.useRef(!1),x=v?f||!!v.closest("form"):!0,[S,R]=Q({prop:r,defaultProp:s??!1,onChange:p,caller:Te});return l.jsxs(Yr,{scope:o,checked:S,disabled:c,children:[l.jsx(_.button,{type:"button",role:"switch","aria-checked":S,"aria-required":i,"data-state":bo(S),"data-disabled":c?"":void 0,disabled:c,value:u,...d,ref:h,onClick:g(e.onClick,w=>{R(P=>!P),x&&(C.current=w.isPropagationStopped(),C.current||w.stopPropagation())})}),x&&l.jsx(Co,{control:v,bubbles:!C.current,name:n,value:u,checked:S,required:i,disabled:c,form:f,style:{transform:"translateX(-100%)"}})]})});go.displayName=Te;var xo="SwitchThumb",So=a.forwardRef((e,t)=>{const{__scopeSwitch:o,...n}=e,r=Xr(xo,o);return l.jsx(_.span,{"data-state":bo(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:t})});So.displayName=xo;var qr="SwitchBubbleInput",Co=a.forwardRef(({__scopeSwitch:e,control:t,checked:o,bubbles:n=!0,...r},s)=>{const i=a.useRef(null),c=A(i,s),u=_t(o),p=Et(t);return a.useEffect(()=>{const f=i.current;if(!f)return;const d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"checked").set;if(u!==o&&m){const h=new Event("click",{bubbles:n});m.call(f,o),f.dispatchEvent(h)}},[u,o,n]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o,...r,tabIndex:-1,ref:c,style:{...r.style,...p,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Co.displayName=qr;function bo(e){return e?"checked":"unchecked"}var yi=go,Mi=So,wo=["PageUp","PageDown"],Po=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ro={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},se="Slider",[ke,Zr,Jr]=Ge(se),[_o]=G(se,[Jr]),[Qr,Ie]=_o(se),Eo=a.forwardRef((e,t)=>{const{name:o,min:n=0,max:r=100,step:s=1,orientation:i="horizontal",disabled:c=!1,minStepsBetweenThumbs:u=0,defaultValue:p=[n],value:f,onValueChange:d=()=>{},onValueCommit:v=()=>{},inverted:m=!1,form:h,...C}=e,x=a.useRef(new Set),S=a.useRef(0),w=i==="horizontal"?ea:ta,[P=[],I]=Q({prop:f,defaultProp:p,onChange:y=>{[...x.current][S.current]?.focus(),d(y)}}),j=a.useRef(P);function N(y){const L=sa(P,y);M(y,L)}function T(y){M(y,S.current)}function E(){const y=j.current[S.current];P[S.current]!==y&&v(P)}function M(y,L,{commit:W}={commit:!1}){const q=ua(s),Z=da(Math.round((y-n)/s)*s+n,q),O=Ue(Z,[n,r]);I((z=[])=>{const F=ra(z,O,L);if(la(F,u*s)){S.current=F.indexOf(O);const b=String(F)!==String(z);return b&&W&&v(F),b?F:z}else return z})}return l.jsx(Qr,{scope:e.__scopeSlider,name:o,disabled:c,min:n,max:r,valueIndexToChangeRef:S,thumbs:x.current,values:P,orientation:i,form:h,children:l.jsx(ke.Provider,{scope:e.__scopeSlider,children:l.jsx(ke.Slot,{scope:e.__scopeSlider,children:l.jsx(w,{"aria-disabled":c,"data-disabled":c?"":void 0,...C,ref:t,onPointerDown:g(C.onPointerDown,()=>{c||(j.current=P)}),min:n,max:r,inverted:m,onSlideStart:c?void 0:N,onSlideMove:c?void 0:T,onSlideEnd:c?void 0:E,onHomeKeyDown:()=>!c&&M(n,0,{commit:!0}),onEndKeyDown:()=>!c&&M(r,P.length-1,{commit:!0}),onStepKeyDown:({event:y,direction:L})=>{if(!c){const Z=wo.includes(y.key)||y.shiftKey&&Po.includes(y.key)?10:1,O=S.current,z=P[O],F=s*Z*L;M(z+F,O,{commit:!0})}}})})})})});Eo.displayName=se;var[yo,Mo]=_o(se,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ea=a.forwardRef((e,t)=>{const{min:o,max:n,dir:r,inverted:s,onSlideStart:i,onSlideMove:c,onSlideEnd:u,onStepKeyDown:p,...f}=e,[d,v]=a.useState(null),m=A(t,w=>v(w)),h=a.useRef(void 0),C=pe(r),x=C==="ltr",S=x&&!s||!x&&s;function R(w){const P=h.current||d.getBoundingClientRect(),I=[0,P.width],N=tt(I,S?[o,n]:[n,o]);return h.current=P,N(w-P.left)}return l.jsx(yo,{scope:e.__scopeSlider,startEdge:S?"left":"right",endEdge:S?"right":"left",direction:S?1:-1,size:"width",children:l.jsx(Ao,{dir:C,"data-orientation":"horizontal",...f,ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const P=R(w.clientX);i?.(P)},onSlideMove:w=>{const P=R(w.clientX);c?.(P)},onSlideEnd:()=>{h.current=void 0,u?.()},onStepKeyDown:w=>{const I=Ro[S?"from-left":"from-right"].includes(w.key);p?.({event:w,direction:I?-1:1})}})})}),ta=a.forwardRef((e,t)=>{const{min:o,max:n,inverted:r,onSlideStart:s,onSlideMove:i,onSlideEnd:c,onStepKeyDown:u,...p}=e,f=a.useRef(null),d=A(t,f),v=a.useRef(void 0),m=!r;function h(C){const x=v.current||f.current.getBoundingClientRect(),S=[0,x.height],w=tt(S,m?[n,o]:[o,n]);return v.current=x,w(C-x.top)}return l.jsx(yo,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:l.jsx(Ao,{"data-orientation":"vertical",...p,ref:d,style:{...p.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:C=>{const x=h(C.clientY);s?.(x)},onSlideMove:C=>{const x=h(C.clientY);i?.(x)},onSlideEnd:()=>{v.current=void 0,c?.()},onStepKeyDown:C=>{const S=Ro[m?"from-bottom":"from-top"].includes(C.key);u?.({event:C,direction:S?-1:1})}})})}),Ao=a.forwardRef((e,t)=>{const{__scopeSlider:o,onSlideStart:n,onSlideMove:r,onSlideEnd:s,onHomeKeyDown:i,onEndKeyDown:c,onStepKeyDown:u,...p}=e,f=Ie(se,o);return l.jsx(_.span,{...p,ref:t,onKeyDown:g(e.onKeyDown,d=>{d.key==="Home"?(i(d),d.preventDefault()):d.key==="End"?(c(d),d.preventDefault()):wo.concat(Po).includes(d.key)&&(u(d),d.preventDefault())}),onPointerDown:g(e.onPointerDown,d=>{const v=d.target;v.setPointerCapture(d.pointerId),d.preventDefault(),f.thumbs.has(v)?v.focus():n(d)}),onPointerMove:g(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&r(d)}),onPointerUp:g(e.onPointerUp,d=>{const v=d.target;v.hasPointerCapture(d.pointerId)&&(v.releasePointerCapture(d.pointerId),s(d))})})}),To="SliderTrack",Io=a.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,r=Ie(To,o);return l.jsx(_.span,{"data-disabled":r.disabled?"":void 0,"data-orientation":r.orientation,...n,ref:t})});Io.displayName=To;var Ve="SliderRange",No=a.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,r=Ie(Ve,o),s=Mo(Ve,o),i=a.useRef(null),c=A(t,i),u=r.values.length,p=r.values.map(v=>jo(v,r.min,r.max)),f=u>1?Math.min(...p):0,d=100-Math.max(...p);return l.jsx(_.span,{"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,...n,ref:c,style:{...e.style,[s.startEdge]:f+"%",[s.endEdge]:d+"%"}})});No.displayName=Ve;var Be="SliderThumb",Do=a.forwardRef((e,t)=>{const o=Zr(e.__scopeSlider),[n,r]=a.useState(null),s=A(t,c=>r(c)),i=a.useMemo(()=>n?o().findIndex(c=>c.ref.current===n):-1,[o,n]);return l.jsx(oa,{...e,ref:s,index:i})}),oa=a.forwardRef((e,t)=>{const{__scopeSlider:o,index:n,name:r,...s}=e,i=Ie(Be,o),c=Mo(Be,o),[u,p]=a.useState(null),f=A(t,R=>p(R)),d=u?i.form||!!u.closest("form"):!0,v=Et(u),m=i.values[n],h=m===void 0?0:jo(m,i.min,i.max),C=aa(n,i.values.length),x=v?.[c.size],S=x?ia(x,h,c.direction):0;return a.useEffect(()=>{if(u)return i.thumbs.add(u),()=>{i.thumbs.delete(u)}},[u,i.thumbs]),l.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${h}% + ${S}px)`},children:[l.jsx(ke.ItemSlot,{scope:e.__scopeSlider,children:l.jsx(_.span,{role:"slider","aria-label":e["aria-label"]||C,"aria-valuemin":i.min,"aria-valuenow":m,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...s,ref:f,style:m===void 0?{display:"none"}:e.style,onFocus:g(e.onFocus,()=>{i.valueIndexToChangeRef.current=n})})}),d&&l.jsx(Oo,{name:r??(i.name?i.name+(i.values.length>1?"[]":""):void 0),form:i.form,value:m},n)]})});Do.displayName=Be;var na="RadioBubbleInput",Oo=a.forwardRef(({__scopeSlider:e,value:t,...o},n)=>{const r=a.useRef(null),s=A(r,n),i=_t(t);return a.useEffect(()=>{const c=r.current;if(!c)return;const u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"value").set;if(i!==t&&f){const d=new Event("input",{bubbles:!0});f.call(c,t),c.dispatchEvent(d)}},[i,t]),l.jsx(_.input,{style:{display:"none"},...o,ref:s,defaultValue:t})});Oo.displayName=na;function ra(e=[],t,o){const n=[...e];return n[o]=t,n.sort((r,s)=>r-s)}function jo(e,t,o){const s=100/(o-t)*(e-t);return Ue(s,[0,100])}function aa(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function sa(e,t){if(e.length===1)return 0;const o=e.map(r=>Math.abs(r-t)),n=Math.min(...o);return o.indexOf(n)}function ia(e,t,o){const n=e/2,s=tt([0,50],[0,n]);return(n-s(t)*o)*o}function ca(e){return e.slice(0,-1).map((t,o)=>e[o+1]-t)}function la(e,t){if(t>0){const o=ca(e);return Math.min(...o)>=t}return!0}function tt(e,t){return o=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(o-e[0])}}function ua(e){return(String(e).split(".")[1]||"").length}function da(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}var Ai=Eo,Ti=Io,Ii=No,Ni=Do,fa=Symbol("radix.slottable");function pa(e){const t=({children:o})=>l.jsx(l.Fragment,{children:o});return t.displayName=`${e}.Slottable`,t.__radixId=fa,t}var Lo="AlertDialog",[va]=G(Lo,[yt]),H=yt(),Fo=e=>{const{__scopeAlertDialog:t,...o}=e,n=H(t);return l.jsx(ur,{...n,...o,modal:!0})};Fo.displayName=Lo;var ma="AlertDialogTrigger",$o=a.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,r=H(o);return l.jsx(dr,{...r,...n,ref:t})});$o.displayName=ma;var ha="AlertDialogPortal",ko=e=>{const{__scopeAlertDialog:t,...o}=e,n=H(t);return l.jsx(ar,{...n,...o})};ko.displayName=ha;var ga="AlertDialogOverlay",Vo=a.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,r=H(o);return l.jsx(rr,{...r,...n,ref:t})});Vo.displayName=ga;var oe="AlertDialogContent",[xa,Sa]=va(oe),Ca=pa("AlertDialogContent"),Bo=a.forwardRef((e,t)=>{const{__scopeAlertDialog:o,children:n,...r}=e,s=H(o),i=a.useRef(null),c=A(t,i),u=a.useRef(null);return l.jsx(sr,{contentName:oe,titleName:Ko,docsSlug:"alert-dialog",children:l.jsx(xa,{scope:o,cancelRef:u,children:l.jsxs(ir,{role:"alertdialog",...s,...r,ref:c,onOpenAutoFocus:g(r.onOpenAutoFocus,p=>{p.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:p=>p.preventDefault(),onInteractOutside:p=>p.preventDefault(),children:[l.jsx(Ca,{children:n}),l.jsx(wa,{contentRef:i})]})})})});Bo.displayName=oe;var Ko="AlertDialogTitle",Go=a.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,r=H(o);return l.jsx(cr,{...r,...n,ref:t})});Go.displayName=Ko;var Uo="AlertDialogDescription",Ho=a.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,r=H(o);return l.jsx(lr,{...r,...n,ref:t})});Ho.displayName=Uo;var ba="AlertDialogAction",Wo=a.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,r=H(o);return l.jsx(Mt,{...r,...n,ref:t})});Wo.displayName=ba;var zo="AlertDialogCancel",Yo=a.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,{cancelRef:r}=Sa(zo,o),s=H(o),i=A(t,r);return l.jsx(Mt,{...s,...n,ref:i})});Yo.displayName=zo;var wa=({contentRef:e})=>{const t=`\`${oe}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${oe}\` by passing a \`${Uo}\` component as a child, which also benefits sighted users by adding visible context to the dialog. + +Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${oe}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. + +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return a.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Di=Fo,Oi=$o,ji=ko,Li=Vo,Fi=Bo,$i=Wo,ki=Yo,Vi=Go,Bi=Ho,Pa=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ra=Pa.reduce((e,t)=>{const o=He(`Primitive.${t}`),n=a.forwardRef((r,s)=>{const{asChild:i,...c}=r,u=i?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(u,{...c,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),_a="Separator",wt="horizontal",Ea=["horizontal","vertical"],Xo=a.forwardRef((e,t)=>{const{decorative:o,orientation:n=wt,...r}=e,s=ya(n)?n:wt,c=o?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return l.jsx(Ra.div,{"data-orientation":s,...c,...r,ref:t})});Xo.displayName=_a;function ya(e){return Ea.includes(e)}var Ki=Xo;function Ma(e){const t=Aa(e),o=a.forwardRef((n,r)=>{const{children:s,...i}=n,c=a.Children.toArray(s),u=c.find(Ia);if(u){const p=u.props.children,f=c.map(d=>d===u?a.Children.count(p)>1?a.Children.only(null):a.isValidElement(p)?p.props.children:null:d);return l.jsx(t,{...i,ref:r,children:a.isValidElement(p)?a.cloneElement(p,void 0,f):null})}return l.jsx(t,{...i,ref:r,children:s})});return o.displayName=`${e}.Slot`,o}function Aa(e){const t=a.forwardRef((o,n)=>{const{children:r,...s}=o;if(a.isValidElement(r)){const i=Da(r),c=Na(s,r.props);return r.type!==a.Fragment&&(c.ref=n?We(n,i):i),a.cloneElement(r,c)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ta=Symbol("radix.slottable");function Ia(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ta}function Na(e,t){const o={...t};for(const n in t){const r=e[n],s=t[n];/^on[A-Z]/.test(n)?r&&s?o[n]=(...c)=>{const u=s(...c);return r(...c),u}:r&&(o[n]=r):n==="style"?o[n]={...r,...s}:n==="className"&&(o[n]=[r,s].filter(Boolean).join(" "))}return{...e,...o}}function Da(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var Ne="Popover",[qo]=G(Ne,[_e]),me=_e(),[Oa,Y]=qo(Ne),Zo=e=>{const{__scopePopover:t,children:o,open:n,defaultOpen:r,onOpenChange:s,modal:i=!1}=e,c=me(t),u=a.useRef(null),[p,f]=a.useState(!1),[d,v]=Q({prop:n,defaultProp:r??!1,onChange:s,caller:Ne});return l.jsx(ze,{...c,children:l.jsx(Oa,{scope:t,contentId:ne(),triggerRef:u,open:d,onOpenChange:v,onOpenToggle:a.useCallback(()=>v(m=>!m),[v]),hasCustomAnchor:p,onCustomAnchorAdd:a.useCallback(()=>f(!0),[]),onCustomAnchorRemove:a.useCallback(()=>f(!1),[]),modal:i,children:o})})};Zo.displayName=Ne;var Jo="PopoverAnchor",ja=a.forwardRef((e,t)=>{const{__scopePopover:o,...n}=e,r=Y(Jo,o),s=me(o),{onCustomAnchorAdd:i,onCustomAnchorRemove:c}=r;return a.useEffect(()=>(i(),()=>c()),[i,c]),l.jsx(Ye,{...s,...n,ref:t})});ja.displayName=Jo;var Qo="PopoverTrigger",en=a.forwardRef((e,t)=>{const{__scopePopover:o,...n}=e,r=Y(Qo,o),s=me(o),i=A(t,r.triggerRef),c=l.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":an(r.open),...n,ref:i,onClick:g(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?c:l.jsx(Ye,{asChild:!0,...s,children:c})});en.displayName=Qo;var ot="PopoverPortal",[La,Fa]=qo(ot,{forceMount:void 0}),tn=e=>{const{__scopePopover:t,forceMount:o,children:n,container:r}=e,s=Y(ot,t);return l.jsx(La,{scope:t,forceMount:o,children:l.jsx(B,{present:o||s.open,children:l.jsx(At,{asChild:!0,container:r,children:n})})})};tn.displayName=ot;var ae="PopoverContent",on=a.forwardRef((e,t)=>{const o=Fa(ae,e.__scopePopover),{forceMount:n=o.forceMount,...r}=e,s=Y(ae,e.__scopePopover);return l.jsx(B,{present:n||s.open,children:s.modal?l.jsx(ka,{...r,ref:t}):l.jsx(Va,{...r,ref:t})})});on.displayName=ae;var $a=Ma("PopoverContent.RemoveScroll"),ka=a.forwardRef((e,t)=>{const o=Y(ae,e.__scopePopover),n=a.useRef(null),r=A(t,n),s=a.useRef(!1);return a.useEffect(()=>{const i=n.current;if(i)return Tt(i)},[]),l.jsx(It,{as:$a,allowPinchZoom:!0,children:l.jsx(nn,{...e,ref:r,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(e.onCloseAutoFocus,i=>{i.preventDefault(),s.current||o.triggerRef.current?.focus()}),onPointerDownOutside:g(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,p=c.button===2||u;s.current=p},{checkForDefaultPrevented:!1}),onFocusOutside:g(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Va=a.forwardRef((e,t)=>{const o=Y(ae,e.__scopePopover),n=a.useRef(!1),r=a.useRef(!1);return l.jsx(nn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(n.current||o.triggerRef.current?.focus(),s.preventDefault()),n.current=!1,r.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=s.target;o.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),nn=a.forwardRef((e,t)=>{const{__scopePopover:o,trapFocus:n,onOpenAutoFocus:r,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:p,onInteractOutside:f,...d}=e,v=Y(ae,o),m=me(o);return Nt(),l.jsx(Dt,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:r,onUnmountAutoFocus:s,children:l.jsx(Ot,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:p,onDismiss:()=>v.onOpenChange(!1),children:l.jsx(jt,{"data-state":an(v.open),role:"dialog",id:v.contentId,...m,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),rn="PopoverClose",Ba=a.forwardRef((e,t)=>{const{__scopePopover:o,...n}=e,r=Y(rn,o);return l.jsx(_.button,{type:"button",...n,ref:t,onClick:g(e.onClick,()=>r.onOpenChange(!1))})});Ba.displayName=rn;var Ka="PopoverArrow",Ga=a.forwardRef((e,t)=>{const{__scopePopover:o,...n}=e,r=me(o);return l.jsx(Lt,{...r,...n,ref:t})});Ga.displayName=Ka;function an(e){return e?"open":"closed"}var Gi=Zo,Ui=en,Hi=tn,Wi=on,De="Collapsible",[Ua]=G(De),[Ha,nt]=Ua(De),sn=a.forwardRef((e,t)=>{const{__scopeCollapsible:o,open:n,defaultOpen:r,disabled:s,onOpenChange:i,...c}=e,[u,p]=Q({prop:n,defaultProp:r??!1,onChange:i,caller:De});return l.jsx(Ha,{scope:o,disabled:s,contentId:ne(),open:u,onOpenToggle:a.useCallback(()=>p(f=>!f),[p]),children:l.jsx(_.div,{"data-state":at(u),"data-disabled":s?"":void 0,...c,ref:t})})});sn.displayName=De;var cn="CollapsibleTrigger",Wa=a.forwardRef((e,t)=>{const{__scopeCollapsible:o,...n}=e,r=nt(cn,o);return l.jsx(_.button,{type:"button","aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":at(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...n,ref:t,onClick:g(e.onClick,r.onOpenToggle)})});Wa.displayName=cn;var rt="CollapsibleContent",za=a.forwardRef((e,t)=>{const{forceMount:o,...n}=e,r=nt(rt,e.__scopeCollapsible);return l.jsx(B,{present:o||r.open,children:({present:s})=>l.jsx(Ya,{...n,ref:t,present:s})})});za.displayName=rt;var Ya=a.forwardRef((e,t)=>{const{__scopeCollapsible:o,present:n,children:r,...s}=e,i=nt(rt,o),[c,u]=a.useState(n),p=a.useRef(null),f=A(t,p),d=a.useRef(0),v=d.current,m=a.useRef(0),h=m.current,C=i.open||c,x=a.useRef(C),S=a.useRef(void 0);return a.useEffect(()=>{const R=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(R)},[]),ue(()=>{const R=p.current;if(R){S.current=S.current||{transitionDuration:R.style.transitionDuration,animationName:R.style.animationName},R.style.transitionDuration="0s",R.style.animationName="none";const w=R.getBoundingClientRect();d.current=w.height,m.current=w.width,x.current||(R.style.transitionDuration=S.current.transitionDuration,R.style.animationName=S.current.animationName),u(n)}},[i.open,n]),l.jsx(_.div,{"data-state":at(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!C,...s,ref:f,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...e.style},children:C&&r})});function at(e){return e?"open":"closed"}var zi=sn;function Xa(e,t=[]){let o=[];function n(s,i){const c=a.createContext(i);c.displayName=s+"Context";const u=o.length;o=[...o,i];const p=d=>{const{scope:v,children:m,...h}=d,C=v?.[e]?.[u]||c,x=a.useMemo(()=>h,Object.values(h));return l.jsx(C.Provider,{value:x,children:m})};p.displayName=s+"Provider";function f(d,v){const m=v?.[e]?.[u]||c,h=a.useContext(m);if(h)return h;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[p,f]}const r=()=>{const s=o.map(i=>a.createContext(i));return function(c){const u=c?.[e]||s;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return r.scopeName=e,[n,qa(r,...t)]}function qa(...e){const t=e[0];if(e.length===1)return t;const o=()=>{const n=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const i=n.reduce((c,{useScope:u,scopeName:p})=>{const d=u(s)[`__scope${p}`];return{...c,...d}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return o.scopeName=t.scopeName,o}var Za=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],st=Za.reduce((e,t)=>{const o=He(`Primitive.${t}`),n=a.forwardRef((r,s)=>{const{asChild:i,...c}=r,u=i?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(u,{...c,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Ja=nr();function Qa(){return Ja.useSyncExternalStore(es,()=>!0,()=>!1)}function es(){return()=>{}}var it="Avatar",[ts]=Xa(it),[os,ln]=ts(it),un=a.forwardRef((e,t)=>{const{__scopeAvatar:o,...n}=e,[r,s]=a.useState("idle");return l.jsx(os,{scope:o,imageLoadingStatus:r,onImageLoadingStatusChange:s,children:l.jsx(st.span,{...n,ref:t})})});un.displayName=it;var dn="AvatarImage",fn=a.forwardRef((e,t)=>{const{__scopeAvatar:o,src:n,onLoadingStatusChange:r=()=>{},...s}=e,i=ln(dn,o),c=ns(n,s),u=k(p=>{r(p),i.onImageLoadingStatusChange(p)});return ue(()=>{c!=="idle"&&u(c)},[c,u]),c==="loaded"?l.jsx(st.img,{...s,ref:t,src:n}):null});fn.displayName=dn;var pn="AvatarFallback",vn=a.forwardRef((e,t)=>{const{__scopeAvatar:o,delayMs:n,...r}=e,s=ln(pn,o),[i,c]=a.useState(n===void 0);return a.useEffect(()=>{if(n!==void 0){const u=window.setTimeout(()=>c(!0),n);return()=>window.clearTimeout(u)}},[n]),i&&s.imageLoadingStatus!=="loaded"?l.jsx(st.span,{...r,ref:t}):null});vn.displayName=pn;function Pt(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function ns(e,{referrerPolicy:t,crossOrigin:o}){const n=Qa(),r=a.useRef(null),s=n?(r.current||(r.current=new window.Image),r.current):null,[i,c]=a.useState(()=>Pt(s,e));return ue(()=>{c(Pt(s,e))},[s,e]),ue(()=>{const u=d=>()=>{c(d)};if(!s)return;const p=u("loaded"),f=u("error");return s.addEventListener("load",p),s.addEventListener("error",f),t&&(s.referrerPolicy=t),typeof o=="string"&&(s.crossOrigin=o),()=>{s.removeEventListener("load",p),s.removeEventListener("error",f)}},[s,o,t]),i}var Yi=un,Xi=fn,qi=vn;function rs(e){const t=as(e),o=a.forwardRef((n,r)=>{const{children:s,...i}=n,c=a.Children.toArray(s),u=c.find(is);if(u){const p=u.props.children,f=c.map(d=>d===u?a.Children.count(p)>1?a.Children.only(null):a.isValidElement(p)?p.props.children:null:d);return l.jsx(t,{...i,ref:r,children:a.isValidElement(p)?a.cloneElement(p,void 0,f):null})}return l.jsx(t,{...i,ref:r,children:s})});return o.displayName=`${e}.Slot`,o}function as(e){const t=a.forwardRef((o,n)=>{const{children:r,...s}=o;if(a.isValidElement(r)){const i=ls(r),c=cs(s,r.props);return r.type!==a.Fragment&&(c.ref=n?We(n,i):i),a.cloneElement(r,c)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ss=Symbol("radix.slottable");function is(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ss}function cs(e,t){const o={...t};for(const n in t){const r=e[n],s=t[n];/^on[A-Z]/.test(n)?r&&s?o[n]=(...c)=>{const u=s(...c);return r(...c),u}:r&&(o[n]=r):n==="style"?o[n]={...r,...s}:n==="className"&&(o[n]=[r,s].filter(Boolean).join(" "))}return{...e,...o}}function ls(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var Ke=["Enter"," "],us=["ArrowDown","PageUp","Home"],mn=["ArrowUp","PageDown","End"],ds=[...us,...mn],fs={ltr:[...Ke,"ArrowRight"],rtl:[...Ke,"ArrowLeft"]},ps={ltr:["ArrowLeft"],rtl:["ArrowRight"]},he="Menu",[de,vs,ms]=Ge(he),[ee,hn]=G(he,[ms,_e,Ee]),ge=_e(),gn=Ee(),[xn,X]=ee(he),[hs,xe]=ee(he),Sn=e=>{const{__scopeMenu:t,open:o=!1,children:n,dir:r,onOpenChange:s,modal:i=!0}=e,c=ge(t),[u,p]=a.useState(null),f=a.useRef(!1),d=k(s),v=pe(r);return a.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",h,{capture:!0,once:!0}),document.addEventListener("pointermove",h,{capture:!0,once:!0})},h=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",h,{capture:!0}),document.removeEventListener("pointermove",h,{capture:!0})}},[]),l.jsx(ze,{...c,children:l.jsx(xn,{scope:t,open:o,onOpenChange:d,content:u,onContentChange:p,children:l.jsx(hs,{scope:t,onClose:a.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:f,dir:v,modal:i,children:n})})})};Sn.displayName=he;var gs="MenuAnchor",ct=a.forwardRef((e,t)=>{const{__scopeMenu:o,...n}=e,r=ge(o);return l.jsx(Ye,{...r,...n,ref:t})});ct.displayName=gs;var lt="MenuPortal",[xs,Cn]=ee(lt,{forceMount:void 0}),bn=e=>{const{__scopeMenu:t,forceMount:o,children:n,container:r}=e,s=X(lt,t);return l.jsx(xs,{scope:t,forceMount:o,children:l.jsx(B,{present:o||s.open,children:l.jsx(At,{asChild:!0,container:r,children:n})})})};bn.displayName=lt;var V="MenuContent",[Ss,ut]=ee(V),wn=a.forwardRef((e,t)=>{const o=Cn(V,e.__scopeMenu),{forceMount:n=o.forceMount,...r}=e,s=X(V,e.__scopeMenu),i=xe(V,e.__scopeMenu);return l.jsx(de.Provider,{scope:e.__scopeMenu,children:l.jsx(B,{present:n||s.open,children:l.jsx(de.Slot,{scope:e.__scopeMenu,children:i.modal?l.jsx(Cs,{...r,ref:t}):l.jsx(bs,{...r,ref:t})})})})}),Cs=a.forwardRef((e,t)=>{const o=X(V,e.__scopeMenu),n=a.useRef(null),r=A(t,n);return a.useEffect(()=>{const s=n.current;if(s)return Tt(s)},[]),l.jsx(dt,{...e,ref:r,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:g(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})}),bs=a.forwardRef((e,t)=>{const o=X(V,e.__scopeMenu);return l.jsx(dt,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)})}),ws=rs("MenuContent.ScrollLock"),dt=a.forwardRef((e,t)=>{const{__scopeMenu:o,loop:n=!1,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:p,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:v,onDismiss:m,disableOutsideScroll:h,...C}=e,x=X(V,o),S=xe(V,o),R=ge(o),w=gn(o),P=vs(o),[I,j]=a.useState(null),N=a.useRef(null),T=A(t,N,x.onContentChange),E=a.useRef(0),M=a.useRef(""),y=a.useRef(0),L=a.useRef(null),W=a.useRef("right"),q=a.useRef(0),Z=h?It:a.Fragment,O=h?{as:ws,allowPinchZoom:!0}:void 0,z=b=>{const te=M.current+b,J=P().filter($=>!$.disabled),ie=document.activeElement,je=J.find($=>$.ref.current===ie)?.textValue,Le=J.map($=>$.textValue),gt=Os(Le,te,je),ce=J.find($=>$.textValue===gt)?.ref.current;(function $(xt){M.current=xt,window.clearTimeout(E.current),xt!==""&&(E.current=window.setTimeout(()=>$(""),1e3))})(te),ce&&setTimeout(()=>ce.focus())};a.useEffect(()=>()=>window.clearTimeout(E.current),[]),Nt();const F=a.useCallback(b=>W.current===L.current?.side&&Ls(b,L.current?.area),[]);return l.jsx(Ss,{scope:o,searchRef:M,onItemEnter:a.useCallback(b=>{F(b)&&b.preventDefault()},[F]),onItemLeave:a.useCallback(b=>{F(b)||(N.current?.focus(),j(null))},[F]),onTriggerLeave:a.useCallback(b=>{F(b)&&b.preventDefault()},[F]),pointerGraceTimerRef:y,onPointerGraceIntentChange:a.useCallback(b=>{L.current=b},[]),children:l.jsx(Z,{...O,children:l.jsx(Dt,{asChild:!0,trapped:r,onMountAutoFocus:g(s,b=>{b.preventDefault(),N.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:l.jsx(Ot,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:p,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:v,onDismiss:m,children:l.jsx(Kt,{asChild:!0,...w,dir:S.dir,orientation:"vertical",loop:n,currentTabStopId:I,onCurrentTabStopIdChange:j,onEntryFocus:g(u,b=>{S.isUsingKeyboardRef.current||b.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(jt,{role:"menu","aria-orientation":"vertical","data-state":kn(x.open),"data-radix-menu-content":"",dir:S.dir,...R,...C,ref:T,style:{outline:"none",...C.style},onKeyDown:g(C.onKeyDown,b=>{const J=b.target.closest("[data-radix-menu-content]")===b.currentTarget,ie=b.ctrlKey||b.altKey||b.metaKey,je=b.key.length===1;J&&(b.key==="Tab"&&b.preventDefault(),!ie&&je&&z(b.key));const Le=N.current;if(b.target!==Le||!ds.includes(b.key))return;b.preventDefault();const ce=P().filter($=>!$.disabled).map($=>$.ref.current);mn.includes(b.key)&&ce.reverse(),Ns(ce)}),onBlur:g(e.onBlur,b=>{b.currentTarget.contains(b.target)||(window.clearTimeout(E.current),M.current="")}),onPointerMove:g(e.onPointerMove,fe(b=>{const te=b.target,J=q.current!==b.clientX;if(b.currentTarget.contains(te)&&J){const ie=b.clientX>q.current?"right":"left";W.current=ie,q.current=b.clientX}}))})})})})})})});wn.displayName=V;var Ps="MenuGroup",ft=a.forwardRef((e,t)=>{const{__scopeMenu:o,...n}=e;return l.jsx(_.div,{role:"group",...n,ref:t})});ft.displayName=Ps;var Rs="MenuLabel",Pn=a.forwardRef((e,t)=>{const{__scopeMenu:o,...n}=e;return l.jsx(_.div,{...n,ref:t})});Pn.displayName=Rs;var Pe="MenuItem",Rt="menu.itemSelect",Oe=a.forwardRef((e,t)=>{const{disabled:o=!1,onSelect:n,...r}=e,s=a.useRef(null),i=xe(Pe,e.__scopeMenu),c=ut(Pe,e.__scopeMenu),u=A(t,s),p=a.useRef(!1),f=()=>{const d=s.current;if(!o&&d){const v=new CustomEvent(Rt,{bubbles:!0,cancelable:!0});d.addEventListener(Rt,m=>n?.(m),{once:!0}),fr(d,v),v.defaultPrevented?p.current=!1:i.onClose()}};return l.jsx(Rn,{...r,ref:u,disabled:o,onClick:g(e.onClick,f),onPointerDown:d=>{e.onPointerDown?.(d),p.current=!0},onPointerUp:g(e.onPointerUp,d=>{p.current||d.currentTarget?.click()}),onKeyDown:g(e.onKeyDown,d=>{const v=c.searchRef.current!=="";o||v&&d.key===" "||Ke.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Oe.displayName=Pe;var Rn=a.forwardRef((e,t)=>{const{__scopeMenu:o,disabled:n=!1,textValue:r,...s}=e,i=ut(Pe,o),c=gn(o),u=a.useRef(null),p=A(t,u),[f,d]=a.useState(!1),[v,m]=a.useState("");return a.useEffect(()=>{const h=u.current;h&&m((h.textContent??"").trim())},[s.children]),l.jsx(de.ItemSlot,{scope:o,disabled:n,textValue:r??v,children:l.jsx(Gt,{asChild:!0,...c,focusable:!n,children:l.jsx(_.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...s,ref:p,onPointerMove:g(e.onPointerMove,fe(h=>{n?i.onItemLeave(h):(i.onItemEnter(h),h.defaultPrevented||h.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:g(e.onPointerLeave,fe(h=>i.onItemLeave(h))),onFocus:g(e.onFocus,()=>d(!0)),onBlur:g(e.onBlur,()=>d(!1))})})})}),_s="MenuCheckboxItem",_n=a.forwardRef((e,t)=>{const{checked:o=!1,onCheckedChange:n,...r}=e;return l.jsx(Tn,{scope:e.__scopeMenu,checked:o,children:l.jsx(Oe,{role:"menuitemcheckbox","aria-checked":Re(o)?"mixed":o,...r,ref:t,"data-state":mt(o),onSelect:g(r.onSelect,()=>n?.(Re(o)?!0:!o),{checkForDefaultPrevented:!1})})})});_n.displayName=_s;var En="MenuRadioGroup",[Es,ys]=ee(En,{value:void 0,onValueChange:()=>{}}),yn=a.forwardRef((e,t)=>{const{value:o,onValueChange:n,...r}=e,s=k(n);return l.jsx(Es,{scope:e.__scopeMenu,value:o,onValueChange:s,children:l.jsx(ft,{...r,ref:t})})});yn.displayName=En;var Mn="MenuRadioItem",An=a.forwardRef((e,t)=>{const{value:o,...n}=e,r=ys(Mn,e.__scopeMenu),s=o===r.value;return l.jsx(Tn,{scope:e.__scopeMenu,checked:s,children:l.jsx(Oe,{role:"menuitemradio","aria-checked":s,...n,ref:t,"data-state":mt(s),onSelect:g(n.onSelect,()=>r.onValueChange?.(o),{checkForDefaultPrevented:!1})})})});An.displayName=Mn;var pt="MenuItemIndicator",[Tn,Ms]=ee(pt,{checked:!1}),In=a.forwardRef((e,t)=>{const{__scopeMenu:o,forceMount:n,...r}=e,s=Ms(pt,o);return l.jsx(B,{present:n||Re(s.checked)||s.checked===!0,children:l.jsx(_.span,{...r,ref:t,"data-state":mt(s.checked)})})});In.displayName=pt;var As="MenuSeparator",Nn=a.forwardRef((e,t)=>{const{__scopeMenu:o,...n}=e;return l.jsx(_.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});Nn.displayName=As;var Ts="MenuArrow",Dn=a.forwardRef((e,t)=>{const{__scopeMenu:o,...n}=e,r=ge(o);return l.jsx(Lt,{...r,...n,ref:t})});Dn.displayName=Ts;var vt="MenuSub",[Is,On]=ee(vt),jn=e=>{const{__scopeMenu:t,children:o,open:n=!1,onOpenChange:r}=e,s=X(vt,t),i=ge(t),[c,u]=a.useState(null),[p,f]=a.useState(null),d=k(r);return a.useEffect(()=>(s.open===!1&&d(!1),()=>d(!1)),[s.open,d]),l.jsx(ze,{...i,children:l.jsx(xn,{scope:t,open:n,onOpenChange:d,content:p,onContentChange:f,children:l.jsx(Is,{scope:t,contentId:ne(),triggerId:ne(),trigger:c,onTriggerChange:u,children:o})})})};jn.displayName=vt;var le="MenuSubTrigger",Ln=a.forwardRef((e,t)=>{const o=X(le,e.__scopeMenu),n=xe(le,e.__scopeMenu),r=On(le,e.__scopeMenu),s=ut(le,e.__scopeMenu),i=a.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=s,p={__scopeMenu:e.__scopeMenu},f=a.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return a.useEffect(()=>f,[f]),a.useEffect(()=>{const d=c.current;return()=>{window.clearTimeout(d),u(null)}},[c,u]),l.jsx(ct,{asChild:!0,...p,children:l.jsx(Rn,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":r.contentId,"data-state":kn(o.open),...e,ref:We(t,r.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),o.open||o.onOpenChange(!0))},onPointerMove:g(e.onPointerMove,fe(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!o.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{o.onOpenChange(!0),f()},100))})),onPointerLeave:g(e.onPointerLeave,fe(d=>{f();const v=o.content?.getBoundingClientRect();if(v){const m=o.content?.dataset.side,h=m==="right",C=h?-5:5,x=v[h?"left":"right"],S=v[h?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+C,y:d.clientY},{x,y:v.top},{x:S,y:v.top},{x:S,y:v.bottom},{x,y:v.bottom}],side:m}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:g(e.onKeyDown,d=>{const v=s.searchRef.current!=="";e.disabled||v&&d.key===" "||fs[n.dir].includes(d.key)&&(o.onOpenChange(!0),o.content?.focus(),d.preventDefault())})})})});Ln.displayName=le;var Fn="MenuSubContent",$n=a.forwardRef((e,t)=>{const o=Cn(V,e.__scopeMenu),{forceMount:n=o.forceMount,...r}=e,s=X(V,e.__scopeMenu),i=xe(V,e.__scopeMenu),c=On(Fn,e.__scopeMenu),u=a.useRef(null),p=A(t,u);return l.jsx(de.Provider,{scope:e.__scopeMenu,children:l.jsx(B,{present:n||s.open,children:l.jsx(de.Slot,{scope:e.__scopeMenu,children:l.jsx(dt,{id:c.contentId,"aria-labelledby":c.triggerId,...r,ref:p,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{i.isUsingKeyboardRef.current&&u.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:g(e.onFocusOutside,f=>{f.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:g(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:g(e.onKeyDown,f=>{const d=f.currentTarget.contains(f.target),v=ps[i.dir].includes(f.key);d&&v&&(s.onOpenChange(!1),c.trigger?.focus(),f.preventDefault())})})})})})});$n.displayName=Fn;function kn(e){return e?"open":"closed"}function Re(e){return e==="indeterminate"}function mt(e){return Re(e)?"indeterminate":e?"checked":"unchecked"}function Ns(e){const t=document.activeElement;for(const o of e)if(o===t||(o.focus(),document.activeElement!==t))return}function Ds(e,t){return e.map((o,n)=>e[(t+n)%e.length])}function Os(e,t,o){const r=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,s=o?e.indexOf(o):-1;let i=Ds(e,Math.max(s,0));r.length===1&&(i=i.filter(p=>p!==o));const u=i.find(p=>p.toLowerCase().startsWith(r.toLowerCase()));return u!==o?u:void 0}function js(e,t){const{x:o,y:n}=e;let r=!1;for(let s=0,i=t.length-1;sn!=v>n&&o<(d-p)*(n-f)/(v-f)+p&&(r=!r)}return r}function Ls(e,t){if(!t)return!1;const o={x:e.clientX,y:e.clientY};return js(o,t)}function fe(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Fs=Sn,$s=ct,ks=bn,Vs=wn,Bs=ft,Ks=Pn,Gs=Oe,Us=_n,Hs=yn,Ws=An,zs=In,Ys=Nn,Xs=Dn,qs=jn,Zs=Ln,Js=$n,ht="ContextMenu",[Qs]=G(ht,[hn]),D=hn(),[ei,Vn]=Qs(ht),Bn=e=>{const{__scopeContextMenu:t,children:o,onOpenChange:n,dir:r,modal:s=!0}=e,[i,c]=a.useState(!1),u=D(t),p=k(n),f=a.useCallback(d=>{c(d),p(d)},[p]);return l.jsx(ei,{scope:t,open:i,onOpenChange:f,modal:s,children:l.jsx(Fs,{...u,dir:r,open:i,onOpenChange:f,modal:s,children:o})})};Bn.displayName=ht;var Kn="ContextMenuTrigger",Gn=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,disabled:n=!1,...r}=e,s=Vn(Kn,o),i=D(o),c=a.useRef({x:0,y:0}),u=a.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),p=a.useRef(0),f=a.useCallback(()=>window.clearTimeout(p.current),[]),d=v=>{c.current={x:v.clientX,y:v.clientY},s.onOpenChange(!0)};return a.useEffect(()=>f,[f]),a.useEffect(()=>void(n&&f()),[n,f]),l.jsxs(l.Fragment,{children:[l.jsx($s,{...i,virtualRef:u}),l.jsx(_.span,{"data-state":s.open?"open":"closed","data-disabled":n?"":void 0,...r,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:n?e.onContextMenu:g(e.onContextMenu,v=>{f(),d(v),v.preventDefault()}),onPointerDown:n?e.onPointerDown:g(e.onPointerDown,Se(v=>{f(),p.current=window.setTimeout(()=>d(v),700)})),onPointerMove:n?e.onPointerMove:g(e.onPointerMove,Se(f)),onPointerCancel:n?e.onPointerCancel:g(e.onPointerCancel,Se(f)),onPointerUp:n?e.onPointerUp:g(e.onPointerUp,Se(f))})]})});Gn.displayName=Kn;var ti="ContextMenuPortal",Un=e=>{const{__scopeContextMenu:t,...o}=e,n=D(t);return l.jsx(ks,{...n,...o})};Un.displayName=ti;var Hn="ContextMenuContent",Wn=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,...n}=e,r=Vn(Hn,o),s=D(o),i=a.useRef(!1);return l.jsx(Vs,{...s,...n,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{e.onCloseAutoFocus?.(c),!c.defaultPrevented&&i.current&&c.preventDefault(),i.current=!1},onInteractOutside:c=>{e.onInteractOutside?.(c),!c.defaultPrevented&&!r.modal&&(i.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Wn.displayName=Hn;var oi="ContextMenuGroup",ni=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,...n}=e,r=D(o);return l.jsx(Bs,{...r,...n,ref:t})});ni.displayName=oi;var ri="ContextMenuLabel",zn=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,...n}=e,r=D(o);return l.jsx(Ks,{...r,...n,ref:t})});zn.displayName=ri;var ai="ContextMenuItem",Yn=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,...n}=e,r=D(o);return l.jsx(Gs,{...r,...n,ref:t})});Yn.displayName=ai;var si="ContextMenuCheckboxItem",Xn=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,...n}=e,r=D(o);return l.jsx(Us,{...r,...n,ref:t})});Xn.displayName=si;var ii="ContextMenuRadioGroup",ci=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,...n}=e,r=D(o);return l.jsx(Hs,{...r,...n,ref:t})});ci.displayName=ii;var li="ContextMenuRadioItem",qn=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,...n}=e,r=D(o);return l.jsx(Ws,{...r,...n,ref:t})});qn.displayName=li;var ui="ContextMenuItemIndicator",Zn=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,...n}=e,r=D(o);return l.jsx(zs,{...r,...n,ref:t})});Zn.displayName=ui;var di="ContextMenuSeparator",Jn=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,...n}=e,r=D(o);return l.jsx(Ys,{...r,...n,ref:t})});Jn.displayName=di;var fi="ContextMenuArrow",pi=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,...n}=e,r=D(o);return l.jsx(Xs,{...r,...n,ref:t})});pi.displayName=fi;var Qn="ContextMenuSub",er=e=>{const{__scopeContextMenu:t,children:o,onOpenChange:n,open:r,defaultOpen:s}=e,i=D(t),[c,u]=Q({prop:r,defaultProp:s??!1,onChange:n,caller:Qn});return l.jsx(qs,{...i,open:c,onOpenChange:u,children:o})};er.displayName=Qn;var vi="ContextMenuSubTrigger",tr=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,...n}=e,r=D(o);return l.jsx(Zs,{...r,...n,ref:t})});tr.displayName=vi;var mi="ContextMenuSubContent",or=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,...n}=e,r=D(o);return l.jsx(Js,{...r,...n,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});or.displayName=mi;function Se(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var Zi=Bn,Ji=Gn,Qi=Un,ec=Wn,tc=zn,oc=Yn,nc=Xn,rc=qn,ac=Zn,sc=Jn,ic=er,cc=tr,lc=or;export{$i as A,lc as B,bi as C,Bi as D,Qi as E,qi as F,ec as G,oc as H,Ei as I,nc as J,ac as K,Si as L,rc as M,tc as N,Li as O,ji as P,sc as Q,xi as R,yr as S,Ci as T,Zi as U,Pi as V,Ji as W,ic as X,wi as a,Ri as b,Dr as c,_i as d,yi as e,Mi as f,Ai as g,Ti as h,Ii as i,Ni as j,Fi as k,Vi as l,ki as m,Di as n,Oi as o,Ki as p,Hi as q,Wi as r,Gi as s,Ui as t,zi as u,Wa as v,za as w,Yi as x,Xi as y,cc as z}; diff --git a/webui/dist/assets/reactflow-B3n3_Vkw.js b/webui/dist/assets/reactflow-B3n3_Vkw.js new file mode 100644 index 00000000..d4b54604 --- /dev/null +++ b/webui/dist/assets/reactflow-B3n3_Vkw.js @@ -0,0 +1,2 @@ +import{u as Rc,R as P,r as T}from"./router-CWhjJi2n.js";import{i as Ac,b as Oo,c as Mc,d as Fo,e as Ic,f as qc,g as Tc,r as ea,h as Pc,j as co,k as ta,l as We,m as lo,n as Dc,o as zc,p as na,q as ra,s as oa,t as fo,u as ho,v as po,w as Lc,x as $c,y as Oc,z as Fc,A as Hc,B as Vc,C as Bc,D as go,E as Wt,F as Gc,G as Uc,H as mo,I as Yc,J as Wc,K as ia,L as sa,M as aa,N as ua,O as Zt,P as ca,Q as la,R as Zc,S as Xc,T as Kc,U as jc,V as Qc,W as Jc,X as el,Y as tl,Z as da,$ as fa,a0 as nl,a1 as rl,a2 as ol,a3 as il,a4 as sl,a5 as al,a6 as ul,a7 as cl,a8 as ll,a9 as dl,aa as fl,ab as hl,ac as pl,ad as gl,ae as ml,af as vl}from"./charts-Dhri-zxi.js";function ce(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{let t;const n=new Set,r=(u,d)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const h=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(_=>_(t,h))}},o=()=>t,c={setState:r,getState:o,getInitialState:()=>l,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(yl?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},l=t=e(r,o,c);return c},wl=e=>e?Ho(e):Ho,{useDebugValue:_l}=P,{useSyncExternalStoreWithSelector:El}=Rc,bl=e=>e;function ha(e,t=bl,n){const r=El(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return _l(r),r}const Vo=(e,t)=>{const n=wl(e),r=(o,i=t)=>ha(n,o,i);return Object.assign(r,n),r},xl=(e,t)=>e?Vo(e,t):Vo;function ue(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var Sl={value:()=>{}};function Xt(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Pt.prototype=Xt.prototype={constructor:Pt,on:function(e,t){var n=this._,r=Nl(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i0)for(var n=new Array(o),r=0,o,i;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Go.hasOwnProperty(t)?{space:Go[t],local:e}:e}function kl(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Kr&&t.documentElement.namespaceURI===Kr?t.createElement(e):t.createElementNS(n,e)}}function Rl(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function pa(e){var t=Kt(e);return(t.local?Rl:kl)(t)}function Al(){}function vo(e){return e==null?Al:function(){return this.querySelector(e)}}function Ml(e){typeof e!="function"&&(e=vo(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o=E&&(E=y+1);!(b=g[E])&&++E<_;);v._next=b||null}}return s=new pe(s,r),s._enter=a,s._exit=c,s}function Kl(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function jl(){return new pe(this._exit||this._groups.map(ya),this._parents)}function Ql(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function Jl(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),a=new Array(o),c=0;c=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function td(e){e||(e=nd);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,o=new Array(r),i=0;it?1:e>=t?0:NaN}function rd(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function od(){return Array.from(this)}function id(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?md:typeof t=="function"?yd:vd)(e,t,n??"")):at(this.node(),e)}function at(e,t){return e.style.getPropertyValue(t)||wa(e).getComputedStyle(e,null).getPropertyValue(t)}function _d(e){return function(){delete this[e]}}function Ed(e,t){return function(){this[e]=t}}function bd(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function xd(e,t){return arguments.length>1?this.each((t==null?_d:typeof t=="function"?bd:Ed)(e,t)):this.node()[e]}function _a(e){return e.trim().split(/^|\s+/)}function yo(e){return e.classList||new Ea(e)}function Ea(e){this._node=e,this._names=_a(e.getAttribute("class")||"")}Ea.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function ba(e,t){for(var n=yo(e),r=-1,o=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function jd(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n()=>e;function jr(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:a,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}jr.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function uf(e){return!e.ctrlKey&&!e.button}function cf(){return this.parentNode}function lf(e,t){return t??{x:e.x,y:e.y}}function df(){return navigator.maxTouchPoints||"ontouchstart"in this}function ff(){var e=uf,t=cf,n=lf,r=df,o={},i=Xt("start","drag","end"),s=0,a,c,l,u,d=0;function f(v){v.on("mousedown.drag",h).filter(r).on("touchstart.drag",g).on("touchmove.drag",p,af).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(v,b){if(!(u||!e.call(this,v,b))){var x=E(this,t.call(this,v,b),v,b,"mouse");x&&(ge(v.view).on("mousemove.drag",_,Et).on("mouseup.drag",m,Et),Ca(v.view),an(v),l=!1,a=v.clientX,c=v.clientY,x("start",v))}}function _(v){if(it(v),!l){var b=v.clientX-a,x=v.clientY-c;l=b*b+x*x>d}o.mouse("drag",v)}function m(v){ge(v.view).on("mousemove.drag mouseup.drag",null),ka(v.view,l),it(v),o.mouse("end",v)}function g(v,b){if(e.call(this,v,b)){var x=v.changedTouches,C=t.call(this,v,b),q=x.length,k,A;for(k=0;k=0&&e._call.call(void 0,t),e=e._next;--ut}function Uo(){Ue=(Ft=bt.now())+jt,ut=yt=0;try{pf()}finally{ut=0,mf(),Ue=0}}function gf(){var e=bt.now(),t=e-Ft;t>Ra&&(jt-=t,Ft=e)}function mf(){for(var e,t=Ot,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ot=n);wt=e,Qr(r)}function Qr(e){if(!ut){yt&&(yt=clearTimeout(yt));var t=e-Ue;t>24?(e<1/0&&(yt=setTimeout(Uo,e-bt.now()-jt)),ht&&(ht=clearInterval(ht))):(ht||(Ft=bt.now(),ht=setInterval(gf,Ra)),ut=1,Aa(Uo))}}function Yo(e,t,n){var r=new Ht;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var vf=Xt("start","end","cancel","interrupt"),yf=[],Ia=0,Wo=1,Jr=2,Dt=3,Zo=4,eo=5,zt=6;function Qt(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;wf(e,n,{name:t,index:r,group:o,on:vf,tween:yf,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Ia})}function _o(e,t){var n=Ee(e,t);if(n.state>Ia)throw new Error("too late; already scheduled");return n}function Se(e,t){var n=Ee(e,t);if(n.state>Dt)throw new Error("too late; already running");return n}function Ee(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function wf(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=Ma(i,0,n.time);function i(l){n.state=Wo,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var u,d,f,h;if(n.state!==Wo)return c();for(u in r)if(h=r[u],h.name===n.name){if(h.state===Dt)return Yo(s);h.state===Zo?(h.state=zt,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[u]):+uJr&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function Xf(e,t,n){var r,o,i=Zf(t)?_o:Se;return function(){var s=i(this,e),a=s.on;a!==r&&(o=(r=a).copy()).on(t,n),s.on=o}}function Kf(e,t){var n=this._id;return arguments.length<2?Ee(this.node(),n).on.on(e):this.each(Xf(n,e,t))}function jf(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Qf(){return this.on("end.remove",jf(this._id))}function Jf(e){var t=this._name,n=this._id;typeof e!="function"&&(e=vo(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s()=>e;function Sh(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function Re(e,t,n){this.k=e,this.x=t,this.y=n}Re.prototype={constructor:Re,scale:function(e){return e===1?this:new Re(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Re(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ae=new Re(1,0,0);Re.prototype;function un(e){e.stopImmediatePropagation()}function pt(e){e.preventDefault(),e.stopImmediatePropagation()}function Nh(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Ch(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Xo(){return this.__zoom||Ae}function kh(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Rh(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ah(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function Da(){var e=Nh,t=Ch,n=Ah,r=kh,o=Rh,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,c=Tc,l=Xt("start","zoom","end"),u,d,f,h=500,_=150,m=0,g=10;function p(w){w.property("__zoom",Xo).on("wheel.zoom",q,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",A).filter(o).on("touchstart.zoom",D).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(w,R,N,O){var H=w.selection?w.selection():w;H.property("__zoom",Xo),w!==H?b(w,R,N,O):H.interrupt().each(function(){x(this,arguments).event(O).start().zoom(null,typeof R=="function"?R.apply(this,arguments):R).end()})},p.scaleBy=function(w,R,N,O){p.scaleTo(w,function(){var H=this.__zoom.k,M=typeof R=="function"?R.apply(this,arguments):R;return H*M},N,O)},p.scaleTo=function(w,R,N,O){p.transform(w,function(){var H=t.apply(this,arguments),M=this.__zoom,F=N==null?v(H):typeof N=="function"?N.apply(this,arguments):N,B=M.invert(F),G=typeof R=="function"?R.apply(this,arguments):R;return n(E(y(M,G),F,B),H,s)},N,O)},p.translateBy=function(w,R,N,O){p.transform(w,function(){return n(this.__zoom.translate(typeof R=="function"?R.apply(this,arguments):R,typeof N=="function"?N.apply(this,arguments):N),t.apply(this,arguments),s)},null,O)},p.translateTo=function(w,R,N,O,H){p.transform(w,function(){var M=t.apply(this,arguments),F=this.__zoom,B=O==null?v(M):typeof O=="function"?O.apply(this,arguments):O;return n(Ae.translate(B[0],B[1]).scale(F.k).translate(typeof R=="function"?-R.apply(this,arguments):-R,typeof N=="function"?-N.apply(this,arguments):-N),M,s)},O,H)};function y(w,R){return R=Math.max(i[0],Math.min(i[1],R)),R===w.k?w:new Re(R,w.x,w.y)}function E(w,R,N){var O=R[0]-N[0]*w.k,H=R[1]-N[1]*w.k;return O===w.x&&H===w.y?w:new Re(w.k,O,H)}function v(w){return[(+w[0][0]+ +w[1][0])/2,(+w[0][1]+ +w[1][1])/2]}function b(w,R,N,O){w.on("start.zoom",function(){x(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){x(this,arguments).event(O).end()}).tween("zoom",function(){var H=this,M=arguments,F=x(H,M).event(O),B=t.apply(H,M),G=N==null?v(B):typeof N=="function"?N.apply(H,M):N,U=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),S=H.__zoom,I=typeof R=="function"?R.apply(H,M):R,z=c(S.invert(G).concat(U/S.k),I.invert(G).concat(U/I.k));return function(V){if(V===1)V=I;else{var Y=z(V),W=U/Y[2];V=new Re(W,G[0]-Y[0]*W,G[1]-Y[1]*W)}F.zoom(null,V)}})}function x(w,R,N){return!N&&w.__zooming||new C(w,R)}function C(w,R){this.that=w,this.args=R,this.active=0,this.sourceEvent=null,this.extent=t.apply(w,R),this.taps=0}C.prototype={event:function(w){return w&&(this.sourceEvent=w),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(w,R){return this.mouse&&w!=="mouse"&&(this.mouse[1]=R.invert(this.mouse[0])),this.touch0&&w!=="touch"&&(this.touch0[1]=R.invert(this.touch0[0])),this.touch1&&w!=="touch"&&(this.touch1[1]=R.invert(this.touch1[0])),this.that.__zoom=R,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(w){var R=ge(this.that).datum();l.call(w,this.that,new Sh(w,{sourceEvent:this.sourceEvent,target:p,transform:this.that.__zoom,dispatch:l}),R)}};function q(w,...R){if(!e.apply(this,arguments))return;var N=x(this,R).event(w),O=this.__zoom,H=Math.max(i[0],Math.min(i[1],O.k*Math.pow(2,r.apply(this,arguments)))),M=ye(w);if(N.wheel)(N.mouse[0][0]!==M[0]||N.mouse[0][1]!==M[1])&&(N.mouse[1]=O.invert(N.mouse[0]=M)),clearTimeout(N.wheel);else{if(O.k===H)return;N.mouse=[M,O.invert(M)],Lt(this),N.start()}pt(w),N.wheel=setTimeout(F,_),N.zoom("mouse",n(E(y(O,H),N.mouse[0],N.mouse[1]),N.extent,s));function F(){N.wheel=null,N.end()}}function k(w,...R){if(f||!e.apply(this,arguments))return;var N=w.currentTarget,O=x(this,R,!0).event(w),H=ge(w.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",U,!0),M=ye(w,N),F=w.clientX,B=w.clientY;Ca(w.view),un(w),O.mouse=[M,this.__zoom.invert(M)],Lt(this),O.start();function G(S){if(pt(S),!O.moved){var I=S.clientX-F,z=S.clientY-B;O.moved=I*I+z*z>m}O.event(S).zoom("mouse",n(E(O.that.__zoom,O.mouse[0]=ye(S,N),O.mouse[1]),O.extent,s))}function U(S){H.on("mousemove.zoom mouseup.zoom",null),ka(S.view,O.moved),pt(S),O.event(S).end()}}function A(w,...R){if(e.apply(this,arguments)){var N=this.__zoom,O=ye(w.changedTouches?w.changedTouches[0]:w,this),H=N.invert(O),M=N.k*(w.shiftKey?.5:2),F=n(E(y(N,M),O,H),t.apply(this,R),s);pt(w),a>0?ge(this).transition().duration(a).call(b,F,O,w):ge(this).call(p.transform,F,O,w)}}function D(w,...R){if(e.apply(this,arguments)){var N=w.touches,O=N.length,H=x(this,R,w.changedTouches.length===O).event(w),M,F,B,G;for(un(w),F=0;F"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},za=Ie.error001();function re(e,t){const n=T.useContext(Jt);if(n===null)throw new Error(za);return ha(n,e,t)}const ae=()=>{const e=T.useContext(Jt);if(e===null)throw new Error(za);return T.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},Ih=e=>e.userSelectionActive?"none":"all";function bo({position:e,children:t,className:n,style:r,...o}){const i=re(Ih),s=`${e}`.split("-");return P.createElement("div",{className:ce(["react-flow__panel",n,...s]),style:{...r,pointerEvents:i},...o},t)}function qh({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:P.createElement(bo,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},P.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const Th=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:o=!0,labelBgStyle:i={},labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:c,className:l,...u})=>{const d=T.useRef(null),[f,h]=T.useState({x:0,y:0,width:0,height:0}),_=ce(["react-flow__edge-textwrapper",l]);return T.useEffect(()=>{if(d.current){const m=d.current.getBBox();h({x:m.x,y:m.y,width:m.width,height:m.height})}},[n]),typeof n>"u"||!n?null:P.createElement("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:_,visibility:f.width?"visible":"hidden",...u},o&&P.createElement("rect",{width:f.width+2*s[0],x:-s[0],y:-s[1],height:f.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),P.createElement("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:d,style:r},n),c)};var Ph=T.memo(Th);const xo=e=>({width:e.offsetWidth,height:e.offsetHeight}),ct=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),So=(e={x:0,y:0},t)=>({x:ct(e.x,t[0][0],t[1][0]),y:ct(e.y,t[0][1],t[1][1])}),Ko=(e,t,n)=>en?-ct(Math.abs(e-n),1,50)/50:0,La=(e,t)=>{const n=Ko(e.x,35,t.width-35)*20,r=Ko(e.y,35,t.height-35)*20;return[n,r]},$a=e=>e.getRootNode?.()||window?.document,Oa=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),xt=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Fa=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),jo=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),Dh=(e,t)=>Fa(Oa(xt(e),xt(t))),to=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},zh=e=>me(e.width)&&me(e.height)&&me(e.x)&&me(e.y),me=e=>!isNaN(e)&&isFinite(e),se=Symbol.for("internals"),Ha=["Enter"," ","Escape"],Lh=(e,t)=>{},$h=e=>"nativeEvent"in e;function no(e){const n=($h(e)?e.nativeEvent:e).composedPath?.()?.[0]||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n?.nodeName)||n?.hasAttribute("contenteditable")||!!n?.closest(".nokey")}const Va=e=>"clientX"in e,De=(e,t)=>{const n=Va(e),r=n?e.clientX:e.touches?.[0].clientX,o=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:o-(t?.top??0)}},Vt=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0,kt=({id:e,path:t,labelX:n,labelY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:l,style:u,markerEnd:d,markerStart:f,interactionWidth:h=20})=>P.createElement(P.Fragment,null,P.createElement("path",{id:e,style:u,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:d,markerStart:f}),h&&P.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),o&&me(n)&&me(r)?P.createElement(Ph,{x:n,y:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:l}):null);kt.displayName="BaseEdge";function gt(e,t,n){return n===void 0?n:r=>{const o=t().edges.find(i=>i.id===e);o&&n(r,{...o})}}function Ba({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n{const[g,p,y]=Ua({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i});return P.createElement(kt,{path:g,labelX:p,labelY:y,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:_,interactionWidth:m})});No.displayName="SimpleBezierEdge";const Jo={[X.Left]:{x:-1,y:0},[X.Right]:{x:1,y:0},[X.Top]:{x:0,y:-1},[X.Bottom]:{x:0,y:1}},Oh=({source:e,sourcePosition:t=X.Bottom,target:n})=>t===X.Left||t===X.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Fh({source:e,sourcePosition:t=X.Bottom,target:n,targetPosition:r=X.Top,center:o,offset:i}){const s=Jo[t],a=Jo[r],c={x:e.x+s.x*i,y:e.y+s.y*i},l={x:n.x+a.x*i,y:n.y+a.y*i},u=Oh({source:c,sourcePosition:t,target:l}),d=u.x!==0?"x":"y",f=u[d];let h=[],_,m;const g={x:0,y:0},p={x:0,y:0},[y,E,v,b]=Ba({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[d]*a[d]===-1){_=o.x??y,m=o.y??E;const C=[{x:_,y:c.y},{x:_,y:l.y}],q=[{x:c.x,y:m},{x:l.x,y:m}];s[d]===f?h=d==="x"?C:q:h=d==="x"?q:C}else{const C=[{x:c.x,y:l.y}],q=[{x:l.x,y:c.y}];if(d==="x"?h=s.x===f?q:C:h=s.y===f?C:q,t===r){const L=Math.abs(e[d]-n[d]);if(L<=i){const w=Math.min(i-1,i-L);s[d]===f?g[d]=(c[d]>e[d]?-1:1)*w:p[d]=(l[d]>n[d]?-1:1)*w}}if(t!==r){const L=d==="x"?"y":"x",w=s[d]===a[L],R=c[L]>l[L],N=c[L]=$?(_=(k.x+A.x)/2,m=h[0].y):(_=h[0].x,m=(k.y+A.y)/2)}return[[e,{x:c.x+g.x,y:c.y+g.y},...h,{x:l.x+p.x,y:l.y+p.y},n],_,m,v,b]}function Hh(e,t,n,r){const o=Math.min(ei(e,t)/2,ei(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const l=e.x{let E="";return y>0&&y{const[p,y,E]=ro({sourceX:e,sourceY:t,sourcePosition:d,targetX:n,targetY:r,targetPosition:f,borderRadius:m?.borderRadius,offset:m?.offset});return P.createElement(kt,{path:p,labelX:y,labelY:E,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:l,style:u,markerEnd:h,markerStart:_,interactionWidth:g})});en.displayName="SmoothStepEdge";const Co=T.memo(e=>P.createElement(en,{...e,pathOptions:T.useMemo(()=>({borderRadius:0,offset:e.pathOptions?.offset}),[e.pathOptions?.offset])}));Co.displayName="StepEdge";function Vh({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,a]=Ba({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,a]}const ko=T.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:l,style:u,markerEnd:d,markerStart:f,interactionWidth:h})=>{const[_,m,g]=Vh({sourceX:e,sourceY:t,targetX:n,targetY:r});return P.createElement(kt,{path:_,labelX:m,labelY:g,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:l,style:u,markerEnd:d,markerStart:f,interactionWidth:h})});ko.displayName="StraightEdge";function Mt(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ti({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case X.Left:return[t-Mt(t-r,i),n];case X.Right:return[t+Mt(r-t,i),n];case X.Top:return[t,n-Mt(n-o,i)];case X.Bottom:return[t,n+Mt(o-n,i)]}}function Ya({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:o,targetPosition:i=X.Top,curvature:s=.25}){const[a,c]=ti({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[l,u]=ti({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[d,f,h,_]=Ga({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${a},${c} ${l},${u} ${r},${o}`,d,f,h,_]}const Gt=T.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=X.Bottom,targetPosition:i=X.Top,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:_,pathOptions:m,interactionWidth:g})=>{const[p,y,E]=Ya({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i,curvature:m?.curvature});return P.createElement(kt,{path:p,labelX:y,labelY:E,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:_,interactionWidth:g})});Gt.displayName="BezierEdge";const Ro=T.createContext(null),Bh=Ro.Provider;Ro.Consumer;const Gh=()=>T.useContext(Ro),Uh=e=>"id"in e&&"source"in e&&"target"in e,Yh=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,oo=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,Wh=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Zh=(e,t)=>{if(!e.source||!e.target)return t;let n;return Uh(e)?n={...e}:n={...e,id:Yh(e)},Wh(n,t)?t:t.concat(n)},io=({x:e,y:t},[n,r,o],i,[s,a])=>{const c={x:(e-n)/o,y:(t-r)/o};return i?{x:s*Math.round(c.x/s),y:a*Math.round(c.y/a)}:c},Wa=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),Ge=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],o={x:e.position.x-n,y:e.position.y-r};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:o}},tn=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const{x:i,y:s}=Ge(o,t).positionAbsolute;return Oa(r,xt({x:i,y:s,width:o.width||0,height:o.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Fa(n)},Za=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1,a=[0,0])=>{const c={x:(t.x-n)/o,y:(t.y-r)/o,width:t.width/o,height:t.height/o},l=[];return e.forEach(u=>{const{width:d,height:f,selectable:h=!0,hidden:_=!1}=u;if(s&&!h||_)return!1;const{positionAbsolute:m}=Ge(u,a),g={x:m.x,y:m.y,width:d||0,height:f||0},p=to(c,g),y=typeof d>"u"||typeof f>"u"||d===null||f===null,E=i&&p>0,v=(d||0)*(f||0);(y||E||p>=v||u.dragging)&&l.push(u)}),l},Xa=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},Ka=(e,t,n,r,o,i=.1)=>{const s=t/(e.width*(1+i)),a=n/(e.height*(1+i)),c=Math.min(s,a),l=ct(c,r,o),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,h=n/2-d*l;return{x:f,y:h,zoom:l}},Ve=(e,t=0)=>e.transition().duration(t);function ni(e,t,n,r){return(t[n]||[]).reduce((o,i)=>(`${e.id}-${i.id}-${n}`!==r&&o.push({id:i.id||null,type:n,nodeId:e.id,x:(e.positionAbsolute?.x??0)+i.x+i.width/2,y:(e.positionAbsolute?.y??0)+i.y+i.height/2}),o),[])}function Xh(e,t,n,r,o,i){const{x:s,y:a}=De(e),l=t.elementsFromPoint(s,a).find(_=>_.classList.contains("react-flow__handle"));if(l){const _=l.getAttribute("data-nodeid");if(_){const m=Ao(void 0,l),g=l.getAttribute("data-handleid"),p=i({nodeId:_,id:g,type:m});if(p){const y=o.find(E=>E.nodeId===_&&E.type===m&&E.id===g);return{handle:{id:g,type:m,nodeId:_,x:y?.x||n.x,y:y?.y||n.y},validHandleResult:p}}}}let u=[],d=1/0;if(o.forEach(_=>{const m=Math.sqrt((_.x-n.x)**2+(_.y-n.y)**2);if(m<=r){const g=i(_);m<=d&&(m_.isValid),h=u.some(({handle:_})=>_.type==="target");return u.find(({handle:_,validHandleResult:m})=>h?_.type==="target":f?m.isValid:!0)||u[0]}const Kh={source:null,target:null,sourceHandle:null,targetHandle:null},ja=()=>({handleDomNode:null,isValid:!1,connection:Kh,endHandle:null});function Qa(e,t,n,r,o,i,s){const a=o==="target",c=s.querySelector(`.react-flow__handle[data-id="${e?.nodeId}-${e?.id}-${e?.type}"]`),l={...ja(),handleDomNode:c};if(c){const u=Ao(void 0,c),d=c.getAttribute("data-nodeid"),f=c.getAttribute("data-handleid"),h=c.classList.contains("connectable"),_=c.classList.contains("connectableend"),m={source:a?d:n,sourceHandle:a?f:r,target:a?n:d,targetHandle:a?r:f};l.connection=m,h&&_&&(t===Ye.Strict?a&&u==="source"||!a&&u==="target":d!==n||f!==r)&&(l.endHandle={nodeId:d,handleId:f,type:u},l.isValid=i(m))}return l}function jh({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((o,i)=>{if(i[se]){const{handleBounds:s}=i[se];let a=[],c=[];s&&(a=ni(i,s,"source",`${t}-${n}-${r}`),c=ni(i,s,"target",`${t}-${n}-${r}`)),o.push(...a,...c)}return o},[])}function Ao(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function cn(e){e?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function Qh(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function Ja({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:i,setState:s,isValidConnection:a,edgeUpdaterType:c,onReconnectEnd:l}){const u=$a(e.target),{connectionMode:d,domNode:f,autoPanOnConnect:h,connectionRadius:_,onConnectStart:m,panBy:g,getNodes:p,cancelConnection:y}=i();let E=0,v;const{x:b,y:x}=De(e),C=u?.elementFromPoint(b,x),q=Ao(c,C),k=f?.getBoundingClientRect();if(!k||!q)return;let A,D=De(e,k),$=!1,L=null,w=!1,R=null;const N=jh({nodes:p(),nodeId:n,handleId:t,handleType:q}),O=()=>{if(!h)return;const[F,B]=La(D,k);g({x:F,y:B}),E=requestAnimationFrame(O)};s({connectionPosition:D,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:q,connectionStartHandle:{nodeId:n,handleId:t,type:q},connectionEndHandle:null}),m?.(e,{nodeId:n,handleId:t,handleType:q});function H(F){const{transform:B}=i();D=De(F,k);const{handle:G,validHandleResult:U}=Xh(F,u,io(D,B,!1,[1,1]),_,N,S=>Qa(S,d,n,t,o?"target":"source",a,u));if(v=G,$||(O(),$=!0),R=U.handleDomNode,L=U.connection,w=U.isValid,s({connectionPosition:v&&w?Wa({x:v.x,y:v.y},B):D,connectionStatus:Qh(!!v,w),connectionEndHandle:U.endHandle}),!v&&!w&&!R)return cn(A);L.source!==L.target&&R&&(cn(A),A=R,R.classList.add("connecting","react-flow__handle-connecting"),R.classList.toggle("valid",w),R.classList.toggle("react-flow__handle-valid",w))}function M(F){(v||R)&&L&&w&&r?.(L),i().onConnectEnd?.(F),c&&l?.(F),cn(A),y(),cancelAnimationFrame(E),$=!1,w=!1,L=null,R=null,u.removeEventListener("mousemove",H),u.removeEventListener("mouseup",M),u.removeEventListener("touchmove",H),u.removeEventListener("touchend",M)}u.addEventListener("mousemove",H),u.addEventListener("mouseup",M),u.addEventListener("touchmove",H),u.addEventListener("touchend",M)}const ri=()=>!0,Jh=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),ep=(e,t,n)=>r=>{const{connectionStartHandle:o,connectionEndHandle:i,connectionClickStartHandle:s}=r;return{connecting:o?.nodeId===e&&o?.handleId===t&&o?.type===n||i?.nodeId===e&&i?.handleId===t&&i?.type===n,clickConnecting:s?.nodeId===e&&s?.handleId===t&&s?.type===n}},eu=T.forwardRef(({type:e="source",position:t=X.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},h)=>{const _=s||null,m=e==="target",g=ae(),p=Gh(),{connectOnClick:y,noPanClassName:E}=re(Jh,ue),{connecting:v,clickConnecting:b}=re(ep(p,_,e),ue);p||g.getState().onError?.("010",Ie.error010());const x=k=>{const{defaultEdgeOptions:A,onConnect:D,hasDefaultEdges:$}=g.getState(),L={...A,...k};if($){const{edges:w,setEdges:R}=g.getState();R(Zh(L,w))}D?.(L),a?.(L)},C=k=>{if(!p)return;const A=Va(k);o&&(A&&k.button===0||!A)&&Ja({event:k,handleId:_,nodeId:p,onConnect:x,isTarget:m,getState:g.getState,setState:g.setState,isValidConnection:n||g.getState().isValidConnection||ri}),A?u?.(k):d?.(k)},q=k=>{const{onClickConnectStart:A,onClickConnectEnd:D,connectionClickStartHandle:$,connectionMode:L,isValidConnection:w}=g.getState();if(!p||!$&&!o)return;if(!$){A?.(k,{nodeId:p,handleId:_,handleType:e}),g.setState({connectionClickStartHandle:{nodeId:p,type:e,handleId:_}});return}const R=$a(k.target),N=n||w||ri,{connection:O,isValid:H}=Qa({nodeId:p,id:_,type:e},L,$.nodeId,$.handleId||null,$.type,N,R);H&&x(O),D?.(k),g.setState({connectionClickStartHandle:null})};return P.createElement("div",{"data-handleid":_,"data-nodeid":p,"data-handlepos":t,"data-id":`${p}-${_}-${e}`,className:ce(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",E,l,{source:!m,target:m,connectable:r,connectablestart:o,connectableend:i,connecting:b,connectionindicator:r&&(o&&!v||i&&v)}]),onMouseDown:C,onTouchStart:C,onClick:y?q:void 0,ref:h,...f},c)});eu.displayName="Handle";var Ut=T.memo(eu);const tu=({data:e,isConnectable:t,targetPosition:n=X.Top,sourcePosition:r=X.Bottom})=>P.createElement(P.Fragment,null,P.createElement(Ut,{type:"target",position:n,isConnectable:t}),e?.label,P.createElement(Ut,{type:"source",position:r,isConnectable:t}));tu.displayName="DefaultNode";var so=T.memo(tu);const nu=({data:e,isConnectable:t,sourcePosition:n=X.Bottom})=>P.createElement(P.Fragment,null,e?.label,P.createElement(Ut,{type:"source",position:n,isConnectable:t}));nu.displayName="InputNode";var ru=T.memo(nu);const ou=({data:e,isConnectable:t,targetPosition:n=X.Top})=>P.createElement(P.Fragment,null,P.createElement(Ut,{type:"target",position:n,isConnectable:t}),e?.label);ou.displayName="OutputNode";var iu=T.memo(ou);const Mo=()=>null;Mo.displayName="GroupNode";const tp=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected).map(t=>({...t}))}),It=e=>e.id;function np(e,t){return ue(e.selectedNodes.map(It),t.selectedNodes.map(It))&&ue(e.selectedEdges.map(It),t.selectedEdges.map(It))}const su=T.memo(({onSelectionChange:e})=>{const t=ae(),{selectedNodes:n,selectedEdges:r}=re(tp,np);return T.useEffect(()=>{const o={nodes:n,edges:r};e?.(o),t.getState().onSelectionChange.forEach(i=>i(o))},[n,r,e]),null});su.displayName="SelectionListener";const rp=e=>!!e.onSelectionChange;function op({onSelectionChange:e}){const t=re(rp);return e||t?P.createElement(su,{onSelectionChange:e}):null}const ip=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function et(e,t){T.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function j(e,t,n){T.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const sp=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:o,onConnectStart:i,onConnectEnd:s,onClickConnectStart:a,onClickConnectEnd:c,nodesDraggable:l,nodesConnectable:u,nodesFocusable:d,edgesFocusable:f,edgesUpdatable:h,elevateNodesOnSelect:_,minZoom:m,maxZoom:g,nodeExtent:p,onNodesChange:y,onEdgesChange:E,elementsSelectable:v,connectionMode:b,snapGrid:x,snapToGrid:C,translateExtent:q,connectOnClick:k,defaultEdgeOptions:A,fitView:D,fitViewOptions:$,onNodesDelete:L,onEdgesDelete:w,onNodeDrag:R,onNodeDragStart:N,onNodeDragStop:O,onSelectionDrag:H,onSelectionDragStart:M,onSelectionDragStop:F,noPanClassName:B,nodeOrigin:G,rfId:U,autoPanOnConnect:S,autoPanOnNodeDrag:I,onError:z,connectionRadius:V,isValidConnection:Y,nodeDragThreshold:W})=>{const{setNodes:K,setEdges:ee,setDefaultNodesAndEdges:ie,setMinZoom:te,setMaxZoom:Q,setTranslateExtent:ne,setNodeExtent:le,reset:J}=re(ip,ue),Z=ae();return T.useEffect(()=>{const fe=r?.map(Ne=>({...Ne,...A}));return ie(n,fe),()=>{J()}},[]),j("defaultEdgeOptions",A,Z.setState),j("connectionMode",b,Z.setState),j("onConnect",o,Z.setState),j("onConnectStart",i,Z.setState),j("onConnectEnd",s,Z.setState),j("onClickConnectStart",a,Z.setState),j("onClickConnectEnd",c,Z.setState),j("nodesDraggable",l,Z.setState),j("nodesConnectable",u,Z.setState),j("nodesFocusable",d,Z.setState),j("edgesFocusable",f,Z.setState),j("edgesUpdatable",h,Z.setState),j("elementsSelectable",v,Z.setState),j("elevateNodesOnSelect",_,Z.setState),j("snapToGrid",C,Z.setState),j("snapGrid",x,Z.setState),j("onNodesChange",y,Z.setState),j("onEdgesChange",E,Z.setState),j("connectOnClick",k,Z.setState),j("fitViewOnInit",D,Z.setState),j("fitViewOnInitOptions",$,Z.setState),j("onNodesDelete",L,Z.setState),j("onEdgesDelete",w,Z.setState),j("onNodeDrag",R,Z.setState),j("onNodeDragStart",N,Z.setState),j("onNodeDragStop",O,Z.setState),j("onSelectionDrag",H,Z.setState),j("onSelectionDragStart",M,Z.setState),j("onSelectionDragStop",F,Z.setState),j("noPanClassName",B,Z.setState),j("nodeOrigin",G,Z.setState),j("rfId",U,Z.setState),j("autoPanOnConnect",S,Z.setState),j("autoPanOnNodeDrag",I,Z.setState),j("onError",z,Z.setState),j("connectionRadius",V,Z.setState),j("isValidConnection",Y,Z.setState),j("nodeDragThreshold",W,Z.setState),et(e,K),et(t,ee),et(m,te),et(g,Q),et(q,ne),et(p,le),null},oi={display:"none"},ap={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},au="react-flow__node-desc",uu="react-flow__edge-desc",up="react-flow__aria-live",cp=e=>e.ariaLiveMessage;function lp({rfId:e}){const t=re(cp);return P.createElement("div",{id:`${up}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:ap},t)}function dp({rfId:e,disableKeyboardA11y:t}){return P.createElement(P.Fragment,null,P.createElement("div",{id:`${au}-${e}`,style:oi},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),P.createElement("div",{id:`${uu}-${e}`,style:oi},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&P.createElement(lp,{rfId:e}))}var Nt=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=T.useState(!1),o=T.useRef(!1),i=T.useRef(new Set([])),[s,a]=T.useMemo(()=>{if(e!==null){const l=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.split("+")),u=l.reduce((d,f)=>d.concat(...f),[]);return[l,u]}return[[],[]]},[e]);return T.useEffect(()=>{const c=typeof document<"u"?document:null,l=t?.target||c;if(e!==null){const u=h=>{if(o.current=h.ctrlKey||h.metaKey||h.shiftKey,(!o.current||o.current&&!t.actInsideInputWithModifier)&&no(h))return!1;const m=si(h.code,a);i.current.add(h[m]),ii(s,i.current,!1)&&(h.preventDefault(),r(!0))},d=h=>{if((!o.current||o.current&&!t.actInsideInputWithModifier)&&no(h))return!1;const m=si(h.code,a);ii(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(h[m]),h.key==="Meta"&&i.current.clear(),o.current=!1},f=()=>{i.current.clear(),r(!1)};return l?.addEventListener("keydown",u),l?.addEventListener("keyup",d),window.addEventListener("blur",f),()=>{l?.removeEventListener("keydown",u),l?.removeEventListener("keyup",d),window.removeEventListener("blur",f)}}},[e,r]),n};function ii(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function si(e,t){return t.includes(e)?"code":"key"}function cu(e,t,n,r){const o=e.parentNode||e.parentId;if(!o)return n;const i=t.get(o),s=Ge(i,r);return cu(i,t,{x:(n.x??0)+s.x,y:(n.y??0)+s.y,z:(i[se]?.z??0)>(n.z??0)?i[se]?.z??0:n.z??0},r)}function lu(e,t,n){e.forEach(r=>{const o=r.parentNode||r.parentId;if(o&&!e.has(o))throw new Error(`Parent node ${o} not found`);if(o||n?.[r.id]){const{x:i,y:s,z:a}=cu(r,e,{...r.position,z:r[se]?.z??0},t);r.positionAbsolute={x:i,y:s},r[se].z=a,n?.[r.id]&&(r[se].isParent=!0)}})}function ln(e,t,n,r){const o=new Map,i={},s=r?1e3:0;return e.forEach(a=>{const c=(me(a.zIndex)?a.zIndex:0)+(a.selected?s:0),l=t.get(a.id),u={...a,positionAbsolute:{x:a.position.x,y:a.position.y}},d=a.parentNode||a.parentId;d&&(i[d]=!0);const f=l?.type&&l?.type!==a.type;Object.defineProperty(u,se,{enumerable:!1,value:{handleBounds:f?void 0:l?.[se]?.handleBounds,z:c}}),o.set(a.id,u)}),lu(o,n,i),o}function du(e,t={}){const{getNodes:n,width:r,height:o,minZoom:i,maxZoom:s,d3Zoom:a,d3Selection:c,fitViewOnInitDone:l,fitViewOnInit:u,nodeOrigin:d}=e(),f=t.initial&&!l&&u;if(a&&c&&(f||!t.initial)){const _=n().filter(g=>{const p=t.includeHiddenNodes?g.width&&g.height:!g.hidden;return t.nodes?.length?p&&t.nodes.some(y=>y.id===g.id):p}),m=_.every(g=>g.width&&g.height);if(_.length>0&&m){const g=tn(_,d),{x:p,y,zoom:E}=Ka(g,r,o,t.minZoom??i,t.maxZoom??s,t.padding??.1),v=Ae.translate(p,y).scale(E);return typeof t.duration=="number"&&t.duration>0?a.transform(Ve(c,t.duration),v):a.transform(c,v),!0}}return!1}function fp(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[se]:r[se],selected:n.selected})}),new Map(t)}function hp(e,t){return t.map(n=>{const r=e.find(o=>o.id===n.id);return r&&(n.selected=r.selected),n})}function qt({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:o,edges:i,onNodesChange:s,onEdgesChange:a,hasDefaultNodes:c,hasDefaultEdges:l}=n();e?.length&&(c&&r({nodeInternals:fp(e,o)}),s?.(e)),t?.length&&(l&&r({edges:hp(t,i)}),a?.(t))}const tt=()=>{},pp={zoomIn:tt,zoomOut:tt,zoomTo:tt,getZoom:()=>1,setViewport:tt,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:tt,fitBounds:tt,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},gp=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),mp=()=>{const e=ae(),{d3Zoom:t,d3Selection:n}=re(gp,ue);return T.useMemo(()=>n&&t?{zoomIn:o=>t.scaleBy(Ve(n,o?.duration),1.2),zoomOut:o=>t.scaleBy(Ve(n,o?.duration),1/1.2),zoomTo:(o,i)=>t.scaleTo(Ve(n,i?.duration),o),getZoom:()=>e.getState().transform[2],setViewport:(o,i)=>{const[s,a,c]=e.getState().transform,l=Ae.translate(o.x??s,o.y??a).scale(o.zoom??c);t.transform(Ve(n,i?.duration),l)},getViewport:()=>{const[o,i,s]=e.getState().transform;return{x:o,y:i,zoom:s}},fitView:o=>du(e.getState,o),setCenter:(o,i,s)=>{const{width:a,height:c,maxZoom:l}=e.getState(),u=typeof s?.zoom<"u"?s.zoom:l,d=a/2-o*u,f=c/2-i*u,h=Ae.translate(d,f).scale(u);t.transform(Ve(n,s?.duration),h)},fitBounds:(o,i)=>{const{width:s,height:a,minZoom:c,maxZoom:l}=e.getState(),{x:u,y:d,zoom:f}=Ka(o,s,a,c,l,i?.padding??.1),h=Ae.translate(u,d).scale(f);t.transform(Ve(n,i?.duration),h)},project:o=>{const{transform:i,snapToGrid:s,snapGrid:a}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),io(o,i,s,a)},screenToFlowPosition:o=>{const{transform:i,snapToGrid:s,snapGrid:a,domNode:c}=e.getState();if(!c)return o;const{x:l,y:u}=c.getBoundingClientRect(),d={x:o.x-l,y:o.y-u};return io(d,i,s,a)},flowToScreenPosition:o=>{const{transform:i,domNode:s}=e.getState();if(!s)return o;const{x:a,y:c}=s.getBoundingClientRect(),l=Wa(o,i);return{x:l.x+a,y:l.y+c}},viewportInitialized:!0}:pp,[t,n])};function Io(){const e=mp(),t=ae(),n=T.useCallback(()=>t.getState().getNodes().map(m=>({...m})),[]),r=T.useCallback(m=>t.getState().nodeInternals.get(m),[]),o=T.useCallback(()=>{const{edges:m=[]}=t.getState();return m.map(g=>({...g}))},[]),i=T.useCallback(m=>{const{edges:g=[]}=t.getState();return g.find(p=>p.id===m)},[]),s=T.useCallback(m=>{const{getNodes:g,setNodes:p,hasDefaultNodes:y,onNodesChange:E}=t.getState(),v=g(),b=typeof m=="function"?m(v):m;if(y)p(b);else if(E){const x=b.length===0?v.map(C=>({type:"remove",id:C.id})):b.map(C=>({item:C,type:"reset"}));E(x)}},[]),a=T.useCallback(m=>{const{edges:g=[],setEdges:p,hasDefaultEdges:y,onEdgesChange:E}=t.getState(),v=typeof m=="function"?m(g):m;if(y)p(v);else if(E){const b=v.length===0?g.map(x=>({type:"remove",id:x.id})):v.map(x=>({item:x,type:"reset"}));E(b)}},[]),c=T.useCallback(m=>{const g=Array.isArray(m)?m:[m],{getNodes:p,setNodes:y,hasDefaultNodes:E,onNodesChange:v}=t.getState();if(E){const x=[...p(),...g];y(x)}else if(v){const b=g.map(x=>({item:x,type:"add"}));v(b)}},[]),l=T.useCallback(m=>{const g=Array.isArray(m)?m:[m],{edges:p=[],setEdges:y,hasDefaultEdges:E,onEdgesChange:v}=t.getState();if(E)y([...p,...g]);else if(v){const b=g.map(x=>({item:x,type:"add"}));v(b)}},[]),u=T.useCallback(()=>{const{getNodes:m,edges:g=[],transform:p}=t.getState(),[y,E,v]=p;return{nodes:m().map(b=>({...b})),edges:g.map(b=>({...b})),viewport:{x:y,y:E,zoom:v}}},[]),d=T.useCallback(({nodes:m,edges:g})=>{const{nodeInternals:p,getNodes:y,edges:E,hasDefaultNodes:v,hasDefaultEdges:b,onNodesDelete:x,onEdgesDelete:C,onNodesChange:q,onEdgesChange:k}=t.getState(),A=(m||[]).map(R=>R.id),D=(g||[]).map(R=>R.id),$=y().reduce((R,N)=>{const O=N.parentNode||N.parentId,H=!A.includes(N.id)&&O&&R.find(F=>F.id===O);return(typeof N.deletable=="boolean"?N.deletable:!0)&&(A.includes(N.id)||H)&&R.push(N),R},[]),L=E.filter(R=>typeof R.deletable=="boolean"?R.deletable:!0),w=L.filter(R=>D.includes(R.id));if($||w){const R=Xa($,L),N=[...w,...R],O=N.reduce((H,M)=>(H.includes(M.id)||H.push(M.id),H),[]);if((b||v)&&(b&&t.setState({edges:E.filter(H=>!O.includes(H.id))}),v&&($.forEach(H=>{p.delete(H.id)}),t.setState({nodeInternals:new Map(p)}))),O.length>0&&(C?.(N),k&&k(O.map(H=>({id:H,type:"remove"})))),$.length>0&&(x?.($),q)){const H=$.map(M=>({id:M.id,type:"remove"}));q(H)}}},[]),f=T.useCallback(m=>{const g=zh(m),p=g?null:t.getState().nodeInternals.get(m.id);return!g&&!p?[null,null,g]:[g?m:jo(p),p,g]},[]),h=T.useCallback((m,g=!0,p)=>{const[y,E,v]=f(m);return y?(p||t.getState().getNodes()).filter(b=>{if(!v&&(b.id===E.id||!b.positionAbsolute))return!1;const x=jo(b),C=to(x,y);return g&&C>0||C>=y.width*y.height}):[]},[]),_=T.useCallback((m,g,p=!0)=>{const[y]=f(m);if(!y)return!1;const E=to(y,g);return p&&E>0||E>=y.width*y.height},[]);return T.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:o,getEdge:i,setNodes:s,setEdges:a,addNodes:c,addEdges:l,toObject:u,deleteElements:d,getIntersectingNodes:h,isNodeIntersecting:_}),[e,n,r,o,i,s,a,c,l,u,d,h,_])}const vp={actInsideInputWithModifier:!1};var yp=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=ae(),{deleteElements:r}=Io(),o=Nt(e,vp),i=Nt(t);T.useEffect(()=>{if(o){const{edges:s,getNodes:a}=n.getState(),c=a().filter(u=>u.selected),l=s.filter(u=>u.selected);r({nodes:c,edges:l}),n.setState({nodesSelectionActive:!1})}},[o]),T.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])};function wp(e){const t=ae();T.useEffect(()=>{let n;const r=()=>{if(!e.current)return;const o=xo(e.current);(o.height===0||o.width===0)&&t.getState().onError?.("004",Ie.error004()),t.setState({width:o.width||500,height:o.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}const qo={position:"absolute",width:"100%",height:"100%",top:0,left:0},_p=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Tt=e=>({x:e.x,y:e.y,zoom:e.k}),nt=(e,t)=>e.target.closest(`.${t}`),ai=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),ui=e=>{const t=e.ctrlKey&&Vt()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},Ep=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),bp=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:o=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:c=Be.Free,zoomOnDoubleClick:l=!0,elementsSelectable:u,panOnDrag:d=!0,defaultViewport:f,translateExtent:h,minZoom:_,maxZoom:m,zoomActivationKeyCode:g,preventScrolling:p=!0,children:y,noWheelClassName:E,noPanClassName:v})=>{const b=T.useRef(),x=ae(),C=T.useRef(!1),q=T.useRef(!1),k=T.useRef(null),A=T.useRef({x:0,y:0,zoom:0}),{d3Zoom:D,d3Selection:$,d3ZoomHandler:L,userSelectionActive:w}=re(Ep,ue),R=Nt(g),N=T.useRef(0),O=T.useRef(!1),H=T.useRef();return wp(k),T.useEffect(()=>{if(k.current){const M=k.current.getBoundingClientRect(),F=Da().scaleExtent([_,m]).translateExtent(h),B=ge(k.current).call(F),G=Ae.translate(f.x,f.y).scale(ct(f.zoom,_,m)),U=[[0,0],[M.width,M.height]],S=F.constrain()(G,U,h);F.transform(B,S),F.wheelDelta(ui),x.setState({d3Zoom:F,d3Selection:B,d3ZoomHandler:B.on("wheel.zoom"),transform:[S.x,S.y,S.k],domNode:k.current.closest(".react-flow")})}},[]),T.useEffect(()=>{$&&D&&(s&&!R&&!w?$.on("wheel.zoom",M=>{if(nt(M,E))return!1;M.preventDefault(),M.stopImmediatePropagation();const F=$.property("__zoom").k||1;if(M.ctrlKey&&i){const Y=ye(M),W=ui(M),K=F*Math.pow(2,W);D.scaleTo($,K,Y,M);return}const B=M.deltaMode===1?20:1;let G=c===Be.Vertical?0:M.deltaX*B,U=c===Be.Horizontal?0:M.deltaY*B;!Vt()&&M.shiftKey&&c!==Be.Vertical&&(G=M.deltaY*B,U=0),D.translateBy($,-(G/F)*a,-(U/F)*a,{internal:!0});const S=Tt($.property("__zoom")),{onViewportChangeStart:I,onViewportChange:z,onViewportChangeEnd:V}=x.getState();clearTimeout(H.current),O.current||(O.current=!0,t?.(M,S),I?.(S)),O.current&&(e?.(M,S),z?.(S),H.current=setTimeout(()=>{n?.(M,S),V?.(S),O.current=!1},150))},{passive:!1}):typeof L<"u"&&$.on("wheel.zoom",function(M,F){if(!p&&M.type==="wheel"&&!M.ctrlKey||nt(M,E))return null;M.preventDefault(),L.call(this,M,F)},{passive:!1}))},[w,s,c,$,D,L,R,i,p,E,t,e,n]),T.useEffect(()=>{D&&D.on("start",M=>{if(!M.sourceEvent||M.sourceEvent.internal)return null;N.current=M.sourceEvent?.button;const{onViewportChangeStart:F}=x.getState(),B=Tt(M.transform);C.current=!0,A.current=B,M.sourceEvent?.type==="mousedown"&&x.setState({paneDragging:!0}),F?.(B),t?.(M.sourceEvent,B)})},[D,t]),T.useEffect(()=>{D&&(w&&!C.current?D.on("zoom",null):w||D.on("zoom",M=>{const{onViewportChange:F}=x.getState();if(x.setState({transform:[M.transform.x,M.transform.y,M.transform.k]}),q.current=!!(r&&ai(d,N.current??0)),(e||F)&&!M.sourceEvent?.internal){const B=Tt(M.transform);F?.(B),e?.(M.sourceEvent,B)}}))},[w,D,e,d,r]),T.useEffect(()=>{D&&D.on("end",M=>{if(!M.sourceEvent||M.sourceEvent.internal)return null;const{onViewportChangeEnd:F}=x.getState();if(C.current=!1,x.setState({paneDragging:!1}),r&&ai(d,N.current??0)&&!q.current&&r(M.sourceEvent),q.current=!1,(n||F)&&_p(A.current,M.transform)){const B=Tt(M.transform);A.current=B,clearTimeout(b.current),b.current=setTimeout(()=>{F?.(B),n?.(M.sourceEvent,B)},s?150:0)}})},[D,s,d,n,r]),T.useEffect(()=>{D&&D.filter(M=>{const F=R||o,B=i&&M.ctrlKey;if((d===!0||Array.isArray(d)&&d.includes(1))&&M.button===1&&M.type==="mousedown"&&(nt(M,"react-flow__node")||nt(M,"react-flow__edge")))return!0;if(!d&&!F&&!s&&!l&&!i||w||!l&&M.type==="dblclick"||nt(M,E)&&M.type==="wheel"||nt(M,v)&&(M.type!=="wheel"||s&&M.type==="wheel"&&!R)||!i&&M.ctrlKey&&M.type==="wheel"||!F&&!s&&!B&&M.type==="wheel"||!d&&(M.type==="mousedown"||M.type==="touchstart")||Array.isArray(d)&&!d.includes(M.button)&&M.type==="mousedown")return!1;const G=Array.isArray(d)&&d.includes(M.button)||!M.button||M.button<=1;return(!M.ctrlKey||M.type==="wheel")&&G})},[w,D,o,i,s,l,d,u,R]),P.createElement("div",{className:"react-flow__renderer",ref:k,style:qo},y)},xp=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Sp(){const{userSelectionActive:e,userSelectionRect:t}=re(xp,ue);return e&&t?P.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function ci(e,t){const n=t.parentNode||t.parentId,r=e.find(o=>o.id===n);if(r){const o=t.position.x+t.width-r.width,i=t.position.y+t.height-r.height;if(o>0||i>0||t.position.x<0||t.position.y<0){if(r.style={...r.style},r.style.width=r.style.width??r.width,r.style.height=r.style.height??r.height,o>0&&(r.style.width+=o),i>0&&(r.style.height+=i),t.position.x<0){const s=Math.abs(t.position.x);r.position.x=r.position.x-s,r.style.width+=s,t.position.x=0}if(t.position.y<0){const s=Math.abs(t.position.y);r.position.y=r.position.y-s,r.style.height+=s,t.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function fu(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);const n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,o)=>{const i=e.filter(a=>a.id===o.id);if(i.length===0)return r.push(o),r;const s={...o};for(const a of i)if(a)switch(a.type){case"select":{s.selected=a.selected;break}case"position":{typeof a.position<"u"&&(s.position=a.position),typeof a.positionAbsolute<"u"&&(s.positionAbsolute=a.positionAbsolute),typeof a.dragging<"u"&&(s.dragging=a.dragging),s.expandParent&&ci(r,s);break}case"dimensions":{typeof a.dimensions<"u"&&(s.width=a.dimensions.width,s.height=a.dimensions.height),typeof a.updateStyle<"u"&&(s.style={...s.style||{},...a.dimensions}),typeof a.resizing=="boolean"&&(s.resizing=a.resizing),s.expandParent&&ci(r,s);break}case"remove":return r}return r.push(s),r},n)}function hu(e,t){return fu(e,t)}function Np(e,t){return fu(e,t)}const Te=(e,t)=>({id:e,type:"select",selected:t});function ot(e,t){return e.reduce((n,r)=>{const o=t.includes(r.id);return!r.selected&&o?(r.selected=!0,n.push(Te(r.id,!0))):r.selected&&!o&&(r.selected=!1,n.push(Te(r.id,!1))),n},[])}const dn=(e,t)=>n=>{n.target===t.current&&e?.(n)},Cp=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),pu=T.memo(({isSelecting:e,selectionMode:t=St.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:o,onPaneClick:i,onPaneContextMenu:s,onPaneScroll:a,onPaneMouseEnter:c,onPaneMouseMove:l,onPaneMouseLeave:u,children:d})=>{const f=T.useRef(null),h=ae(),_=T.useRef(0),m=T.useRef(0),g=T.useRef(),{userSelectionActive:p,elementsSelectable:y,dragging:E}=re(Cp,ue),v=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),_.current=0,m.current=0},b=L=>{i?.(L),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},x=L=>{if(Array.isArray(n)&&n?.includes(2)){L.preventDefault();return}s?.(L)},C=a?L=>a(L):void 0,q=L=>{const{resetSelectedElements:w,domNode:R}=h.getState();if(g.current=R?.getBoundingClientRect(),!y||!e||L.button!==0||L.target!==f.current||!g.current)return;const{x:N,y:O}=De(L,g.current);w(),h.setState({userSelectionRect:{width:0,height:0,startX:N,startY:O,x:N,y:O}}),r?.(L)},k=L=>{const{userSelectionRect:w,nodeInternals:R,edges:N,transform:O,onNodesChange:H,onEdgesChange:M,nodeOrigin:F,getNodes:B}=h.getState();if(!e||!g.current||!w)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const G=De(L,g.current),U=w.startX??0,S=w.startY??0,I={...w,x:G.xK.id),W=V.map(K=>K.id);if(_.current!==W.length){_.current=W.length;const K=ot(z,W);K.length&&H?.(K)}if(m.current!==Y.length){m.current=Y.length;const K=ot(N,Y);K.length&&M?.(K)}h.setState({userSelectionRect:I})},A=L=>{if(L.button!==0)return;const{userSelectionRect:w}=h.getState();!p&&w&&L.target===f.current&&b?.(L),h.setState({nodesSelectionActive:_.current>0}),v(),o?.(L)},D=L=>{p&&(h.setState({nodesSelectionActive:_.current>0}),o?.(L)),v()},$=y&&(e||p);return P.createElement("div",{className:ce(["react-flow__pane",{dragging:E,selection:e}]),onClick:$?void 0:dn(b,f),onContextMenu:dn(x,f),onWheel:dn(C,f),onMouseEnter:$?void 0:c,onMouseDown:$?q:void 0,onMouseMove:$?k:l,onMouseUp:$?A:void 0,onMouseLeave:$?D:u,ref:f,style:qo},d,P.createElement(Sp,null))});pu.displayName="Pane";function gu(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const r=t.get(n);return r?r.selected?!0:gu(r,t):!1}function li(e,t,n){let r=e;do{if(r?.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function kp(e,t,n,r){return Array.from(e.values()).filter(o=>(o.selected||o.id===r)&&(!o.parentNode||o.parentId||!gu(o,e))&&(o.draggable||t&&typeof o.draggable>"u")).map(o=>({id:o.id,position:o.position||{x:0,y:0},positionAbsolute:o.positionAbsolute||{x:0,y:0},distance:{x:n.x-(o.positionAbsolute?.x??0),y:n.y-(o.positionAbsolute?.y??0)},delta:{x:0,y:0},extent:o.extent,parentNode:o.parentNode||o.parentId,parentId:o.parentNode||o.parentId,width:o.width,height:o.height,expandParent:o.expandParent}))}function Rp(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function mu(e,t,n,r,o=[0,0],i){const s=Rp(e,e.extent||r);let a=s;const c=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(c&&e.width&&e.height){const d=n.get(c),{x:f,y:h}=Ge(d,o).positionAbsolute;a=d&&me(f)&&me(h)&&me(d.width)&&me(d.height)?[[f+e.width*o[0],h+e.height*o[1]],[f+d.width-e.width+e.width*o[0],h+d.height-e.height+e.height*o[1]]]:a}else i?.("005",Ie.error005()),a=s;else if(e.extent&&c&&e.extent!=="parent"){const d=n.get(c),{x:f,y:h}=Ge(d,o).positionAbsolute;a=[[e.extent[0][0]+f,e.extent[0][1]+h],[e.extent[1][0]+f,e.extent[1][1]+h]]}let l={x:0,y:0};if(c){const d=n.get(c);l=Ge(d,o).positionAbsolute}const u=a&&a!=="parent"?So(t,a):t;return{position:{x:u.x-l.x,y:u.y-l.y},positionAbsolute:u}}function fn({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(o=>({...n.get(o.id),position:o.position,positionAbsolute:o.positionAbsolute}));return[e?r.find(o=>o.id===e):r[0],r]}const di=(e,t,n,r)=>{const o=t.querySelectorAll(e);if(!o||!o.length)return null;const i=Array.from(o),s=t.getBoundingClientRect(),a={x:s.width*r[0],y:s.height*r[1]};return i.map(c=>{const l=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),position:c.getAttribute("data-handlepos"),x:(l.left-s.left-a.x)/n,y:(l.top-s.top-a.y)/n,...xo(c)}})};function mt(e,t,n){return n===void 0?n:r=>{const o=t().nodeInternals.get(e);o&&n(r,{...o})}}function ao({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:s,nodeInternals:a,onError:c}=t.getState(),l=a.get(e);if(!l){c?.("012",Ie.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&s)&&(i({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):o([e])}function Ap(){const e=ae();return T.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:o,snapToGrid:i}=e.getState(),s=n.touches?n.touches[0].clientX:n.clientX,a=n.touches?n.touches[0].clientY:n.clientY,c={x:(s-r[0])/r[2],y:(a-r[1])/r[2]};return{xSnapped:i?o[0]*Math.round(c.x/o[0]):c.x,ySnapped:i?o[1]*Math.round(c.y/o[1]):c.y,...c}},[])}function hn(e){return(t,n,r)=>e?.(t,r)}function vu({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,selectNodesOnDrag:s}){const a=ae(),[c,l]=T.useState(!1),u=T.useRef([]),d=T.useRef({x:null,y:null}),f=T.useRef(0),h=T.useRef(null),_=T.useRef({x:0,y:0}),m=T.useRef(null),g=T.useRef(!1),p=T.useRef(!1),y=T.useRef(!1),E=Ap();return T.useEffect(()=>{if(e?.current){const v=ge(e.current),b=({x:q,y:k})=>{const{nodeInternals:A,onNodeDrag:D,onSelectionDrag:$,updateNodePositions:L,nodeExtent:w,snapGrid:R,snapToGrid:N,nodeOrigin:O,onError:H}=a.getState();d.current={x:q,y:k};let M=!1,F={x:0,y:0,x2:0,y2:0};if(u.current.length>1&&w){const G=tn(u.current,O);F=xt(G)}if(u.current=u.current.map(G=>{const U={x:q-G.distance.x,y:k-G.distance.y};N&&(U.x=R[0]*Math.round(U.x/R[0]),U.y=R[1]*Math.round(U.y/R[1]));const S=[[w[0][0],w[0][1]],[w[1][0],w[1][1]]];u.current.length>1&&w&&!G.extent&&(S[0][0]=G.positionAbsolute.x-F.x+w[0][0],S[1][0]=G.positionAbsolute.x+(G.width??0)-F.x2+w[1][0],S[0][1]=G.positionAbsolute.y-F.y+w[0][1],S[1][1]=G.positionAbsolute.y+(G.height??0)-F.y2+w[1][1]);const I=mu(G,U,A,S,O,H);return M=M||G.position.x!==I.position.x||G.position.y!==I.position.y,G.position=I.position,G.positionAbsolute=I.positionAbsolute,G}),!M)return;L(u.current,!0,!0),l(!0);const B=o?D:hn($);if(B&&m.current){const[G,U]=fn({nodeId:o,dragItems:u.current,nodeInternals:A});B(m.current,G,U)}},x=()=>{if(!h.current)return;const[q,k]=La(_.current,h.current);if(q!==0||k!==0){const{transform:A,panBy:D}=a.getState();d.current.x=(d.current.x??0)-q/A[2],d.current.y=(d.current.y??0)-k/A[2],D({x:q,y:k})&&b(d.current)}f.current=requestAnimationFrame(x)},C=q=>{const{nodeInternals:k,multiSelectionActive:A,nodesDraggable:D,unselectNodesAndEdges:$,onNodeDragStart:L,onSelectionDragStart:w}=a.getState();p.current=!0;const R=o?L:hn(w);(!s||!i)&&!A&&o&&(k.get(o)?.selected||$()),o&&i&&s&&ao({id:o,store:a,nodeRef:e});const N=E(q);if(d.current=N,u.current=kp(k,D,N,o),R&&u.current){const[O,H]=fn({nodeId:o,dragItems:u.current,nodeInternals:k});R(q.sourceEvent,O,H)}};if(t)v.on(".drag",null);else{const q=ff().on("start",k=>{const{domNode:A,nodeDragThreshold:D}=a.getState();D===0&&C(k),y.current=!1;const $=E(k);d.current=$,h.current=A?.getBoundingClientRect()||null,_.current=De(k.sourceEvent,h.current)}).on("drag",k=>{const A=E(k),{autoPanOnNodeDrag:D,nodeDragThreshold:$}=a.getState();if(k.sourceEvent.type==="touchmove"&&k.sourceEvent.touches.length>1&&(y.current=!0),!y.current){if(!g.current&&p.current&&D&&(g.current=!0,x()),!p.current){const L=A.xSnapped-(d?.current?.x??0),w=A.ySnapped-(d?.current?.y??0);Math.sqrt(L*L+w*w)>$&&C(k)}(d.current.x!==A.xSnapped||d.current.y!==A.ySnapped)&&u.current&&p.current&&(m.current=k.sourceEvent,_.current=De(k.sourceEvent,h.current),b(A))}}).on("end",k=>{if(!(!p.current||y.current)&&(l(!1),g.current=!1,p.current=!1,cancelAnimationFrame(f.current),u.current)){const{updateNodePositions:A,nodeInternals:D,onNodeDragStop:$,onSelectionDragStop:L}=a.getState(),w=o?$:hn(L);if(A(u.current,!1,!1),w){const[R,N]=fn({nodeId:o,dragItems:u.current,nodeInternals:D});w(k.sourceEvent,R,N)}}}).filter(k=>{const A=k.target;return!k.button&&(!n||!li(A,`.${n}`,e))&&(!r||li(A,r,e))});return v.call(q),()=>{v.on(".drag",null)}}}},[e,t,n,r,i,a,o,s,E]),c}function yu(){const e=ae();return T.useCallback(n=>{const{nodeInternals:r,nodeExtent:o,updateNodePositions:i,getNodes:s,snapToGrid:a,snapGrid:c,onError:l,nodesDraggable:u}=e.getState(),d=s().filter(y=>y.selected&&(y.draggable||u&&typeof y.draggable>"u")),f=a?c[0]:5,h=a?c[1]:5,_=n.isShiftPressed?4:1,m=n.x*f*_,g=n.y*h*_,p=d.map(y=>{if(y.positionAbsolute){const E={x:y.positionAbsolute.x+m,y:y.positionAbsolute.y+g};a&&(E.x=c[0]*Math.round(E.x/c[0]),E.y=c[1]*Math.round(E.y/c[1]));const{positionAbsolute:v,position:b}=mu(y,E,r,o,void 0,l);y.position=b,y.positionAbsolute=v}return y});i(p,!0,!1)},[])}const st={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var vt=e=>{const t=({id:n,type:r,data:o,xPos:i,yPos:s,xPosOrigin:a,yPosOrigin:c,selected:l,onClick:u,onMouseEnter:d,onMouseMove:f,onMouseLeave:h,onContextMenu:_,onDoubleClick:m,style:g,className:p,isDraggable:y,isSelectable:E,isConnectable:v,isFocusable:b,selectNodesOnDrag:x,sourcePosition:C,targetPosition:q,hidden:k,resizeObserver:A,dragHandle:D,zIndex:$,isParent:L,noDragClassName:w,noPanClassName:R,initialized:N,disableKeyboardA11y:O,ariaLabel:H,rfId:M,hasHandleBounds:F})=>{const B=ae(),G=T.useRef(null),U=T.useRef(null),S=T.useRef(C),I=T.useRef(q),z=T.useRef(r),V=E||y||u||d||f||h,Y=yu(),W=mt(n,B.getState,d),K=mt(n,B.getState,f),ee=mt(n,B.getState,h),ie=mt(n,B.getState,_),te=mt(n,B.getState,m),Q=J=>{const{nodeDragThreshold:Z}=B.getState();if(E&&(!x||!y||Z>0)&&ao({id:n,store:B,nodeRef:G}),u){const fe=B.getState().nodeInternals.get(n);fe&&u(J,{...fe})}},ne=J=>{if(!no(J)&&!O)if(Ha.includes(J.key)&&E){const Z=J.key==="Escape";ao({id:n,store:B,unselect:Z,nodeRef:G})}else y&&l&&Object.prototype.hasOwnProperty.call(st,J.key)&&(B.setState({ariaLiveMessage:`Moved selected node ${J.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~s}`}),Y({x:st[J.key].x,y:st[J.key].y,isShiftPressed:J.shiftKey}))};T.useEffect(()=>()=>{U.current&&(A?.unobserve(U.current),U.current=null)},[]),T.useEffect(()=>{if(G.current&&!k){const J=G.current;(!N||!F||U.current!==J)&&(U.current&&A?.unobserve(U.current),A?.observe(J),U.current=J)}},[k,N,F]),T.useEffect(()=>{const J=z.current!==r,Z=S.current!==C,fe=I.current!==q;G.current&&(J||Z||fe)&&(J&&(z.current=r),Z&&(S.current=C),fe&&(I.current=q),B.getState().updateNodeDimensions([{id:n,nodeElement:G.current,forceUpdate:!0}]))},[n,r,C,q]);const le=vu({nodeRef:G,disabled:k||!y,noDragClassName:w,handleSelector:D,nodeId:n,isSelectable:E,selectNodesOnDrag:x});return k?null:P.createElement("div",{className:ce(["react-flow__node",`react-flow__node-${r}`,{[R]:y},p,{selected:l,selectable:E,parent:L,dragging:le}]),ref:G,style:{zIndex:$,transform:`translate(${a}px,${c}px)`,pointerEvents:V?"all":"none",visibility:N?"visible":"hidden",...g},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:W,onMouseMove:K,onMouseLeave:ee,onContextMenu:ie,onClick:Q,onDoubleClick:te,onKeyDown:b?ne:void 0,tabIndex:b?0:void 0,role:b?"button":void 0,"aria-describedby":O?void 0:`${au}-${M}`,"aria-label":H},P.createElement(Bh,{value:n},P.createElement(e,{id:n,data:o,type:r,xPos:i,yPos:s,selected:l,isConnectable:v,sourcePosition:C,targetPosition:q,dragging:le,dragHandle:D,zIndex:$})))};return t.displayName="NodeWrapper",T.memo(t)};const Mp=e=>{const t=e.getNodes().filter(n=>n.selected);return{...tn(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function Ip({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ae(),{width:o,height:i,x:s,y:a,transformString:c,userSelectionActive:l}=re(Mp,ue),u=yu(),d=T.useRef(null);if(T.useEffect(()=>{n||d.current?.focus({preventScroll:!0})},[n]),vu({nodeRef:d}),l||!o||!i)return null;const f=e?_=>{const m=r.getState().getNodes().filter(g=>g.selected);e(_,m)}:void 0,h=_=>{Object.prototype.hasOwnProperty.call(st,_.key)&&u({x:st[_.key].x,y:st[_.key].y,isShiftPressed:_.shiftKey})};return P.createElement("div",{className:ce(["react-flow__nodesselection","react-flow__container",t]),style:{transform:c}},P.createElement("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:o,height:i,top:a,left:s}}))}var qp=T.memo(Ip);const Tp=e=>e.nodesSelectionActive,wu=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,deleteKeyCode:a,onMove:c,onMoveStart:l,onMoveEnd:u,selectionKeyCode:d,selectionOnDrag:f,selectionMode:h,onSelectionStart:_,onSelectionEnd:m,multiSelectionKeyCode:g,panActivationKeyCode:p,zoomActivationKeyCode:y,elementsSelectable:E,zoomOnScroll:v,zoomOnPinch:b,panOnScroll:x,panOnScrollSpeed:C,panOnScrollMode:q,zoomOnDoubleClick:k,panOnDrag:A,defaultViewport:D,translateExtent:$,minZoom:L,maxZoom:w,preventScrolling:R,onSelectionContextMenu:N,noWheelClassName:O,noPanClassName:H,disableKeyboardA11y:M})=>{const F=re(Tp),B=Nt(d),G=Nt(p),U=G||A,S=G||x,I=B||f&&U!==!0;return yp({deleteKeyCode:a,multiSelectionKeyCode:g}),P.createElement(bp,{onMove:c,onMoveStart:l,onMoveEnd:u,onPaneContextMenu:i,elementsSelectable:E,zoomOnScroll:v,zoomOnPinch:b,panOnScroll:S,panOnScrollSpeed:C,panOnScrollMode:q,zoomOnDoubleClick:k,panOnDrag:!B&&U,defaultViewport:D,translateExtent:$,minZoom:L,maxZoom:w,zoomActivationKeyCode:y,preventScrolling:R,noWheelClassName:O,noPanClassName:H},P.createElement(pu,{onSelectionStart:_,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:U,isSelecting:!!I,selectionMode:h},e,F&&P.createElement(qp,{onSelectionContextMenu:N,noPanClassName:H,disableKeyboardA11y:M})))};wu.displayName="FlowRenderer";var Pp=T.memo(wu);function Dp(e){return re(T.useCallback(n=>e?Za(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function zp(e){const t={input:vt(e.input||ru),default:vt(e.default||so),output:vt(e.output||iu),group:vt(e.group||Mo)},n={},r=Object.keys(e).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,i)=>(o[i]=vt(e[i]||so),o),n);return{...t,...r}}const Lp=({x:e,y:t,width:n,height:r,origin:o})=>!n||!r?{x:e,y:t}:o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:t}:{x:e-n*o[0],y:t-r*o[1]},$p=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),_u=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,updateNodeDimensions:i,onError:s}=re($p,ue),a=Dp(e.onlyRenderVisibleElements),c=T.useRef(),l=T.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const u=new ResizeObserver(d=>{const f=d.map(h=>({id:h.target.getAttribute("data-id"),nodeElement:h.target,forceUpdate:!0}));i(f)});return c.current=u,u},[]);return T.useEffect(()=>()=>{c?.current?.disconnect()},[]),P.createElement("div",{className:"react-flow__nodes",style:qo},a.map(u=>{let d=u.type||"default";e.nodeTypes[d]||(s?.("003",Ie.error003(d)),d="default");const f=e.nodeTypes[d]||e.nodeTypes.default,h=!!(u.draggable||t&&typeof u.draggable>"u"),_=!!(u.selectable||o&&typeof u.selectable>"u"),m=!!(u.connectable||n&&typeof u.connectable>"u"),g=!!(u.focusable||r&&typeof u.focusable>"u"),p=e.nodeExtent?So(u.positionAbsolute,e.nodeExtent):u.positionAbsolute,y=p?.x??0,E=p?.y??0,v=Lp({x:y,y:E,width:u.width??0,height:u.height??0,origin:e.nodeOrigin});return P.createElement(f,{key:u.id,id:u.id,className:u.className,style:u.style,type:d,data:u.data,sourcePosition:u.sourcePosition||X.Bottom,targetPosition:u.targetPosition||X.Top,hidden:u.hidden,xPos:y,yPos:E,xPosOrigin:v.x,yPosOrigin:v.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!u.selected,isDraggable:h,isSelectable:_,isConnectable:m,isFocusable:g,resizeObserver:l,dragHandle:u.dragHandle,zIndex:u[se]?.z??0,isParent:!!u[se]?.isParent,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!u.width&&!!u.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:u.ariaLabel,hasHandleBounds:!!u[se]?.handleBounds})}))};_u.displayName="NodeRenderer";var Op=T.memo(_u);const Fp=(e,t,n)=>n===X.Left?e-t:n===X.Right?e+t:e,Hp=(e,t,n)=>n===X.Top?e-t:n===X.Bottom?e+t:e,fi="react-flow__edgeupdater",hi=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:a})=>P.createElement("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:ce([fi,`${fi}-${a}`]),cx:Fp(t,r,e),cy:Hp(n,r,e),r,stroke:"transparent",fill:"transparent"}),Vp=()=>!0;var rt=e=>{const t=({id:n,className:r,type:o,data:i,onClick:s,onEdgeDoubleClick:a,selected:c,animated:l,label:u,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:_,labelBgBorderRadius:m,style:g,source:p,target:y,sourceX:E,sourceY:v,targetX:b,targetY:x,sourcePosition:C,targetPosition:q,elementsSelectable:k,hidden:A,sourceHandleId:D,targetHandleId:$,onContextMenu:L,onMouseEnter:w,onMouseMove:R,onMouseLeave:N,reconnectRadius:O,onReconnect:H,onReconnectStart:M,onReconnectEnd:F,markerEnd:B,markerStart:G,rfId:U,ariaLabel:S,isFocusable:I,isReconnectable:z,pathOptions:V,interactionWidth:Y,disableKeyboardA11y:W})=>{const K=T.useRef(null),[ee,ie]=T.useState(!1),[te,Q]=T.useState(!1),ne=ae(),le=T.useMemo(()=>`url('#${oo(G,U)}')`,[G,U]),J=T.useMemo(()=>`url('#${oo(B,U)}')`,[B,U]);if(A)return null;const Z=de=>{const{edges:be,addSelectedEdges:$e,unselectNodesAndEdges:Oe,multiSelectionActive:Je}=ne.getState(),xe=be.find(Fe=>Fe.id===n);xe&&(k&&(ne.setState({nodesSelectionActive:!1}),xe.selected&&Je?(Oe({nodes:[],edges:[xe]}),K.current?.blur()):$e([n])),s&&s(de,xe))},fe=gt(n,ne.getState,a),Ne=gt(n,ne.getState,L),lt=gt(n,ne.getState,w),Ze=gt(n,ne.getState,R),Xe=gt(n,ne.getState,N),Ce=(de,be)=>{if(de.button!==0)return;const{edges:$e,isValidConnection:Oe}=ne.getState(),Je=be?y:p,xe=(be?$:D)||null,Fe=be?"target":"source",nn=Oe||Vp,rn=be,ft=$e.find(He=>He.id===n);Q(!0),M?.(de,ft,Fe);const on=He=>{Q(!1),F?.(He,ft,Fe)};Ja({event:de,handleId:xe,nodeId:Je,onConnect:He=>H?.(ft,He),isTarget:rn,getState:ne.getState,setState:ne.setState,isValidConnection:nn,edgeUpdaterType:Fe,onReconnectEnd:on})},Ke=de=>Ce(de,!0),ze=de=>Ce(de,!1),Le=()=>ie(!0),je=()=>ie(!1),Qe=!k&&!s,dt=de=>{if(!W&&Ha.includes(de.key)&&k){const{unselectNodesAndEdges:be,addSelectedEdges:$e,edges:Oe}=ne.getState();de.key==="Escape"?(K.current?.blur(),be({edges:[Oe.find(xe=>xe.id===n)]})):$e([n])}};return P.createElement("g",{className:ce(["react-flow__edge",`react-flow__edge-${o}`,r,{selected:c,animated:l,inactive:Qe,updating:ee}]),onClick:Z,onDoubleClick:fe,onContextMenu:Ne,onMouseEnter:lt,onMouseMove:Ze,onMouseLeave:Xe,onKeyDown:I?dt:void 0,tabIndex:I?0:void 0,role:I?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":S===null?void 0:S||`Edge from ${p} to ${y}`,"aria-describedby":I?`${uu}-${U}`:void 0,ref:K},!te&&P.createElement(e,{id:n,source:p,target:y,selected:c,animated:l,label:u,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:_,labelBgBorderRadius:m,data:i,style:g,sourceX:E,sourceY:v,targetX:b,targetY:x,sourcePosition:C,targetPosition:q,sourceHandleId:D,targetHandleId:$,markerStart:le,markerEnd:J,pathOptions:V,interactionWidth:Y}),z&&P.createElement(P.Fragment,null,(z==="source"||z===!0)&&P.createElement(hi,{position:C,centerX:E,centerY:v,radius:O,onMouseDown:Ke,onMouseEnter:Le,onMouseOut:je,type:"source"}),(z==="target"||z===!0)&&P.createElement(hi,{position:q,centerX:b,centerY:x,radius:O,onMouseDown:ze,onMouseEnter:Le,onMouseOut:je,type:"target"})))};return t.displayName="EdgeWrapper",T.memo(t)};function Bp(e){const t={default:rt(e.default||Gt),straight:rt(e.bezier||ko),step:rt(e.step||Co),smoothstep:rt(e.step||en),simplebezier:rt(e.simplebezier||No)},n={},r=Object.keys(e).filter(o=>!["default","bezier"].includes(o)).reduce((o,i)=>(o[i]=rt(e[i]||Gt),o),n);return{...t,...r}}function pi(e,t,n=null){const r=(n?.x||0)+t.x,o=(n?.y||0)+t.y,i=n?.width||t.width,s=n?.height||t.height;switch(e){case X.Top:return{x:r+i/2,y:o};case X.Right:return{x:r+i,y:o+s/2};case X.Bottom:return{x:r+i/2,y:o+s};case X.Left:return{x:r,y:o+s/2}}}function gi(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const Gp=(e,t,n,r,o,i)=>{const s=pi(n,e,t),a=pi(i,r,o);return{sourceX:s.x,sourceY:s.y,targetX:a.x,targetY:a.y}};function Up({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:i,width:s,height:a,transform:c}){const l={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+o),y2:Math.max(e.y+r,t.y+i)};l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);const u=xt({x:(0-c[0])/c[2],y:(0-c[1])/c[2],width:s/c[2],height:a/c[2]}),d=Math.max(0,Math.min(u.x2,l.x2)-Math.max(u.x,l.x)),f=Math.max(0,Math.min(u.y2,l.y2)-Math.max(u.y,l.y));return Math.ceil(d*f)>0}function mi(e){const t=e?.[se]?.handleBounds||null,n=t&&e?.width&&e?.height&&typeof e?.positionAbsolute?.x<"u"&&typeof e?.positionAbsolute?.y<"u";return[{x:e?.positionAbsolute?.x||0,y:e?.positionAbsolute?.y||0,width:e?.width||0,height:e?.height||0},t,!!n]}const Yp=[{level:0,isMaxLevel:!0,edges:[]}];function Wp(e,t,n=!1){let r=-1;const o=e.reduce((s,a)=>{const c=me(a.zIndex);let l=c?a.zIndex:0;if(n){const u=t.get(a.target),d=t.get(a.source),f=a.selected||u?.selected||d?.selected,h=Math.max(d?.[se]?.z||0,u?.[se]?.z||0,1e3);l=(c?a.zIndex:0)+(f?h:0)}return s[l]?s[l].push(a):s[l]=[a],r=l>r?l:r,s},{}),i=Object.entries(o).map(([s,a])=>{const c=+s;return{edges:a,level:c,isMaxLevel:c===r}});return i.length===0?Yp:i}function Zp(e,t,n){const r=re(T.useCallback(o=>e?o.edges.filter(i=>{const s=t.get(i.source),a=t.get(i.target);return s?.width&&s?.height&&a?.width&&a?.height&&Up({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:a.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:a.width,targetHeight:a.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[e,t]));return Wp(r,t,n)}const Xp=({color:e="none",strokeWidth:t=1})=>P.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),Kp=({color:e="none",strokeWidth:t=1})=>P.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),vi={[Bt.Arrow]:Xp,[Bt.ArrowClosed]:Kp};function jp(e){const t=ae();return T.useMemo(()=>Object.prototype.hasOwnProperty.call(vi,e)?vi[e]:(t.getState().onError?.("009",Ie.error009(e)),null),[e])}const Qp=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const c=jp(t);return c?P.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0"},P.createElement(c,{color:n,strokeWidth:s})):null},Jp=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((o,i)=>([i.markerStart,i.markerEnd].forEach(s=>{if(s&&typeof s=="object"){const a=oo(s,t);r.includes(a)||(o.push({id:a,color:s.color||e,...s}),r.push(a))}}),o),[]).sort((o,i)=>o.id.localeCompare(i.id))},Eu=({defaultColor:e,rfId:t})=>{const n=re(T.useCallback(Jp({defaultColor:e,rfId:t}),[e,t]),(r,o)=>!(r.length!==o.length||r.some((i,s)=>i.id!==o[s].id)));return P.createElement("defs",null,n.map(r=>P.createElement(Qp,{id:r.id,key:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient})))};Eu.displayName="MarkerDefinitions";var eg=T.memo(Eu);const tg=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),bu=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:o,noPanClassName:i,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,onEdgeDoubleClick:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:_,reconnectRadius:m,children:g,disableKeyboardA11y:p})=>{const{edgesFocusable:y,edgesUpdatable:E,elementsSelectable:v,width:b,height:x,connectionMode:C,nodeInternals:q,onError:k}=re(tg,ue),A=Zp(t,q,n);return b?P.createElement(P.Fragment,null,A.map(({level:D,edges:$,isMaxLevel:L})=>P.createElement("svg",{key:D,style:{zIndex:D},width:b,height:x,className:"react-flow__edges react-flow__container"},L&&P.createElement(eg,{defaultColor:e,rfId:r}),P.createElement("g",null,$.map(w=>{const[R,N,O]=mi(q.get(w.source)),[H,M,F]=mi(q.get(w.target));if(!O||!F)return null;let B=w.type||"default";o[B]||(k?.("011",Ie.error011(B)),B="default");const G=o[B]||o.default,U=C===Ye.Strict?M.target:(M.target??[]).concat(M.source??[]),S=gi(N.source,w.sourceHandle),I=gi(U,w.targetHandle),z=S?.position||X.Bottom,V=I?.position||X.Top,Y=!!(w.focusable||y&&typeof w.focusable>"u"),W=w.reconnectable||w.updatable,K=typeof f<"u"&&(W||E&&typeof W>"u");if(!S||!I)return k?.("008",Ie.error008(S,w)),null;const{sourceX:ee,sourceY:ie,targetX:te,targetY:Q}=Gp(R,S,z,H,I,V);return P.createElement(G,{key:w.id,id:w.id,className:ce([w.className,i]),type:B,data:w.data,selected:!!w.selected,animated:!!w.animated,hidden:!!w.hidden,label:w.label,labelStyle:w.labelStyle,labelShowBg:w.labelShowBg,labelBgStyle:w.labelBgStyle,labelBgPadding:w.labelBgPadding,labelBgBorderRadius:w.labelBgBorderRadius,style:w.style,source:w.source,target:w.target,sourceHandleId:w.sourceHandle,targetHandleId:w.targetHandle,markerEnd:w.markerEnd,markerStart:w.markerStart,sourceX:ee,sourceY:ie,targetX:te,targetY:Q,sourcePosition:z,targetPosition:V,elementsSelectable:v,onContextMenu:s,onMouseEnter:a,onMouseMove:c,onMouseLeave:l,onClick:u,onEdgeDoubleClick:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:_,reconnectRadius:m,rfId:r,ariaLabel:w.ariaLabel,isFocusable:Y,isReconnectable:K,pathOptions:"pathOptions"in w?w.pathOptions:void 0,interactionWidth:w.interactionWidth,disableKeyboardA11y:p})})))),g):null};bu.displayName="EdgeRenderer";var ng=T.memo(bu);const rg=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function og({children:e}){const t=re(rg);return P.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function ig(e){const t=Io(),n=T.useRef(!1);T.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const sg={[X.Left]:X.Right,[X.Right]:X.Left,[X.Top]:X.Bottom,[X.Bottom]:X.Top},xu=({nodeId:e,handleType:t,style:n,type:r=Pe.Bezier,CustomComponent:o,connectionStatus:i})=>{const{fromNode:s,handleId:a,toX:c,toY:l,connectionMode:u}=re(T.useCallback(x=>({fromNode:x.nodeInternals.get(e),handleId:x.connectionHandleId,toX:(x.connectionPosition.x-x.transform[0])/x.transform[2],toY:(x.connectionPosition.y-x.transform[1])/x.transform[2],connectionMode:x.connectionMode}),[e]),ue),d=s?.[se]?.handleBounds;let f=d?.[t];if(u===Ye.Loose&&(f=f||d?.[t==="source"?"target":"source"]),!s||!f)return null;const h=a?f.find(x=>x.id===a):f[0],_=h?h.x+h.width/2:(s.width??0)/2,m=h?h.y+h.height/2:s.height??0,g=(s.positionAbsolute?.x??0)+_,p=(s.positionAbsolute?.y??0)+m,y=h?.position,E=y?sg[y]:null;if(!y||!E)return null;if(o)return P.createElement(o,{connectionLineType:r,connectionLineStyle:n,fromNode:s,fromHandle:h,fromX:g,fromY:p,toX:c,toY:l,fromPosition:y,toPosition:E,connectionStatus:i});let v="";const b={sourceX:g,sourceY:p,sourcePosition:y,targetX:c,targetY:l,targetPosition:E};return r===Pe.Bezier?[v]=Ya(b):r===Pe.Step?[v]=ro({...b,borderRadius:0}):r===Pe.SmoothStep?[v]=ro(b):r===Pe.SimpleBezier?[v]=Ua(b):v=`M${g},${p} ${c},${l}`,P.createElement("path",{d:v,fill:"none",className:"react-flow__connection-path",style:n})};xu.displayName="ConnectionLine";const ag=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function ug({containerStyle:e,style:t,type:n,component:r}){const{nodeId:o,handleType:i,nodesConnectable:s,width:a,height:c,connectionStatus:l}=re(ag,ue);return!(o&&i&&a&&s)?null:P.createElement("svg",{style:e,width:a,height:c,className:"react-flow__edges react-flow__connectionline react-flow__container"},P.createElement("g",{className:ce(["react-flow__connection",l])},P.createElement(xu,{nodeId:o,handleType:i,style:t,type:n,CustomComponent:r,connectionStatus:l})))}function yi(e,t){return T.useRef(null),ae(),T.useMemo(()=>t(e),[e])}const Su=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:o,onInit:i,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:c,onEdgeDoubleClick:l,onNodeMouseEnter:u,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,onSelectionContextMenu:_,onSelectionStart:m,onSelectionEnd:g,connectionLineType:p,connectionLineStyle:y,connectionLineComponent:E,connectionLineContainerStyle:v,selectionKeyCode:b,selectionOnDrag:x,selectionMode:C,multiSelectionKeyCode:q,panActivationKeyCode:k,zoomActivationKeyCode:A,deleteKeyCode:D,onlyRenderVisibleElements:$,elementsSelectable:L,selectNodesOnDrag:w,defaultViewport:R,translateExtent:N,minZoom:O,maxZoom:H,preventScrolling:M,defaultMarkerColor:F,zoomOnScroll:B,zoomOnPinch:G,panOnScroll:U,panOnScrollSpeed:S,panOnScrollMode:I,zoomOnDoubleClick:z,panOnDrag:V,onPaneClick:Y,onPaneMouseEnter:W,onPaneMouseMove:K,onPaneMouseLeave:ee,onPaneScroll:ie,onPaneContextMenu:te,onEdgeContextMenu:Q,onEdgeMouseEnter:ne,onEdgeMouseMove:le,onEdgeMouseLeave:J,onReconnect:Z,onReconnectStart:fe,onReconnectEnd:Ne,reconnectRadius:lt,noDragClassName:Ze,noWheelClassName:Xe,noPanClassName:Ce,elevateEdgesOnSelect:Ke,disableKeyboardA11y:ze,nodeOrigin:Le,nodeExtent:je,rfId:Qe})=>{const dt=yi(e,zp),de=yi(t,Bp);return ig(i),P.createElement(Pp,{onPaneClick:Y,onPaneMouseEnter:W,onPaneMouseMove:K,onPaneMouseLeave:ee,onPaneContextMenu:te,onPaneScroll:ie,deleteKeyCode:D,selectionKeyCode:b,selectionOnDrag:x,selectionMode:C,onSelectionStart:m,onSelectionEnd:g,multiSelectionKeyCode:q,panActivationKeyCode:k,zoomActivationKeyCode:A,elementsSelectable:L,onMove:n,onMoveStart:r,onMoveEnd:o,zoomOnScroll:B,zoomOnPinch:G,zoomOnDoubleClick:z,panOnScroll:U,panOnScrollSpeed:S,panOnScrollMode:I,panOnDrag:V,defaultViewport:R,translateExtent:N,minZoom:O,maxZoom:H,onSelectionContextMenu:_,preventScrolling:M,noDragClassName:Ze,noWheelClassName:Xe,noPanClassName:Ce,disableKeyboardA11y:ze},P.createElement(og,null,P.createElement(ng,{edgeTypes:de,onEdgeClick:a,onEdgeDoubleClick:l,onlyRenderVisibleElements:$,onEdgeContextMenu:Q,onEdgeMouseEnter:ne,onEdgeMouseMove:le,onEdgeMouseLeave:J,onReconnect:Z,onReconnectStart:fe,onReconnectEnd:Ne,reconnectRadius:lt,defaultMarkerColor:F,noPanClassName:Ce,elevateEdgesOnSelect:!!Ke,disableKeyboardA11y:ze,rfId:Qe},P.createElement(ug,{style:y,type:p,component:E,containerStyle:v})),P.createElement("div",{className:"react-flow__edgelabel-renderer"}),P.createElement(Op,{nodeTypes:dt,onNodeClick:s,onNodeDoubleClick:c,onNodeMouseEnter:u,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,selectNodesOnDrag:w,onlyRenderVisibleElements:$,noPanClassName:Ce,noDragClassName:Ze,disableKeyboardA11y:ze,nodeOrigin:Le,nodeExtent:je,rfId:Qe})))};Su.displayName="GraphView";var cg=T.memo(Su);const uo=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],qe={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:uo,nodeExtent:uo,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Ye.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:Lh,isValidConnection:void 0},lg=()=>xl((e,t)=>({...qe,setNodes:n=>{const{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:i}=t();e({nodeInternals:ln(n,r,o,i)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(o=>({...r,...o}))})},setDefaultNodesAndEdges:(n,r)=>{const o=typeof n<"u",i=typeof r<"u",s=o?ln(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:s,edges:i?r:[],hasDefaultNodes:o,hasDefaultEdges:i})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:o,fitViewOnInit:i,fitViewOnInitDone:s,fitViewOnInitOptions:a,domNode:c,nodeOrigin:l}=t(),u=c?.querySelector(".react-flow__viewport");if(!u)return;const d=window.getComputedStyle(u),{m22:f}=new window.DOMMatrixReadOnly(d.transform),h=n.reduce((m,g)=>{const p=o.get(g.id);if(p?.hidden)o.set(p.id,{...p,[se]:{...p[se],handleBounds:void 0}});else if(p){const y=xo(g.nodeElement);!!(y.width&&y.height&&(p.width!==y.width||p.height!==y.height||g.forceUpdate))&&(o.set(p.id,{...p,[se]:{...p[se],handleBounds:{source:di(".source",g.nodeElement,f,l),target:di(".target",g.nodeElement,f,l)}},...y}),m.push({id:p.id,type:"dimensions",dimensions:y}))}return m},[]);lu(o,l);const _=s||i&&!s&&du(t,{initial:!0,...a});e({nodeInternals:new Map(o),fitViewOnInitDone:_}),h?.length>0&&r?.(h)},updateNodePositions:(n,r=!0,o=!1)=>{const{triggerNodeChanges:i}=t(),s=n.map(a=>{const c={id:a.id,type:"position",dragging:o};return r&&(c.positionAbsolute=a.positionAbsolute,c.position=a.position),c});i(s)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:o,hasDefaultNodes:i,nodeOrigin:s,getNodes:a,elevateNodesOnSelect:c}=t();if(n?.length){if(i){const l=hu(n,a()),u=ln(l,o,s,c);e({nodeInternals:u})}r?.(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let s,a=null;r?s=n.map(c=>Te(c,!0)):(s=ot(i(),n),a=ot(o,[])),qt({changedNodes:s,changedEdges:a,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let s,a=null;r?s=n.map(c=>Te(c,!0)):(s=ot(o,n),a=ot(i(),[])),qt({changedNodes:a,changedEdges:s,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:o,getNodes:i}=t(),s=n||i(),a=r||o,c=s.map(u=>(u.selected=!1,Te(u.id,!1))),l=a.map(u=>Te(u.id,!1));qt({changedNodes:c,changedEdges:l,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:o}=t();r?.scaleExtent([n,o]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:o}=t();r?.scaleExtent([o,n]),e({maxZoom:n})},setTranslateExtent:n=>{t().d3Zoom?.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),i=r().filter(a=>a.selected).map(a=>Te(a.id,!1)),s=n.filter(a=>a.selected).map(a=>Te(a.id,!1));qt({changedNodes:i,changedEdges:s,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(o=>{o.positionAbsolute=So(o.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:o,height:i,d3Zoom:s,d3Selection:a,translateExtent:c}=t();if(!s||!a||!n.x&&!n.y)return!1;const l=Ae.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),u=[[0,0],[o,i]],d=s?.constrain()(l,u,c);return s.transform(a,d),r[0]!==d.x||r[1]!==d.y||r[2]!==d.k},cancelConnection:()=>e({connectionNodeId:qe.connectionNodeId,connectionHandleId:qe.connectionHandleId,connectionHandleType:qe.connectionHandleType,connectionStatus:qe.connectionStatus,connectionStartHandle:qe.connectionStartHandle,connectionEndHandle:qe.connectionEndHandle}),reset:()=>e({...qe})}),Object.is),Nu=({children:e})=>{const t=T.useRef(null);return t.current||(t.current=lg()),P.createElement(Mh,{value:t.current},e)};Nu.displayName="ReactFlowProvider";const Cu=({children:e})=>T.useContext(Jt)?P.createElement(P.Fragment,null,e):P.createElement(Nu,null,e);Cu.displayName="ReactFlowWrapper";const dg={input:ru,default:so,output:iu,group:Mo},fg={default:Gt,straight:ko,step:Co,smoothstep:en,simplebezier:No},hg=[0,0],pg=[15,15],gg={x:0,y:0,zoom:1},mg={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},vg=T.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i=dg,edgeTypes:s=fg,onNodeClick:a,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:h,onConnectStart:_,onConnectEnd:m,onClickConnectStart:g,onClickConnectEnd:p,onNodeMouseEnter:y,onNodeMouseMove:E,onNodeMouseLeave:v,onNodeContextMenu:b,onNodeDoubleClick:x,onNodeDragStart:C,onNodeDrag:q,onNodeDragStop:k,onNodesDelete:A,onEdgesDelete:D,onSelectionChange:$,onSelectionDragStart:L,onSelectionDrag:w,onSelectionDragStop:R,onSelectionContextMenu:N,onSelectionStart:O,onSelectionEnd:H,connectionMode:M=Ye.Strict,connectionLineType:F=Pe.Bezier,connectionLineStyle:B,connectionLineComponent:G,connectionLineContainerStyle:U,deleteKeyCode:S="Backspace",selectionKeyCode:I="Shift",selectionOnDrag:z=!1,selectionMode:V=St.Full,panActivationKeyCode:Y="Space",multiSelectionKeyCode:W=Vt()?"Meta":"Control",zoomActivationKeyCode:K=Vt()?"Meta":"Control",snapToGrid:ee=!1,snapGrid:ie=pg,onlyRenderVisibleElements:te=!1,selectNodesOnDrag:Q=!0,nodesDraggable:ne,nodesConnectable:le,nodesFocusable:J,nodeOrigin:Z=hg,edgesFocusable:fe,edgesUpdatable:Ne,elementsSelectable:lt,defaultViewport:Ze=gg,minZoom:Xe=.5,maxZoom:Ce=2,translateExtent:Ke=uo,preventScrolling:ze=!0,nodeExtent:Le,defaultMarkerColor:je="#b1b1b7",zoomOnScroll:Qe=!0,zoomOnPinch:dt=!0,panOnScroll:de=!1,panOnScrollSpeed:be=.5,panOnScrollMode:$e=Be.Free,zoomOnDoubleClick:Oe=!0,panOnDrag:Je=!0,onPaneClick:xe,onPaneMouseEnter:Fe,onPaneMouseMove:nn,onPaneMouseLeave:rn,onPaneScroll:ft,onPaneContextMenu:on,children:Do,onEdgeContextMenu:He,onEdgeDoubleClick:Xu,onEdgeMouseEnter:Ku,onEdgeMouseMove:ju,onEdgeMouseLeave:Qu,onEdgeUpdate:Ju,onEdgeUpdateStart:ec,onEdgeUpdateEnd:tc,onReconnect:nc,onReconnectStart:rc,onReconnectEnd:oc,reconnectRadius:ic=10,edgeUpdaterRadius:sc=10,onNodesChange:ac,onEdgesChange:uc,noDragClassName:cc="nodrag",noWheelClassName:lc="nowheel",noPanClassName:zo="nopan",fitView:dc=!1,fitViewOptions:fc,connectOnClick:hc=!0,attributionPosition:pc,proOptions:gc,defaultEdgeOptions:mc,elevateNodesOnSelect:vc=!0,elevateEdgesOnSelect:yc=!1,disableKeyboardA11y:Lo=!1,autoPanOnConnect:wc=!0,autoPanOnNodeDrag:_c=!0,connectionRadius:Ec=20,isValidConnection:bc,onError:xc,style:Sc,id:$o,nodeDragThreshold:Nc,...Cc},kc)=>{const sn=$o||"1";return P.createElement("div",{...Cc,style:{...Sc,...mg},ref:kc,className:ce(["react-flow",o]),"data-testid":"rf__wrapper",id:$o},P.createElement(Cu,null,P.createElement(cg,{onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onNodeClick:a,onEdgeClick:c,onNodeMouseEnter:y,onNodeMouseMove:E,onNodeMouseLeave:v,onNodeContextMenu:b,onNodeDoubleClick:x,nodeTypes:i,edgeTypes:s,connectionLineType:F,connectionLineStyle:B,connectionLineComponent:G,connectionLineContainerStyle:U,selectionKeyCode:I,selectionOnDrag:z,selectionMode:V,deleteKeyCode:S,multiSelectionKeyCode:W,panActivationKeyCode:Y,zoomActivationKeyCode:K,onlyRenderVisibleElements:te,selectNodesOnDrag:Q,defaultViewport:Ze,translateExtent:Ke,minZoom:Xe,maxZoom:Ce,preventScrolling:ze,zoomOnScroll:Qe,zoomOnPinch:dt,zoomOnDoubleClick:Oe,panOnScroll:de,panOnScrollSpeed:be,panOnScrollMode:$e,panOnDrag:Je,onPaneClick:xe,onPaneMouseEnter:Fe,onPaneMouseMove:nn,onPaneMouseLeave:rn,onPaneScroll:ft,onPaneContextMenu:on,onSelectionContextMenu:N,onSelectionStart:O,onSelectionEnd:H,onEdgeContextMenu:He,onEdgeDoubleClick:Xu,onEdgeMouseEnter:Ku,onEdgeMouseMove:ju,onEdgeMouseLeave:Qu,onReconnect:nc??Ju,onReconnectStart:rc??ec,onReconnectEnd:oc??tc,reconnectRadius:ic??sc,defaultMarkerColor:je,noDragClassName:cc,noWheelClassName:lc,noPanClassName:zo,elevateEdgesOnSelect:yc,rfId:sn,disableKeyboardA11y:Lo,nodeOrigin:Z,nodeExtent:Le}),P.createElement(sp,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:_,onConnectEnd:m,onClickConnectStart:g,onClickConnectEnd:p,nodesDraggable:ne,nodesConnectable:le,nodesFocusable:J,edgesFocusable:fe,edgesUpdatable:Ne,elementsSelectable:lt,elevateNodesOnSelect:vc,minZoom:Xe,maxZoom:Ce,nodeExtent:Le,onNodesChange:ac,onEdgesChange:uc,snapToGrid:ee,snapGrid:ie,connectionMode:M,translateExtent:Ke,connectOnClick:hc,defaultEdgeOptions:mc,fitView:dc,fitViewOptions:fc,onNodesDelete:A,onEdgesDelete:D,onNodeDragStart:C,onNodeDrag:q,onNodeDragStop:k,onSelectionDrag:w,onSelectionDragStart:L,onSelectionDragStop:R,noPanClassName:zo,nodeOrigin:Z,rfId:sn,autoPanOnConnect:wc,autoPanOnNodeDrag:_c,onError:xc,connectionRadius:Ec,isValidConnection:bc,nodeDragThreshold:Nc}),P.createElement(op,{onSelectionChange:$}),Do,P.createElement(qh,{proOptions:gc,position:pc}),P.createElement(dp,{rfId:sn,disableKeyboardA11y:Lo})))});vg.displayName="ReactFlow";function ku(e){return t=>{const[n,r]=T.useState(t),o=T.useCallback(i=>r(s=>e(i,s)),[]);return[n,r,o]}}const jm=ku(hu),Qm=ku(Np),Ru=({id:e,x:t,y:n,width:r,height:o,style:i,color:s,strokeColor:a,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,onClick:f,selected:h})=>{const{background:_,backgroundColor:m}=i||{},g=s||_||m;return P.createElement("rect",{className:ce(["react-flow__minimap-node",{selected:h},l]),x:t,y:n,rx:u,ry:u,width:r,height:o,fill:g,stroke:a,strokeWidth:c,shapeRendering:d,onClick:f?p=>f(p,e):void 0})};Ru.displayName="MiniMapNode";var yg=T.memo(Ru);const wg=e=>e.nodeOrigin,_g=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),pn=e=>e instanceof Function?e:()=>e;function Eg({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o=2,nodeComponent:i=yg,onClick:s}){const a=re(_g,ue),c=re(wg),l=pn(t),u=pn(e),d=pn(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return P.createElement(P.Fragment,null,a.map(h=>{const{x:_,y:m}=Ge(h,c).positionAbsolute;return P.createElement(i,{key:h.id,x:_,y:m,width:h.width,height:h.height,style:h.style,selected:h.selected,className:d(h),color:l(h),borderRadius:r,strokeColor:u(h),strokeWidth:o,shapeRendering:f,onClick:s,id:h.id})}))}var bg=T.memo(Eg);const xg=200,Sg=150,Ng=e=>{const t=e.getNodes(),n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:t.length>0?Dh(tn(t,e.nodeOrigin),n):n,rfId:e.rfId}},Cg="react-flow__minimap-desc";function Au({style:e,className:t,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:s=2,nodeComponent:a,maskColor:c="rgb(240, 240, 240, 0.6)",maskStrokeColor:l="none",maskStrokeWidth:u=1,position:d="bottom-right",onClick:f,onNodeClick:h,pannable:_=!1,zoomable:m=!1,ariaLabel:g="React Flow mini map",inversePan:p=!1,zoomStep:y=10,offsetScale:E=5}){const v=ae(),b=T.useRef(null),{boundingRect:x,viewBB:C,rfId:q}=re(Ng,ue),k=e?.width??xg,A=e?.height??Sg,D=x.width/k,$=x.height/A,L=Math.max(D,$),w=L*k,R=L*A,N=E*L,O=x.x-(w-x.width)/2-N,H=x.y-(R-x.height)/2-N,M=w+N*2,F=R+N*2,B=`${Cg}-${q}`,G=T.useRef(0);G.current=L,T.useEffect(()=>{if(b.current){const I=ge(b.current),z=W=>{const{transform:K,d3Selection:ee,d3Zoom:ie}=v.getState();if(W.sourceEvent.type!=="wheel"||!ee||!ie)return;const te=-W.sourceEvent.deltaY*(W.sourceEvent.deltaMode===1?.05:W.sourceEvent.deltaMode?1:.002)*y,Q=K[2]*Math.pow(2,te);ie.scaleTo(ee,Q)},V=W=>{const{transform:K,d3Selection:ee,d3Zoom:ie,translateExtent:te,width:Q,height:ne}=v.getState();if(W.sourceEvent.type!=="mousemove"||!ee||!ie)return;const le=G.current*Math.max(1,K[2])*(p?-1:1),J={x:K[0]-W.sourceEvent.movementX*le,y:K[1]-W.sourceEvent.movementY*le},Z=[[0,0],[Q,ne]],fe=Ae.translate(J.x,J.y).scale(K[2]),Ne=ie.constrain()(fe,Z,te);ie.transform(ee,Ne)},Y=Da().on("zoom",_?V:null).on("zoom.wheel",m?z:null);return I.call(Y),()=>{I.on("zoom",null)}}},[_,m,p,y]);const U=f?I=>{const z=ye(I);f(I,{x:z[0],y:z[1]})}:void 0,S=h?(I,z)=>{const V=v.getState().nodeInternals.get(z);h(I,V)}:void 0;return P.createElement(bo,{position:d,style:e,className:ce(["react-flow__minimap",t]),"data-testid":"rf__minimap"},P.createElement("svg",{width:k,height:A,viewBox:`${O} ${H} ${M} ${F}`,role:"img","aria-labelledby":B,ref:b,onClick:U},g&&P.createElement("title",{id:B},g),P.createElement(bg,{onClick:S,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:s,nodeComponent:a}),P.createElement("path",{className:"react-flow__minimap-mask",d:`M${O-N},${H-N}h${M+N*2}v${F+N*2}h${-M-N*2}z + M${C.x},${C.y}h${C.width}v${C.height}h${-C.width}z`,fill:c,fillRule:"evenodd",stroke:l,strokeWidth:u,pointerEvents:"none"})))}Au.displayName="MiniMap";var Jm=T.memo(Au);function kg(){return P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},P.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function Rg(){return P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},P.createElement("path",{d:"M0 0h32v4.2H0z"}))}function Ag(){return P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},P.createElement("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"}))}function Mg(){return P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},P.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"}))}function Ig(){return P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},P.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"}))}const _t=({children:e,className:t,...n})=>P.createElement("button",{type:"button",className:ce(["react-flow__controls-button",t]),...n},e);_t.displayName="ControlButton";const qg=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),Mu=({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:a,onInteractiveChange:c,className:l,children:u,position:d="bottom-left"})=>{const f=ae(),[h,_]=T.useState(!1),{isInteractive:m,minZoomReached:g,maxZoomReached:p}=re(qg,ue),{zoomIn:y,zoomOut:E,fitView:v}=Io();if(T.useEffect(()=>{_(!0)},[]),!h)return null;const b=()=>{y(),i?.()},x=()=>{E(),s?.()},C=()=>{v(o),a?.()},q=()=>{f.setState({nodesDraggable:!m,nodesConnectable:!m,elementsSelectable:!m}),c?.(!m)};return P.createElement(bo,{className:ce(["react-flow__controls",l]),position:d,style:e,"data-testid":"rf__controls"},t&&P.createElement(P.Fragment,null,P.createElement(_t,{onClick:b,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:p},P.createElement(kg,null)),P.createElement(_t,{onClick:x,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:g},P.createElement(Rg,null))),n&&P.createElement(_t,{className:"react-flow__controls-fitview",onClick:C,title:"fit view","aria-label":"fit view"},P.createElement(Ag,null)),r&&P.createElement(_t,{className:"react-flow__controls-interactive",onClick:q,title:"toggle interactivity","aria-label":"toggle interactivity"},m?P.createElement(Ig,null):P.createElement(Mg,null)),u)};Mu.displayName="Controls";var ev=T.memo(Mu),we;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(we||(we={}));function Tg({color:e,dimensions:t,lineWidth:n}){return P.createElement("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function Pg({color:e,radius:t}){return P.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const Dg={[we.Dots]:"#91919a",[we.Lines]:"#eee",[we.Cross]:"#e2e2e2"},zg={[we.Dots]:1,[we.Lines]:1,[we.Cross]:6},Lg=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Iu({id:e,variant:t=we.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=2,color:s,style:a,className:c}){const l=T.useRef(null),{transform:u,patternId:d}=re(Lg,ue),f=s||Dg[t],h=r||zg[t],_=t===we.Dots,m=t===we.Cross,g=Array.isArray(n)?n:[n,n],p=[g[0]*u[2]||1,g[1]*u[2]||1],y=h*u[2],E=m?[y,y]:p,v=_?[y/i,y/i]:[E[0]/i,E[1]/i];return P.createElement("svg",{className:ce(["react-flow__background",c]),style:{...a,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:l,"data-testid":"rf__background"},P.createElement("pattern",{id:d+e,x:u[0]%p[0],y:u[1]%p[1],width:p[0],height:p[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${v[0]},-${v[1]})`},_?P.createElement(Pg,{color:f,radius:y/i}):P.createElement(Tg,{dimensions:E,color:f,lineWidth:o})),P.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${d+e})`}))}Iu.displayName="Background";var tv=T.memo(Iu);function To(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var gn,wi;function $g(){if(wi)return gn;wi=1;var e=ea(),t=4;function n(r){return e(r,t)}return gn=n,gn}var mn,_i;function qu(){if(_i)return mn;_i=1;var e=Pc();function t(n){return typeof n=="function"?n:e}return mn=t,mn}var vn,Ei;function Tu(){if(Ei)return vn;Ei=1;var e=ta(),t=co(),n=qu(),r=We();function o(i,s){var a=r(i)?e:t;return a(i,n(s))}return vn=o,vn}var yn,bi;function Pu(){return bi||(bi=1,yn=Tu()),yn}var wn,xi;function Og(){if(xi)return wn;xi=1;var e=co();function t(n,r){var o=[];return e(n,function(i,s,a){r(i,s,a)&&o.push(i)}),o}return wn=t,wn}var _n,Si;function Du(){if(Si)return _n;Si=1;var e=Dc(),t=Og(),n=lo(),r=We();function o(i,s){var a=r(i)?e:t;return a(i,n(s,3))}return _n=o,_n}var En,Ni;function Fg(){if(Ni)return En;Ni=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,o){return r!=null&&t.call(r,o)}return En=n,En}var bn,Ci;function zu(){if(Ci)return bn;Ci=1;var e=Fg(),t=zc();function n(r,o){return r!=null&&t(r,o,e)}return bn=n,bn}var xn,ki;function Hg(){if(ki)return xn;ki=1;var e=na(),t=ra(),n=oa(),r=We(),o=fo(),i=ho(),s=Lc(),a=po(),c="[object Map]",l="[object Set]",u=Object.prototype,d=u.hasOwnProperty;function f(h){if(h==null)return!0;if(o(h)&&(r(h)||typeof h=="string"||typeof h.splice=="function"||i(h)||a(h)||n(h)))return!h.length;var _=t(h);if(_==c||_==l)return!h.size;if(s(h))return!e(h).length;for(var m in h)if(d.call(h,m))return!1;return!0}return xn=f,xn}var Sn,Ri;function Lu(){if(Ri)return Sn;Ri=1;function e(t){return t===void 0}return Sn=e,Sn}var Nn,Ai;function Vg(){if(Ai)return Nn;Ai=1;function e(t,n,r,o){var i=-1,s=t==null?0:t.length;for(o&&s&&(r=t[++i]);++i1?h.setNode(_,d):h.setNode(_)}),this},o.prototype.setNode=function(u,d){return e.has(this._nodes,u)?(arguments.length>1&&(this._nodes[u]=d),this):(this._nodes[u]=arguments.length>1?d:this._defaultNodeLabelFn(u),this._isCompound&&(this._parent[u]=n,this._children[u]={},this._children[n][u]=!0),this._in[u]={},this._preds[u]={},this._out[u]={},this._sucs[u]={},++this._nodeCount,this)},o.prototype.node=function(u){return this._nodes[u]},o.prototype.hasNode=function(u){return e.has(this._nodes,u)},o.prototype.removeNode=function(u){var d=this;if(e.has(this._nodes,u)){var f=function(h){d.removeEdge(d._edgeObjs[h])};delete this._nodes[u],this._isCompound&&(this._removeFromParentsChildList(u),delete this._parent[u],e.each(this.children(u),function(h){d.setParent(h)}),delete this._children[u]),e.each(e.keys(this._in[u]),f),delete this._in[u],delete this._preds[u],e.each(e.keys(this._out[u]),f),delete this._out[u],delete this._sucs[u],--this._nodeCount}return this},o.prototype.setParent=function(u,d){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(d))d=n;else{d+="";for(var f=d;!e.isUndefined(f);f=this.parent(f))if(f===u)throw new Error("Setting "+d+" as parent of "+u+" would create a cycle");this.setNode(d)}return this.setNode(u),this._removeFromParentsChildList(u),this._parent[u]=d,this._children[d][u]=!0,this},o.prototype._removeFromParentsChildList=function(u){delete this._children[this._parent[u]][u]},o.prototype.parent=function(u){if(this._isCompound){var d=this._parent[u];if(d!==n)return d}},o.prototype.children=function(u){if(e.isUndefined(u)&&(u=n),this._isCompound){var d=this._children[u];if(d)return e.keys(d)}else{if(u===n)return this.nodes();if(this.hasNode(u))return[]}},o.prototype.predecessors=function(u){var d=this._preds[u];if(d)return e.keys(d)},o.prototype.successors=function(u){var d=this._sucs[u];if(d)return e.keys(d)},o.prototype.neighbors=function(u){var d=this.predecessors(u);if(d)return e.union(d,this.successors(u))},o.prototype.isLeaf=function(u){var d;return this.isDirected()?d=this.successors(u):d=this.neighbors(u),d.length===0},o.prototype.filterNodes=function(u){var d=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});d.setGraph(this.graph());var f=this;e.each(this._nodes,function(m,g){u(g)&&d.setNode(g,m)}),e.each(this._edgeObjs,function(m){d.hasNode(m.v)&&d.hasNode(m.w)&&d.setEdge(m,f.edge(m))});var h={};function _(m){var g=f.parent(m);return g===void 0||d.hasNode(g)?(h[m]=g,g):g in h?h[g]:_(g)}return this._isCompound&&e.each(d.nodes(),function(m){d.setParent(m,_(m))}),d},o.prototype.setDefaultEdgeLabel=function(u){return e.isFunction(u)||(u=e.constant(u)),this._defaultEdgeLabelFn=u,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return e.values(this._edgeObjs)},o.prototype.setPath=function(u,d){var f=this,h=arguments;return e.reduce(u,function(_,m){return h.length>1?f.setEdge(_,m,d):f.setEdge(_,m),m}),this},o.prototype.setEdge=function(){var u,d,f,h,_=!1,m=arguments[0];typeof m=="object"&&m!==null&&"v"in m?(u=m.v,d=m.w,f=m.name,arguments.length===2&&(h=arguments[1],_=!0)):(u=m,d=arguments[1],f=arguments[3],arguments.length>2&&(h=arguments[2],_=!0)),u=""+u,d=""+d,e.isUndefined(f)||(f=""+f);var g=a(this._isDirected,u,d,f);if(e.has(this._edgeLabels,g))return _&&(this._edgeLabels[g]=h),this;if(!e.isUndefined(f)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(u),this.setNode(d),this._edgeLabels[g]=_?h:this._defaultEdgeLabelFn(u,d,f);var p=c(this._isDirected,u,d,f);return u=p.v,d=p.w,Object.freeze(p),this._edgeObjs[g]=p,i(this._preds[d],u),i(this._sucs[u],d),this._in[d][g]=p,this._out[u][g]=p,this._edgeCount++,this},o.prototype.edge=function(u,d,f){var h=arguments.length===1?l(this._isDirected,arguments[0]):a(this._isDirected,u,d,f);return this._edgeLabels[h]},o.prototype.hasEdge=function(u,d,f){var h=arguments.length===1?l(this._isDirected,arguments[0]):a(this._isDirected,u,d,f);return e.has(this._edgeLabels,h)},o.prototype.removeEdge=function(u,d,f){var h=arguments.length===1?l(this._isDirected,arguments[0]):a(this._isDirected,u,d,f),_=this._edgeObjs[h];return _&&(u=_.v,d=_.w,delete this._edgeLabels[h],delete this._edgeObjs[h],s(this._preds[d],u),s(this._sucs[u],d),delete this._in[d][h],delete this._out[u][h],this._edgeCount--),this},o.prototype.inEdges=function(u,d){var f=this._in[u];if(f){var h=e.values(f);return d?e.filter(h,function(_){return _.v===d}):h}},o.prototype.outEdges=function(u,d){var f=this._out[u];if(f){var h=e.values(f);return d?e.filter(h,function(_){return _.w===d}):h}},o.prototype.nodeEdges=function(u,d){var f=this.inEdges(u,d);if(f)return f.concat(this.outEdges(u,d))};function i(u,d){u[d]?u[d]++:u[d]=1}function s(u,d){--u[d]||delete u[d]}function a(u,d,f,h){var _=""+d,m=""+f;if(!u&&_>m){var g=_;_=m,m=g}return _+r+m+r+(e.isUndefined(h)?t:h)}function c(u,d,f,h){var _=""+d,m=""+f;if(!u&&_>m){var g=_;_=m,m=g}var p={v:_,w:m};return h&&(p.name=h),p}function l(u,d){return a(u,d.v,d.w,d.name)}return $n}var On,Bi;function jg(){return Bi||(Bi=1,On="2.1.8"),On}var Fn,Gi;function Qg(){return Gi||(Gi=1,Fn={Graph:Po(),version:jg()}),Fn}var Hn,Ui;function Jg(){if(Ui)return Hn;Ui=1;var e=ve(),t=Po();Hn={write:n,read:i};function n(s){var a={options:{directed:s.isDirected(),multigraph:s.isMultigraph(),compound:s.isCompound()},nodes:r(s),edges:o(s)};return e.isUndefined(s.graph())||(a.value=e.clone(s.graph())),a}function r(s){return e.map(s.nodes(),function(a){var c=s.node(a),l=s.parent(a),u={v:a};return e.isUndefined(c)||(u.value=c),e.isUndefined(l)||(u.parent=l),u})}function o(s){return e.map(s.edges(),function(a){var c=s.edge(a),l={v:a.v,w:a.w};return e.isUndefined(a.name)||(l.name=a.name),e.isUndefined(c)||(l.value=c),l})}function i(s){var a=new t(s.options).setGraph(s.value);return e.each(s.nodes,function(c){a.setNode(c.v,c.value),c.parent&&a.setParent(c.v,c.parent)}),e.each(s.edges,function(c){a.setEdge({v:c.v,w:c.w,name:c.name},c.value)}),a}return Hn}var Vn,Yi;function em(){if(Yi)return Vn;Yi=1;var e=ve();Vn=t;function t(n){var r={},o=[],i;function s(a){e.has(r,a)||(r[a]=!0,i.push(a),e.each(n.successors(a),s),e.each(n.predecessors(a),s))}return e.each(n.nodes(),function(a){i=[],s(a),i.length&&o.push(i)}),o}return Vn}var Bn,Wi;function Hu(){if(Wi)return Bn;Wi=1;var e=ve();Bn=t;function t(){this._arr=[],this._keyIndices={}}return t.prototype.size=function(){return this._arr.length},t.prototype.keys=function(){return this._arr.map(function(n){return n.key})},t.prototype.has=function(n){return e.has(this._keyIndices,n)},t.prototype.priority=function(n){var r=this._keyIndices[n];if(r!==void 0)return this._arr[r].priority},t.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},t.prototype.add=function(n,r){var o=this._keyIndices;if(n=String(n),!e.has(o,n)){var i=this._arr,s=i.length;return o[n]=s,i.push({key:n,priority:r}),this._decrease(s),!0}return!1},t.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key},t.prototype.decrease=function(n,r){var o=this._keyIndices[n];if(r>this._arr[o].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[o].priority+" New: "+r);this._arr[o].priority=r,this._decrease(o)},t.prototype._heapify=function(n){var r=this._arr,o=2*n,i=o+1,s=n;o>1,!(r[i].priority0&&(d=u.removeMin(),f=l[d],f.distance!==Number.POSITIVE_INFINITY);)c(d).forEach(h);return l}return Gn}var Un,Xi;function tm(){if(Xi)return Un;Xi=1;var e=Vu(),t=ve();Un=n;function n(r,o,i){return t.transform(r.nodes(),function(s,a){s[a]=e(r,a,o,i)},{})}return Un}var Yn,Ki;function Bu(){if(Ki)return Yn;Ki=1;var e=ve();Yn=t;function t(n){var r=0,o=[],i={},s=[];function a(c){var l=i[c]={onStack:!0,lowlink:r,index:r++};if(o.push(c),n.successors(c).forEach(function(f){e.has(i,f)?i[f].onStack&&(l.lowlink=Math.min(l.lowlink,i[f].index)):(a(f),l.lowlink=Math.min(l.lowlink,i[f].lowlink))}),l.lowlink===l.index){var u=[],d;do d=o.pop(),i[d].onStack=!1,u.push(d);while(c!==d);s.push(u)}}return n.nodes().forEach(function(c){e.has(i,c)||a(c)}),s}return Yn}var Wn,ji;function nm(){if(ji)return Wn;ji=1;var e=ve(),t=Bu();Wn=n;function n(r){return e.filter(t(r),function(o){return o.length>1||o.length===1&&r.hasEdge(o[0],o[0])})}return Wn}var Zn,Qi;function rm(){if(Qi)return Zn;Qi=1;var e=ve();Zn=n;var t=e.constant(1);function n(o,i,s){return r(o,i||t,s||function(a){return o.outEdges(a)})}function r(o,i,s){var a={},c=o.nodes();return c.forEach(function(l){a[l]={},a[l][l]={distance:0},c.forEach(function(u){l!==u&&(a[l][u]={distance:Number.POSITIVE_INFINITY})}),s(l).forEach(function(u){var d=u.v===l?u.w:u.v,f=i(u);a[l][d]={distance:f,predecessor:l}})}),c.forEach(function(l){var u=a[l];c.forEach(function(d){var f=a[d];c.forEach(function(h){var _=f[l],m=u[h],g=f[h],p=_.distance+m.distance;p0;){if(l=c.removeMin(),e.has(a,l))s.setEdge(l,a[l]);else{if(d)throw new Error("Input graph is not connected: "+o);d=!0}o.nodeEdges(l).forEach(u)}return s}return er}var tr,is;function um(){return is||(is=1,tr={components:em(),dijkstra:Vu(),dijkstraAll:tm(),findCycles:nm(),floydWarshall:rm(),isAcyclic:om(),postorder:im(),preorder:sm(),prim:am(),tarjan:Bu(),topsort:Gu()}),tr}var nr,ss;function cm(){if(ss)return nr;ss=1;var e=Qg();return nr={Graph:e.Graph,json:Jg(),alg:um(),version:e.version},nr}var rr,as;function _e(){if(as)return rr;as=1;var e;if(typeof To=="function")try{e=cm()}catch{}return e||(e=window.graphlib),rr=e,rr}var or,us;function lm(){if(us)return or;us=1;var e=ea(),t=1,n=4;function r(o){return e(o,t|n)}return or=r,or}var ir,cs;function dm(){if(cs)return ir;cs=1;var e=mo(),t=ca(),n=ua(),r=Zt(),o=Object.prototype,i=o.hasOwnProperty,s=e(function(a,c){a=Object(a);var l=-1,u=c.length,d=u>2?c[2]:void 0;for(d&&n(c[0],c[1],d)&&(u=1);++l1?i[a-1]:void 0,l=a>2?i[2]:void 0;for(c=r.length>3&&typeof c=="function"?(a--,c):void 0,l&&t(i[0],i[1],l)&&(c=a<3?void 0:c,a=1),o=Object(o);++s0;--g)if(m=u[g].dequeue(),m){f=f.concat(s(l,u,d,m,!0));break}}}return f}function s(l,u,d,f,h){var _=h?[]:void 0;return e.forEach(l.inEdges(f.v),function(m){var g=l.edge(m),p=l.node(m.v);h&&_.push({v:m.v,w:m.w}),p.out-=g,c(u,d,p)}),e.forEach(l.outEdges(f.v),function(m){var g=l.edge(m),p=m.w,y=l.node(p);y.in-=g,c(u,d,y)}),l.removeNode(f.v),_}function a(l,u){var d=new t,f=0,h=0;e.forEach(l.nodes(),function(g){d.setNode(g,{v:g,in:0,out:0})}),e.forEach(l.edges(),function(g){var p=d.edge(g.v,g.w)||0,y=u(g),E=p+y;d.setEdge(g.v,g.w,E),h=Math.max(h,d.node(g.v).out+=y),f=Math.max(f,d.node(g.w).in+=y)});var _=e.range(h+f+3).map(function(){return new n}),m=f+1;return e.forEach(d.nodes(),function(g){c(_,m,d.node(g))}),{graph:d,buckets:_,zeroIdx:m}}function c(l,u,d){d.out?d.in?l[d.out-d.in+u].enqueue(d):l[l.length-1].enqueue(d):l[0].enqueue(d)}return xr}var Sr,Rs;function km(){if(Rs)return Sr;Rs=1;var e=oe(),t=Cm();Sr={run:n,undo:o};function n(i){var s=i.graph().acyclicer==="greedy"?t(i,a(i)):r(i);e.forEach(s,function(c){var l=i.edge(c);i.removeEdge(c),l.forwardName=c.name,l.reversed=!0,i.setEdge(c.w,c.v,l,e.uniqueId("rev"))});function a(c){return function(l){return c.edge(l).weight}}}function r(i){var s=[],a={},c={};function l(u){e.has(c,u)||(c[u]=!0,a[u]=!0,e.forEach(i.outEdges(u),function(d){e.has(a,d.w)?s.push(d):l(d.w)}),delete a[u])}return e.forEach(i.nodes(),l),s}function o(i){e.forEach(i.edges(),function(s){var a=i.edge(s);if(a.reversed){i.removeEdge(s);var c=a.forwardName;delete a.reversed,delete a.forwardName,i.setEdge(s.w,s.v,a,c)}})}return Sr}var Nr,As;function he(){if(As)return Nr;As=1;var e=oe(),t=_e().Graph;Nr={addDummyNode:n,simplify:r,asNonCompoundGraph:o,successorWeights:i,predecessorWeights:s,intersectRect:a,buildLayerMatrix:c,normalizeRanks:l,removeEmptyRanks:u,addBorderNode:d,maxRank:f,partition:h,time:_,notime:m};function n(g,p,y,E){var v;do v=e.uniqueId(E);while(g.hasNode(v));return y.dummy=p,g.setNode(v,y),v}function r(g){var p=new t().setGraph(g.graph());return e.forEach(g.nodes(),function(y){p.setNode(y,g.node(y))}),e.forEach(g.edges(),function(y){var E=p.edge(y.v,y.w)||{weight:0,minlen:1},v=g.edge(y);p.setEdge(y.v,y.w,{weight:E.weight+v.weight,minlen:Math.max(E.minlen,v.minlen)})}),p}function o(g){var p=new t({multigraph:g.isMultigraph()}).setGraph(g.graph());return e.forEach(g.nodes(),function(y){g.children(y).length||p.setNode(y,g.node(y))}),e.forEach(g.edges(),function(y){p.setEdge(y,g.edge(y))}),p}function i(g){var p=e.map(g.nodes(),function(y){var E={};return e.forEach(g.outEdges(y),function(v){E[v.w]=(E[v.w]||0)+g.edge(v).weight}),E});return e.zipObject(g.nodes(),p)}function s(g){var p=e.map(g.nodes(),function(y){var E={};return e.forEach(g.inEdges(y),function(v){E[v.v]=(E[v.v]||0)+g.edge(v).weight}),E});return e.zipObject(g.nodes(),p)}function a(g,p){var y=g.x,E=g.y,v=p.x-y,b=p.y-E,x=g.width/2,C=g.height/2;if(!v&&!b)throw new Error("Not possible to find intersection inside of the rectangle");var q,k;return Math.abs(b)*x>Math.abs(v)*C?(b<0&&(C=-C),q=C*v/b,k=C):(v<0&&(x=-x),q=x,k=x*b/v),{x:y+q,y:E+k}}function c(g){var p=e.map(e.range(f(g)+1),function(){return[]});return e.forEach(g.nodes(),function(y){var E=g.node(y),v=E.rank;e.isUndefined(v)||(p[v][E.order]=y)}),p}function l(g){var p=e.min(e.map(g.nodes(),function(y){return g.node(y).rank}));e.forEach(g.nodes(),function(y){var E=g.node(y);e.has(E,"rank")&&(E.rank-=p)})}function u(g){var p=e.min(e.map(g.nodes(),function(b){return g.node(b).rank})),y=[];e.forEach(g.nodes(),function(b){var x=g.node(b).rank-p;y[x]||(y[x]=[]),y[x].push(b)});var E=0,v=g.graph().nodeRankFactor;e.forEach(y,function(b,x){e.isUndefined(b)&&x%v!==0?--E:E&&e.forEach(b,function(C){g.node(C).rank+=E})})}function d(g,p,y,E){var v={width:0,height:0};return arguments.length>=4&&(v.rank=y,v.order=E),n(g,"border",v,p)}function f(g){return e.max(e.map(g.nodes(),function(p){var y=g.node(p).rank;if(!e.isUndefined(y))return y}))}function h(g,p){var y={lhs:[],rhs:[]};return e.forEach(g,function(E){p(E)?y.lhs.push(E):y.rhs.push(E)}),y}function _(g,p){var y=e.now();try{return p()}finally{console.log(g+" time: "+(e.now()-y)+"ms")}}function m(g,p){return p()}return Nr}var Cr,Ms;function Rm(){if(Ms)return Cr;Ms=1;var e=oe(),t=he();Cr={run:n,undo:o};function n(i){i.graph().dummyChains=[],e.forEach(i.edges(),function(s){r(i,s)})}function r(i,s){var a=s.v,c=i.node(a).rank,l=s.w,u=i.node(l).rank,d=s.name,f=i.edge(s),h=f.labelRank;if(u!==c+1){i.removeEdge(s);var _,m,g;for(g=0,++c;ck.lim&&(A=k,D=!0);var $=e.filter(v.edges(),function(L){return D===y(E,E.node(L.v),A)&&D!==y(E,E.node(L.w),A)});return e.minBy($,function(L){return n(v,L)})}function m(E,v,b,x){var C=b.v,q=b.w;E.removeEdge(C,q),E.setEdge(x.v,x.w,{}),d(E),c(E,v),g(E,v)}function g(E,v){var b=e.find(E.nodes(),function(C){return!v.node(C).parent}),x=o(E,b);x=x.slice(1),e.forEach(x,function(C){var q=E.node(C).parent,k=v.edge(C,q),A=!1;k||(k=v.edge(q,C),A=!0),v.node(C).rank=v.node(q).rank+(A?k.minlen:-k.minlen)})}function p(E,v,b){return E.hasEdge(v,b)}function y(E,v,b){return b.low<=v.lim&&v.lim<=b.lim}return Ar}var Mr,Ps;function Mm(){if(Ps)return Mr;Ps=1;var e=Yt(),t=e.longestPath,n=Zu(),r=Am();Mr=o;function o(c){switch(c.graph().ranker){case"network-simplex":a(c);break;case"tight-tree":s(c);break;case"longest-path":i(c);break;default:a(c)}}var i=t;function s(c){t(c),n(c)}function a(c){r(c)}return Mr}var Ir,Ds;function Im(){if(Ds)return Ir;Ds=1;var e=oe();Ir=t;function t(o){var i=r(o);e.forEach(o.graph().dummyChains,function(s){for(var a=o.node(s),c=a.edgeObj,l=n(o,i,c.v,c.w),u=l.path,d=l.lca,f=0,h=u[f],_=!0;s!==c.w;){if(a=o.node(s),_){for(;(h=u[f])!==d&&o.node(h).maxRanku||d>i[f].lim));for(h=f,f=a;(f=o.parent(f))!==h;)l.push(f);return{path:c.concat(l.reverse()),lca:h}}function r(o){var i={},s=0;function a(c){var l=s;e.forEach(o.children(c),a),i[c]={low:l,lim:s++}}return e.forEach(o.children(),a),i}return Ir}var qr,zs;function qm(){if(zs)return qr;zs=1;var e=oe(),t=he();qr={run:n,cleanup:s};function n(a){var c=t.addDummyNode(a,"root",{},"_root"),l=o(a),u=e.max(e.values(l))-1,d=2*u+1;a.graph().nestingRoot=c,e.forEach(a.edges(),function(h){a.edge(h).minlen*=d});var f=i(a)+1;e.forEach(a.children(),function(h){r(a,c,d,f,u,l,h)}),a.graph().nodeRankFactor=d}function r(a,c,l,u,d,f,h){var _=a.children(h);if(!_.length){h!==c&&a.setEdge(c,h,{weight:0,minlen:l});return}var m=t.addBorderNode(a,"_bt"),g=t.addBorderNode(a,"_bb"),p=a.node(h);a.setParent(m,h),p.borderTop=m,a.setParent(g,h),p.borderBottom=g,e.forEach(_,function(y){r(a,c,l,u,d,f,y);var E=a.node(y),v=E.borderTop?E.borderTop:y,b=E.borderBottom?E.borderBottom:y,x=E.borderTop?u:2*u,C=v!==b?1:d-f[h]+1;a.setEdge(m,v,{weight:x,minlen:C,nestingEdge:!0}),a.setEdge(b,g,{weight:x,minlen:C,nestingEdge:!0})}),a.parent(h)||a.setEdge(c,m,{weight:0,minlen:d+f[h]})}function o(a){var c={};function l(u,d){var f=a.children(u);f&&f.length&&e.forEach(f,function(h){l(h,d+1)}),c[u]=d}return e.forEach(a.children(),function(u){l(u,1)}),c}function i(a){return e.reduce(a.edges(),function(c,l){return c+a.edge(l).weight},0)}function s(a){var c=a.graph();a.removeNode(c.nestingRoot),delete c.nestingRoot,e.forEach(a.edges(),function(l){var u=a.edge(l);u.nestingEdge&&a.removeEdge(l)})}return qr}var Tr,Ls;function Tm(){if(Ls)return Tr;Ls=1;var e=oe(),t=he();Tr=n;function n(o){function i(s){var a=o.children(s),c=o.node(s);if(a.length&&e.forEach(a,i),e.has(c,"minRank")){c.borderLeft=[],c.borderRight=[];for(var l=c.minRank,u=c.maxRank+1;l0;)h%2&&(_+=u[h+1]),h=h-1>>1,u[h]+=f.weight;d+=f.weight*_})),d}return zr}var Lr,Hs;function Lm(){if(Hs)return Lr;Hs=1;var e=oe();Lr=t;function t(n,r){return e.map(r,function(o){var i=n.inEdges(o);if(i.length){var s=e.reduce(i,function(a,c){var l=n.edge(c),u=n.node(c.v);return{sum:a.sum+l.weight*u.order,weight:a.weight+l.weight}},{sum:0,weight:0});return{v:o,barycenter:s.sum/s.weight,weight:s.weight}}else return{v:o}})}return Lr}var $r,Vs;function $m(){if(Vs)return $r;Vs=1;var e=oe();$r=t;function t(o,i){var s={};e.forEach(o,function(c,l){var u=s[c.v]={indegree:0,in:[],out:[],vs:[c.v],i:l};e.isUndefined(c.barycenter)||(u.barycenter=c.barycenter,u.weight=c.weight)}),e.forEach(i.edges(),function(c){var l=s[c.v],u=s[c.w];!e.isUndefined(l)&&!e.isUndefined(u)&&(u.indegree++,l.out.push(s[c.w]))});var a=e.filter(s,function(c){return!c.indegree});return n(a)}function n(o){var i=[];function s(l){return function(u){u.merged||(e.isUndefined(u.barycenter)||e.isUndefined(l.barycenter)||u.barycenter>=l.barycenter)&&r(l,u)}}function a(l){return function(u){u.in.push(l),--u.indegree===0&&o.push(u)}}for(;o.length;){var c=o.pop();i.push(c),e.forEach(c.in.reverse(),s(c)),e.forEach(c.out,a(c))}return e.map(e.filter(i,function(l){return!l.merged}),function(l){return e.pick(l,["vs","i","barycenter","weight"])})}function r(o,i){var s=0,a=0;o.weight&&(s+=o.barycenter*o.weight,a+=o.weight),i.weight&&(s+=i.barycenter*i.weight,a+=i.weight),o.vs=i.vs.concat(o.vs),o.barycenter=s/a,o.weight=a,o.i=Math.min(i.i,o.i),i.merged=!0}return $r}var Or,Bs;function Om(){if(Bs)return Or;Bs=1;var e=oe(),t=he();Or=n;function n(i,s){var a=t.partition(i,function(m){return e.has(m,"barycenter")}),c=a.lhs,l=e.sortBy(a.rhs,function(m){return-m.i}),u=[],d=0,f=0,h=0;c.sort(o(!!s)),h=r(u,l,h),e.forEach(c,function(m){h+=m.vs.length,u.push(m.vs),d+=m.barycenter*m.weight,f+=m.weight,h=r(u,l,h)});var _={vs:e.flatten(u,!0)};return f&&(_.barycenter=d/f,_.weight=f),_}function r(i,s,a){for(var c;s.length&&(c=e.last(s)).i<=a;)s.pop(),i.push(c.vs),a++;return a}function o(i){return function(s,a){return s.barycentera.barycenter?1:i?a.i-s.i:s.i-a.i}}return Or}var Fr,Gs;function Fm(){if(Gs)return Fr;Gs=1;var e=oe(),t=Lm(),n=$m(),r=Om();Fr=o;function o(a,c,l,u){var d=a.children(c),f=a.node(c),h=f?f.borderLeft:void 0,_=f?f.borderRight:void 0,m={};h&&(d=e.filter(d,function(b){return b!==h&&b!==_}));var g=t(a,d);e.forEach(g,function(b){if(a.children(b.v).length){var x=o(a,b.v,l,u);m[b.v]=x,e.has(x,"barycenter")&&s(b,x)}});var p=n(g,l);i(p,m);var y=r(p,u);if(h&&(y.vs=e.flatten([h,y.vs,_],!0),a.predecessors(h).length)){var E=a.node(a.predecessors(h)[0]),v=a.node(a.predecessors(_)[0]);e.has(y,"barycenter")||(y.barycenter=0,y.weight=0),y.barycenter=(y.barycenter*y.weight+E.order+v.order)/(y.weight+2),y.weight+=2}return y}function i(a,c){e.forEach(a,function(l){l.vs=e.flatten(l.vs.map(function(u){return c[u]?c[u].vs:u}),!0)})}function s(a,c){e.isUndefined(a.barycenter)?(a.barycenter=c.barycenter,a.weight=c.weight):(a.barycenter=(a.barycenter*a.weight+c.barycenter*c.weight)/(a.weight+c.weight),a.weight+=c.weight)}return Fr}var Hr,Us;function Hm(){if(Us)return Hr;Us=1;var e=oe(),t=_e().Graph;Hr=n;function n(o,i,s){var a=r(o),c=new t({compound:!0}).setGraph({root:a}).setDefaultNodeLabel(function(l){return o.node(l)});return e.forEach(o.nodes(),function(l){var u=o.node(l),d=o.parent(l);(u.rank===i||u.minRank<=i&&i<=u.maxRank)&&(c.setNode(l),c.setParent(l,d||a),e.forEach(o[s](l),function(f){var h=f.v===l?f.w:f.v,_=c.edge(h,l),m=e.isUndefined(_)?0:_.weight;c.setEdge(h,l,{weight:o.edge(f).weight+m})}),e.has(u,"minRank")&&c.setNode(l,{borderLeft:u.borderLeft[i],borderRight:u.borderRight[i]}))}),c}function r(o){for(var i;o.hasNode(i=e.uniqueId("_root")););return i}return Hr}var Vr,Ys;function Vm(){if(Ys)return Vr;Ys=1;var e=oe();Vr=t;function t(n,r,o){var i={},s;e.forEach(o,function(a){for(var c=n.parent(a),l,u;c;){if(l=n.parent(c),l?(u=i[l],i[l]=c):(u=s,s=c),u&&u!==c){r.setEdge(u,c);return}c=l}})}return Vr}var Br,Ws;function Bm(){if(Ws)return Br;Ws=1;var e=oe(),t=Dm(),n=zm(),r=Fm(),o=Hm(),i=Vm(),s=_e().Graph,a=he();Br=c;function c(f){var h=a.maxRank(f),_=l(f,e.range(1,h+1),"inEdges"),m=l(f,e.range(h-1,-1,-1),"outEdges"),g=t(f);d(f,g);for(var p=Number.POSITIVE_INFINITY,y,E=0,v=0;v<4;++E,++v){u(E%2?_:m,E%4>=2),g=a.buildLayerMatrix(f);var b=n(f,g);bA)&&s(E,L,D)})})}function b(x,C){var q=-1,k,A=0;return e.forEach(C,function(D,$){if(p.node(D).dummy==="border"){var L=p.predecessors(D);L.length&&(k=p.node(L[0]).order,v(C,A,$,q,k),A=$,q=k)}v(C,A,C.length,k,x.length)}),C}return e.reduce(y,b),E}function i(p,y){if(p.node(y).dummy)return e.find(p.predecessors(y),function(E){return p.node(E).dummy})}function s(p,y,E){if(y>E){var v=y;y=E,E=v}var b=p[y];b||(p[y]=b={}),b[E]=!0}function a(p,y,E){if(y>E){var v=y;y=E,E=v}return e.has(p[y],E)}function c(p,y,E,v){var b={},x={},C={};return e.forEach(y,function(q){e.forEach(q,function(k,A){b[k]=k,x[k]=k,C[k]=A})}),e.forEach(y,function(q){var k=-1;e.forEach(q,function(A){var D=v(A);if(D.length){D=e.sortBy(D,function(N){return C[N]});for(var $=(D.length-1)/2,L=Math.floor($),w=Math.ceil($);L<=w;++L){var R=D[L];x[A]===A&&ks[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var v=_s(),_=se();const it=oe(_),En=Ps({__proto__:null,default:it},[_]),Xt=new WeakMap,ws=new WeakMap,Et={current:[]};let Nt=!1,gt=0;const mt=new Set,wt=new Map;function Ge(t){for(const o of t){if(Et.current.includes(o))continue;Et.current.push(o),o.recompute();const e=ws.get(o);if(e)for(const s of e){const n=Xt.get(s);n?.length&&Ge(n)}}}function xs(t){const o={prevVal:t.prevState,currentVal:t.state};for(const e of t.listeners)e(o)}function bs(t){const o={prevVal:t.prevState,currentVal:t.state};for(const e of t.listeners)e(o)}function Je(t){if(gt>0&&!wt.has(t)&&wt.set(t,t.prevState),mt.add(t),!(gt>0)&&!Nt)try{for(Nt=!0;mt.size>0;){const o=Array.from(mt);mt.clear();for(const e of o){const s=wt.get(e)??e.prevState;e.prevState=s,xs(e)}for(const e of o){const s=Xt.get(e);s&&(Et.current.push(e),Ge(s))}for(const e of o){const s=Xt.get(e);if(s)for(const n of s)bs(n)}}}finally{Nt=!1,Et.current=[],wt.clear()}}function vt(t){gt++;try{t()}finally{if(gt--,gt===0){const o=mt.values().next().value;o&&Je(o)}}}function Cs(t){return typeof t=="function"}class Ms{constructor(o,e){this.listeners=new Set,this.subscribe=s=>{var n,r;this.listeners.add(s);const i=(r=(n=this.options)==null?void 0:n.onSubscribe)==null?void 0:r.call(n,s,this);return()=>{this.listeners.delete(s),i?.()}},this.prevState=o,this.state=o,this.options=e}setState(o){var e,s,n;this.prevState=this.state,(e=this.options)!=null&&e.updateFn?this.state=this.options.updateFn(this.prevState)(o):Cs(o)?this.state=o(this.prevState):this.state=o,(n=(s=this.options)==null?void 0:s.onUpdate)==null||n.call(s),Je(this)}}const q="__TSR_index",Re="popstate",Pe="beforeunload";function Ls(t){let o=t.getLocation();const e=new Set,s=i=>{o=t.getLocation(),e.forEach(a=>a({location:o,action:i}))},n=i=>{t.notifyOnIndexChange??!0?s(i):o=t.getLocation()},r=async({task:i,navigateOpts:a,...c})=>{if(a?.ignoreBlocker??!1){i();return}const l=t.getBlockers?.()??[],h=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&l.length&&h)for(const d of l){const f=Tt(c.path,c.state);if(await d.blockerFn({currentLocation:o,nextLocation:f,action:c.type})){t.onBlocked?.();return}}i()};return{get location(){return o},get length(){return t.getLength()},subscribers:e,subscribe:i=>(e.add(i),()=>{e.delete(i)}),push:(i,a,c)=>{const u=o.state[q];a=we(u+1,a),r({task:()=>{t.pushState(i,a),s({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:i,state:a})},replace:(i,a,c)=>{const u=o.state[q];a=we(u,a),r({task:()=>{t.replaceState(i,a),s({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:i,state:a})},go:(i,a)=>{r({task:()=>{t.go(i),n({type:"GO",index:i})},navigateOpts:a,type:"GO"})},back:i=>{r({task:()=>{t.back(i?.ignoreBlocker??!1),n({type:"BACK"})},navigateOpts:i,type:"BACK"})},forward:i=>{r({task:()=>{t.forward(i?.ignoreBlocker??!1),n({type:"FORWARD"})},navigateOpts:i,type:"FORWARD"})},canGoBack:()=>o.state[q]!==0,createHref:i=>t.createHref(i),block:i=>{if(!t.setBlockers)return()=>{};const a=t.getBlockers?.()??[];return t.setBlockers([...a,i]),()=>{const c=t.getBlockers?.()??[];t.setBlockers?.(c.filter(u=>u!==i))}},flush:()=>t.flush?.(),destroy:()=>t.destroy?.(),notify:s}}function we(t,o){o||(o={});const e=ne();return{...o,key:e,__TSR_key:e,[q]:t}}function Es(t){const o=typeof document<"u"?window:void 0,e=o.history.pushState,s=o.history.replaceState;let n=[];const r=()=>n,i=S=>n=S,a=(S=>S),c=(()=>Tt(`${o.location.pathname}${o.location.search}${o.location.hash}`,o.history.state));if(!o.history.state?.__TSR_key&&!o.history.state?.key){const S=ne();o.history.replaceState({[q]:0,key:S,__TSR_key:S},"")}let u=c(),l,h=!1,d=!1,f=!1,p=!1;const m=()=>u;let g,y;const w=()=>{g&&(R._ignoreSubscribers=!0,(g.isPush?o.history.pushState:o.history.replaceState)(g.state,"",g.href),R._ignoreSubscribers=!1,g=void 0,y=void 0,l=void 0)},P=(S,C,M)=>{const T=a(C);y||(l=u),u=Tt(C,M),g={href:T,state:M,isPush:g?.isPush||S==="push"},y||(y=Promise.resolve().then(()=>w()))},b=S=>{u=c(),R.notify({type:S})},E=async()=>{if(d){d=!1;return}const S=c(),C=S.state[q]-u.state[q],M=C===1,T=C===-1,I=!M&&!T||h;h=!1;const Y=I?"GO":T?"BACK":"FORWARD",D=I?{type:"GO",index:C}:{type:T?"BACK":"FORWARD"};if(f)f=!1;else{const X=r();if(typeof document<"u"&&X.length){for(const pe of X)if(await pe.blockerFn({currentLocation:u,nextLocation:S,action:Y})){d=!0,o.history.go(1),R.notify(D);return}}}u=c(),R.notify(D)},x=S=>{if(p){p=!1;return}let C=!1;const M=r();if(typeof document<"u"&&M.length)for(const T of M){const I=T.enableBeforeUnload??!0;if(I===!0){C=!0;break}if(typeof I=="function"&&I()===!0){C=!0;break}}if(C)return S.preventDefault(),S.returnValue=""},R=Ls({getLocation:m,getLength:()=>o.history.length,pushState:(S,C)=>P("push",S,C),replaceState:(S,C)=>P("replace",S,C),back:S=>(S&&(f=!0),p=!0,o.history.back()),forward:S=>{S&&(f=!0),p=!0,o.history.forward()},go:S=>{h=!0,o.history.go(S)},createHref:S=>a(S),flush:w,destroy:()=>{o.history.pushState=e,o.history.replaceState=s,o.removeEventListener(Pe,x,{capture:!0}),o.removeEventListener(Re,E)},onBlocked:()=>{l&&u!==l&&(u=l)},getBlockers:r,setBlockers:i,notifyOnIndexChange:!1});return o.addEventListener(Pe,x,{capture:!0}),o.addEventListener(Re,E),o.history.pushState=function(...S){const C=e.apply(o.history,S);return R._ignoreSubscribers||b("PUSH"),C},o.history.replaceState=function(...S){const C=s.apply(o.history,S);return R._ignoreSubscribers||b("REPLACE"),C},R}function Tt(t,o){const e=t.indexOf("#"),s=t.indexOf("?"),n=ne();return{href:t,pathname:t.substring(0,e>0?s>0?Math.min(e,s):e:s>0?s:t.length),hash:e>-1?t.substring(e):"",search:s>-1?t.slice(s,e===-1?void 0:e):"",state:o||{[q]:0,key:n,__TSR_key:n}}}function ne(){return(Math.random()+1).toString(36).substring(7)}function Zt(t){return t[t.length-1]}function Ts(t){return typeof t=="function"}function Q(t,o){return Ts(t)?t(o):t}const Is=Object.prototype.hasOwnProperty;function B(t,o){if(t===o)return t;const e=o,s=Ce(t)&&Ce(e);if(!s&&!(It(t)&&It(e)))return e;const n=s?t:xe(t);if(!n)return e;const r=s?e:xe(e);if(!r)return e;const i=n.length,a=r.length,c=s?new Array(a):{};let u=0;for(let l=0;l"u")return!0;const e=o.prototype;return!(!be(e)||!e.hasOwnProperty("isPrototypeOf"))}function be(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ce(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function tt(t,o,e){if(t===o)return!0;if(typeof t!=typeof o)return!1;if(Array.isArray(t)&&Array.isArray(o)){if(t.length!==o.length)return!1;for(let s=0,n=t.length;sn||!tt(t[i],o[i],e)))return!1;return n===r}return!1}function at(t){let o,e;const s=new Promise((n,r)=>{o=n,e=r});return s.status="pending",s.resolve=n=>{s.status="resolved",s.value=n,o(n),t?.(n)},s.reject=n=>{s.status="rejected",e(n)},s}function G(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}const Os=Array.from(new Map([["%","%25"],["\\","%5C"]]).values());function Me(t,o=Os){function e(n,r,i=0){for(let a=i;a{try{return decodeURI(a)}catch{return a}})}}if(t===""||!/%[0-9A-Fa-f]{2}/g.test(t))return t;const s=t.replaceAll(/%[0-9a-f]{2}/g,n=>n.toUpperCase());return e(s,o)}var ks="Invariant failed";function K(t,o){if(!t)throw new Error(ks)}const N=0,st=1,ct=2,lt=3;function U(t){return re(t.filter(o=>o!==void 0).join("/"))}function re(t){return t.replace(/\/{2,}/g,"/")}function ie(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}function J(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}function Mt(t){return J(ie(t))}function Ot(t,o){return t?.endsWith("/")&&t!=="/"&&t!==`${o}/`?t.slice(0,-1):t}function Fs(t,o,e){return Ot(t,e)===Ot(o,e)}function As(t){const{type:o,value:e}=t;if(o===N)return e;const{prefixSegment:s,suffixSegment:n}=t;if(o===st){const r=e.substring(1);if(s&&n)return`${s}{$${r}}${n}`;if(s)return`${s}{$${r}}`;if(n)return`{$${r}}${n}`}if(o===lt){const r=e.substring(1);return s&&n?`${s}{-$${r}}${n}`:s?`${s}{-$${r}}`:n?`{-$${r}}${n}`:`{-$${r}}`}if(o===ct){if(s&&n)return`${s}{$}${n}`;if(s)return`${s}{$}`;if(n)return`{$}${n}`}return e}function Bs({base:t,to:o,trailingSlash:e="never",parseCache:s}){let n=ut(t,s).slice();const r=ut(o,s);n.length>1&&Zt(n)?.value==="/"&&n.pop();for(let c=0,u=r.length;c1&&(Zt(n).value==="/"?e==="never"&&n.pop():e==="always"&&n.push({type:N,value:"/"}));const i=n.map(As);return U(i)}const ut=(t,o)=>{if(!t)return[];const e=o?.get(t);if(e)return e;const s=Ws(t);return o?.set(t,s),s},Ds=/^\$.{1,}$/,zs=/^(.*?)\{(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,$s=/^(.*?)\{-(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,js=/^\$$/,Ns=/^(.*?)\{\$\}(.*)$/;function Ws(t){t=re(t);const o=[];if(t.slice(0,1)==="/"&&(t=t.substring(1),o.push({type:N,value:"/"})),!t)return o;const e=t.split("/").filter(Boolean);return o.push(...e.map(s=>{const n=s.match(Ns);if(n){const a=n[1],c=n[2];return{type:ct,value:"$",prefixSegment:a||void 0,suffixSegment:c||void 0}}const r=s.match($s);if(r){const a=r[1],c=r[2],u=r[3];return{type:lt,value:c,prefixSegment:a||void 0,suffixSegment:u||void 0}}const i=s.match(zs);if(i){const a=i[1],c=i[2],u=i[3];return{type:st,value:""+c,prefixSegment:a||void 0,suffixSegment:u||void 0}}if(Ds.test(s)){const a=s.substring(1);return{type:st,value:"$"+a,prefixSegment:void 0,suffixSegment:void 0}}return js.test(s)?{type:ct,value:"$",prefixSegment:void 0,suffixSegment:void 0}:{type:N,value:s}})),t.slice(-1)==="/"&&(t=t.substring(1),o.push({type:N,value:"/"})),o}function Wt({path:t,params:o,decodeCharMap:e,parseCache:s}){const n=ut(t,s);function r(u){const l=o[u],h=typeof l=="string";return u==="*"||u==="_splat"?h?encodeURI(l):l:h?Vs(l,e):l}let i=!1;const a={},c=U(n.map(u=>{if(u.type===N)return u.value;if(u.type===ct){a._splat=o._splat,a["*"]=o._splat;const l=u.prefixSegment||"",h=u.suffixSegment||"";if(!o._splat)return i=!0,l||h?`${l}${h}`:void 0;const d=r("_splat");return`${l}${d}${h}`}if(u.type===st){const l=u.value.substring(1);!i&&!(l in o)&&(i=!0),a[l]=o[l];const h=u.prefixSegment||"",d=u.suffixSegment||"";return`${h}${r(l)??"undefined"}${d}`}if(u.type===lt){const l=u.value.substring(1),h=u.prefixSegment||"",d=u.suffixSegment||"";return!(l in o)||o[l]==null?h||d?`${h}${d}`:void 0:(a[l]=o[l],`${h}${r(l)??""}${d}`)}return u.value}));return{usedParams:a,interpolatedPath:c,isMissingParams:i}}function Vs(t,o){let e=encodeURIComponent(t);if(o)for(const[s,n]of o)e=e.replaceAll(s,n);return e}function Qt(t,o,e){const s=Us(t,o,e);if(!(o.to&&!s))return s??{}}function Us(t,{to:o,fuzzy:e,caseSensitive:s},n){const r=o,i=ut(t.startsWith("/")?t:`/${t}`,n),a=ut(r.startsWith("/")?r:`/${r}`,n),c={};return Ks(i,a,c,e,s)?c:void 0}function Ks(t,o,e,s,n){let r=0,i=0;for(;rm.value)));h&&p.startsWith(h)&&(p=p.slice(h.length)),d&&p.endsWith(d)&&(p=p.slice(0,p.length-d.length)),l=p}else l=decodeURI(U(u.map(h=>h.value)));return e["*"]=l,e._splat=l,!0}if(c.type===N){if(c.value==="/"&&!a?.value){i++;continue}if(a){if(n){if(c.value!==a.value)return!1}else if(c.value.toLowerCase()!==a.value.toLowerCase())return!1;r++,i++;continue}else return!1}if(c.type===st){if(!a||a.value==="/")return!1;let u="",l=!1;if(c.prefixSegment||c.suffixSegment){const h=c.prefixSegment||"",d=c.suffixSegment||"",f=a.value;if(h&&!f.startsWith(h)||d&&!f.endsWith(d))return!1;let p=f;h&&p.startsWith(h)&&(p=p.slice(h.length)),d&&p.endsWith(d)&&(p=p.slice(0,p.length-d.length)),u=decodeURIComponent(p),l=!0}else u=decodeURIComponent(a.value),l=!0;l&&(e[c.value.substring(1)]=u,r++),i++;continue}if(c.type===lt){if(!a){i++;continue}if(a.value==="/"){i++;continue}let u="",l=!1;if(c.prefixSegment||c.suffixSegment){const h=c.prefixSegment||"",d=c.suffixSegment||"",f=a.value;if((!h||f.startsWith(h))&&(!d||f.endsWith(d))){let p=f;h&&p.startsWith(h)&&(p=p.slice(h.length)),d&&p.endsWith(d)&&(p=p.slice(0,p.length-d.length)),u=decodeURIComponent(p),l=!0}}else{let h=!0;for(let d=i+1;d=o.length)return e["**"]=U(t.slice(r).map(u=>u.value)),!!s&&o[o.length-1]?.value!=="/";if(i=t.length){for(let u=i;u{if(s.isRoot||!s.path)return;const r=ie(s.fullPath);let i=ut(r),a=0;for(;i.length>a+1&&i[a]?.value==="/";)a++;a>0&&(i=i.slice(a));let c=0,u=!1;const l=i.map((h,d)=>{if(h.value==="/")return Hs;if(h.type===N)return qs;let f;h.type===st?f=Gs:h.type===lt?(f=Js,c++):f=Ys;for(let p=d+1;p{const r=Math.min(s.scores.length,n.scores.length);for(let i=0;in.parsed[i].value?1:-1;return s.index-n.index}).map((s,n)=>(s.child.rank=n,s.child))}function so({routeTree:t,initRoute:o}){const e={},s={},n=i=>{i.forEach((a,c)=>{o?.(a,c);const u=e[a.id];if(K(!u,`Duplicate routes found with id: ${String(a.id)}`),e[a.id]=a,!a.isRoot&&a.path){const h=J(a.fullPath);(!s[h]||a.fullPath.endsWith("/"))&&(s[h]=a)}const l=a.children;l?.length&&n(l)})};n([t]);const r=eo(Object.values(e));return{routesById:e,routesByPath:s,flatRoutes:r}}function $(t){return!!t?.isNotFound}function oo(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const kt="tsr-scroll-restoration-v1_3",no=(t,o)=>{let e;return(...s)=>{e||(e=setTimeout(()=>{t(...s),e=null},o))}};function ro(){const t=oo();if(!t)return null;const o=t.getItem(kt);let e=o?JSON.parse(o):{};return{state:e,set:s=>(e=Q(s,e)||e,t.setItem(kt,JSON.stringify(e)))}}const xt=ro(),te=t=>t.state.__TSR_key||t.href;function io(t){const o=[];let e;for(;e=t.parentNode;)o.push(`${t.tagName}:nth-child(${Array.prototype.indexOf.call(e.children,t)+1})`),t=e;return`${o.reverse().join(" > ")}`.toLowerCase()}let Ft=!1;function Ye({storageKey:t,key:o,behavior:e,shouldScrollRestoration:s,scrollToTopSelectors:n,location:r}){let i;try{i=JSON.parse(sessionStorage.getItem(t)||"{}")}catch(u){console.error(u);return}const a=o||window.history.state?.__TSR_key,c=i[a];Ft=!0;t:{if(s&&c&&Object.keys(c).length>0){for(const h in c){const d=c[h];if(h==="window")window.scrollTo({top:d.scrollY,left:d.scrollX,behavior:e});else if(h){const f=document.querySelector(h);f&&(f.scrollLeft=d.scrollX,f.scrollTop=d.scrollY)}}break t}const u=(r??window.location).hash.split("#",2)[1];if(u){const h=window.history.state?.__hashScrollIntoViewOptions??!0;if(h){const d=document.getElementById(u);d&&d.scrollIntoView(h)}break t}const l={top:0,left:0,behavior:e};if(window.scrollTo(l),n)for(const h of n){if(h==="window")continue;const d=typeof h=="function"?h():document.querySelector(h);d&&d.scrollTo(l)}}Ft=!1}function ao(t,o){if(!xt&&!t.isServer||((t.options.scrollRestoration??!1)&&(t.isScrollRestoring=!0),t.isServer||t.isScrollRestorationSetup||!xt))return;t.isScrollRestorationSetup=!0,Ft=!1;const s=t.options.getScrollRestorationKey||te;window.history.scrollRestoration="manual";const n=r=>{if(Ft||!t.isScrollRestoring)return;let i="";if(r.target===document||r.target===window)i="window";else{const c=r.target.getAttribute("data-scroll-restoration-id");c?i=`[data-scroll-restoration-id="${c}"]`:i=io(r.target)}const a=s(t.state.location);xt.set(c=>{const u=c[a]||={},l=u[i]||={};if(i==="window")l.scrollX=window.scrollX||0,l.scrollY=window.scrollY||0;else if(i){const h=document.querySelector(i);h&&(l.scrollX=h.scrollLeft||0,l.scrollY=h.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",no(n,100),!0),t.subscribe("onRendered",r=>{const i=s(r.toLocation);if(!t.resetNextScroll){t.resetNextScroll=!0;return}typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation})||(Ye({storageKey:kt,key:i,behavior:t.options.scrollRestorationBehavior,shouldScrollRestoration:t.isScrollRestoring,scrollToTopSelectors:t.options.scrollToTopSelectors,location:t.history.location}),t.isScrollRestoring&&xt.set(a=>(a[i]||={},a)))})}function co(t){if(typeof document<"u"&&document.querySelector){const o=t.state.location.state.__hashScrollIntoViewOptions??!0;if(o&&t.state.location.hash!==""){const e=document.getElementById(t.state.location.hash);e&&e.scrollIntoView(o)}}}function lo(t,o=String){const e=new URLSearchParams;for(const s in t){const n=t[s];n!==void 0&&e.set(s,o(n))}return e.toString()}function Vt(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}function uo(t){const o=new URLSearchParams(t),e={};for(const[s,n]of o.entries()){const r=e[s];r==null?e[s]=Vt(n):Array.isArray(r)?r.push(Vt(n)):e[s]=[r,Vt(n)]}return e}const ho=po(JSON.parse),fo=mo(JSON.stringify,JSON.parse);function po(t){return o=>{o[0]==="?"&&(o=o.substring(1));const e=uo(o);for(const s in e){const n=e[s];if(typeof n=="string")try{e[s]=t(n)}catch{}}return e}}function mo(t,o){const e=typeof o=="function";function s(n){if(typeof n=="object"&&n!==null)try{return t(n)}catch{}else if(e&&typeof n=="string")try{return o(n),t(n)}catch{}return n}return n=>{const r=lo(n,s);return r?`?${r}`:""}}const A="__root__";function go(t){if(t.statusCode=t.statusCode||t.code||307,!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}const o=new Headers(t.headers);t.href&&o.get("Location")===null&&o.set("Location",t.href);const e=new Response(null,{status:t.statusCode,headers:o});if(e.options=t,t.throw)throw e;return e}function j(t){return t instanceof Response&&!!t.options}function vo(t){const o=new Map;let e,s;const n=r=>{r.next&&(r.prev?(r.prev.next=r.next,r.next.prev=r.prev,r.next=void 0,s&&(s.next=r,r.prev=s)):(r.next.prev=void 0,e=r.next,r.next=void 0,s&&(r.prev=s,s.next=r)),s=r)};return{get(r){const i=o.get(r);if(i)return n(i),i.value},set(r,i){if(o.size>=t&&e){const c=e;o.delete(c.key),c.next&&(e=c.next,c.next.prev=void 0),c===s&&(s=void 0)}const a=o.get(r);if(a)a.value=i,n(a);else{const c={key:r,value:i,prev:s};s&&(s.next=c),s=c,e||(e=c),o.set(r,c)}}}}const Lt=t=>{if(!t.rendered)return t.rendered=!0,t.onReady?.()},Bt=(t,o)=>!!(t.preload&&!t.router.state.matches.some(e=>e.id===o)),Xe=(t,o)=>{const e=t.router.routesById[o.routeId??""]??t.router.routeTree;!e.options.notFoundComponent&&t.router.options?.defaultNotFoundComponent&&(e.options.notFoundComponent=t.router.options.defaultNotFoundComponent),K(e.options.notFoundComponent);const s=t.matches.find(n=>n.routeId===e.id);K(s,"Could not find match for route: "+e.id),t.updateMatch(s.id,n=>({...n,status:"notFound",error:o,isFetching:!1})),o.routerCode==="BEFORE_LOAD"&&e.parentRoute&&(o.routeId=e.parentRoute.id,Xe(t,o))},H=(t,o,e)=>{if(!(!j(e)&&!$(e))){if(j(e)&&e.redirectHandled&&!e.options.reloadDocument)throw e;if(o){o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.loaderPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,o._nonReactive.loaderPromise=void 0;const s=j(e)?"redirected":"notFound";o._nonReactive.error=e,t.updateMatch(o.id,n=>({...n,status:s,isFetching:!1,error:e})),$(e)&&!e.routeId&&(e.routeId=o.routeId),o._nonReactive.loadPromise?.resolve()}throw j(e)?(t.rendered=!0,e.options._fromLocation=t.location,e.redirectHandled=!0,e=t.router.resolveRedirect(e),e):(Xe(t,e),e)}},Ze=(t,o)=>{const e=t.router.getMatch(o);return!!(!t.router.isServer&&e._nonReactive.dehydrated||t.router.isServer&&e.ssr===!1)},dt=(t,o,e,s)=>{const{id:n,routeId:r}=t.matches[o],i=t.router.looseRoutesById[r];if(e instanceof Promise)throw e;e.routerCode=s,t.firstBadMatchIndex??=o,H(t,t.router.getMatch(n),e);try{i.options.onError?.(e)}catch(a){e=a,H(t,t.router.getMatch(n),e)}t.updateMatch(n,a=>(a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,a._nonReactive.loadPromise?.resolve(),{...a,error:e,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},yo=(t,o,e,s)=>{const n=t.router.getMatch(o),r=t.matches[e-1]?.id,i=r?t.router.getMatch(r):void 0;if(t.router.isShell()){n.ssr=s.id===A;return}if(i?.ssr===!1){n.ssr=!1;return}const a=f=>f===!0&&i?.ssr==="data-only"?"data-only":f,c=t.router.options.defaultSsr??!0;if(s.options.ssr===void 0){n.ssr=a(c);return}if(typeof s.options.ssr!="function"){n.ssr=a(s.options.ssr);return}const{search:u,params:l}=n,h={search:bt(u,n.searchError),params:bt(l,n.paramsError),location:t.location,matches:t.matches.map(f=>({index:f.index,pathname:f.pathname,fullPath:f.fullPath,staticData:f.staticData,id:f.id,routeId:f.routeId,search:bt(f.search,f.searchError),params:bt(f.params,f.paramsError),ssr:f.ssr}))},d=s.options.ssr(h);if(G(d))return d.then(f=>{n.ssr=a(f??c)});n.ssr=a(d??c)},Qe=(t,o,e,s)=>{if(s._nonReactive.pendingTimeout!==void 0)return;const n=e.options.pendingMs??t.router.options.defaultPendingMs;if(!!(t.onReady&&!t.router.isServer&&!Bt(t,o)&&(e.options.loader||e.options.beforeLoad||ss(e))&&typeof n=="number"&&n!==1/0&&(e.options.pendingComponent??t.router.options?.defaultPendingComponent))){const i=setTimeout(()=>{Lt(t)},n);s._nonReactive.pendingTimeout=i}},So=(t,o,e)=>{const s=t.router.getMatch(o);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;Qe(t,o,e,s);const n=()=>{const r=t.router.getMatch(o);r.preload&&(r.status==="redirected"||r.status==="notFound")&&H(t,r,r.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(n):n()},_o=(t,o,e,s)=>{const n=t.router.getMatch(o),r=n._nonReactive.loadPromise;n._nonReactive.loadPromise=at(()=>{r?.resolve()});const{paramsError:i,searchError:a}=n;i&&dt(t,e,i,"PARSE_PARAMS"),a&&dt(t,e,a,"VALIDATE_SEARCH"),Qe(t,o,s,n);const c=new AbortController,u=t.matches[e-1]?.id,d={...(u?t.router.getMatch(u):void 0)?.context??t.router.options.context??void 0,...n.__routeContext};let f=!1;const p=()=>{f||(f=!0,t.updateMatch(o,R=>({...R,isFetching:"beforeLoad",fetchCount:R.fetchCount+1,abortController:c,context:d})))},m=()=>{n._nonReactive.beforeLoadPromise?.resolve(),n._nonReactive.beforeLoadPromise=void 0,t.updateMatch(o,R=>({...R,isFetching:!1}))};if(!s.options.beforeLoad){vt(()=>{p(),m()});return}n._nonReactive.beforeLoadPromise=at();const{search:g,params:y,cause:w}=n,P=Bt(t,o),b={search:g,abortController:c,params:y,preload:P,context:d,location:t.location,navigate:R=>t.router.navigate({...R,_fromLocation:t.location}),buildLocation:t.router.buildLocation,cause:P?"preload":w,matches:t.matches,...t.router.options.additionalContext},E=R=>{if(R===void 0){vt(()=>{p(),m()});return}(j(R)||$(R))&&(p(),dt(t,e,R,"BEFORE_LOAD")),vt(()=>{p(),t.updateMatch(o,S=>({...S,__beforeLoadContext:R,context:{...S.context,...R}})),m()})};let x;try{if(x=s.options.beforeLoad(b),G(x))return p(),x.catch(R=>{dt(t,e,R,"BEFORE_LOAD")}).then(E)}catch(R){p(),dt(t,e,R,"BEFORE_LOAD")}E(x)},Ro=(t,o)=>{const{id:e,routeId:s}=t.matches[o],n=t.router.looseRoutesById[s],r=()=>{if(t.router.isServer){const c=yo(t,e,o,n);if(G(c))return c.then(a)}return a()},i=()=>_o(t,e,o,n),a=()=>{if(Ze(t,e))return;const c=So(t,e,n);return G(c)?c.then(i):i()};return r()},yt=(t,o,e)=>{const s=t.router.getMatch(o);if(!s||!e.options.head&&!e.options.scripts&&!e.options.headers)return;const n={matches:t.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([e.options.head?.(n),e.options.scripts?.(n),e.options.headers?.(n)]).then(([r,i,a])=>{const c=r?.meta,u=r?.links,l=r?.scripts,h=r?.styles;return{meta:c,links:u,headScripts:l,headers:a,scripts:i,styles:h}})},ts=(t,o,e,s)=>{const n=t.matchPromises[e-1],{params:r,loaderDeps:i,abortController:a,cause:c}=t.router.getMatch(o);let u=t.router.options.context??{};for(let h=0;h<=e;h++){const d=t.matches[h];if(!d)continue;const f=t.router.getMatch(d.id);f&&(u={...u,...f.__routeContext??{},...f.__beforeLoadContext??{}})}const l=Bt(t,o);return{params:r,deps:i,preload:!!l,parentMatchPromise:n,abortController:a,context:u,location:t.location,navigate:h=>t.router.navigate({...h,_fromLocation:t.location}),cause:l?"preload":c,route:s,...t.router.options.additionalContext}},Ie=async(t,o,e,s)=>{try{const n=t.router.getMatch(o);try{(!t.router.isServer||n.ssr===!0)&&es(s);const r=s.options.loader?.(ts(t,o,e,s)),i=s.options.loader&&G(r);if(!!(i||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||n._nonReactive.minPendingPromise)&&t.updateMatch(o,h=>({...h,isFetching:"loader"})),s.options.loader){const h=i?await r:r;H(t,t.router.getMatch(o),h),h!==void 0&&t.updateMatch(o,d=>({...d,loaderData:h}))}s._lazyPromise&&await s._lazyPromise;const c=yt(t,o,s),u=c?await c:void 0,l=n._nonReactive.minPendingPromise;l&&await l,s._componentsPromise&&await s._componentsPromise,t.updateMatch(o,h=>({...h,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),...u}))}catch(r){let i=r;const a=n._nonReactive.minPendingPromise;a&&await a,$(r)&&await s.options.notFoundComponent?.preload?.(),H(t,t.router.getMatch(o),r);try{s.options.onError?.(r)}catch(l){i=l,H(t,t.router.getMatch(o),l)}const c=yt(t,o,s),u=c?await c:void 0;t.updateMatch(o,l=>({...l,error:i,status:"error",isFetching:!1,...u}))}}catch(n){const r=t.router.getMatch(o);if(r){const i=yt(t,o,s);if(i){const a=await i;t.updateMatch(o,c=>({...c,...a}))}r._nonReactive.loaderPromise=void 0}H(t,r,n)}},Po=async(t,o)=>{const{id:e,routeId:s}=t.matches[o];let n=!1,r=!1;const i=t.router.looseRoutesById[s];if(Ze(t,e)){if(t.router.isServer){const u=yt(t,e,i);if(u){const l=await u;t.updateMatch(e,h=>({...h,...l}))}return t.router.getMatch(e)}}else{const u=t.router.getMatch(e);if(u._nonReactive.loaderPromise){if(u.status==="success"&&!t.sync&&!u.preload)return u;await u._nonReactive.loaderPromise;const l=t.router.getMatch(e),h=l._nonReactive.error||l.error;h&&H(t,l,h)}else{const l=Date.now()-u.updatedAt,h=Bt(t,e),d=h?i.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:i.options.staleTime??t.router.options.defaultStaleTime??0,f=i.options.shouldReload,p=typeof f=="function"?f(ts(t,e,o,i)):f,m=!!h&&!t.router.state.matches.some(P=>P.id===e),g=t.router.getMatch(e);g._nonReactive.loaderPromise=at(),m!==g.preload&&t.updateMatch(e,P=>({...P,preload:m}));const{status:y,invalid:w}=g;if(n=y==="success"&&(w||(p??l>d)),!(h&&i.options.preload===!1))if(n&&!t.sync)r=!0,(async()=>{try{await Ie(t,e,o,i);const P=t.router.getMatch(e);P._nonReactive.loaderPromise?.resolve(),P._nonReactive.loadPromise?.resolve(),P._nonReactive.loaderPromise=void 0}catch(P){j(P)&&await t.router.navigate(P.options)}})();else if(y!=="success"||n&&t.sync)await Ie(t,e,o,i);else{const P=yt(t,e,i);if(P){const b=await P;t.updateMatch(e,E=>({...E,...b}))}}}}const a=t.router.getMatch(e);r||(a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loadPromise?.resolve()),clearTimeout(a._nonReactive.pendingTimeout),a._nonReactive.pendingTimeout=void 0,r||(a._nonReactive.loaderPromise=void 0),a._nonReactive.dehydrated=void 0;const c=r?a.isFetching:!1;return c!==a.isFetching||a.invalid!==!1?(t.updateMatch(e,u=>({...u,isFetching:c,invalid:!1})),t.router.getMatch(e)):a};async function Oe(t){const o=Object.assign(t,{matchPromises:[]});!o.router.isServer&&o.router.state.matches.some(e=>e._forcePending)&&Lt(o);try{for(let n=0;n{const{id:e,...s}=o.options;Object.assign(t.options,s),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0),!t._componentsLoaded&&t._componentsPromise===void 0){const o=()=>{const e=[];for(const s of os){const n=t.options[s]?.preload;n&&e.push(n())}if(e.length)return Promise.all(e).then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0});t._componentsLoaded=!0,t._componentsPromise=void 0};t._componentsPromise=t._lazyPromise?t._lazyPromise.then(o):o()}return t._componentsPromise}function bt(t,o){return o?{status:"error",error:o}:{status:"success",value:t}}function ss(t){for(const o of os)if(t.options[o]?.preload)return!0;return!1}const os=["component","errorComponent","pendingComponent","notFoundComponent"];function wo(t){return{input:({url:o})=>{for(const e of t)o=ns(e,o);return o},output:({url:o})=>{for(let e=t.length-1;e>=0;e--)o=rs(t[e],o);return o}}}function xo(t){const o=Mt(t.basepath),e=`/${o}`,s=`${e}/`,n=t.caseSensitive?e:e.toLowerCase(),r=t.caseSensitive?s:s.toLowerCase();return{input:({url:i})=>{const a=t.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===n?i.pathname="/":a.startsWith(r)&&(i.pathname=i.pathname.slice(e.length)),i},output:({url:i})=>(i.pathname=U(["/",o,i.pathname]),i)}}function ns(t,o){const e=t?.input?.({url:o});if(e){if(typeof e=="string")return new URL(e);if(e instanceof URL)return e}return o}function rs(t,o){const e=t?.output?.({url:o});if(e){if(typeof e=="string")return new URL(e);if(e instanceof URL)return e}return o}function et(t){const o=t.resolvedLocation,e=t.location,s=o?.pathname!==e.pathname,n=o?.href!==e.href,r=o?.hash!==e.hash;return{fromLocation:o,toLocation:e,pathChanged:s,hrefChanged:n,hashChanged:r}}class bo{constructor(o){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{e.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const s=this.options,n=this.basepath??s?.basepath??"/",r=this.basepath===void 0,i=s?.rewrite;this.options={...s,...e},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(d=>[encodeURIComponent(d),d])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=Es())),this.origin=this.options.origin,this.origin||(!this.isServer&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new Ms(Mo(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(d=>!["redirected"].includes(d.status))}}}),ao(this));let a=!1;const c=this.options.basepath??"/",u=this.options.rewrite;if(r||n!==c||i!==u){this.basepath=c;const d=[];Mt(c)!==""&&d.push(xo({basepath:c})),u&&d.push(u),this.rewrite=d.length===0?void 0:d.length===1?d[0]:wo(d),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const{routesById:e,routesByPath:s,flatRoutes:n}=so({routeTree:this.routeTree,initRoute:(i,a)=>{i.init({originalIndex:a})}});this.routesById=e,this.routesByPath=s,this.flatRoutes=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)},this.subscribe=(e,s)=>{const n={eventType:e,fn:s};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(s=>{s.eventType===e.type&&s.fn(e)})},this.parseLocation=(e,s)=>{const n=({href:c,state:u})=>{const l=new URL(c,this.origin),h=ns(this.rewrite,l),d=this.options.parseSearch(h.search),f=this.options.stringifySearch(d);h.search=f;const p=h.href.replace(h.origin,""),{pathname:m,hash:g}=h;return{href:p,publicHref:c,url:h.href,pathname:Me(m),searchStr:f,search:B(s?.search,d),hash:g.split("#").reverse()[0]??"",state:B(s?.state,u)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){const c=n(i);return c.state.key=r.state.key,c.state.__TSR_key=r.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:r}}return r},this.resolvePathWithBase=(e,s)=>Bs({base:e,to:re(s),trailingSlash:this.options.trailingSlash,parseCache:this.parsePathnameCache}),this.matchRoutes=(e,s,n)=>typeof e=="string"?this.matchRoutesInternal({pathname:e,search:s},n):this.matchRoutesInternal(e,s),this.parsePathnameCache=vo(1e3),this.getMatchedRoutes=(e,s)=>Lo({pathname:e,routePathname:s,caseSensitive:this.options.caseSensitive,routesByPath:this.routesByPath,routesById:this.routesById,flatRoutes:this.flatRoutes,parseCache:this.parsePathnameCache}),this.cancelMatch=e=>{const s=this.getMatch(e);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const e=this.state.matches.filter(r=>r.status==="pending"),s=this.state.matches.filter(r=>r.isFetching==="loader");new Set([...this.state.pendingMatches??[],...e,...s]).forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=e=>{const s=(r={})=>{const i=r._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutes(i,{_buildLocation:!0}),c=Zt(a);r.from;const u=r.unsafeRelative==="path"?i.pathname:r.from??c.fullPath,l=this.resolvePathWithBase(u,"."),h=c.search,d={...c.params},f=r.to?this.resolvePathWithBase(l,`${r.to}`):this.resolvePathWithBase(l,"."),p=r.params===!1||r.params===null?{}:(r.params??!0)===!0?d:Object.assign(d,Q(r.params,d)),m=Wt({path:f,params:p,parseCache:this.parsePathnameCache}).interpolatedPath,g=this.matchRoutes(m,void 0,{_buildLocation:!0}).map(M=>this.looseRoutesById[M.routeId]);if(Object.keys(p).length>0)for(const M of g){const T=M.options.params?.stringify??M.options.stringifyParams;T&&Object.assign(p,T(p))}const y=e.leaveParams?f:Me(Wt({path:f,params:p,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath);let w=h;if(e._includeValidateSearch&&this.options.search?.strict){const M={};g.forEach(T=>{if(T.options.validateSearch)try{Object.assign(M,ee(T.options.validateSearch,{...M,...w}))}catch{}}),w=M}w=Eo({search:w,dest:r,destRoutes:g,_includeValidateSearch:e._includeValidateSearch}),w=B(h,w);const P=this.options.stringifySearch(w),b=r.hash===!0?i.hash:r.hash?Q(r.hash,i.hash):void 0,E=b?`#${b}`:"";let x=r.state===!0?i.state:r.state?Q(r.state,i.state):{};x=B(i.state,x);const R=`${y}${P}${E}`,S=new URL(R,this.origin),C=rs(this.rewrite,S);return{publicHref:C.pathname+C.search+C.hash,href:R,url:C.href,pathname:y,search:w,searchStr:P,state:x,hash:b??"",unmaskOnReload:r.unmaskOnReload}},n=(r={},i)=>{const a=s(r);let c=i?s(i):void 0;if(!c){let u={};const l=this.options.routeMasks?.find(h=>{const d=Qt(a.pathname,{to:h.from,caseSensitive:!1,fuzzy:!1},this.parsePathnameCache);return d?(u=d,!0):!1});if(l){const{from:h,...d}=l;i={from:e.from,...d,params:u},c=s(i)}}return c&&(a.maskedLocation=c),a};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=({viewTransition:e,ignoreBlocker:s,...n})=>{const r=()=>{const c=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];c.forEach(l=>{n.state[l]=this.latestLocation.state[l]});const u=tt(n.state,this.latestLocation.state);return c.forEach(l=>{delete n.state[l]}),u},i=J(this.latestLocation.href)===J(n.href),a=this.commitLocationPromise;if(this.commitLocationPromise=at(()=>{a?.resolve()}),i&&r())this.load();else{let{maskedLocation:c,hashScrollIntoView:u,...l}=n;c&&(l={...c,state:{...c.state,__tempKey:void 0,__tempLocation:{...l,search:l.searchStr,state:{...l.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(l.unmaskOnReload??this.options.unmaskOnReload??!1)&&(l.state.__tempKey=this.tempLocationKey)),l.state.__hashScrollIntoViewOptions=u??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?"replace":"push"](l.publicHref,l.state,{ignoreBlocker:s})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:s,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...c}={})=>{if(a){const h=this.history.location.state.__TSR_index,d=Tt(a,{__TSR_index:e?h:h+1});c.to=d.pathname,c.search=this.options.parseSearch(d.search),c.hash=d.hash.slice(1)}const u=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=u;const l=this.commitLocation({...u,viewTransition:r,replace:e,resetScroll:s,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===u&&(this.pendingBuiltLocation=void 0)}),l},this.navigate=({to:e,reloadDocument:s,href:n,...r})=>{if(!s&&n)try{new URL(`${n}`),s=!0}catch{}return s?(n||(n=this.buildLocation({to:e,...r}).url),r.replace?window.location.replace(n):window.location.href=n,Promise.resolve()):this.buildAndCommitLocation({...r,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const s=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0}),n=r=>{try{return encodeURI(decodeURI(r))}catch{return r}};if(Mt(n(this.latestLocation.href))!==Mt(n(s.href))){let r=s.url;throw this.origin&&r.startsWith(this.origin)&&(r=r.replace(this.origin,"")||"/"),go({href:r})}}const e=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:e,cachedMatches:s.cachedMatches.filter(n=>!e.some(r=>r.id===n.id))}))},this.load=async e=>{let s,n,r;for(r=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();const c=this.latestLocation,u=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...et({resolvedLocation:u,location:c})}),this.emit({type:"onBeforeLoad",...et({resolvedLocation:u,location:c})}),await Oe({router:this,sync:e?.sync,matches:this.state.pendingMatches,location:c,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let l=[],h=[],d=[];vt(()=>{this.__store.setState(f=>{const p=f.matches,m=f.pendingMatches||f.matches;return l=p.filter(g=>!m.some(y=>y.id===g.id)),h=m.filter(g=>!p.some(y=>y.id===g.id)),d=m.filter(g=>p.some(y=>y.id===g.id)),{...f,isLoading:!1,loadedAt:Date.now(),matches:m,pendingMatches:void 0,cachedMatches:[...f.cachedMatches,...l.filter(g=>g.status!=="error")]}}),this.clearExpiredCache()}),[[l,"onLeave"],[h,"onEnter"],[d,"onStay"]].forEach(([f,p])=>{f.forEach(m=>{this.looseRoutesById[m.routeId].options[p]?.(m)})})})})}})}catch(c){j(c)?(s=c,this.isServer||this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):$(c)&&(n=c),this.__store.setState(u=>({...u,statusCode:s?s.status:n?404:u.matches.some(l=>l.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let i;this.hasNotFoundMatch()?i=404:this.__store.state.matches.some(a=>a.status==="error")&&(i=500),i!==void 0&&this.__store.setState(a=>({...a,statusCode:i}))},this.startViewTransition=e=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let n;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const r=this.latestLocation,i=this.state.resolvedLocation,a=typeof s.types=="function"?s.types(et({resolvedLocation:i,location:r})):s.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,s)=>{this.startTransition(()=>{const n=this.state.pendingMatches?.some(r=>r.id===e)?"pendingMatches":this.state.matches.some(r=>r.id===e)?"matches":this.state.cachedMatches.some(r=>r.id===e)?"cachedMatches":"";n&&this.__store.setState(r=>({...r,[n]:r[n]?.map(i=>i.id===e?s(i):i)}))})},this.getMatch=e=>{const s=n=>n.id===e;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=e=>{const s=n=>e?.filter?.(n)??!0?{...n,invalid:!0,...e?.forcePending||n.status==="error"?{status:"pending",error:void 0}:void 0}:n;return this.__store.setState(n=>({...n,matches:n.matches.map(s),cachedMatches:n.cachedMatches.map(s),pendingMatches:n.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{if(!e.options.href){const s=this.buildLocation(e.options);let n=s.url;this.origin&&n.startsWith(this.origin)&&(n=n.replace(this.origin,"")||"/"),e.options.href=s.href,e.headers.set("Location",n)}return e.headers.get("Location")||e.headers.set("Location",e.options.href),e},this.clearCache=e=>{const s=e?.filter;s!==void 0?this.__store.setState(n=>({...n,cachedMatches:n.cachedMatches.filter(r=>!s(r))})):this.__store.setState(n=>({...n,cachedMatches:[]}))},this.clearExpiredCache=()=>{const e=s=>{const n=this.looseRoutesById[s.routeId];if(!n.options.loader)return!0;const r=(s.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=r};this.clearCache({filter:e})},this.loadRouteChunk=es,this.preloadRoute=async e=>{const s=this.buildLocation(e);let n=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:e});const r=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(a=>a.id)),i=new Set([...r,...this.state.cachedMatches.map(a=>a.id)]);vt(()=>{n.forEach(a=>{i.has(a.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,a]}))})});try{return n=await Oe({router:this,matches:n,location:s,preload:!0,updateMatch:(a,c)=>{r.has(a)?n=n.map(u=>u.id===a?c(u):u):this.updateMatch(a,c)}}),n}catch(a){if(j(a))return a.options.reloadDocument?void 0:await this.preloadRoute({...a.options,_fromLocation:s});$(a)||console.error(a);return}},this.matchRoute=(e,s)=>{const n={...e,to:e.to?this.resolvePathWithBase(e.from||"",e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(s?.pending&&this.state.status!=="pending")return!1;const a=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,c=Qt(a.pathname,{...s,to:r.pathname},this.parsePathnameCache);return!c||e.params&&!tt(c,e.params,{partial:!0})?!1:c&&(s?.includeSearch??!0)?tt(a.search,r.search,{partial:!0})?c:!1:c},this.hasNotFoundMatch=()=>this.__store.state.matches.some(e=>e.status==="notFound"||e.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...o,caseSensitive:o.caseSensitive??!1,notFoundMode:o.notFoundMode??"fuzzy",stringifySearch:o.stringifySearch??fo,parseSearch:o.parseSearch??ho}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(o,e){const{foundRoute:s,matchedRoutes:n,routeParams:r}=this.getMatchedRoutes(o.pathname,e?.dest?.to);let i=!1;(s?s.path!=="/"&&r["**"]:J(o.pathname))&&(this.options.notFoundRoute?n.push(this.options.notFoundRoute):i=!0);const a=(()=>{if(i){if(this.options.notFoundMode!=="root")for(let l=n.length-1;l>=0;l--){const h=n[l];if(h.children)return h.id}return A}})(),c=[],u=l=>l?.id?l.context??this.options.context??void 0:this.options.context??void 0;return n.forEach((l,h)=>{const d=c[h-1],[f,p,m]=(()=>{const I=d?.search??o.search,Y=d?._strictSearch??void 0;try{const D=ee(l.options.validateSearch,{...I})??void 0;return[{...I,...D},{...Y,...D},void 0]}catch(D){let X=D;if(D instanceof At||(X=new At(D.message,{cause:D})),e?.throwOnError)throw X;return[I,{},X]}})(),g=l.options.loaderDeps?.({search:f})??"",y=g?JSON.stringify(g):"",{interpolatedPath:w,usedParams:P}=Wt({path:l.fullPath,params:r,decodeCharMap:this.pathParamsDecodeCharMap}),b=l.id+w+y,E=this.getMatch(b),x=this.state.matches.find(I=>I.routeId===l.id),R=E?._strictParams??P;let S;if(!E){const I=l.options.params?.parse??l.options.parseParams;if(I)try{Object.assign(R,I(R))}catch(Y){if(S=new Co(Y.message,{cause:Y}),e?.throwOnError)throw S}}Object.assign(r,R);const C=x?"stay":"enter";let M;if(E)M={...E,cause:C,params:x?B(x.params,r):r,_strictParams:R,search:B(x?x.search:E.search,f),_strictSearch:p};else{const I=l.options.loader||l.options.beforeLoad||l.lazyFn||ss(l)?"pending":"success";M={id:b,index:h,routeId:l.id,params:x?B(x.params,r):r,_strictParams:R,pathname:w,updatedAt:Date.now(),search:x?B(x.search,f):f,_strictSearch:p,searchError:void 0,status:I,isFetching:!1,error:void 0,paramsError:S,__routeContext:void 0,_nonReactive:{loadPromise:at()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:C,loaderDeps:x?B(x.loaderDeps,g):g,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:l.options.staticData||{},fullPath:l.fullPath}}e?.preload||(M.globalNotFound=a===l.id),M.searchError=m;const T=u(d);M.context={...T,...M.__routeContext,...M.__beforeLoadContext},c.push(M)}),c.forEach((l,h)=>{const d=this.looseRoutesById[l.routeId];if(!this.getMatch(l.id)&&e?._buildLocation!==!0){const p=c[h-1],m=u(p);if(d.options.context){const g={deps:l.loaderDeps,params:l.params,context:m??{},location:o,navigate:y=>this.navigate({...y,_fromLocation:o}),buildLocation:this.buildLocation,cause:l.cause,abortController:l.abortController,preload:!!l.preload,matches:c};l.__routeContext=d.options.context(g)??void 0}l.context={...m,...l.__routeContext,...l.__beforeLoadContext}}}),c}}class At extends Error{}class Co extends Error{}function Mo(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function ee(t,o){if(t==null)return{};if("~standard"in t){const e=t["~standard"].validate(o);if(e instanceof Promise)throw new At("Async validation not supported");if(e.issues)throw new At(JSON.stringify(e.issues,void 0,2),{cause:e});return e.value}return"parse"in t?t.parse(o):typeof t=="function"?t(o):{}}function Lo({pathname:t,routePathname:o,caseSensitive:e,routesByPath:s,routesById:n,flatRoutes:r,parseCache:i}){let a={};const c=J(t),u=f=>Qt(c,{to:f.fullPath,caseSensitive:f.options?.caseSensitive??e,fuzzy:!0},i);let l=o!==void 0?s[o]:void 0;if(l)a=u(l);else{let f;for(const p of r){const m=u(p);if(m)if(p.path!=="/"&&m["**"])f||(f={foundRoute:p,routeParams:m});else{l=p,a=m;break}}!l&&f&&(l=f.foundRoute,a=f.routeParams)}let h=l||n[A];const d=[h];for(;h.parentRoute;)h=h.parentRoute,d.push(h);return d.reverse(),{matchedRoutes:d,routeParams:a,foundRoute:l}}function Eo({search:t,dest:o,destRoutes:e,_includeValidateSearch:s}){const n=e.reduce((a,c)=>{const u=[];if("search"in c.options)c.options.search?.middlewares&&u.push(...c.options.search.middlewares);else if(c.options.preSearchFilters||c.options.postSearchFilters){const l=({search:h,next:d})=>{let f=h;"preSearchFilters"in c.options&&c.options.preSearchFilters&&(f=c.options.preSearchFilters.reduce((m,g)=>g(m),h));const p=d(f);return"postSearchFilters"in c.options&&c.options.postSearchFilters?c.options.postSearchFilters.reduce((m,g)=>g(m),p):p};u.push(l)}if(s&&c.options.validateSearch){const l=({search:h,next:d})=>{const f=d(h);try{return{...f,...ee(c.options.validateSearch,f)??void 0}}catch{return f}};u.push(l)}return a.concat(u)},[])??[],r=({search:a})=>o.search?o.search===!0?a:Q(o.search,a):{};n.push(r);const i=(a,c)=>{if(a>=n.length)return c;const u=n[a];return u({search:c,next:h=>i(a+1,h)})};return i(0,t)}const To="Error preloading route! ☝️";class is{constructor(o){if(this.init=e=>{this.originalIndex=e.originalIndex;const s=this.options,n=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=A:this.parentRoute||K(!1);let r=n?A:s?.path;r&&r!=="/"&&(r=ie(r));const i=s?.id||r;let a=n?A:U([this.parentRoute.id===A?"":this.parentRoute.id,i]);r===A&&(r="/"),a!==A&&(a=U(["/",a]));const c=a===A?"/":U([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=c,this._to=c},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e=="object"&&e!==null&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.options=o||{},this.isRoot=!o?.getParentRoute,o?.id&&o?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class Io extends is{constructor(o){super(o)}}function ae(t){const o=t.errorComponent??Dt;return v.jsx(Oo,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:e,reset:s})=>e?_.createElement(o,{error:e,reset:s}):t.children})}class Oo extends _.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(o){return{resetKey:o.getResetKey()}}static getDerivedStateFromError(o){return{error:o}}reset(){this.setState({error:null})}componentDidUpdate(o,e){e.error&&e.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(o,e){this.props.onCatch&&this.props.onCatch(o,e)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Dt({error:t}){const[o,e]=_.useState(!1);return v.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[v.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),v.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>e(s=>!s),children:o?"Hide Error":"Show Error"})]}),v.jsx("div",{style:{height:".25rem"}}),o?v.jsx("div",{children:v.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?v.jsx("code",{children:t.message}):null})}):null]})}function ko({children:t,fallback:o=null}){return Fo()?v.jsx(it.Fragment,{children:t}):v.jsx(it.Fragment,{children:o})}function Fo(){return it.useSyncExternalStore(Ao,()=>!0,()=>!1)}function Ao(){return()=>{}}var Ut={exports:{}},Kt={},Ht={exports:{}},qt={};var ke;function Bo(){if(ke)return qt;ke=1;var t=se();function o(h,d){return h===d&&(h!==0||1/h===1/d)||h!==h&&d!==d}var e=typeof Object.is=="function"?Object.is:o,s=t.useState,n=t.useEffect,r=t.useLayoutEffect,i=t.useDebugValue;function a(h,d){var f=d(),p=s({inst:{value:f,getSnapshot:d}}),m=p[0].inst,g=p[1];return r(function(){m.value=f,m.getSnapshot=d,c(m)&&g({inst:m})},[h,f,d]),n(function(){return c(m)&&g({inst:m}),h(function(){c(m)&&g({inst:m})})},[h]),i(f),f}function c(h){var d=h.getSnapshot;h=h.value;try{var f=d();return!e(h,f)}catch{return!0}}function u(h,d){return d()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return qt.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:l,qt}var Fe;function Do(){return Fe||(Fe=1,Ht.exports=Bo()),Ht.exports}var Ae;function zo(){if(Ae)return Kt;Ae=1;var t=se(),o=Do();function e(u,l){return u===l&&(u!==0||1/u===1/l)||u!==u&&l!==l}var s=typeof Object.is=="function"?Object.is:e,n=o.useSyncExternalStore,r=t.useRef,i=t.useEffect,a=t.useMemo,c=t.useDebugValue;return Kt.useSyncExternalStoreWithSelector=function(u,l,h,d,f){var p=r(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=a(function(){function y(x){if(!w){if(w=!0,P=x,x=d(x),f!==void 0&&m.hasValue){var R=m.value;if(f(R,x))return b=R}return b=x}if(R=b,s(P,x))return R;var S=d(x);return f!==void 0&&f(R,S)?(P=x,R):(P=x,b=S)}var w=!1,P,b,E=h===void 0?null:h;return[function(){return y(l())},E===null?void 0:function(){return y(E())}]},[l,h,d,f]);var g=n(u,p[0],p[1]);return i(function(){m.hasValue=!0,m.value=g},[g]),c(g),g},Kt}var Be;function $o(){return Be||(Be=1,Ut.exports=zo()),Ut.exports}var as=$o();const Tn=oe(as);function jo(t,o=s=>s,e={}){const s=e.equal??No;return as.useSyncExternalStoreWithSelector(t.subscribe,()=>t.state,()=>t.state,o,s)}function No(t,o){if(Object.is(t,o))return!0;if(typeof t!="object"||t===null||typeof o!="object"||o===null)return!1;if(t instanceof Map&&o instanceof Map){if(t.size!==o.size)return!1;for(const[s,n]of t)if(!o.has(s)||!Object.is(n,o.get(s)))return!1;return!0}if(t instanceof Set&&o instanceof Set){if(t.size!==o.size)return!1;for(const s of t)if(!o.has(s))return!1;return!0}if(t instanceof Date&&o instanceof Date)return t.getTime()===o.getTime();const e=De(t);if(e.length!==De(o).length)return!1;for(let s=0;s"u"?Gt:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Gt,Gt)}function F(t){const o=_.useContext(cs());return t?.warn,o}function k(t){const o=F({warn:t?.router===void 0}),e=t?.router||o,s=_.useRef(void 0);return jo(e.__store,n=>{if(t?.select){if(t.structuralSharing??e.options.defaultStructuralSharing){const r=B(s.current,t.select(n));return s.current=r,r}return t.select(n)}return n})}const zt=_.createContext(void 0),Wo=_.createContext(void 0);function W(t){const o=_.useContext(t.from?Wo:zt);return k({select:s=>{const n=s.matches.find(r=>t.from?t.from===r.routeId:r.id===o);if(K(!((t.shouldThrow??!0)&&!n),`Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`),n!==void 0)return t.select?t.select(n):n},structuralSharing:t.structuralSharing})}function ce(t){return W({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:o=>t.select?t.select(o.loaderData):o.loaderData})}function le(t){const{select:o,...e}=t;return W({...e,select:s=>o?o(s.loaderDeps):s.loaderDeps})}function ue(t){return W({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:o=>{const e=t.strict===!1?o.params:o._strictParams;return t.select?t.select(e):e}})}function he(t){return W({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:o=>t.select?t.select(o.search):o.search})}function de(t){const o=F();return _.useCallback(e=>o.navigate({...e,from:e.from??t?.from}),[t?.from,o])}var fe=Rs();const In=oe(fe),Ct=typeof window<"u"?_.useLayoutEffect:_.useEffect;function Jt(t){const o=_.useRef({value:t,prev:null}),e=o.current.value;return t!==e&&(o.current={value:t,prev:e}),o.current.prev}function Vo(t,o,e={},s={}){_.useEffect(()=>{if(!t.current||s.disabled||typeof IntersectionObserver!="function")return;const n=new IntersectionObserver(([r])=>{o(r)},e);return n.observe(t.current),()=>{n.disconnect()}},[o,e,s.disabled,t])}function Uo(t){const o=_.useRef(null);return _.useImperativeHandle(t,()=>o.current,[]),o}function Ko(t,o){const e=F(),[s,n]=_.useState(!1),r=_.useRef(!1),i=Uo(o),{activeProps:a,inactiveProps:c,activeOptions:u,to:l,preload:h,preloadDelay:d,hashScrollIntoView:f,replace:p,startTransition:m,resetScroll:g,viewTransition:y,children:w,target:P,disabled:b,style:E,className:x,onClick:R,onFocus:S,onMouseEnter:C,onMouseLeave:M,onTouchStart:T,ignoreBlocker:I,params:Y,search:D,hash:X,state:pe,mask:fs,reloadDocument:xn,unsafeRelative:bn,from:Cn,_fromLocation:Mn,...me}=t,ps=k({select:L=>L.location.search,structuralSharing:!0}),ge=t.from,ht=_.useMemo(()=>({...t,from:ge}),[e,ps,ge,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),V=_.useMemo(()=>e.buildLocation({...ht}),[e,ht]),St=_.useMemo(()=>{if(b)return;let L=V.maskedLocation?V.maskedLocation.url:V.url,O=!1;return e.origin&&(L.startsWith(e.origin)?L=e.history.createHref(L.replace(e.origin,""))||"/":O=!0),{href:L,external:O}},[b,V.maskedLocation,V.url,e.origin,e.history]),_t=_.useMemo(()=>{if(St?.external)return St.href;try{return new URL(l),l}catch{}},[l,St]),ot=t.reloadDocument||_t?!1:h??e.options.defaultPreload,$t=d??e.options.defaultPreloadDelay??0,jt=k({select:L=>{if(_t)return!1;if(u?.exact){if(!Fs(L.location.pathname,V.pathname,e.basepath))return!1}else{const O=Ot(L.location.pathname,e.basepath),z=Ot(V.pathname,e.basepath);if(!(O.startsWith(z)&&(O.length===z.length||O[z.length]==="/")))return!1}return(u?.includeSearch??!0)&&!tt(L.location.search,V.search,{partial:!u?.exact,ignoreUndefined:!u?.explicitUndefined})?!1:u?.includeHash?L.location.hash===V.hash:!0}}),Z=_.useCallback(()=>{e.preloadRoute({...ht}).catch(L=>{console.warn(L),console.warn(To)})},[e,ht]),ms=_.useCallback(L=>{L?.isIntersecting&&Z()},[Z]);Vo(i,ms,Yo,{disabled:!!b||ot!=="viewport"}),_.useEffect(()=>{r.current||!b&&ot==="render"&&(Z(),r.current=!0)},[b,Z,ot]);const gs=L=>{const O=L.currentTarget.getAttribute("target"),z=P!==void 0?P:O;if(!b&&!Xo(L)&&!L.defaultPrevented&&(!z||z==="_self")&&L.button===0){L.preventDefault(),fe.flushSync(()=>{n(!0)});const _e=e.subscribe("onResolved",()=>{_e(),n(!1)});e.navigate({...ht,replace:p,resetScroll:g,hashScrollIntoView:f,startTransition:m,viewTransition:y,ignoreBlocker:I})}};if(_t)return{...me,ref:i,href:_t,...w&&{children:w},...P&&{target:P},...b&&{disabled:b},...E&&{style:E},...x&&{className:x},...R&&{onClick:R},...S&&{onFocus:S},...C&&{onMouseEnter:C},...M&&{onMouseLeave:M},...T&&{onTouchStart:T}};const ve=L=>{b||ot&&Z()},vs=ve,ys=L=>{if(!(b||!ot))if(!$t)Z();else{const O=L.target;if(ft.has(O))return;const z=setTimeout(()=>{ft.delete(O),Z()},$t);ft.set(O,z)}},Ss=L=>{if(b||!ot||!$t)return;const O=L.target,z=ft.get(O);z&&(clearTimeout(z),ft.delete(O))},Rt=jt?Q(a,{})??Ho:Yt,Pt=jt?Yt:Q(c,{})??Yt,ye=[x,Rt.className,Pt.className].filter(Boolean).join(" "),Se=(E||Rt.style||Pt.style)&&{...E,...Rt.style,...Pt.style};return{...me,...Rt,...Pt,href:St?.href,ref:i,onClick:pt([R,gs]),onFocus:pt([S,ve]),onMouseEnter:pt([C,ys]),onMouseLeave:pt([M,Ss]),onTouchStart:pt([T,vs]),disabled:!!b,target:P,...Se&&{style:Se},...ye&&{className:ye},...b&&qo,...jt&&Go,...s&&Jo}}const Yt={},Ho={className:"active"},qo={role:"link","aria-disabled":!0},Go={"data-status":"active","aria-current":"page"},Jo={"data-transitioning":"transitioning"},ft=new WeakMap,Yo={rootMargin:"100px"},pt=t=>o=>{for(const e of t)if(e){if(o.defaultPrevented)return;e(o)}},ls=_.forwardRef((t,o)=>{const{_asChild:e,...s}=t,{type:n,ref:r,...i}=Ko(s,o),a=typeof s.children=="function"?s.children({isActive:i["data-status"]==="active"}):s.children;return e===void 0&&delete i.disabled,_.createElement(e||"a",{...i,ref:r},a)});function Xo(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}class Zo extends is{constructor(o){super(o),this.useMatch=e=>W({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>W({...e,from:this.id,select:s=>e?.select?e.select(s.context):s.context}),this.useSearch=e=>he({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>ue({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>le({...e,from:this.id}),this.useLoaderData=e=>ce({...e,from:this.id}),this.useNavigate=()=>de({from:this.fullPath}),this.Link=it.forwardRef((e,s)=>v.jsx(ls,{ref:s,from:this.fullPath,...e})),this.$$typeof=Symbol.for("react.memo")}}function Qo(t){return new Zo(t)}class tn extends Io{constructor(o){super(o),this.useMatch=e=>W({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>W({...e,from:this.id,select:s=>e?.select?e.select(s.context):s.context}),this.useSearch=e=>he({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>ue({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>le({...e,from:this.id}),this.useLoaderData=e=>ce({...e,from:this.id}),this.useNavigate=()=>de({from:this.fullPath}),this.Link=it.forwardRef((e,s)=>v.jsx(ls,{ref:s,from:this.fullPath,...e})),this.$$typeof=Symbol.for("react.memo")}}function On(t){return new tn(t)}function ze(t){return typeof t=="object"?new $e(t,{silent:!0}).createRoute(t):new $e(t,{silent:!0}).createRoute}class $e{constructor(o,e){this.path=o,this.createRoute=s=>{this.silent;const n=Qo(s);return n.isRoot=!1,n},this.silent=e?.silent}}class je{constructor(o){this.useMatch=e=>W({select:e?.select,from:this.options.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>W({from:this.options.id,select:s=>e?.select?e.select(s.context):s.context}),this.useSearch=e=>he({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useParams=e=>ue({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useLoaderDeps=e=>le({...e,from:this.options.id}),this.useLoaderData=e=>ce({...e,from:this.options.id}),this.useNavigate=()=>{const e=F();return de({from:e.routesById[this.options.id].fullPath})},this.options=o,this.$$typeof=Symbol.for("react.memo")}}function Ne(t){return typeof t=="object"?new je(t):o=>new je({id:t,...o})}function en(){const t=F(),o=_.useRef({router:t,mounted:!1}),[e,s]=_.useState(!1),{hasPendingMatches:n,isLoading:r}=k({select:h=>({isLoading:h.isLoading,hasPendingMatches:h.matches.some(d=>d.status==="pending")}),structuralSharing:!0}),i=Jt(r),a=r||e||n,c=Jt(a),u=r||n,l=Jt(u);return t.startTransition=h=>{s(!0),_.startTransition(()=>{h(),s(!1)})},_.useEffect(()=>{const h=t.history.subscribe(t.load),d=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return J(t.latestLocation.href)!==J(d.href)&&t.commitLocation({...d,replace:!0}),()=>{h()}},[t,t.history]),Ct(()=>{if(typeof window<"u"&&t.ssr||o.current.router===t&&o.current.mounted)return;o.current={router:t,mounted:!0},(async()=>{try{await t.load()}catch(d){console.error(d)}})()},[t]),Ct(()=>{i&&!r&&t.emit({type:"onLoad",...et(t.state)})},[i,t,r]),Ct(()=>{l&&!u&&t.emit({type:"onBeforeRouteMount",...et(t.state)})},[u,l,t]),Ct(()=>{c&&!a&&(t.emit({type:"onResolved",...et(t.state)}),t.__store.setState(h=>({...h,status:"idle",resolvedLocation:h.location})),co(t))},[a,c,t]),null}function sn(t){const o=k({select:e=>`not-found-${e.location.pathname}-${e.status}`});return v.jsx(ae,{getResetKey:()=>o,onCatch:(e,s)=>{if($(e))t.onCatch?.(e,s);else throw e},errorComponent:({error:e})=>{if($(e))return t.fallback?.(e);throw e},children:t.children})}function on(){return v.jsx("p",{children:"Not Found"})}function rt(t){return v.jsx(v.Fragment,{children:t.children})}function us(t,o,e){return o.options.notFoundComponent?v.jsx(o.options.notFoundComponent,{data:e}):t.options.defaultNotFoundComponent?v.jsx(t.options.defaultNotFoundComponent,{data:e}):v.jsx(on,{})}function nn({children:t}){const o=F();return o.isServer?v.jsx("script",{nonce:o.options.ssr?.nonce,className:"$tsr",dangerouslySetInnerHTML:{__html:[t].filter(Boolean).join(` +`)+";$_TSR.c()"}}):null}function rn(){const t=F();if(!t.isScrollRestoring||!t.isServer||typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return null;const e=(t.options.getScrollRestorationKey||te)(t.latestLocation),s=e!==te(t.latestLocation)?e:void 0,n={storageKey:kt,shouldScrollRestoration:!0};return s&&(n.key=s),v.jsx(nn,{children:`(${Ye.toString()})(${JSON.stringify(n)})`})}const hs=_.memo(function({matchId:o}){const e=F(),s=k({select:y=>{const w=y.matches.find(P=>P.id===o);return K(w),{routeId:w.routeId,ssr:w.ssr,_displayPending:w._displayPending}},structuralSharing:!0}),n=e.routesById[s.routeId],r=n.options.pendingComponent??e.options.defaultPendingComponent,i=r?v.jsx(r,{}):null,a=n.options.errorComponent??e.options.defaultErrorComponent,c=n.options.onCatch??e.options.defaultOnCatch,u=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,l=s.ssr===!1||s.ssr==="data-only",h=(!n.isRoot||n.options.wrapInSuspense||l)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||l))?_.Suspense:rt,d=a?ae:rt,f=u?sn:rt,p=k({select:y=>y.loadedAt}),m=k({select:y=>{const w=y.matches.findIndex(P=>P.id===o);return y.matches[w-1]?.routeId}}),g=n.isRoot?n.options.shellComponent??rt:rt;return v.jsxs(g,{children:[v.jsx(zt.Provider,{value:o,children:v.jsx(h,{fallback:i,children:v.jsx(d,{getResetKey:()=>p,errorComponent:a||Dt,onCatch:(y,w)=>{if($(y))throw y;c?.(y,w)},children:v.jsx(f,{fallback:y=>{if(!u||y.routeId&&y.routeId!==s.routeId||!y.routeId&&!n.isRoot)throw y;return _.createElement(u,y)},children:l||s._displayPending?v.jsx(ko,{fallback:i,children:v.jsx(We,{matchId:o})}):v.jsx(We,{matchId:o})})})})}),m===A&&e.options.scrollRestoration?v.jsxs(v.Fragment,{children:[v.jsx(an,{}),v.jsx(rn,{})]}):null]})});function an(){const t=F(),o=_.useRef(void 0);return v.jsx("script",{suppressHydrationWarning:!0,ref:e=>{e&&(o.current===void 0||o.current.href!==t.latestLocation.href)&&(t.emit({type:"onRendered",...et(t.state)}),o.current=t.latestLocation)}},t.latestLocation.state.__TSR_key)}const We=_.memo(function({matchId:o}){const e=F(),{match:s,key:n,routeId:r}=k({select:c=>{const u=c.matches.find(p=>p.id===o),l=u.routeId,d=(e.routesById[l].options.remountDeps??e.options.defaultRemountDeps)?.({routeId:l,loaderDeps:u.loaderDeps,params:u._strictParams,search:u._strictSearch});return{key:d?JSON.stringify(d):void 0,routeId:l,match:{id:u.id,status:u.status,error:u.error,_forcePending:u._forcePending,_displayPending:u._displayPending}}},structuralSharing:!0}),i=e.routesById[r],a=_.useMemo(()=>{const c=i.options.component??e.options.defaultComponent;return c?v.jsx(c,{},n):v.jsx(cn,{})},[n,i.options.component,e.options.defaultComponent]);if(s._displayPending)throw e.getMatch(s.id)?._nonReactive.displayPendingPromise;if(s._forcePending)throw e.getMatch(s.id)?._nonReactive.minPendingPromise;if(s.status==="pending"){const c=i.options.pendingMinMs??e.options.defaultPendingMinMs;if(c){const u=e.getMatch(s.id);if(u&&!u._nonReactive.minPendingPromise&&!e.isServer){const l=at();u._nonReactive.minPendingPromise=l,setTimeout(()=>{l.resolve(),u._nonReactive.minPendingPromise=void 0},c)}}throw e.getMatch(s.id)?._nonReactive.loadPromise}if(s.status==="notFound")return K($(s.error)),us(e,i,s.error);if(s.status==="redirected")throw K(j(s.error)),e.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error"){if(e.isServer){const c=(i.options.errorComponent??e.options.defaultErrorComponent)||Dt;return v.jsx(c,{error:s.error,reset:void 0,info:{componentStack:""}})}throw s.error}return a}),cn=_.memo(function(){const o=F(),e=_.useContext(zt),s=k({select:u=>u.matches.find(l=>l.id===e)?.routeId}),n=o.routesById[s],r=k({select:u=>{const h=u.matches.find(d=>d.id===e);return K(h),h.globalNotFound}}),i=k({select:u=>{const l=u.matches,h=l.findIndex(d=>d.id===e);return l[h+1]?.id}}),a=o.options.defaultPendingComponent?v.jsx(o.options.defaultPendingComponent,{}):null;if(r)return us(o,n,void 0);if(!i)return null;const c=v.jsx(hs,{matchId:i});return s===A?v.jsx(_.Suspense,{fallback:a,children:c}):c});function ln(){const t=F(),e=t.routesById[A].options.pendingComponent??t.options.defaultPendingComponent,s=e?v.jsx(e,{}):null,n=t.isServer||typeof document<"u"&&t.ssr?rt:_.Suspense,r=v.jsxs(n,{fallback:s,children:[!t.isServer&&v.jsx(en,{}),v.jsx(un,{})]});return t.options.InnerWrap?v.jsx(t.options.InnerWrap,{children:r}):r}function un(){const t=F(),o=k({select:n=>n.matches[0]?.id}),e=k({select:n=>n.loadedAt}),s=o?v.jsx(hs,{matchId:o}):null;return v.jsx(zt.Provider,{value:o,children:t.options.disableGlobalCatchBoundary?s:v.jsx(ae,{getResetKey:()=>e,errorComponent:Dt,onCatch:n=>{n.message||n.toString()},children:s})})}function kn(){const t=F();return k({select:o=>[o.location.href,o.resolvedLocation?.href,o.status],structuralSharing:!0}),_.useCallback(o=>{const{pending:e,caseSensitive:s,fuzzy:n,includeSearch:r,...i}=o;return t.matchRoute(i,{pending:e,caseSensitive:s,fuzzy:n,includeSearch:r})},[t])}const Fn=t=>new hn(t);class hn extends bo{constructor(o){super(o)}}typeof globalThis<"u"?(globalThis.createFileRoute=ze,globalThis.createLazyFileRoute=Ne):typeof window<"u"&&(window.createFileRoute=ze,window.createLazyFileRoute=Ne);function dn({router:t,children:o,...e}){Object.keys(e).length>0&&t.update({...t.options,...e,context:{...t.options.context,...e.context}});const s=cs(),n=v.jsx(s.Provider,{value:t,children:o});return t.options.Wrap?v.jsx(t.options.Wrap,{children:n}):n}function An({router:t,...o}){return v.jsx(dn,{router:t,...o,children:v.jsx(ln,{})})}function nt(t,o,e){let s=e.initialDeps??[],n;function r(){var i,a,c,u;let l;e.key&&((i=e.debug)!=null&&i.call(e))&&(l=Date.now());const h=t();if(!(h.length!==s.length||h.some((p,m)=>s[m]!==p)))return n;s=h;let f;if(e.key&&((a=e.debug)!=null&&a.call(e))&&(f=Date.now()),n=o(...h),e.key&&((c=e.debug)!=null&&c.call(e))){const p=Math.round((Date.now()-l)*100)/100,m=Math.round((Date.now()-f)*100)/100,g=m/16,y=(w,P)=>{for(w=String(w);w.length{s=i},r}function Ve(t,o){if(t===void 0)throw new Error("Unexpected undefined");return t}const fn=(t,o)=>Math.abs(t-o)<1.01,pn=(t,o,e)=>{let s;return function(...n){t.clearTimeout(s),s=t.setTimeout(()=>o.apply(this,n),e)}},Ue=t=>{const{offsetWidth:o,offsetHeight:e}=t;return{width:o,height:e}},mn=t=>t,gn=t=>{const o=Math.max(t.startIndex-t.overscan,0),e=Math.min(t.endIndex+t.overscan,t.count-1),s=[];for(let n=o;n<=e;n++)s.push(n);return s},vn=(t,o)=>{const e=t.scrollElement;if(!e)return;const s=t.targetWindow;if(!s)return;const n=i=>{const{width:a,height:c}=i;o({width:Math.round(a),height:Math.round(c)})};if(n(Ue(e)),!s.ResizeObserver)return()=>{};const r=new s.ResizeObserver(i=>{const a=()=>{const c=i[0];if(c?.borderBoxSize){const u=c.borderBoxSize[0];if(u){n({width:u.inlineSize,height:u.blockSize});return}}n(Ue(e))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return r.observe(e,{box:"border-box"}),()=>{r.unobserve(e)}},Ke={passive:!0},He=typeof window>"u"?!0:"onscrollend"in window,yn=(t,o)=>{const e=t.scrollElement;if(!e)return;const s=t.targetWindow;if(!s)return;let n=0;const r=t.options.useScrollendEvent&&He?()=>{}:pn(s,()=>{o(n,!1)},t.options.isScrollingResetDelay),i=l=>()=>{const{horizontal:h,isRtl:d}=t.options;n=h?e.scrollLeft*(d&&-1||1):e.scrollTop,r(),o(n,l)},a=i(!0),c=i(!1);c(),e.addEventListener("scroll",a,Ke);const u=t.options.useScrollendEvent&&He;return u&&e.addEventListener("scrollend",c,Ke),()=>{e.removeEventListener("scroll",a),u&&e.removeEventListener("scrollend",c)}},Sn=(t,o,e)=>{if(o?.borderBoxSize){const s=o.borderBoxSize[0];if(s)return Math.round(s[e.options.horizontal?"inlineSize":"blockSize"])}return t[e.options.horizontal?"offsetWidth":"offsetHeight"]},_n=(t,{adjustments:o=0,behavior:e},s)=>{var n,r;const i=t+o;(r=(n=s.scrollElement)==null?void 0:n.scrollTo)==null||r.call(n,{[s.options.horizontal?"left":"top"]:i,behavior:e})};class Rn{constructor(o){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const s=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(n=>{n.forEach(r=>{const i=()=>{this._measureElement(r.target,r)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var n;(n=s())==null||n.disconnect(),e=null},observe:n=>{var r;return(r=s())==null?void 0:r.observe(n,{box:"border-box"})},unobserve:n=>{var r;return(r=s())==null?void 0:r.unobserve(n)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([s,n])=>{typeof n>"u"&&delete e[s]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:mn,rangeExtractor:gn,onChange:()=>{},measureElement:Sn,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var s,n;(n=(s=this.options).onChange)==null||n.call(s,this,e)},this.maybeNotify=nt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s){this.maybeNotify();return}this.scrollElement=s,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((e=this.scrollElement)==null?void 0:e.window)??null,this.elementsCache.forEach(n=>{this.observer.observe(n)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,n=>{this.scrollRect=n,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(n,r)=>{this.scrollAdjustments=0,this.scrollDirection=r?this.getScrollOffset()this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,s)=>{const n=new Map,r=new Map;for(let i=s-1;i>=0;i--){const a=e[i];if(n.has(a.lane))continue;const c=r.get(a.lane);if(c==null||a.end>c.end?r.set(a.lane,a):a.endi.end===a.end?i.index-a.index:i.end-a.end)[0]:void 0},this.getMeasurementOptions=nt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(e,s,n,r,i)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:s,scrollMargin:n,getItemKey:r,enabled:i}),{key:!1}),this.getMeasurements=nt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:s,scrollMargin:n,getItemKey:r,enabled:i},a)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(l=>{this.itemSizeCache.set(l.key,l.size)}));const c=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,c);for(let l=c;lthis.options.debug}),this.calculateRange=nt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,s,n,r)=>this.range=e.length>0&&s>0?Pn({measurements:e,outerSize:s,scrollOffset:n,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=nt(()=>{let e=null,s=null;const n=this.calculateRange();return n&&(e=n.startIndex,s=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,s]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,s]},(e,s,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:s,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const s=this.options.indexAttribute,n=e.getAttribute(s);return n?parseInt(n,10):(console.warn(`Missing attribute name '${s}={index}' on measured element.`),-1)},this._measureElement=(e,s)=>{const n=this.indexFromElement(e),r=this.measurementsCache[n];if(!r)return;const i=r.key,a=this.elementsCache.get(i);a!==e&&(a&&this.observer.unobserve(a),this.observer.observe(e),this.elementsCache.set(i,e)),e.isConnected&&this.resizeItem(n,this.options.measureElement(e,s,this))},this.resizeItem=(e,s)=>{const n=this.measurementsCache[e];if(!n)return;const r=this.itemSizeCache.get(n.key)??n.size,i=s-r;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(n,i,this):n.start{if(!e){this.elementsCache.forEach((s,n)=>{s.isConnected||(this.observer.unobserve(s),this.elementsCache.delete(n))});return}this._measureElement(e,void 0)},this.getVirtualItems=nt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,s)=>{const n=[];for(let r=0,i=e.length;rthis.options.debug}),this.getVirtualItemForOffset=e=>{const s=this.getMeasurements();if(s.length!==0)return Ve(s[ds(0,s.length-1,n=>Ve(s[n]).start,e)])},this.getOffsetForAlignment=(e,s,n=0)=>{const r=this.getSize(),i=this.getScrollOffset();s==="auto"&&(s=e>=i+r?"end":"start"),s==="center"?e+=(n-r)/2:s==="end"&&(e-=r);const a=this.getTotalSize()+this.options.scrollMargin-r;return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,s="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const n=this.measurementsCache[e];if(!n)return;const r=this.getSize(),i=this.getScrollOffset();if(s==="auto")if(n.end>=i+r-this.options.scrollPaddingEnd)s="end";else if(n.start<=i+this.options.scrollPaddingStart)s="start";else return[i,s];const a=s==="end"?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,s,n.size),s]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:s="start",behavior:n}={})=>{n==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,s),{adjustments:void 0,behavior:n})},this.scrollToIndex=(e,{align:s="auto",behavior:n}={})=>{n==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1));let r=0;const i=10,a=u=>{if(!this.targetWindow)return;const l=this.getOffsetForIndex(e,u);if(!l){console.warn("Failed to get offset for index:",e);return}const[h,d]=l;this._scrollToOffset(h,{adjustments:void 0,behavior:n}),this.targetWindow.requestAnimationFrame(()=>{const f=this.getScrollOffset(),p=this.getOffsetForIndex(e,d);if(!p){console.warn("Failed to get offset for index:",e);return}fn(p[0],f)||c(d)})},c=u=>{this.targetWindow&&(r++,ra(u)):console.warn(`Failed to scroll to index ${e} after ${i} attempts.`))};a(s)},this.scrollBy=(e,{behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:s})},this.getTotalSize=()=>{var e;const s=this.getMeasurements();let n;if(s.length===0)n=this.options.paddingStart;else if(this.options.lanes===1)n=((e=s[s.length-1])==null?void 0:e.end)??0;else{const r=Array(this.options.lanes).fill(null);let i=s.length-1;for(;i>=0&&r.some(a=>a===null);){const a=s[i];r[a.lane]===null&&(r[a.lane]=a.end),i--}n=Math.max(...r.filter(a=>a!==null))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:s,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:s},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(o)}}const ds=(t,o,e,s)=>{for(;t<=o;){const n=(t+o)/2|0,r=e(n);if(rs)o=n-1;else return n}return t>0?t-1:0};function Pn({measurements:t,outerSize:o,scrollOffset:e,lanes:s}){const n=t.length-1,r=c=>t[c].start;if(t.length<=s)return{startIndex:0,endIndex:n};let i=ds(0,n,r,e),a=i;if(s===1)for(;a1){const c=Array(s).fill(0);for(;al=0&&u.some(l=>l>=e);){const l=t[i];u[l.lane]=l.start,i--}i=Math.max(0,i-i%s),a=Math.min(n,a+(s-1-a%s))}return{startIndex:i,endIndex:a}}const qe=typeof document<"u"?_.useLayoutEffect:_.useEffect;function wn(t){const o=_.useReducer(()=>({}),{})[1],e={...t,onChange:(n,r)=>{var i;r?fe.flushSync(o):o(),(i=t.onChange)==null||i.call(t,n,r)}},[s]=_.useState(()=>new Rn(e));return s.setOptions(e),qe(()=>s._didMount(),[]),qe(()=>s._willUpdate()),s}function Bn(t){return wn({observeElementRect:vn,observeElementOffset:yn,scrollToFn:_n,...t})}export{ls as L,cn as O,it as R,En as a,fe as b,In as c,Do as d,de as e,Bn as f,kn as g,On as h,K as i,v as j,Qo as k,Fn as l,go as m,An as n,_ as r,Tn as u}; diff --git a/webui/dist/assets/router-DQNkr8RI.js b/webui/dist/assets/router-DQNkr8RI.js deleted file mode 100644 index 70f3abb1..00000000 --- a/webui/dist/assets/router-DQNkr8RI.js +++ /dev/null @@ -1,2 +0,0 @@ -import{r as po,a as ee,g as oe,b as mo}from"./react-vendor-Dtc2IqVY.js";function go(t,o){for(var e=0;es[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var g=po(),R=ee();const rt=oe(R),hn=go({__proto__:null,default:rt},[R]),Yt=new WeakMap,yo=new WeakMap,bt={current:[]};let Nt=!1,mt=0;const pt=new Set,Pt=new Map;function Ue(t){for(const o of t){if(bt.current.includes(o))continue;bt.current.push(o),o.recompute();const e=yo.get(o);if(e)for(const s of e){const n=Yt.get(s);n?.length&&Ue(n)}}}function vo(t){const o={prevVal:t.prevState,currentVal:t.state};for(const e of t.listeners)e(o)}function So(t){const o={prevVal:t.prevState,currentVal:t.state};for(const e of t.listeners)e(o)}function Ve(t){if(mt>0&&!Pt.has(t)&&Pt.set(t,t.prevState),pt.add(t),!(mt>0)&&!Nt)try{for(Nt=!0;pt.size>0;){const o=Array.from(pt);pt.clear();for(const e of o){const s=Pt.get(e)??e.prevState;e.prevState=s,vo(e)}for(const e of o){const s=Yt.get(e);s&&(bt.current.push(e),Ue(s))}for(const e of o){const s=Yt.get(e);if(s)for(const n of s)So(n)}}}finally{Nt=!1,bt.current=[],Pt.clear()}}function gt(t){mt++;try{t()}finally{if(mt--,mt===0){const o=pt.values().next().value;o&&Ve(o)}}}function _o(t){return typeof t=="function"}class Ro{constructor(o,e){this.listeners=new Set,this.subscribe=s=>{var n,r;this.listeners.add(s);const i=(r=(n=this.options)==null?void 0:n.onSubscribe)==null?void 0:r.call(n,s,this);return()=>{this.listeners.delete(s),i?.()}},this.prevState=o,this.state=o,this.options=e}setState(o){var e,s,n;this.prevState=this.state,(e=this.options)!=null&&e.updateFn?this.state=this.options.updateFn(this.prevState)(o):_o(o)?this.state=o(this.prevState):this.state=o,(n=(s=this.options)==null?void 0:s.onUpdate)==null||n.call(s),Ve(this)}}const G="__TSR_index",Se="popstate",_e="beforeunload";function Po(t){let o=t.getLocation();const e=new Set,s=i=>{o=t.getLocation(),e.forEach(c=>c({location:o,action:i}))},n=i=>{t.notifyOnIndexChange??!0?s(i):o=t.getLocation()},r=async({task:i,navigateOpts:c,...a})=>{if(c?.ignoreBlocker??!1){i();return}const u=t.getBlockers?.()??[],h=a.type==="PUSH"||a.type==="REPLACE";if(typeof document<"u"&&u.length&&h)for(const f of u){const d=Et(a.path,a.state);if(await f.blockerFn({currentLocation:o,nextLocation:d,action:a.type})){t.onBlocked?.();return}}i()};return{get location(){return o},get length(){return t.getLength()},subscribers:e,subscribe:i=>(e.add(i),()=>{e.delete(i)}),push:(i,c,a)=>{const l=o.state[G];c=Re(l+1,c),r({task:()=>{t.pushState(i,c),s({type:"PUSH"})},navigateOpts:a,type:"PUSH",path:i,state:c})},replace:(i,c,a)=>{const l=o.state[G];c=Re(l,c),r({task:()=>{t.replaceState(i,c),s({type:"REPLACE"})},navigateOpts:a,type:"REPLACE",path:i,state:c})},go:(i,c)=>{r({task:()=>{t.go(i),n({type:"GO",index:i})},navigateOpts:c,type:"GO"})},back:i=>{r({task:()=>{t.back(i?.ignoreBlocker??!1),n({type:"BACK"})},navigateOpts:i,type:"BACK"})},forward:i=>{r({task:()=>{t.forward(i?.ignoreBlocker??!1),n({type:"FORWARD"})},navigateOpts:i,type:"FORWARD"})},canGoBack:()=>o.state[G]!==0,createHref:i=>t.createHref(i),block:i=>{if(!t.setBlockers)return()=>{};const c=t.getBlockers?.()??[];return t.setBlockers([...c,i]),()=>{const a=t.getBlockers?.()??[];t.setBlockers?.(a.filter(l=>l!==i))}},flush:()=>t.flush?.(),destroy:()=>t.destroy?.(),notify:s}}function Re(t,o){o||(o={});const e=se();return{...o,key:e,__TSR_key:e,[G]:t}}function wo(t){const o=typeof document<"u"?window:void 0,e=o.history.pushState,s=o.history.replaceState;let n=[];const r=()=>n,i=v=>n=v,c=(v=>v),a=(()=>Et(`${o.location.pathname}${o.location.search}${o.location.hash}`,o.history.state));if(!o.history.state?.__TSR_key&&!o.history.state?.key){const v=se();o.history.replaceState({[G]:0,key:v,__TSR_key:v},"")}let l=a(),u,h=!1,f=!1,d=!1,p=!1;const m=()=>l;let y,_;const x=()=>{y&&(S._ignoreSubscribers=!0,(y.isPush?o.history.pushState:o.history.replaceState)(y.state,"",y.href),S._ignoreSubscribers=!1,y=void 0,_=void 0,u=void 0)},P=(v,C,M)=>{const T=c(C);_||(u=l),l=Et(C,M),y={href:T,state:M,isPush:y?.isPush||v==="push"},_||(_=Promise.resolve().then(()=>x()))},L=v=>{l=a(),S.notify({type:v})},E=async()=>{if(f){f=!1;return}const v=a(),C=v.state[G]-l.state[G],M=C===1,T=C===-1,I=!M&&!T||h;h=!1;const Y=I?"GO":T?"BACK":"FORWARD",D=I?{type:"GO",index:C}:{type:T?"BACK":"FORWARD"};if(d)d=!1;else{const X=r();if(typeof document<"u"&&X.length){for(const fe of X)if(await fe.blockerFn({currentLocation:l,nextLocation:v,action:Y})){f=!0,o.history.go(1),S.notify(D);return}}}l=a(),S.notify(D)},w=v=>{if(p){p=!1;return}let C=!1;const M=r();if(typeof document<"u"&&M.length)for(const T of M){const I=T.enableBeforeUnload??!0;if(I===!0){C=!0;break}if(typeof I=="function"&&I()===!0){C=!0;break}}if(C)return v.preventDefault(),v.returnValue=""},S=Po({getLocation:m,getLength:()=>o.history.length,pushState:(v,C)=>P("push",v,C),replaceState:(v,C)=>P("replace",v,C),back:v=>(v&&(d=!0),p=!0,o.history.back()),forward:v=>{v&&(d=!0),p=!0,o.history.forward()},go:v=>{h=!0,o.history.go(v)},createHref:v=>c(v),flush:x,destroy:()=>{o.history.pushState=e,o.history.replaceState=s,o.removeEventListener(_e,w,{capture:!0}),o.removeEventListener(Se,E)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:r,setBlockers:i,notifyOnIndexChange:!1});return o.addEventListener(_e,w,{capture:!0}),o.addEventListener(Se,E),o.history.pushState=function(...v){const C=e.apply(o.history,v);return S._ignoreSubscribers||L("PUSH"),C},o.history.replaceState=function(...v){const C=s.apply(o.history,v);return S._ignoreSubscribers||L("REPLACE"),C},S}function Et(t,o){const e=t.indexOf("#"),s=t.indexOf("?"),n=se();return{href:t,pathname:t.substring(0,e>0?s>0?Math.min(e,s):e:s>0?s:t.length),hash:e>-1?t.substring(e):"",search:s>-1?t.slice(s,e===-1?void 0:e):"",state:o||{[G]:0,key:n,__TSR_key:n}}}function se(){return(Math.random()+1).toString(36).substring(7)}function Xt(t){return t[t.length-1]}function xo(t){return typeof t=="function"}function Q(t,o){return xo(t)?t(o):t}const Lo=Object.prototype.hasOwnProperty;function B(t,o){if(t===o)return t;const e=o,s=xe(t)&&xe(e);if(!s&&!(Tt(t)&&Tt(e)))return e;const n=s?t:Pe(t);if(!n)return e;const r=s?e:Pe(e);if(!r)return e;const i=n.length,c=r.length,a=s?new Array(c):{};let l=0;for(let u=0;u"u")return!0;const e=o.prototype;return!(!we(e)||!e.hasOwnProperty("isPrototypeOf"))}function we(t){return Object.prototype.toString.call(t)==="[object Object]"}function xe(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function tt(t,o,e){if(t===o)return!0;if(typeof t!=typeof o)return!1;if(Array.isArray(t)&&Array.isArray(o)){if(t.length!==o.length)return!1;for(let s=0,n=t.length;sn||!tt(t[i],o[i],e)))return!1;return n===r}return!1}function it(t){let o,e;const s=new Promise((n,r)=>{o=n,e=r});return s.status="pending",s.resolve=n=>{s.status="resolved",s.value=n,o(n),t?.(n)},s.reject=n=>{s.status="rejected",e(n)},s}function q(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}const Co=Array.from(new Map([["%","%25"],["\\","%5C"]]).values());function Le(t,o=Co){function e(n,r,i=0){for(let c=i;c{try{return decodeURI(c)}catch{return c}})}}if(t===""||!/%[0-9A-Fa-f]{2}/g.test(t))return t;const s=t.replaceAll(/%[0-9a-f]{2}/g,n=>n.toUpperCase());return e(s,o)}var Mo="Invariant failed";function K(t,o){if(!t)throw new Error(Mo)}const U=0,ot=1,at=2,ct=3;function z(t){return ne(t.filter(o=>o!==void 0).join("/"))}function ne(t){return t.replace(/\/{2,}/g,"/")}function re(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}function J(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}function Ct(t){return J(re(t))}function It(t,o){return t?.endsWith("/")&&t!=="/"&&t!==`${o}/`?t.slice(0,-1):t}function bo(t,o,e){return It(t,e)===It(o,e)}function Eo(t){const{type:o,value:e}=t;if(o===U)return e;const{prefixSegment:s,suffixSegment:n}=t;if(o===ot){const r=e.substring(1);if(s&&n)return`${s}{$${r}}${n}`;if(s)return`${s}{$${r}}`;if(n)return`{$${r}}${n}`}if(o===ct){const r=e.substring(1);return s&&n?`${s}{-$${r}}${n}`:s?`${s}{-$${r}}`:n?`{-$${r}}${n}`:`{-$${r}}`}if(o===at){if(s&&n)return`${s}{$}${n}`;if(s)return`${s}{$}`;if(n)return`{$}${n}`}return e}function To({base:t,to:o,trailingSlash:e="never",parseCache:s}){let n=ut(t,s).slice();const r=ut(o,s);n.length>1&&Xt(n)?.value==="/"&&n.pop();for(let a=0,l=r.length;a1&&(Xt(n).value==="/"?e==="never"&&n.pop():e==="always"&&n.push({type:U,value:"/"}));const i=n.map(Eo);return z(i)}const ut=(t,o)=>{if(!t)return[];const e=o?.get(t);if(e)return e;const s=Bo(t);return o?.set(t,s),s},Io=/^\$.{1,}$/,ko=/^(.*?)\{(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,Oo=/^(.*?)\{-(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,Fo=/^\$$/,Ao=/^(.*?)\{\$\}(.*)$/;function Bo(t){t=ne(t);const o=[];if(t.slice(0,1)==="/"&&(t=t.substring(1),o.push({type:U,value:"/"})),!t)return o;const e=t.split("/").filter(Boolean);return o.push(...e.map(s=>{const n=s.match(Ao);if(n){const c=n[1],a=n[2];return{type:at,value:"$",prefixSegment:c||void 0,suffixSegment:a||void 0}}const r=s.match(Oo);if(r){const c=r[1],a=r[2],l=r[3];return{type:ct,value:a,prefixSegment:c||void 0,suffixSegment:l||void 0}}const i=s.match(ko);if(i){const c=i[1],a=i[2],l=i[3];return{type:ot,value:""+a,prefixSegment:c||void 0,suffixSegment:l||void 0}}if(Io.test(s)){const c=s.substring(1);return{type:ot,value:"$"+c,prefixSegment:void 0,suffixSegment:void 0}}return Fo.test(s)?{type:at,value:"$",prefixSegment:void 0,suffixSegment:void 0}:{type:U,value:s}})),t.slice(-1)==="/"&&(t=t.substring(1),o.push({type:U,value:"/"})),o}function Ut({path:t,params:o,decodeCharMap:e,parseCache:s}){const n=ut(t,s);function r(l){const u=o[l],h=typeof u=="string";return l==="*"||l==="_splat"?h?encodeURI(u):u:h?Do(u,e):u}let i=!1;const c={},a=z(n.map(l=>{if(l.type===U)return l.value;if(l.type===at){c._splat=o._splat,c["*"]=o._splat;const u=l.prefixSegment||"",h=l.suffixSegment||"";if(!o._splat)return i=!0,u||h?`${u}${h}`:void 0;const f=r("_splat");return`${u}${f}${h}`}if(l.type===ot){const u=l.value.substring(1);!i&&!(u in o)&&(i=!0),c[u]=o[u];const h=l.prefixSegment||"",f=l.suffixSegment||"";return`${h}${r(u)??"undefined"}${f}`}if(l.type===ct){const u=l.value.substring(1),h=l.prefixSegment||"",f=l.suffixSegment||"";return!(u in o)||o[u]==null?h||f?`${h}${f}`:void 0:(c[u]=o[u],`${h}${r(u)??""}${f}`)}return l.value}));return{usedParams:c,interpolatedPath:a,isMissingParams:i}}function Do(t,o){let e=encodeURIComponent(t);if(o)for(const[s,n]of o)e=e.replaceAll(s,n);return e}function Zt(t,o,e){const s=$o(t,o,e);if(!(o.to&&!s))return s??{}}function $o(t,{to:o,fuzzy:e,caseSensitive:s},n){const r=o,i=ut(t.startsWith("/")?t:`/${t}`,n),c=ut(r.startsWith("/")?r:`/${r}`,n),a={};return jo(i,c,a,e,s)?a:void 0}function jo(t,o,e,s,n){let r=0,i=0;for(;rm.value)));h&&p.startsWith(h)&&(p=p.slice(h.length)),f&&p.endsWith(f)&&(p=p.slice(0,p.length-f.length)),u=p}else u=decodeURI(z(l.map(h=>h.value)));return e["*"]=u,e._splat=u,!0}if(a.type===U){if(a.value==="/"&&!c?.value){i++;continue}if(c){if(n){if(a.value!==c.value)return!1}else if(a.value.toLowerCase()!==c.value.toLowerCase())return!1;r++,i++;continue}else return!1}if(a.type===ot){if(!c||c.value==="/")return!1;let l="",u=!1;if(a.prefixSegment||a.suffixSegment){const h=a.prefixSegment||"",f=a.suffixSegment||"",d=c.value;if(h&&!d.startsWith(h)||f&&!d.endsWith(f))return!1;let p=d;h&&p.startsWith(h)&&(p=p.slice(h.length)),f&&p.endsWith(f)&&(p=p.slice(0,p.length-f.length)),l=decodeURIComponent(p),u=!0}else l=decodeURIComponent(c.value),u=!0;u&&(e[a.value.substring(1)]=l,r++),i++;continue}if(a.type===ct){if(!c){i++;continue}if(c.value==="/"){i++;continue}let l="",u=!1;if(a.prefixSegment||a.suffixSegment){const h=a.prefixSegment||"",f=a.suffixSegment||"",d=c.value;if((!h||d.startsWith(h))&&(!f||d.endsWith(f))){let p=d;h&&p.startsWith(h)&&(p=p.slice(h.length)),f&&p.endsWith(f)&&(p=p.slice(0,p.length-f.length)),l=decodeURIComponent(p),u=!0}}else{let h=!0;for(let f=i+1;f=o.length)return e["**"]=z(t.slice(r).map(l=>l.value)),!!s&&o[o.length-1]?.value!=="/";if(i=t.length){for(let l=i;l{if(s.isRoot||!s.path)return;const r=re(s.fullPath);let i=ut(r),c=0;for(;i.length>c+1&&i[c]?.value==="/";)c++;c>0&&(i=i.slice(c));let a=0,l=!1;const u=i.map((h,f)=>{if(h.value==="/")return No;if(h.type===U)return Uo;let d;h.type===ot?d=Vo:h.type===ct?(d=Wo,a++):d=zo;for(let p=f+1;p{const r=Math.min(s.scores.length,n.scores.length);for(let i=0;in.parsed[i].value?1:-1;return s.index-n.index}).map((s,n)=>(s.child.rank=n,s.child))}function Yo({routeTree:t,initRoute:o}){const e={},s={},n=i=>{i.forEach((c,a)=>{o?.(c,a);const l=e[c.id];if(K(!l,`Duplicate routes found with id: ${String(c.id)}`),e[c.id]=c,!c.isRoot&&c.path){const h=J(c.fullPath);(!s[h]||c.fullPath.endsWith("/"))&&(s[h]=c)}const u=c.children;u?.length&&n(u)})};n([t]);const r=Jo(Object.values(e));return{routesById:e,routesByPath:s,flatRoutes:r}}function j(t){return!!t?.isNotFound}function Xo(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const kt="tsr-scroll-restoration-v1_3",Zo=(t,o)=>{let e;return(...s)=>{e||(e=setTimeout(()=>{t(...s),e=null},o))}};function Qo(){const t=Xo();if(!t)return null;const o=t.getItem(kt);let e=o?JSON.parse(o):{};return{state:e,set:s=>(e=Q(s,e)||e,t.setItem(kt,JSON.stringify(e)))}}const wt=Qo(),Qt=t=>t.state.__TSR_key||t.href;function ts(t){const o=[];let e;for(;e=t.parentNode;)o.push(`${t.tagName}:nth-child(${Array.prototype.indexOf.call(e.children,t)+1})`),t=e;return`${o.reverse().join(" > ")}`.toLowerCase()}let Ot=!1;function We({storageKey:t,key:o,behavior:e,shouldScrollRestoration:s,scrollToTopSelectors:n,location:r}){let i;try{i=JSON.parse(sessionStorage.getItem(t)||"{}")}catch(l){console.error(l);return}const c=o||window.history.state?.__TSR_key,a=i[c];Ot=!0;t:{if(s&&a&&Object.keys(a).length>0){for(const h in a){const f=a[h];if(h==="window")window.scrollTo({top:f.scrollY,left:f.scrollX,behavior:e});else if(h){const d=document.querySelector(h);d&&(d.scrollLeft=f.scrollX,d.scrollTop=f.scrollY)}}break t}const l=(r??window.location).hash.split("#",2)[1];if(l){const h=window.history.state?.__hashScrollIntoViewOptions??!0;if(h){const f=document.getElementById(l);f&&f.scrollIntoView(h)}break t}const u={top:0,left:0,behavior:e};if(window.scrollTo(u),n)for(const h of n){if(h==="window")continue;const f=typeof h=="function"?h():document.querySelector(h);f&&f.scrollTo(u)}}Ot=!1}function es(t,o){if(!wt&&!t.isServer||((t.options.scrollRestoration??!1)&&(t.isScrollRestoring=!0),t.isServer||t.isScrollRestorationSetup||!wt))return;t.isScrollRestorationSetup=!0,Ot=!1;const s=t.options.getScrollRestorationKey||Qt;window.history.scrollRestoration="manual";const n=r=>{if(Ot||!t.isScrollRestoring)return;let i="";if(r.target===document||r.target===window)i="window";else{const a=r.target.getAttribute("data-scroll-restoration-id");a?i=`[data-scroll-restoration-id="${a}"]`:i=ts(r.target)}const c=s(t.state.location);wt.set(a=>{const l=a[c]||={},u=l[i]||={};if(i==="window")u.scrollX=window.scrollX||0,u.scrollY=window.scrollY||0;else if(i){const h=document.querySelector(i);h&&(u.scrollX=h.scrollLeft||0,u.scrollY=h.scrollTop||0)}return a})};typeof document<"u"&&document.addEventListener("scroll",Zo(n,100),!0),t.subscribe("onRendered",r=>{const i=s(r.toLocation);if(!t.resetNextScroll){t.resetNextScroll=!0;return}typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation})||(We({storageKey:kt,key:i,behavior:t.options.scrollRestorationBehavior,shouldScrollRestoration:t.isScrollRestoring,scrollToTopSelectors:t.options.scrollToTopSelectors,location:t.history.location}),t.isScrollRestoring&&wt.set(c=>(c[i]||={},c)))})}function os(t){if(typeof document<"u"&&document.querySelector){const o=t.state.location.state.__hashScrollIntoViewOptions??!0;if(o&&t.state.location.hash!==""){const e=document.getElementById(t.state.location.hash);e&&e.scrollIntoView(o)}}}function ss(t,o=String){const e=new URLSearchParams;for(const s in t){const n=t[s];n!==void 0&&e.set(s,o(n))}return e.toString()}function Vt(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}function ns(t){const o=new URLSearchParams(t),e={};for(const[s,n]of o.entries()){const r=e[s];r==null?e[s]=Vt(n):Array.isArray(r)?r.push(Vt(n)):e[s]=[r,Vt(n)]}return e}const rs=as(JSON.parse),is=cs(JSON.stringify,JSON.parse);function as(t){return o=>{o[0]==="?"&&(o=o.substring(1));const e=ns(o);for(const s in e){const n=e[s];if(typeof n=="string")try{e[s]=t(n)}catch{}}return e}}function cs(t,o){const e=typeof o=="function";function s(n){if(typeof n=="object"&&n!==null)try{return t(n)}catch{}else if(e&&typeof n=="string")try{return o(n),t(n)}catch{}return n}return n=>{const r=ss(n,s);return r?`?${r}`:""}}const A="__root__";function us(t){if(t.statusCode=t.statusCode||t.code||307,!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}const o=new Headers(t.headers);t.href&&o.get("Location")===null&&o.set("Location",t.href);const e=new Response(null,{status:t.statusCode,headers:o});if(e.options=t,t.throw)throw e;return e}function N(t){return t instanceof Response&&!!t.options}function ls(t){const o=new Map;let e,s;const n=r=>{r.next&&(r.prev?(r.prev.next=r.next,r.next.prev=r.prev,r.next=void 0,s&&(s.next=r,r.prev=s)):(r.next.prev=void 0,e=r.next,r.next=void 0,s&&(r.prev=s,s.next=r)),s=r)};return{get(r){const i=o.get(r);if(i)return n(i),i.value},set(r,i){if(o.size>=t&&e){const a=e;o.delete(a.key),a.next&&(e=a.next,a.next.prev=void 0),a===s&&(s=void 0)}const c=o.get(r);if(c)c.value=i,n(c);else{const a={key:r,value:i,prev:s};s&&(s.next=a),s=a,e||(e=a),o.set(r,a)}}}}const Mt=t=>{if(!t.rendered)return t.rendered=!0,t.onReady?.()},At=(t,o)=>!!(t.preload&&!t.router.state.matches.some(e=>e.id===o)),ze=(t,o)=>{const e=t.router.routesById[o.routeId??""]??t.router.routeTree;!e.options.notFoundComponent&&t.router.options?.defaultNotFoundComponent&&(e.options.notFoundComponent=t.router.options.defaultNotFoundComponent),K(e.options.notFoundComponent);const s=t.matches.find(n=>n.routeId===e.id);K(s,"Could not find match for route: "+e.id),t.updateMatch(s.id,n=>({...n,status:"notFound",error:o,isFetching:!1})),o.routerCode==="BEFORE_LOAD"&&e.parentRoute&&(o.routeId=e.parentRoute.id,ze(t,o))},H=(t,o,e)=>{if(!(!N(e)&&!j(e))){if(N(e)&&e.redirectHandled&&!e.options.reloadDocument)throw e;if(o){o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.loaderPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,o._nonReactive.loaderPromise=void 0;const s=N(e)?"redirected":"notFound";o._nonReactive.error=e,t.updateMatch(o.id,n=>({...n,status:s,isFetching:!1,error:e})),j(e)&&!e.routeId&&(e.routeId=o.routeId),o._nonReactive.loadPromise?.resolve()}throw N(e)?(t.rendered=!0,e.options._fromLocation=t.location,e.redirectHandled=!0,e=t.router.resolveRedirect(e),e):(ze(t,e),e)}},Ke=(t,o)=>{const e=t.router.getMatch(o);return!!(!t.router.isServer&&e._nonReactive.dehydrated||t.router.isServer&&e.ssr===!1)},ht=(t,o,e,s)=>{const{id:n,routeId:r}=t.matches[o],i=t.router.looseRoutesById[r];if(e instanceof Promise)throw e;e.routerCode=s,t.firstBadMatchIndex??=o,H(t,t.router.getMatch(n),e);try{i.options.onError?.(e)}catch(c){e=c,H(t,t.router.getMatch(n),e)}t.updateMatch(n,c=>(c._nonReactive.beforeLoadPromise?.resolve(),c._nonReactive.beforeLoadPromise=void 0,c._nonReactive.loadPromise?.resolve(),{...c,error:e,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},hs=(t,o,e,s)=>{const n=t.router.getMatch(o),r=t.matches[e-1]?.id,i=r?t.router.getMatch(r):void 0;if(t.router.isShell()){n.ssr=s.id===A;return}if(i?.ssr===!1){n.ssr=!1;return}const c=d=>d===!0&&i?.ssr==="data-only"?"data-only":d,a=t.router.options.defaultSsr??!0;if(s.options.ssr===void 0){n.ssr=c(a);return}if(typeof s.options.ssr!="function"){n.ssr=c(s.options.ssr);return}const{search:l,params:u}=n,h={search:xt(l,n.searchError),params:xt(u,n.paramsError),location:t.location,matches:t.matches.map(d=>({index:d.index,pathname:d.pathname,fullPath:d.fullPath,staticData:d.staticData,id:d.id,routeId:d.routeId,search:xt(d.search,d.searchError),params:xt(d.params,d.paramsError),ssr:d.ssr}))},f=s.options.ssr(h);if(q(f))return f.then(d=>{n.ssr=c(d??a)});n.ssr=c(f??a)},He=(t,o,e,s)=>{if(s._nonReactive.pendingTimeout!==void 0)return;const n=e.options.pendingMs??t.router.options.defaultPendingMs;if(!!(t.onReady&&!t.router.isServer&&!At(t,o)&&(e.options.loader||e.options.beforeLoad||Je(e))&&typeof n=="number"&&n!==1/0&&(e.options.pendingComponent??t.router.options?.defaultPendingComponent))){const i=setTimeout(()=>{Mt(t)},n);s._nonReactive.pendingTimeout=i}},fs=(t,o,e)=>{const s=t.router.getMatch(o);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;He(t,o,e,s);const n=()=>{const r=t.router.getMatch(o);r.preload&&(r.status==="redirected"||r.status==="notFound")&&H(t,r,r.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(n):n()},ds=(t,o,e,s)=>{const n=t.router.getMatch(o),r=n._nonReactive.loadPromise;n._nonReactive.loadPromise=it(()=>{r?.resolve()});const{paramsError:i,searchError:c}=n;i&&ht(t,e,i,"PARSE_PARAMS"),c&&ht(t,e,c,"VALIDATE_SEARCH"),He(t,o,s,n);const a=new AbortController,l=t.matches[e-1]?.id,f={...(l?t.router.getMatch(l):void 0)?.context??t.router.options.context??void 0,...n.__routeContext};let d=!1;const p=()=>{d||(d=!0,t.updateMatch(o,S=>({...S,isFetching:"beforeLoad",fetchCount:S.fetchCount+1,abortController:a,context:f})))},m=()=>{n._nonReactive.beforeLoadPromise?.resolve(),n._nonReactive.beforeLoadPromise=void 0,t.updateMatch(o,S=>({...S,isFetching:!1}))};if(!s.options.beforeLoad){gt(()=>{p(),m()});return}n._nonReactive.beforeLoadPromise=it();const{search:y,params:_,cause:x}=n,P=At(t,o),L={search:y,abortController:a,params:_,preload:P,context:f,location:t.location,navigate:S=>t.router.navigate({...S,_fromLocation:t.location}),buildLocation:t.router.buildLocation,cause:P?"preload":x,matches:t.matches,...t.router.options.additionalContext},E=S=>{if(S===void 0){gt(()=>{p(),m()});return}(N(S)||j(S))&&(p(),ht(t,e,S,"BEFORE_LOAD")),gt(()=>{p(),t.updateMatch(o,v=>({...v,__beforeLoadContext:S,context:{...v.context,...S}})),m()})};let w;try{if(w=s.options.beforeLoad(L),q(w))return p(),w.catch(S=>{ht(t,e,S,"BEFORE_LOAD")}).then(E)}catch(S){p(),ht(t,e,S,"BEFORE_LOAD")}E(w)},ps=(t,o)=>{const{id:e,routeId:s}=t.matches[o],n=t.router.looseRoutesById[s],r=()=>{if(t.router.isServer){const a=hs(t,e,o,n);if(q(a))return a.then(c)}return c()},i=()=>ds(t,e,o,n),c=()=>{if(Ke(t,e))return;const a=fs(t,e,n);return q(a)?a.then(i):i()};return r()},yt=(t,o,e)=>{const s=t.router.getMatch(o);if(!s||!e.options.head&&!e.options.scripts&&!e.options.headers)return;const n={matches:t.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([e.options.head?.(n),e.options.scripts?.(n),e.options.headers?.(n)]).then(([r,i,c])=>{const a=r?.meta,l=r?.links,u=r?.scripts,h=r?.styles;return{meta:a,links:l,headScripts:u,headers:c,scripts:i,styles:h}})},Ge=(t,o,e,s)=>{const n=t.matchPromises[e-1],{params:r,loaderDeps:i,abortController:c,cause:a}=t.router.getMatch(o);let l=t.router.options.context??{};for(let h=0;h<=e;h++){const f=t.matches[h];if(!f)continue;const d=t.router.getMatch(f.id);d&&(l={...l,...d.__routeContext??{},...d.__beforeLoadContext??{}})}const u=At(t,o);return{params:r,deps:i,preload:!!u,parentMatchPromise:n,abortController:c,context:l,location:t.location,navigate:h=>t.router.navigate({...h,_fromLocation:t.location}),cause:u?"preload":a,route:s,...t.router.options.additionalContext}},Ee=async(t,o,e,s)=>{try{const n=t.router.getMatch(o);try{(!t.router.isServer||n.ssr===!0)&&qe(s);const r=s.options.loader?.(Ge(t,o,e,s)),i=s.options.loader&&q(r);if(!!(i||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||n._nonReactive.minPendingPromise)&&t.updateMatch(o,h=>({...h,isFetching:"loader"})),s.options.loader){const h=i?await r:r;H(t,t.router.getMatch(o),h),h!==void 0&&t.updateMatch(o,f=>({...f,loaderData:h}))}s._lazyPromise&&await s._lazyPromise;const a=yt(t,o,s),l=a?await a:void 0,u=n._nonReactive.minPendingPromise;u&&await u,s._componentsPromise&&await s._componentsPromise,t.updateMatch(o,h=>({...h,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),...l}))}catch(r){let i=r;const c=n._nonReactive.minPendingPromise;c&&await c,j(r)&&await s.options.notFoundComponent?.preload?.(),H(t,t.router.getMatch(o),r);try{s.options.onError?.(r)}catch(u){i=u,H(t,t.router.getMatch(o),u)}const a=yt(t,o,s),l=a?await a:void 0;t.updateMatch(o,u=>({...u,error:i,status:"error",isFetching:!1,...l}))}}catch(n){const r=t.router.getMatch(o);if(r){const i=yt(t,o,s);if(i){const c=await i;t.updateMatch(o,a=>({...a,...c}))}r._nonReactive.loaderPromise=void 0}H(t,r,n)}},ms=async(t,o)=>{const{id:e,routeId:s}=t.matches[o];let n=!1,r=!1;const i=t.router.looseRoutesById[s];if(Ke(t,e)){if(t.router.isServer){const l=yt(t,e,i);if(l){const u=await l;t.updateMatch(e,h=>({...h,...u}))}return t.router.getMatch(e)}}else{const l=t.router.getMatch(e);if(l._nonReactive.loaderPromise){if(l.status==="success"&&!t.sync&&!l.preload)return l;await l._nonReactive.loaderPromise;const u=t.router.getMatch(e),h=u._nonReactive.error||u.error;h&&H(t,u,h)}else{const u=Date.now()-l.updatedAt,h=At(t,e),f=h?i.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:i.options.staleTime??t.router.options.defaultStaleTime??0,d=i.options.shouldReload,p=typeof d=="function"?d(Ge(t,e,o,i)):d,m=!!h&&!t.router.state.matches.some(P=>P.id===e),y=t.router.getMatch(e);y._nonReactive.loaderPromise=it(),m!==y.preload&&t.updateMatch(e,P=>({...P,preload:m}));const{status:_,invalid:x}=y;if(n=_==="success"&&(x||(p??u>f)),!(h&&i.options.preload===!1))if(n&&!t.sync)r=!0,(async()=>{try{await Ee(t,e,o,i);const P=t.router.getMatch(e);P._nonReactive.loaderPromise?.resolve(),P._nonReactive.loadPromise?.resolve(),P._nonReactive.loaderPromise=void 0}catch(P){N(P)&&await t.router.navigate(P.options)}})();else if(_!=="success"||n&&t.sync)await Ee(t,e,o,i);else{const P=yt(t,e,i);if(P){const L=await P;t.updateMatch(e,E=>({...E,...L}))}}}}const c=t.router.getMatch(e);r||(c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loadPromise?.resolve()),clearTimeout(c._nonReactive.pendingTimeout),c._nonReactive.pendingTimeout=void 0,r||(c._nonReactive.loaderPromise=void 0),c._nonReactive.dehydrated=void 0;const a=r?c.isFetching:!1;return a!==c.isFetching||c.invalid!==!1?(t.updateMatch(e,l=>({...l,isFetching:a,invalid:!1})),t.router.getMatch(e)):c};async function Te(t){const o=Object.assign(t,{matchPromises:[]});!o.router.isServer&&o.router.state.matches.some(e=>e._forcePending)&&Mt(o);try{for(let n=0;n{const{id:e,...s}=o.options;Object.assign(t.options,s),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0),!t._componentsLoaded&&t._componentsPromise===void 0){const o=()=>{const e=[];for(const s of Ye){const n=t.options[s]?.preload;n&&e.push(n())}if(e.length)return Promise.all(e).then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0});t._componentsLoaded=!0,t._componentsPromise=void 0};t._componentsPromise=t._lazyPromise?t._lazyPromise.then(o):o()}return t._componentsPromise}function xt(t,o){return o?{status:"error",error:o}:{status:"success",value:t}}function Je(t){for(const o of Ye)if(t.options[o]?.preload)return!0;return!1}const Ye=["component","errorComponent","pendingComponent","notFoundComponent"];function gs(t){return{input:({url:o})=>{for(const e of t)o=Xe(e,o);return o},output:({url:o})=>{for(let e=t.length-1;e>=0;e--)o=Ze(t[e],o);return o}}}function ys(t){const o=Ct(t.basepath),e=`/${o}`,s=`${e}/`,n=t.caseSensitive?e:e.toLowerCase(),r=t.caseSensitive?s:s.toLowerCase();return{input:({url:i})=>{const c=t.caseSensitive?i.pathname:i.pathname.toLowerCase();return c===n?i.pathname="/":c.startsWith(r)&&(i.pathname=i.pathname.slice(e.length)),i},output:({url:i})=>(i.pathname=z(["/",o,i.pathname]),i)}}function Xe(t,o){const e=t?.input?.({url:o});if(e){if(typeof e=="string")return new URL(e);if(e instanceof URL)return e}return o}function Ze(t,o){const e=t?.output?.({url:o});if(e){if(typeof e=="string")return new URL(e);if(e instanceof URL)return e}return o}function et(t){const o=t.resolvedLocation,e=t.location,s=o?.pathname!==e.pathname,n=o?.href!==e.href,r=o?.hash!==e.hash;return{fromLocation:o,toLocation:e,pathChanged:s,hrefChanged:n,hashChanged:r}}class vs{constructor(o){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{e.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const s=this.options,n=this.basepath??s?.basepath??"/",r=this.basepath===void 0,i=s?.rewrite;this.options={...s,...e},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(f=>[encodeURIComponent(f),f])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=wo())),this.origin=this.options.origin,this.origin||(!this.isServer&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new Ro(_s(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(f=>!["redirected"].includes(f.status))}}}),es(this));let c=!1;const a=this.options.basepath??"/",l=this.options.rewrite;if(r||n!==a||i!==l){this.basepath=a;const f=[];Ct(a)!==""&&f.push(ys({basepath:a})),l&&f.push(l),this.rewrite=f.length===0?void 0:f.length===1?f[0]:gs(f),this.history&&this.updateLatestLocation(),c=!0}c&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const{routesById:e,routesByPath:s,flatRoutes:n}=Yo({routeTree:this.routeTree,initRoute:(i,c)=>{i.init({originalIndex:c})}});this.routesById=e,this.routesByPath=s,this.flatRoutes=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)},this.subscribe=(e,s)=>{const n={eventType:e,fn:s};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(s=>{s.eventType===e.type&&s.fn(e)})},this.parseLocation=(e,s)=>{const n=({href:a,state:l})=>{const u=new URL(a,this.origin),h=Xe(this.rewrite,u),f=this.options.parseSearch(h.search),d=this.options.stringifySearch(f);h.search=d;const p=h.href.replace(h.origin,""),{pathname:m,hash:y}=h;return{href:p,publicHref:a,url:h.href,pathname:Le(m),searchStr:d,search:B(s?.search,f),hash:y.split("#").reverse()[0]??"",state:B(s?.state,l)}},r=n(e),{__tempLocation:i,__tempKey:c}=r.state;if(i&&(!c||c===this.tempLocationKey)){const a=n(i);return a.state.key=r.state.key,a.state.__TSR_key=r.state.__TSR_key,delete a.state.__tempLocation,{...a,maskedLocation:r}}return r},this.resolvePathWithBase=(e,s)=>To({base:e,to:ne(s),trailingSlash:this.options.trailingSlash,parseCache:this.parsePathnameCache}),this.matchRoutes=(e,s,n)=>typeof e=="string"?this.matchRoutesInternal({pathname:e,search:s},n):this.matchRoutesInternal(e,s),this.parsePathnameCache=ls(1e3),this.getMatchedRoutes=(e,s)=>Rs({pathname:e,routePathname:s,caseSensitive:this.options.caseSensitive,routesByPath:this.routesByPath,routesById:this.routesById,flatRoutes:this.flatRoutes,parseCache:this.parsePathnameCache}),this.cancelMatch=e=>{const s=this.getMatch(e);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const e=this.state.matches.filter(r=>r.status==="pending"),s=this.state.matches.filter(r=>r.isFetching==="loader");new Set([...this.state.pendingMatches??[],...e,...s]).forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=e=>{const s=(r={})=>{const i=r._fromLocation||this.pendingBuiltLocation||this.latestLocation,c=this.matchRoutes(i,{_buildLocation:!0}),a=Xt(c);r.from;const l=r.unsafeRelative==="path"?i.pathname:r.from??a.fullPath,u=this.resolvePathWithBase(l,"."),h=a.search,f={...a.params},d=r.to?this.resolvePathWithBase(u,`${r.to}`):this.resolvePathWithBase(u,"."),p=r.params===!1||r.params===null?{}:(r.params??!0)===!0?f:Object.assign(f,Q(r.params,f)),m=Ut({path:d,params:p,parseCache:this.parsePathnameCache}).interpolatedPath,y=this.matchRoutes(m,void 0,{_buildLocation:!0}).map(M=>this.looseRoutesById[M.routeId]);if(Object.keys(p).length>0)for(const M of y){const T=M.options.params?.stringify??M.options.stringifyParams;T&&Object.assign(p,T(p))}const _=e.leaveParams?d:Le(Ut({path:d,params:p,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath);let x=h;if(e._includeValidateSearch&&this.options.search?.strict){const M={};y.forEach(T=>{if(T.options.validateSearch)try{Object.assign(M,te(T.options.validateSearch,{...M,...x}))}catch{}}),x=M}x=Ps({search:x,dest:r,destRoutes:y,_includeValidateSearch:e._includeValidateSearch}),x=B(h,x);const P=this.options.stringifySearch(x),L=r.hash===!0?i.hash:r.hash?Q(r.hash,i.hash):void 0,E=L?`#${L}`:"";let w=r.state===!0?i.state:r.state?Q(r.state,i.state):{};w=B(i.state,w);const S=`${_}${P}${E}`,v=new URL(S,this.origin),C=Ze(this.rewrite,v);return{publicHref:C.pathname+C.search+C.hash,href:S,url:C.href,pathname:_,search:x,searchStr:P,state:w,hash:L??"",unmaskOnReload:r.unmaskOnReload}},n=(r={},i)=>{const c=s(r);let a=i?s(i):void 0;if(!a){let l={};const u=this.options.routeMasks?.find(h=>{const f=Zt(c.pathname,{to:h.from,caseSensitive:!1,fuzzy:!1},this.parsePathnameCache);return f?(l=f,!0):!1});if(u){const{from:h,...f}=u;i={from:e.from,...f,params:l},a=s(i)}}return a&&(c.maskedLocation=a),c};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=({viewTransition:e,ignoreBlocker:s,...n})=>{const r=()=>{const a=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];a.forEach(u=>{n.state[u]=this.latestLocation.state[u]});const l=tt(n.state,this.latestLocation.state);return a.forEach(u=>{delete n.state[u]}),l},i=J(this.latestLocation.href)===J(n.href),c=this.commitLocationPromise;if(this.commitLocationPromise=it(()=>{c?.resolve()}),i&&r())this.load();else{let{maskedLocation:a,hashScrollIntoView:l,...u}=n;a&&(u={...a,state:{...a.state,__tempKey:void 0,__tempLocation:{...u,search:u.searchStr,state:{...u.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(u.unmaskOnReload??this.options.unmaskOnReload??!1)&&(u.state.__tempKey=this.tempLocationKey)),u.state.__hashScrollIntoViewOptions=l??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?"replace":"push"](u.publicHref,u.state,{ignoreBlocker:s})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:s,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:c,...a}={})=>{if(c){const h=this.history.location.state.__TSR_index,f=Et(c,{__TSR_index:e?h:h+1});a.to=f.pathname,a.search=this.options.parseSearch(f.search),a.hash=f.hash.slice(1)}const l=this.buildLocation({...a,_includeValidateSearch:!0});this.pendingBuiltLocation=l;const u=this.commitLocation({...l,viewTransition:r,replace:e,resetScroll:s,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===l&&(this.pendingBuiltLocation=void 0)}),u},this.navigate=({to:e,reloadDocument:s,href:n,...r})=>{if(!s&&n)try{new URL(`${n}`),s=!0}catch{}return s?(n||(n=this.buildLocation({to:e,...r}).url),r.replace?window.location.replace(n):window.location.href=n,Promise.resolve()):this.buildAndCommitLocation({...r,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const s=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0}),n=r=>{try{return encodeURI(decodeURI(r))}catch{return r}};if(Ct(n(this.latestLocation.href))!==Ct(n(s.href))){let r=s.url;throw this.origin&&r.startsWith(this.origin)&&(r=r.replace(this.origin,"")||"/"),us({href:r})}}const e=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:e,cachedMatches:s.cachedMatches.filter(n=>!e.some(r=>r.id===n.id))}))},this.load=async e=>{let s,n,r;for(r=new Promise(c=>{this.startTransition(async()=>{try{this.beforeLoad();const a=this.latestLocation,l=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...et({resolvedLocation:l,location:a})}),this.emit({type:"onBeforeLoad",...et({resolvedLocation:l,location:a})}),await Te({router:this,sync:e?.sync,matches:this.state.pendingMatches,location:a,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let u=[],h=[],f=[];gt(()=>{this.__store.setState(d=>{const p=d.matches,m=d.pendingMatches||d.matches;return u=p.filter(y=>!m.some(_=>_.id===y.id)),h=m.filter(y=>!p.some(_=>_.id===y.id)),f=m.filter(y=>p.some(_=>_.id===y.id)),{...d,isLoading:!1,loadedAt:Date.now(),matches:m,pendingMatches:void 0,cachedMatches:[...d.cachedMatches,...u.filter(y=>y.status!=="error")]}}),this.clearExpiredCache()}),[[u,"onLeave"],[h,"onEnter"],[f,"onStay"]].forEach(([d,p])=>{d.forEach(m=>{this.looseRoutesById[m.routeId].options[p]?.(m)})})})})}})}catch(a){N(a)?(s=a,this.isServer||this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):j(a)&&(n=a),this.__store.setState(l=>({...l,statusCode:s?s.status:n?404:l.matches.some(u=>u.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),c()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let i;this.hasNotFoundMatch()?i=404:this.__store.state.matches.some(c=>c.status==="error")&&(i=500),i!==void 0&&this.__store.setState(c=>({...c,statusCode:i}))},this.startViewTransition=e=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let n;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const r=this.latestLocation,i=this.state.resolvedLocation,c=typeof s.types=="function"?s.types(et({resolvedLocation:i,location:r})):s.types;if(c===!1){e();return}n={update:e,types:c}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,s)=>{this.startTransition(()=>{const n=this.state.pendingMatches?.some(r=>r.id===e)?"pendingMatches":this.state.matches.some(r=>r.id===e)?"matches":this.state.cachedMatches.some(r=>r.id===e)?"cachedMatches":"";n&&this.__store.setState(r=>({...r,[n]:r[n]?.map(i=>i.id===e?s(i):i)}))})},this.getMatch=e=>{const s=n=>n.id===e;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=e=>{const s=n=>e?.filter?.(n)??!0?{...n,invalid:!0,...e?.forcePending||n.status==="error"?{status:"pending",error:void 0}:void 0}:n;return this.__store.setState(n=>({...n,matches:n.matches.map(s),cachedMatches:n.cachedMatches.map(s),pendingMatches:n.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{if(!e.options.href){const s=this.buildLocation(e.options);let n=s.url;this.origin&&n.startsWith(this.origin)&&(n=n.replace(this.origin,"")||"/"),e.options.href=s.href,e.headers.set("Location",n)}return e.headers.get("Location")||e.headers.set("Location",e.options.href),e},this.clearCache=e=>{const s=e?.filter;s!==void 0?this.__store.setState(n=>({...n,cachedMatches:n.cachedMatches.filter(r=>!s(r))})):this.__store.setState(n=>({...n,cachedMatches:[]}))},this.clearExpiredCache=()=>{const e=s=>{const n=this.looseRoutesById[s.routeId];if(!n.options.loader)return!0;const r=(s.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=r};this.clearCache({filter:e})},this.loadRouteChunk=qe,this.preloadRoute=async e=>{const s=this.buildLocation(e);let n=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:e});const r=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(c=>c.id)),i=new Set([...r,...this.state.cachedMatches.map(c=>c.id)]);gt(()=>{n.forEach(c=>{i.has(c.id)||this.__store.setState(a=>({...a,cachedMatches:[...a.cachedMatches,c]}))})});try{return n=await Te({router:this,matches:n,location:s,preload:!0,updateMatch:(c,a)=>{r.has(c)?n=n.map(l=>l.id===c?a(l):l):this.updateMatch(c,a)}}),n}catch(c){if(N(c))return c.options.reloadDocument?void 0:await this.preloadRoute({...c.options,_fromLocation:s});j(c)||console.error(c);return}},this.matchRoute=(e,s)=>{const n={...e,to:e.to?this.resolvePathWithBase(e.from||"",e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(s?.pending&&this.state.status!=="pending")return!1;const c=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,a=Zt(c.pathname,{...s,to:r.pathname},this.parsePathnameCache);return!a||e.params&&!tt(a,e.params,{partial:!0})?!1:a&&(s?.includeSearch??!0)?tt(c.search,r.search,{partial:!0})?a:!1:a},this.hasNotFoundMatch=()=>this.__store.state.matches.some(e=>e.status==="notFound"||e.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...o,caseSensitive:o.caseSensitive??!1,notFoundMode:o.notFoundMode??"fuzzy",stringifySearch:o.stringifySearch??is,parseSearch:o.parseSearch??rs}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(o,e){const{foundRoute:s,matchedRoutes:n,routeParams:r}=this.getMatchedRoutes(o.pathname,e?.dest?.to);let i=!1;(s?s.path!=="/"&&r["**"]:J(o.pathname))&&(this.options.notFoundRoute?n.push(this.options.notFoundRoute):i=!0);const c=(()=>{if(i){if(this.options.notFoundMode!=="root")for(let u=n.length-1;u>=0;u--){const h=n[u];if(h.children)return h.id}return A}})(),a=[],l=u=>u?.id?u.context??this.options.context??void 0:this.options.context??void 0;return n.forEach((u,h)=>{const f=a[h-1],[d,p,m]=(()=>{const I=f?.search??o.search,Y=f?._strictSearch??void 0;try{const D=te(u.options.validateSearch,{...I})??void 0;return[{...I,...D},{...Y,...D},void 0]}catch(D){let X=D;if(D instanceof Ft||(X=new Ft(D.message,{cause:D})),e?.throwOnError)throw X;return[I,{},X]}})(),y=u.options.loaderDeps?.({search:d})??"",_=y?JSON.stringify(y):"",{interpolatedPath:x,usedParams:P}=Ut({path:u.fullPath,params:r,decodeCharMap:this.pathParamsDecodeCharMap}),L=u.id+x+_,E=this.getMatch(L),w=this.state.matches.find(I=>I.routeId===u.id),S=E?._strictParams??P;let v;if(!E){const I=u.options.params?.parse??u.options.parseParams;if(I)try{Object.assign(S,I(S))}catch(Y){if(v=new Ss(Y.message,{cause:Y}),e?.throwOnError)throw v}}Object.assign(r,S);const C=w?"stay":"enter";let M;if(E)M={...E,cause:C,params:w?B(w.params,r):r,_strictParams:S,search:B(w?w.search:E.search,d),_strictSearch:p};else{const I=u.options.loader||u.options.beforeLoad||u.lazyFn||Je(u)?"pending":"success";M={id:L,index:h,routeId:u.id,params:w?B(w.params,r):r,_strictParams:S,pathname:x,updatedAt:Date.now(),search:w?B(w.search,d):d,_strictSearch:p,searchError:void 0,status:I,isFetching:!1,error:void 0,paramsError:v,__routeContext:void 0,_nonReactive:{loadPromise:it()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:C,loaderDeps:w?B(w.loaderDeps,y):y,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:u.options.staticData||{},fullPath:u.fullPath}}e?.preload||(M.globalNotFound=c===u.id),M.searchError=m;const T=l(f);M.context={...T,...M.__routeContext,...M.__beforeLoadContext},a.push(M)}),a.forEach((u,h)=>{const f=this.looseRoutesById[u.routeId];if(!this.getMatch(u.id)&&e?._buildLocation!==!0){const p=a[h-1],m=l(p);if(f.options.context){const y={deps:u.loaderDeps,params:u.params,context:m??{},location:o,navigate:_=>this.navigate({..._,_fromLocation:o}),buildLocation:this.buildLocation,cause:u.cause,abortController:u.abortController,preload:!!u.preload,matches:a};u.__routeContext=f.options.context(y)??void 0}u.context={...m,...u.__routeContext,...u.__beforeLoadContext}}}),a}}class Ft extends Error{}class Ss extends Error{}function _s(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function te(t,o){if(t==null)return{};if("~standard"in t){const e=t["~standard"].validate(o);if(e instanceof Promise)throw new Ft("Async validation not supported");if(e.issues)throw new Ft(JSON.stringify(e.issues,void 0,2),{cause:e});return e.value}return"parse"in t?t.parse(o):typeof t=="function"?t(o):{}}function Rs({pathname:t,routePathname:o,caseSensitive:e,routesByPath:s,routesById:n,flatRoutes:r,parseCache:i}){let c={};const a=J(t),l=d=>Zt(a,{to:d.fullPath,caseSensitive:d.options?.caseSensitive??e,fuzzy:!0},i);let u=o!==void 0?s[o]:void 0;if(u)c=l(u);else{let d;for(const p of r){const m=l(p);if(m)if(p.path!=="/"&&m["**"])d||(d={foundRoute:p,routeParams:m});else{u=p,c=m;break}}!u&&d&&(u=d.foundRoute,c=d.routeParams)}let h=u||n[A];const f=[h];for(;h.parentRoute;)h=h.parentRoute,f.push(h);return f.reverse(),{matchedRoutes:f,routeParams:c,foundRoute:u}}function Ps({search:t,dest:o,destRoutes:e,_includeValidateSearch:s}){const n=e.reduce((c,a)=>{const l=[];if("search"in a.options)a.options.search?.middlewares&&l.push(...a.options.search.middlewares);else if(a.options.preSearchFilters||a.options.postSearchFilters){const u=({search:h,next:f})=>{let d=h;"preSearchFilters"in a.options&&a.options.preSearchFilters&&(d=a.options.preSearchFilters.reduce((m,y)=>y(m),h));const p=f(d);return"postSearchFilters"in a.options&&a.options.postSearchFilters?a.options.postSearchFilters.reduce((m,y)=>y(m),p):p};l.push(u)}if(s&&a.options.validateSearch){const u=({search:h,next:f})=>{const d=f(h);try{return{...d,...te(a.options.validateSearch,d)??void 0}}catch{return d}};l.push(u)}return c.concat(l)},[])??[],r=({search:c})=>o.search?o.search===!0?c:Q(o.search,c):{};n.push(r);const i=(c,a)=>{if(c>=n.length)return a;const l=n[c];return l({search:a,next:h=>i(c+1,h)})};return i(0,t)}const ws="Error preloading route! ☝️";class Qe{constructor(o){if(this.init=e=>{this.originalIndex=e.originalIndex;const s=this.options,n=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=A:this.parentRoute||K(!1);let r=n?A:s?.path;r&&r!=="/"&&(r=re(r));const i=s?.id||r;let c=n?A:z([this.parentRoute.id===A?"":this.parentRoute.id,i]);r===A&&(r="/"),c!==A&&(c=z(["/",c]));const a=c===A?"/":z([this.parentRoute.fullPath,r]);this._path=r,this._id=c,this._fullPath=a,this._to=a},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e=="object"&&e!==null&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.options=o||{},this.isRoot=!o?.getParentRoute,o?.id&&o?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class xs extends Qe{constructor(o){super(o)}}function ie(t){const o=t.errorComponent??Bt;return g.jsx(Ls,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:e,reset:s})=>e?R.createElement(o,{error:e,reset:s}):t.children})}class Ls extends R.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(o){return{resetKey:o.getResetKey()}}static getDerivedStateFromError(o){return{error:o}}reset(){this.setState({error:null})}componentDidUpdate(o,e){e.error&&e.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(o,e){this.props.onCatch&&this.props.onCatch(o,e)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Bt({error:t}){const[o,e]=R.useState(!1);return g.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[g.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),g.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>e(s=>!s),children:o?"Hide Error":"Show Error"})]}),g.jsx("div",{style:{height:".25rem"}}),o?g.jsx("div",{children:g.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?g.jsx("code",{children:t.message}):null})}):null]})}function Cs({children:t,fallback:o=null}){return Ms()?g.jsx(rt.Fragment,{children:t}):g.jsx(rt.Fragment,{children:o})}function Ms(){return rt.useSyncExternalStore(bs,()=>!0,()=>!1)}function bs(){return()=>{}}var Wt={exports:{}},zt={},Kt={exports:{}},Ht={};var Ie;function Es(){if(Ie)return Ht;Ie=1;var t=ee();function o(h,f){return h===f&&(h!==0||1/h===1/f)||h!==h&&f!==f}var e=typeof Object.is=="function"?Object.is:o,s=t.useState,n=t.useEffect,r=t.useLayoutEffect,i=t.useDebugValue;function c(h,f){var d=f(),p=s({inst:{value:d,getSnapshot:f}}),m=p[0].inst,y=p[1];return r(function(){m.value=d,m.getSnapshot=f,a(m)&&y({inst:m})},[h,d,f]),n(function(){return a(m)&&y({inst:m}),h(function(){a(m)&&y({inst:m})})},[h]),i(d),d}function a(h){var f=h.getSnapshot;h=h.value;try{var d=f();return!e(h,d)}catch{return!0}}function l(h,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:c;return Ht.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,Ht}var ke;function Ts(){return ke||(ke=1,Kt.exports=Es()),Kt.exports}var Oe;function Is(){if(Oe)return zt;Oe=1;var t=ee(),o=Ts();function e(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var s=typeof Object.is=="function"?Object.is:e,n=o.useSyncExternalStore,r=t.useRef,i=t.useEffect,c=t.useMemo,a=t.useDebugValue;return zt.useSyncExternalStoreWithSelector=function(l,u,h,f,d){var p=r(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=c(function(){function _(w){if(!x){if(x=!0,P=w,w=f(w),d!==void 0&&m.hasValue){var S=m.value;if(d(S,w))return L=S}return L=w}if(S=L,s(P,w))return S;var v=f(w);return d!==void 0&&d(S,v)?(P=w,S):(P=w,L=v)}var x=!1,P,L,E=h===void 0?null:h;return[function(){return _(u())},E===null?void 0:function(){return _(E())}]},[u,h,f,d]);var y=n(l,p[0],p[1]);return i(function(){m.hasValue=!0,m.value=y},[y]),a(y),y},zt}var Fe;function ks(){return Fe||(Fe=1,Wt.exports=Is()),Wt.exports}var to=ks();const fn=oe(to);function Os(t,o=s=>s,e={}){const s=e.equal??Fs;return to.useSyncExternalStoreWithSelector(t.subscribe,()=>t.state,()=>t.state,o,s)}function Fs(t,o){if(Object.is(t,o))return!0;if(typeof t!="object"||t===null||typeof o!="object"||o===null)return!1;if(t instanceof Map&&o instanceof Map){if(t.size!==o.size)return!1;for(const[s,n]of t)if(!o.has(s)||!Object.is(n,o.get(s)))return!1;return!0}if(t instanceof Set&&o instanceof Set){if(t.size!==o.size)return!1;for(const s of t)if(!o.has(s))return!1;return!0}if(t instanceof Date&&o instanceof Date)return t.getTime()===o.getTime();const e=Ae(t);if(e.length!==Ae(o).length)return!1;for(let s=0;s"u"?Gt:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Gt,Gt)}function F(t){const o=R.useContext(eo());return t?.warn,o}function O(t){const o=F({warn:t?.router===void 0}),e=t?.router||o,s=R.useRef(void 0);return Os(e.__store,n=>{if(t?.select){if(t.structuralSharing??e.options.defaultStructuralSharing){const r=B(s.current,t.select(n));return s.current=r,r}return t.select(n)}return n})}const Dt=R.createContext(void 0),As=R.createContext(void 0);function V(t){const o=R.useContext(t.from?As:Dt);return O({select:s=>{const n=s.matches.find(r=>t.from?t.from===r.routeId:r.id===o);if(K(!((t.shouldThrow??!0)&&!n),`Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`),n!==void 0)return t.select?t.select(n):n},structuralSharing:t.structuralSharing})}function ae(t){return V({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:o=>t.select?t.select(o.loaderData):o.loaderData})}function ce(t){const{select:o,...e}=t;return V({...e,select:s=>o?o(s.loaderDeps):s.loaderDeps})}function ue(t){return V({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:o=>{const e=t.strict===!1?o.params:o._strictParams;return t.select?t.select(e):e}})}function le(t){return V({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:o=>t.select?t.select(o.search):o.search})}function he(t){const o=F();return R.useCallback(e=>o.navigate({...e,from:e.from??t?.from}),[t?.from,o])}var oo=mo();const dn=oe(oo),Lt=typeof window<"u"?R.useLayoutEffect:R.useEffect;function qt(t){const o=R.useRef({value:t,prev:null}),e=o.current.value;return t!==e&&(o.current={value:t,prev:e}),o.current.prev}function Bs(t,o,e={},s={}){R.useEffect(()=>{if(!t.current||s.disabled||typeof IntersectionObserver!="function")return;const n=new IntersectionObserver(([r])=>{o(r)},e);return n.observe(t.current),()=>{n.disconnect()}},[o,e,s.disabled,t])}function Ds(t){const o=R.useRef(null);return R.useImperativeHandle(t,()=>o.current,[]),o}function $s(t,o){const e=F(),[s,n]=R.useState(!1),r=R.useRef(!1),i=Ds(o),{activeProps:c,inactiveProps:a,activeOptions:l,to:u,preload:h,preloadDelay:f,hashScrollIntoView:d,replace:p,startTransition:m,resetScroll:y,viewTransition:_,children:x,target:P,disabled:L,style:E,className:w,onClick:S,onFocus:v,onMouseEnter:C,onMouseLeave:M,onTouchStart:T,ignoreBlocker:I,params:Y,search:D,hash:X,state:fe,mask:io,reloadDocument:rn,unsafeRelative:an,from:cn,_fromLocation:un,...de}=t,ao=O({select:b=>b.location.search,structuralSharing:!0}),pe=t.from,lt=R.useMemo(()=>({...t,from:pe}),[e,ao,pe,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),W=R.useMemo(()=>e.buildLocation({...lt}),[e,lt]),vt=R.useMemo(()=>{if(L)return;let b=W.maskedLocation?W.maskedLocation.url:W.url,k=!1;return e.origin&&(b.startsWith(e.origin)?b=e.history.createHref(b.replace(e.origin,""))||"/":k=!0),{href:b,external:k}},[L,W.maskedLocation,W.url,e.origin,e.history]),St=R.useMemo(()=>{if(vt?.external)return vt.href;try{return new URL(u),u}catch{}},[u,vt]),st=t.reloadDocument||St?!1:h??e.options.defaultPreload,$t=f??e.options.defaultPreloadDelay??0,jt=O({select:b=>{if(St)return!1;if(l?.exact){if(!bo(b.location.pathname,W.pathname,e.basepath))return!1}else{const k=It(b.location.pathname,e.basepath),$=It(W.pathname,e.basepath);if(!(k.startsWith($)&&(k.length===$.length||k[$.length]==="/")))return!1}return(l?.includeSearch??!0)&&!tt(b.location.search,W.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?b.location.hash===W.hash:!0}}),Z=R.useCallback(()=>{e.preloadRoute({...lt}).catch(b=>{console.warn(b),console.warn(ws)})},[e,lt]),co=R.useCallback(b=>{b?.isIntersecting&&Z()},[Z]);Bs(i,co,Ws,{disabled:!!L||st!=="viewport"}),R.useEffect(()=>{r.current||!L&&st==="render"&&(Z(),r.current=!0)},[L,Z,st]);const uo=b=>{const k=b.currentTarget.getAttribute("target"),$=P!==void 0?P:k;if(!L&&!zs(b)&&!b.defaultPrevented&&(!$||$==="_self")&&b.button===0){b.preventDefault(),oo.flushSync(()=>{n(!0)});const ve=e.subscribe("onResolved",()=>{ve(),n(!1)});e.navigate({...lt,replace:p,resetScroll:y,hashScrollIntoView:d,startTransition:m,viewTransition:_,ignoreBlocker:I})}};if(St)return{...de,ref:i,href:St,...x&&{children:x},...P&&{target:P},...L&&{disabled:L},...E&&{style:E},...w&&{className:w},...S&&{onClick:S},...v&&{onFocus:v},...C&&{onMouseEnter:C},...M&&{onMouseLeave:M},...T&&{onTouchStart:T}};const me=b=>{L||st&&Z()},lo=me,ho=b=>{if(!(L||!st))if(!$t)Z();else{const k=b.target;if(ft.has(k))return;const $=setTimeout(()=>{ft.delete(k),Z()},$t);ft.set(k,$)}},fo=b=>{if(L||!st||!$t)return;const k=b.target,$=ft.get(k);$&&(clearTimeout($),ft.delete(k))},_t=jt?Q(c,{})??js:Jt,Rt=jt?Jt:Q(a,{})??Jt,ge=[w,_t.className,Rt.className].filter(Boolean).join(" "),ye=(E||_t.style||Rt.style)&&{...E,..._t.style,...Rt.style};return{...de,..._t,...Rt,href:vt?.href,ref:i,onClick:dt([S,uo]),onFocus:dt([v,me]),onMouseEnter:dt([C,ho]),onMouseLeave:dt([M,fo]),onTouchStart:dt([T,lo]),disabled:!!L,target:P,...ye&&{style:ye},...ge&&{className:ge},...L&&Ns,...jt&&Us,...s&&Vs}}const Jt={},js={className:"active"},Ns={role:"link","aria-disabled":!0},Us={"data-status":"active","aria-current":"page"},Vs={"data-transitioning":"transitioning"},ft=new WeakMap,Ws={rootMargin:"100px"},dt=t=>o=>{for(const e of t)if(e){if(o.defaultPrevented)return;e(o)}},so=R.forwardRef((t,o)=>{const{_asChild:e,...s}=t,{type:n,ref:r,...i}=$s(s,o),c=typeof s.children=="function"?s.children({isActive:i["data-status"]==="active"}):s.children;return e===void 0&&delete i.disabled,R.createElement(e||"a",{...i,ref:r},c)});function zs(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}class Ks extends Qe{constructor(o){super(o),this.useMatch=e=>V({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>V({...e,from:this.id,select:s=>e?.select?e.select(s.context):s.context}),this.useSearch=e=>le({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>ue({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>ce({...e,from:this.id}),this.useLoaderData=e=>ae({...e,from:this.id}),this.useNavigate=()=>he({from:this.fullPath}),this.Link=rt.forwardRef((e,s)=>g.jsx(so,{ref:s,from:this.fullPath,...e})),this.$$typeof=Symbol.for("react.memo")}}function Hs(t){return new Ks(t)}class Gs extends xs{constructor(o){super(o),this.useMatch=e=>V({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>V({...e,from:this.id,select:s=>e?.select?e.select(s.context):s.context}),this.useSearch=e=>le({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>ue({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>ce({...e,from:this.id}),this.useLoaderData=e=>ae({...e,from:this.id}),this.useNavigate=()=>he({from:this.fullPath}),this.Link=rt.forwardRef((e,s)=>g.jsx(so,{ref:s,from:this.fullPath,...e})),this.$$typeof=Symbol.for("react.memo")}}function pn(t){return new Gs(t)}function Be(t){return typeof t=="object"?new De(t,{silent:!0}).createRoute(t):new De(t,{silent:!0}).createRoute}class De{constructor(o,e){this.path=o,this.createRoute=s=>{this.silent;const n=Hs(s);return n.isRoot=!1,n},this.silent=e?.silent}}class $e{constructor(o){this.useMatch=e=>V({select:e?.select,from:this.options.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>V({from:this.options.id,select:s=>e?.select?e.select(s.context):s.context}),this.useSearch=e=>le({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useParams=e=>ue({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useLoaderDeps=e=>ce({...e,from:this.options.id}),this.useLoaderData=e=>ae({...e,from:this.options.id}),this.useNavigate=()=>{const e=F();return he({from:e.routesById[this.options.id].fullPath})},this.options=o,this.$$typeof=Symbol.for("react.memo")}}function je(t){return typeof t=="object"?new $e(t):o=>new $e({id:t,...o})}function qs(){const t=F(),o=R.useRef({router:t,mounted:!1}),[e,s]=R.useState(!1),{hasPendingMatches:n,isLoading:r}=O({select:h=>({isLoading:h.isLoading,hasPendingMatches:h.matches.some(f=>f.status==="pending")}),structuralSharing:!0}),i=qt(r),c=r||e||n,a=qt(c),l=r||n,u=qt(l);return t.startTransition=h=>{s(!0),R.startTransition(()=>{h(),s(!1)})},R.useEffect(()=>{const h=t.history.subscribe(t.load),f=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return J(t.latestLocation.href)!==J(f.href)&&t.commitLocation({...f,replace:!0}),()=>{h()}},[t,t.history]),Lt(()=>{if(typeof window<"u"&&t.ssr||o.current.router===t&&o.current.mounted)return;o.current={router:t,mounted:!0},(async()=>{try{await t.load()}catch(f){console.error(f)}})()},[t]),Lt(()=>{i&&!r&&t.emit({type:"onLoad",...et(t.state)})},[i,t,r]),Lt(()=>{u&&!l&&t.emit({type:"onBeforeRouteMount",...et(t.state)})},[l,u,t]),Lt(()=>{a&&!c&&(t.emit({type:"onResolved",...et(t.state)}),t.__store.setState(h=>({...h,status:"idle",resolvedLocation:h.location})),os(t))},[c,a,t]),null}function Js(t){const o=O({select:e=>`not-found-${e.location.pathname}-${e.status}`});return g.jsx(ie,{getResetKey:()=>o,onCatch:(e,s)=>{if(j(e))t.onCatch?.(e,s);else throw e},errorComponent:({error:e})=>{if(j(e))return t.fallback?.(e);throw e},children:t.children})}function Ys(){return g.jsx("p",{children:"Not Found"})}function nt(t){return g.jsx(g.Fragment,{children:t.children})}function no(t,o,e){return o.options.notFoundComponent?g.jsx(o.options.notFoundComponent,{data:e}):t.options.defaultNotFoundComponent?g.jsx(t.options.defaultNotFoundComponent,{data:e}):g.jsx(Ys,{})}function Xs({children:t}){const o=F();return o.isServer?g.jsx("script",{nonce:o.options.ssr?.nonce,className:"$tsr",dangerouslySetInnerHTML:{__html:[t].filter(Boolean).join(` -`)+";$_TSR.c()"}}):null}function Zs(){const t=F();if(!t.isScrollRestoring||!t.isServer||typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return null;const e=(t.options.getScrollRestorationKey||Qt)(t.latestLocation),s=e!==Qt(t.latestLocation)?e:void 0,n={storageKey:kt,shouldScrollRestoration:!0};return s&&(n.key=s),g.jsx(Xs,{children:`(${We.toString()})(${JSON.stringify(n)})`})}const ro=R.memo(function({matchId:o}){const e=F(),s=O({select:_=>{const x=_.matches.find(P=>P.id===o);return K(x),{routeId:x.routeId,ssr:x.ssr,_displayPending:x._displayPending}},structuralSharing:!0}),n=e.routesById[s.routeId],r=n.options.pendingComponent??e.options.defaultPendingComponent,i=r?g.jsx(r,{}):null,c=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,l=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,u=s.ssr===!1||s.ssr==="data-only",h=(!n.isRoot||n.options.wrapInSuspense||u)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||u))?R.Suspense:nt,f=c?ie:nt,d=l?Js:nt,p=O({select:_=>_.loadedAt}),m=O({select:_=>{const x=_.matches.findIndex(P=>P.id===o);return _.matches[x-1]?.routeId}}),y=n.isRoot?n.options.shellComponent??nt:nt;return g.jsxs(y,{children:[g.jsx(Dt.Provider,{value:o,children:g.jsx(h,{fallback:i,children:g.jsx(f,{getResetKey:()=>p,errorComponent:c||Bt,onCatch:(_,x)=>{if(j(_))throw _;a?.(_,x)},children:g.jsx(d,{fallback:_=>{if(!l||_.routeId&&_.routeId!==s.routeId||!_.routeId&&!n.isRoot)throw _;return R.createElement(l,_)},children:u||s._displayPending?g.jsx(Cs,{fallback:i,children:g.jsx(Ne,{matchId:o})}):g.jsx(Ne,{matchId:o})})})})}),m===A&&e.options.scrollRestoration?g.jsxs(g.Fragment,{children:[g.jsx(Qs,{}),g.jsx(Zs,{})]}):null]})});function Qs(){const t=F(),o=R.useRef(void 0);return g.jsx("script",{suppressHydrationWarning:!0,ref:e=>{e&&(o.current===void 0||o.current.href!==t.latestLocation.href)&&(t.emit({type:"onRendered",...et(t.state)}),o.current=t.latestLocation)}},t.latestLocation.state.__TSR_key)}const Ne=R.memo(function({matchId:o}){const e=F(),{match:s,key:n,routeId:r}=O({select:a=>{const l=a.matches.find(p=>p.id===o),u=l.routeId,f=(e.routesById[u].options.remountDeps??e.options.defaultRemountDeps)?.({routeId:u,loaderDeps:l.loaderDeps,params:l._strictParams,search:l._strictSearch});return{key:f?JSON.stringify(f):void 0,routeId:u,match:{id:l.id,status:l.status,error:l.error,_forcePending:l._forcePending,_displayPending:l._displayPending}}},structuralSharing:!0}),i=e.routesById[r],c=R.useMemo(()=>{const a=i.options.component??e.options.defaultComponent;return a?g.jsx(a,{},n):g.jsx(tn,{})},[n,i.options.component,e.options.defaultComponent]);if(s._displayPending)throw e.getMatch(s.id)?._nonReactive.displayPendingPromise;if(s._forcePending)throw e.getMatch(s.id)?._nonReactive.minPendingPromise;if(s.status==="pending"){const a=i.options.pendingMinMs??e.options.defaultPendingMinMs;if(a){const l=e.getMatch(s.id);if(l&&!l._nonReactive.minPendingPromise&&!e.isServer){const u=it();l._nonReactive.minPendingPromise=u,setTimeout(()=>{u.resolve(),l._nonReactive.minPendingPromise=void 0},a)}}throw e.getMatch(s.id)?._nonReactive.loadPromise}if(s.status==="notFound")return K(j(s.error)),no(e,i,s.error);if(s.status==="redirected")throw K(N(s.error)),e.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error"){if(e.isServer){const a=(i.options.errorComponent??e.options.defaultErrorComponent)||Bt;return g.jsx(a,{error:s.error,reset:void 0,info:{componentStack:""}})}throw s.error}return c}),tn=R.memo(function(){const o=F(),e=R.useContext(Dt),s=O({select:l=>l.matches.find(u=>u.id===e)?.routeId}),n=o.routesById[s],r=O({select:l=>{const h=l.matches.find(f=>f.id===e);return K(h),h.globalNotFound}}),i=O({select:l=>{const u=l.matches,h=u.findIndex(f=>f.id===e);return u[h+1]?.id}}),c=o.options.defaultPendingComponent?g.jsx(o.options.defaultPendingComponent,{}):null;if(r)return no(o,n,void 0);if(!i)return null;const a=g.jsx(ro,{matchId:i});return s===A?g.jsx(R.Suspense,{fallback:c,children:a}):a});function en(){const t=F(),e=t.routesById[A].options.pendingComponent??t.options.defaultPendingComponent,s=e?g.jsx(e,{}):null,n=t.isServer||typeof document<"u"&&t.ssr?nt:R.Suspense,r=g.jsxs(n,{fallback:s,children:[!t.isServer&&g.jsx(qs,{}),g.jsx(on,{})]});return t.options.InnerWrap?g.jsx(t.options.InnerWrap,{children:r}):r}function on(){const t=F(),o=O({select:n=>n.matches[0]?.id}),e=O({select:n=>n.loadedAt}),s=o?g.jsx(ro,{matchId:o}):null;return g.jsx(Dt.Provider,{value:o,children:t.options.disableGlobalCatchBoundary?s:g.jsx(ie,{getResetKey:()=>e,errorComponent:Bt,onCatch:n=>{n.message||n.toString()},children:s})})}function mn(){const t=F();return O({select:o=>[o.location.href,o.resolvedLocation?.href,o.status],structuralSharing:!0}),R.useCallback(o=>{const{pending:e,caseSensitive:s,fuzzy:n,includeSearch:r,...i}=o;return t.matchRoute(i,{pending:e,caseSensitive:s,fuzzy:n,includeSearch:r})},[t])}const gn=t=>new sn(t);class sn extends vs{constructor(o){super(o)}}typeof globalThis<"u"?(globalThis.createFileRoute=Be,globalThis.createLazyFileRoute=je):typeof window<"u"&&(window.createFileRoute=Be,window.createLazyFileRoute=je);function nn({router:t,children:o,...e}){Object.keys(e).length>0&&t.update({...t.options,...e,context:{...t.options.context,...e.context}});const s=eo(),n=g.jsx(s.Provider,{value:t,children:o});return t.options.Wrap?g.jsx(t.options.Wrap,{children:n}):n}function yn({router:t,...o}){return g.jsx(nn,{router:t,...o,children:g.jsx(en,{})})}export{so as L,tn as O,rt as R,hn as a,oo as b,dn as c,fn as d,Ts as e,mn as f,pn as g,Hs as h,K as i,g as j,gn as k,us as l,yn as m,R as r,he as u}; diff --git a/webui/dist/assets/ui-vendor-BgfqR_Xz.js b/webui/dist/assets/ui-vendor-BgfqR_Xz.js deleted file mode 100644 index 93e393f0..00000000 --- a/webui/dist/assets/ui-vendor-BgfqR_Xz.js +++ /dev/null @@ -1,45 +0,0 @@ -import{r as a,j as x,R as we,a as Vt,b as at,c as yr}from"./router-DQNkr8RI.js";function k(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function wr(e,t){const n=a.createContext(t),o=i=>{const{children:c,...s}=i,l=a.useMemo(()=>s,Object.values(s));return x.jsx(n.Provider,{value:l,children:c})};o.displayName=e+"Provider";function r(i){const c=a.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[o,r]}function Ve(e,t=[]){let n=[];function o(i,c){const s=a.createContext(c),l=n.length;n=[...n,c];const u=p=>{const{scope:h,children:m,...w}=p,f=h?.[e]?.[l]||s,g=a.useMemo(()=>w,Object.values(w));return x.jsx(f.Provider,{value:g,children:m})};u.displayName=i+"Provider";function d(p,h){const m=h?.[e]?.[l]||s,w=a.useContext(m);if(w)return w;if(c!==void 0)return c;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[u,d]}const r=()=>{const i=n.map(c=>a.createContext(c));return function(s){const l=s?.[e]||i;return a.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return r.scopeName=e,[o,xr(r,...t)]}function xr(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const c=o.reduce((s,{useScope:l,scopeName:u})=>{const p=l(i)[`__scope${u}`];return{...s,...p}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function sn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _e(...e){return t=>{let n=!1;const o=e.map(r=>{const i=sn(r,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r{const{children:i,...c}=o,s=a.Children.toArray(i),l=s.find(Cr);if(l){const u=l.props.children,d=s.map(p=>p===l?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:p);return x.jsx(t,{...c,ref:r,children:a.isValidElement(u)?a.cloneElement(u,void 0,d):null})}return x.jsx(t,{...c,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function Sr(e){const t=a.forwardRef((n,o)=>{const{children:r,...i}=n;if(a.isValidElement(r)){const c=Rr(r),s=Er(i,r.props);return r.type!==a.Fragment&&(s.ref=o?_e(o,c):c),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var br=Symbol("radix.slottable");function Cr(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===br}function Er(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...s)=>{const l=i(...s);return r(...s),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Rr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Pr(e){const t=e+"CollectionProvider",[n,o]=Ve(t),[r,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=f=>{const{scope:g,children:y}=f,v=we.useRef(null),S=we.useRef(new Map).current;return x.jsx(r,{scope:g,itemMap:S,collectionRef:v,children:y})};c.displayName=t;const s=e+"CollectionSlot",l=cn(s),u=we.forwardRef((f,g)=>{const{scope:y,children:v}=f,S=i(s,y),b=H(g,S.collectionRef);return x.jsx(l,{ref:b,children:v})});u.displayName=s;const d=e+"CollectionItemSlot",p="data-radix-collection-item",h=cn(d),m=we.forwardRef((f,g)=>{const{scope:y,children:v,...S}=f,b=we.useRef(null),C=H(g,b),R=i(d,y);return we.useEffect(()=>(R.itemMap.set(b,{ref:b,...S}),()=>void R.itemMap.delete(b))),x.jsx(h,{[p]:"",ref:C,children:v})});m.displayName=d;function w(f){const g=i(e+"CollectionConsumer",f);return we.useCallback(()=>{const v=g.collectionRef.current;if(!v)return[];const S=Array.from(v.querySelectorAll(`[${p}]`));return Array.from(g.itemMap.values()).sort((R,E)=>S.indexOf(R.ref.current)-S.indexOf(E.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:c,Slot:u,ItemSlot:m},w,o]}var K=globalThis?.document?a.useLayoutEffect:()=>{},Ar=Vt[" useId ".trim().toString()]||(()=>{}),Or=0;function Te(e){const[t,n]=a.useState(Ar());return K(()=>{n(o=>o??String(Or++))},[e]),t?`radix-${t}`:""}function Tr(e){const t=Nr(e),n=a.forwardRef((o,r)=>{const{children:i,...c}=o,s=a.Children.toArray(i),l=s.find(Dr);if(l){const u=l.props.children,d=s.map(p=>p===l?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:p);return x.jsx(t,{...c,ref:r,children:a.isValidElement(u)?a.cloneElement(u,void 0,d):null})}return x.jsx(t,{...c,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function Nr(e){const t=a.forwardRef((n,o)=>{const{children:r,...i}=n;if(a.isValidElement(r)){const c=Mr(r),s=_r(i,r.props);return r.type!==a.Fragment&&(s.ref=o?_e(o,c):c),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ir=Symbol("radix.slottable");function Dr(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ir}function _r(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...s)=>{const l=i(...s);return r(...s),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Mr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Lr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],M=Lr.reduce((e,t)=>{const n=Tr(`Primitive.${t}`),o=a.forwardRef((r,i)=>{const{asChild:c,...s}=r,l=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(l,{...s,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function kr(e,t){e&&at.flushSync(()=>e.dispatchEvent(t))}function xe(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>t.current?.(...n),[])}var jr=Vt[" useInsertionEffect ".trim().toString()]||K;function et({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,i,c]=Fr({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:r;{const d=a.useRef(e!==void 0);a.useEffect(()=>{const p=d.current;p!==s&&console.warn(`${o} is changing from ${p?"controlled":"uncontrolled"} to ${s?"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=s},[s,o])}const u=a.useCallback(d=>{if(s){const p=Wr(d)?d(e):d;p!==e&&c.current?.(p)}else i(d)},[s,e,i,c]);return[l,u]}function Fr({defaultProp:e,onChange:t}){const[n,o]=a.useState(e),r=a.useRef(n),i=a.useRef(t);return jr(()=>{i.current=t},[t]),a.useEffect(()=>{r.current!==n&&(i.current?.(n),r.current=n)},[n,r]),[n,o,i]}function Wr(e){return typeof e=="function"}var $r=a.createContext(void 0);function Br(e){const t=a.useContext($r);return e||t||"ltr"}function Vr(e,t){return a.useReducer((n,o)=>t[n][o]??n,e)}var He=e=>{const{present:t,children:n}=e,o=Hr(t),r=typeof n=="function"?n({present:o.isPresent}):a.Children.only(n),i=H(o.ref,Ur(r));return typeof n=="function"||o.isPresent?a.cloneElement(r,{ref:i}):null};He.displayName="Presence";function Hr(e){const[t,n]=a.useState(),o=a.useRef(null),r=a.useRef(e),i=a.useRef("none"),c=e?"mounted":"unmounted",[s,l]=Vr(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const u=ze(o.current);i.current=s==="mounted"?u:"none"},[s]),K(()=>{const u=o.current,d=r.current;if(d!==e){const h=i.current,m=ze(u);e?l("MOUNT"):m==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&h!==m?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),K(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,p=m=>{const f=ze(o.current).includes(CSS.escape(m.animationName));if(m.target===t&&f&&(l("ANIMATION_END"),!r.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=m=>{m.target===t&&(i.current=ze(o.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:a.useCallback(u=>{o.current=u?getComputedStyle(u):null,n(u)},[])}}function ze(e){return e?.animationName||"none"}function Ur(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function an(e,[t,n]){return Math.min(n,Math.max(t,e))}var zr=Symbol.for("react.lazy"),tt=Vt[" use ".trim().toString()];function Kr(e){return typeof e=="object"&&e!==null&&"then"in e}function Dn(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===zr&&"_payload"in e&&Kr(e._payload)}function _n(e){const t=Yr(e),n=a.forwardRef((o,r)=>{let{children:i,...c}=o;Dn(i)&&typeof tt=="function"&&(i=tt(i._payload));const s=a.Children.toArray(i),l=s.find(Gr);if(l){const u=l.props.children,d=s.map(p=>p===l?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:p);return x.jsx(t,{...c,ref:r,children:a.isValidElement(u)?a.cloneElement(u,void 0,d):null})}return x.jsx(t,{...c,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}var wa=_n("Slot");function Yr(e){const t=a.forwardRef((n,o)=>{let{children:r,...i}=n;if(Dn(r)&&typeof tt=="function"&&(r=tt(r._payload)),a.isValidElement(r)){const c=Zr(r),s=qr(i,r.props);return r.type!==a.Fragment&&(s.ref=o?_e(o,c):c),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xr=Symbol("radix.slottable");function Gr(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xr}function qr(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...s)=>{const l=i(...s);return r(...s),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Zr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Mn(e){const t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Ln(e){const[t,n]=a.useState(void 0);return K(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let c,s;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;c=u.inlineSize,s=u.blockSize}else c=e.offsetWidth,s=e.offsetHeight;n({width:c,height:s})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var Qr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Jr=Qr.reduce((e,t)=>{const n=_n(`Primitive.${t}`),o=a.forwardRef((r,i)=>{const{asChild:c,...s}=r,l=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(l,{...s,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),ei="Label",kn=a.forwardRef((e,t)=>x.jsx(Jr.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));kn.displayName=ei;var xa=kn;function ti(e,t=globalThis?.document){const n=xe(e);a.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var ni="DismissableLayer",Dt="dismissableLayer.update",oi="dismissableLayer.pointerDownOutside",ri="dismissableLayer.focusOutside",ln,jn=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lt=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:c,onDismiss:s,...l}=e,u=a.useContext(jn),[d,p]=a.useState(null),h=d?.ownerDocument??globalThis?.document,[,m]=a.useState({}),w=H(t,E=>p(E)),f=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=f.indexOf(g),v=d?f.indexOf(d):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,b=v>=y,C=si(E=>{const O=E.target,_=[...u.branches].some(I=>I.contains(O));!b||_||(r?.(E),c?.(E),E.defaultPrevented||s?.())},h),R=ci(E=>{const O=E.target;[...u.branches].some(I=>I.contains(O))||(i?.(E),c?.(E),E.defaultPrevented||s?.())},h);return ti(E=>{v===u.layers.size-1&&(o?.(E),!E.defaultPrevented&&s&&(E.preventDefault(),s()))},h),a.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(ln=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),un(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=ln)}},[d,h,n,u]),a.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),un())},[d,u]),a.useEffect(()=>{const E=()=>m({});return document.addEventListener(Dt,E),()=>document.removeEventListener(Dt,E)},[]),x.jsx(M.div,{...l,ref:w,style:{pointerEvents:S?b?"auto":"none":void 0,...e.style},onFocusCapture:k(e.onFocusCapture,R.onFocusCapture),onBlurCapture:k(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:k(e.onPointerDownCapture,C.onPointerDownCapture)})});lt.displayName=ni;var ii="DismissableLayerBranch",Fn=a.forwardRef((e,t)=>{const n=a.useContext(jn),o=a.useRef(null),r=H(t,o);return a.useEffect(()=>{const i=o.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),x.jsx(M.div,{...e,ref:r})});Fn.displayName=ii;function si(e,t=globalThis?.document){const n=xe(e),o=a.useRef(!1),r=a.useRef(()=>{});return a.useEffect(()=>{const i=s=>{if(s.target&&!o.current){let l=function(){Wn(oi,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=l,t.addEventListener("click",r.current,{once:!0})):l()}else t.removeEventListener("click",r.current);o.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function ci(e,t=globalThis?.document){const n=xe(e),o=a.useRef(!1);return a.useEffect(()=>{const r=i=>{i.target&&!o.current&&Wn(ri,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function un(){const e=new CustomEvent(Dt);document.dispatchEvent(e)}function Wn(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?kr(r,i):r.dispatchEvent(i)}var Sa=lt,ba=Fn,Ct="focusScope.autoFocusOnMount",Et="focusScope.autoFocusOnUnmount",fn={bubbles:!1,cancelable:!0},ai="FocusScope",Ht=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:i,...c}=e,[s,l]=a.useState(null),u=xe(r),d=xe(i),p=a.useRef(null),h=H(t,f=>l(f)),m=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(o){let f=function(S){if(m.paused||!s)return;const b=S.target;s.contains(b)?p.current=b:ue(p.current,{select:!0})},g=function(S){if(m.paused||!s)return;const b=S.relatedTarget;b!==null&&(s.contains(b)||ue(p.current,{select:!0}))},y=function(S){if(document.activeElement===document.body)for(const C of S)C.removedNodes.length>0&&ue(s)};document.addEventListener("focusin",f),document.addEventListener("focusout",g);const v=new MutationObserver(y);return s&&v.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",g),v.disconnect()}}},[o,s,m.paused]),a.useEffect(()=>{if(s){pn.add(m);const f=document.activeElement;if(!s.contains(f)){const y=new CustomEvent(Ct,fn);s.addEventListener(Ct,u),s.dispatchEvent(y),y.defaultPrevented||(li(mi($n(s)),{select:!0}),document.activeElement===f&&ue(s))}return()=>{s.removeEventListener(Ct,u),setTimeout(()=>{const y=new CustomEvent(Et,fn);s.addEventListener(Et,d),s.dispatchEvent(y),y.defaultPrevented||ue(f??document.body,{select:!0}),s.removeEventListener(Et,d),pn.remove(m)},0)}}},[s,u,d,m]);const w=a.useCallback(f=>{if(!n&&!o||m.paused)return;const g=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,y=document.activeElement;if(g&&y){const v=f.currentTarget,[S,b]=ui(v);S&&b?!f.shiftKey&&y===b?(f.preventDefault(),n&&ue(S,{select:!0})):f.shiftKey&&y===S&&(f.preventDefault(),n&&ue(b,{select:!0})):y===v&&f.preventDefault()}},[n,o,m.paused]);return x.jsx(M.div,{tabIndex:-1,...c,ref:h,onKeyDown:w})});Ht.displayName=ai;function li(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(ue(o,{select:t}),document.activeElement!==n)return}function ui(e){const t=$n(e),n=dn(t,e),o=dn(t.reverse(),e);return[n,o]}function $n(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function dn(e,t){for(const n of e)if(!fi(n,{upTo:t}))return n}function fi(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 di(e){return e instanceof HTMLInputElement&&"select"in e}function ue(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&di(e)&&t&&e.select()}}var pn=pi();function pi(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=mn(e,t),e.unshift(t)},remove(t){e=mn(e,t),e[0]?.resume()}}}function mn(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function mi(e){return e.filter(t=>t.tagName!=="A")}var hi="Portal",Ut=a.forwardRef((e,t)=>{const{container:n,...o}=e,[r,i]=a.useState(!1);K(()=>i(!0),[]);const c=n||r&&globalThis?.document?.body;return c?yr.createPortal(x.jsx(M.div,{...o,ref:t}),c):null});Ut.displayName=hi;var Rt=0;function Bn(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??hn()),document.body.insertAdjacentElement("beforeend",e[1]??hn()),Rt++,()=>{Rt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Rt--}},[])}function hn(){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 ne=function(){return ne=Object.assign||function(t){for(var n,o=1,r=arguments.length;o"u")return Di;var t=_i(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},Li=zn(),Ne="data-scroll-locked",ki=function(e,t,n,o){var r=e.left,i=e.top,c=e.right,s=e.gap;return n===void 0&&(n="margin"),` - .`.concat(vi,` { - overflow: hidden `).concat(o,`; - padding-right: `).concat(s,"px ").concat(o,`; - } - body[`).concat(Ne,`] { - overflow: hidden `).concat(o,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&` - padding-left: `.concat(r,`px; - padding-top: `).concat(i,`px; - padding-right: `).concat(c,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(s,"px ").concat(o,`; - `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(o,";")].filter(Boolean).join(""),` - } - - .`).concat(Ze,` { - right: `).concat(s,"px ").concat(o,`; - } - - .`).concat(Qe,` { - margin-right: `).concat(s,"px ").concat(o,`; - } - - .`).concat(Ze," .").concat(Ze,` { - right: 0 `).concat(o,`; - } - - .`).concat(Qe," .").concat(Qe,` { - margin-right: 0 `).concat(o,`; - } - - body[`).concat(Ne,`] { - `).concat(yi,": ").concat(s,`px; - } -`)},vn=function(){var e=parseInt(document.body.getAttribute(Ne)||"0",10);return isFinite(e)?e:0},ji=function(){a.useEffect(function(){return document.body.setAttribute(Ne,(vn()+1).toString()),function(){var e=vn()-1;e<=0?document.body.removeAttribute(Ne):document.body.setAttribute(Ne,e.toString())}},[])},Fi=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o;ji();var i=a.useMemo(function(){return Mi(r)},[r]);return a.createElement(Li,{styles:ki(i,!t,r,n?"":"!important")})},_t=!1;if(typeof window<"u")try{var Ke=Object.defineProperty({},"passive",{get:function(){return _t=!0,!0}});window.addEventListener("test",Ke,Ke),window.removeEventListener("test",Ke,Ke)}catch{_t=!1}var Pe=_t?{passive:!1}:!1,Wi=function(e){return e.tagName==="TEXTAREA"},Kn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Wi(e)&&n[t]==="visible")},$i=function(e){return Kn(e,"overflowY")},Bi=function(e){return Kn(e,"overflowX")},yn=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var r=Yn(e,o);if(r){var i=Xn(e,o),c=i[1],s=i[2];if(c>s)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},Vi=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},Hi=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},Yn=function(e,t){return e==="v"?$i(t):Bi(t)},Xn=function(e,t){return e==="v"?Vi(t):Hi(t)},Ui=function(e,t){return e==="h"&&t==="rtl"?-1:1},zi=function(e,t,n,o,r){var i=Ui(e,window.getComputedStyle(t).direction),c=i*o,s=n.target,l=t.contains(s),u=!1,d=c>0,p=0,h=0;do{if(!s)break;var m=Xn(e,s),w=m[0],f=m[1],g=m[2],y=f-g-i*w;(w||y)&&Yn(e,s)&&(p+=y,h+=w);var v=s.parentNode;s=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(d&&Math.abs(p)<1||!d&&Math.abs(h)<1)&&(u=!0),u},Ye=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},wn=function(e){return[e.deltaX,e.deltaY]},xn=function(e){return e&&"current"in e?e.current:e},Ki=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Yi=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},Xi=0,Ae=[];function Gi(e){var t=a.useRef([]),n=a.useRef([0,0]),o=a.useRef(),r=a.useState(Xi++)[0],i=a.useState(zn)[0],c=a.useRef(e);a.useEffect(function(){c.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var f=gi([e.lockRef.current],(e.shards||[]).map(xn),!0).filter(Boolean);return f.forEach(function(g){return g.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),f.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var s=a.useCallback(function(f,g){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!c.current.allowPinchZoom;var y=Ye(f),v=n.current,S="deltaX"in f?f.deltaX:v[0]-y[0],b="deltaY"in f?f.deltaY:v[1]-y[1],C,R=f.target,E=Math.abs(S)>Math.abs(b)?"h":"v";if("touches"in f&&E==="h"&&R.type==="range")return!1;var O=yn(E,R);if(!O)return!0;if(O?C=E:(C=E==="v"?"h":"v",O=yn(E,R)),!O)return!1;if(!o.current&&"changedTouches"in f&&(S||b)&&(o.current=C),!C)return!0;var _=o.current||C;return zi(_,g,f,_==="h"?S:b)},[]),l=a.useCallback(function(f){var g=f;if(!(!Ae.length||Ae[Ae.length-1]!==i)){var y="deltaY"in g?wn(g):Ye(g),v=t.current.filter(function(C){return C.name===g.type&&(C.target===g.target||g.target===C.shadowParent)&&Ki(C.delta,y)})[0];if(v&&v.should){g.cancelable&&g.preventDefault();return}if(!v){var S=(c.current.shards||[]).map(xn).filter(Boolean).filter(function(C){return C.contains(g.target)}),b=S.length>0?s(g,S[0]):!c.current.noIsolation;b&&g.cancelable&&g.preventDefault()}}},[]),u=a.useCallback(function(f,g,y,v){var S={name:f,delta:g,target:y,should:v,shadowParent:qi(y)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(b){return b!==S})},1)},[]),d=a.useCallback(function(f){n.current=Ye(f),o.current=void 0},[]),p=a.useCallback(function(f){u(f.type,wn(f),f.target,s(f,e.lockRef.current))},[]),h=a.useCallback(function(f){u(f.type,Ye(f),f.target,s(f,e.lockRef.current))},[]);a.useEffect(function(){return Ae.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Pe),document.addEventListener("touchmove",l,Pe),document.addEventListener("touchstart",d,Pe),function(){Ae=Ae.filter(function(f){return f!==i}),document.removeEventListener("wheel",l,Pe),document.removeEventListener("touchmove",l,Pe),document.removeEventListener("touchstart",d,Pe)}},[]);var m=e.removeScrollBar,w=e.inert;return a.createElement(a.Fragment,null,w?a.createElement(i,{styles:Yi(r)}):null,m?a.createElement(Fi,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function qi(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Zi=Ri(Un,Gi);var zt=a.forwardRef(function(e,t){return a.createElement(ut,ne({},e,{ref:t,sideCar:Zi}))});zt.classNames=ut.classNames;var Qi=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Oe=new WeakMap,Xe=new WeakMap,Ge={},Tt=0,Gn=function(e){return e&&(e.host||Gn(e.parentNode))},Ji=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=Gn(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},es=function(e,t,n,o){var r=Ji(t,Array.isArray(e)?e:[e]);Ge[n]||(Ge[n]=new WeakMap);var i=Ge[n],c=[],s=new Set,l=new Set(r),u=function(p){!p||s.has(p)||(s.add(p),u(p.parentNode))};r.forEach(u);var d=function(p){!p||l.has(p)||Array.prototype.forEach.call(p.children,function(h){if(s.has(h))d(h);else try{var m=h.getAttribute(o),w=m!==null&&m!=="false",f=(Oe.get(h)||0)+1,g=(i.get(h)||0)+1;Oe.set(h,f),i.set(h,g),c.push(h),f===1&&w&&Xe.set(h,!0),g===1&&h.setAttribute(n,"true"),w||h.setAttribute(o,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return d(t),s.clear(),Tt++,function(){c.forEach(function(p){var h=Oe.get(p)-1,m=i.get(p)-1;Oe.set(p,h),i.set(p,m),h||(Xe.has(p)||p.removeAttribute(o),Xe.delete(p)),m||p.removeAttribute(n)}),Tt--,Tt||(Oe=new WeakMap,Oe=new WeakMap,Xe=new WeakMap,Ge={})}},qn=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=Qi(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),es(o,r,n,"aria-hidden")):function(){return null}};function ts(e){const t=ns(e),n=a.forwardRef((o,r)=>{const{children:i,...c}=o,s=a.Children.toArray(i),l=s.find(rs);if(l){const u=l.props.children,d=s.map(p=>p===l?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:p);return x.jsx(t,{...c,ref:r,children:a.isValidElement(u)?a.cloneElement(u,void 0,d):null})}return x.jsx(t,{...c,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function ns(e){const t=a.forwardRef((n,o)=>{const{children:r,...i}=n;if(a.isValidElement(r)){const c=ss(r),s=is(i,r.props);return r.type!==a.Fragment&&(s.ref=o?_e(o,c):c),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var os=Symbol("radix.slottable");function rs(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===os}function is(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...s)=>{const l=i(...s);return r(...s),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function ss(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ft="Dialog",[Zn,Ca]=Ve(ft),[cs,te]=Zn(ft),Qn=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:r,onOpenChange:i,modal:c=!0}=e,s=a.useRef(null),l=a.useRef(null),[u,d]=et({prop:o,defaultProp:r??!1,onChange:i,caller:ft});return x.jsx(cs,{scope:t,triggerRef:s,contentRef:l,contentId:Te(),titleId:Te(),descriptionId:Te(),open:u,onOpenChange:d,onOpenToggle:a.useCallback(()=>d(p=>!p),[d]),modal:c,children:n})};Qn.displayName=ft;var Jn="DialogTrigger",eo=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=te(Jn,n),i=H(t,r.triggerRef);return x.jsx(M.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":Xt(r.open),...o,ref:i,onClick:k(e.onClick,r.onOpenToggle)})});eo.displayName=Jn;var Kt="DialogPortal",[as,to]=Zn(Kt,{forceMount:void 0}),no=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:r}=e,i=te(Kt,t);return x.jsx(as,{scope:t,forceMount:n,children:a.Children.map(o,c=>x.jsx(He,{present:n||i.open,children:x.jsx(Ut,{asChild:!0,container:r,children:c})}))})};no.displayName=Kt;var nt="DialogOverlay",oo=a.forwardRef((e,t)=>{const n=to(nt,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,i=te(nt,e.__scopeDialog);return i.modal?x.jsx(He,{present:o||i.open,children:x.jsx(us,{...r,ref:t})}):null});oo.displayName=nt;var ls=ts("DialogOverlay.RemoveScroll"),us=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=te(nt,n);return x.jsx(zt,{as:ls,allowPinchZoom:!0,shards:[r.contentRef],children:x.jsx(M.div,{"data-state":Xt(r.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),Se="DialogContent",ro=a.forwardRef((e,t)=>{const n=to(Se,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,i=te(Se,e.__scopeDialog);return x.jsx(He,{present:o||i.open,children:i.modal?x.jsx(fs,{...r,ref:t}):x.jsx(ds,{...r,ref:t})})});ro.displayName=Se;var fs=a.forwardRef((e,t)=>{const n=te(Se,e.__scopeDialog),o=a.useRef(null),r=H(t,n.contentRef,o);return a.useEffect(()=>{const i=o.current;if(i)return qn(i)},[]),x.jsx(io,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:k(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:k(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,s=c.button===0&&c.ctrlKey===!0;(c.button===2||s)&&i.preventDefault()}),onFocusOutside:k(e.onFocusOutside,i=>i.preventDefault())})}),ds=a.forwardRef((e,t)=>{const n=te(Se,e.__scopeDialog),o=a.useRef(!1),r=a.useRef(!1);return x.jsx(io,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(o.current||n.triggerRef.current?.focus(),i.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const c=i.target;n.triggerRef.current?.contains(c)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&r.current&&i.preventDefault()}})}),io=a.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:i,...c}=e,s=te(Se,n),l=a.useRef(null),u=H(t,l);return Bn(),x.jsxs(x.Fragment,{children:[x.jsx(Ht,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:i,children:x.jsx(lt,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Xt(s.open),...c,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),x.jsxs(x.Fragment,{children:[x.jsx(ps,{titleId:s.titleId}),x.jsx(hs,{contentRef:l,descriptionId:s.descriptionId})]})]})}),Yt="DialogTitle",so=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=te(Yt,n);return x.jsx(M.h2,{id:r.titleId,...o,ref:t})});so.displayName=Yt;var co="DialogDescription",ao=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=te(co,n);return x.jsx(M.p,{id:r.descriptionId,...o,ref:t})});ao.displayName=co;var lo="DialogClose",uo=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=te(lo,n);return x.jsx(M.button,{type:"button",...o,ref:t,onClick:k(e.onClick,()=>r.onOpenChange(!1))})});uo.displayName=lo;function Xt(e){return e?"open":"closed"}var fo="DialogTitleWarning",[Ea,po]=wr(fo,{contentName:Se,titleName:Yt,docsSlug:"dialog"}),ps=({titleId:e})=>{const t=po(fo),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. - -If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. - -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return a.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},ms="DialogDescriptionWarning",hs=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${po(ms).contentName}}.`;return a.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},Ra=Qn,Pa=eo,Aa=no,Oa=oo,Ta=ro,Na=so,Ia=ao,Da=uo;const gs=["top","right","bottom","left"],de=Math.min,G=Math.max,ot=Math.round,qe=Math.floor,re=e=>({x:e,y:e}),vs={left:"right",right:"left",bottom:"top",top:"bottom"},ys={start:"end",end:"start"};function Mt(e,t,n){return G(e,de(t,n))}function ce(e,t){return typeof e=="function"?e(t):e}function ae(e){return e.split("-")[0]}function Me(e){return e.split("-")[1]}function Gt(e){return e==="x"?"y":"x"}function qt(e){return e==="y"?"height":"width"}const ws=new Set(["top","bottom"]);function oe(e){return ws.has(ae(e))?"y":"x"}function Zt(e){return Gt(oe(e))}function xs(e,t,n){n===void 0&&(n=!1);const o=Me(e),r=Zt(e),i=qt(r);let c=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(c=rt(c)),[c,rt(c)]}function Ss(e){const t=rt(e);return[Lt(e),t,Lt(t)]}function Lt(e){return e.replace(/start|end/g,t=>ys[t])}const Sn=["left","right"],bn=["right","left"],bs=["top","bottom"],Cs=["bottom","top"];function Es(e,t,n){switch(e){case"top":case"bottom":return n?t?bn:Sn:t?Sn:bn;case"left":case"right":return t?bs:Cs;default:return[]}}function Rs(e,t,n,o){const r=Me(e);let i=Es(ae(e),n==="start",o);return r&&(i=i.map(c=>c+"-"+r),t&&(i=i.concat(i.map(Lt)))),i}function rt(e){return e.replace(/left|right|bottom|top/g,t=>vs[t])}function Ps(e){return{top:0,right:0,bottom:0,left:0,...e}}function mo(e){return typeof e!="number"?Ps(e):{top:e,right:e,bottom:e,left:e}}function it(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Cn(e,t,n){let{reference:o,floating:r}=e;const i=oe(t),c=Zt(t),s=qt(c),l=ae(t),u=i==="y",d=o.x+o.width/2-r.width/2,p=o.y+o.height/2-r.height/2,h=o[s]/2-r[s]/2;let m;switch(l){case"top":m={x:d,y:o.y-r.height};break;case"bottom":m={x:d,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:p};break;case"left":m={x:o.x-r.width,y:p};break;default:m={x:o.x,y:o.y}}switch(Me(t)){case"start":m[c]-=h*(n&&u?-1:1);break;case"end":m[c]+=h*(n&&u?-1:1);break}return m}const As=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:c}=n,s=i.filter(Boolean),l=await(c.isRTL==null?void 0:c.isRTL(t));let u=await c.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:p}=Cn(u,o,l),h=o,m={},w=0;for(let f=0;f({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:c,elements:s,middlewareData:l}=t,{element:u,padding:d=0}=ce(e,t)||{};if(u==null)return{};const p=mo(d),h={x:n,y:o},m=Zt(r),w=qt(m),f=await c.getDimensions(u),g=m==="y",y=g?"top":"left",v=g?"bottom":"right",S=g?"clientHeight":"clientWidth",b=i.reference[w]+i.reference[m]-h[m]-i.floating[w],C=h[m]-i.reference[m],R=await(c.getOffsetParent==null?void 0:c.getOffsetParent(u));let E=R?R[S]:0;(!E||!await(c.isElement==null?void 0:c.isElement(R)))&&(E=s.floating[S]||i.floating[w]);const O=b/2-C/2,_=E/2-f[w]/2-1,I=de(p[y],_),j=de(p[v],_),F=I,L=E-f[w]-j,N=E/2-f[w]/2+O,V=Mt(F,N,L),T=!l.arrow&&Me(r)!=null&&N!==V&&i.reference[w]/2-(NN<=0)){var j,F;const N=(((j=i.flip)==null?void 0:j.index)||0)+1,V=E[N];if(V&&(!(p==="alignment"?v!==oe(V):!1)||I.every(A=>oe(A.placement)===v?A.overflows[0]>0:!0)))return{data:{index:N,overflows:I},reset:{placement:V}};let T=(F=I.filter(D=>D.overflows[0]<=0).sort((D,A)=>D.overflows[1]-A.overflows[1])[0])==null?void 0:F.placement;if(!T)switch(m){case"bestFit":{var L;const D=(L=I.filter(A=>{if(R){const W=oe(A.placement);return W===v||W==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(W=>W>0).reduce((W,X)=>W+X,0)]).sort((A,W)=>A[1]-W[1])[0])==null?void 0:L[0];D&&(T=D);break}case"initialPlacement":T=s;break}if(r!==T)return{reset:{placement:T}}}return{}}}};function En(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Rn(e){return gs.some(t=>e[t]>=0)}const Ns=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=ce(e,t);switch(o){case"referenceHidden":{const i=await $e(t,{...r,elementContext:"reference"}),c=En(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Rn(c)}}}case"escaped":{const i=await $e(t,{...r,altBoundary:!0}),c=En(i,n.floating);return{data:{escapedOffsets:c,escaped:Rn(c)}}}default:return{}}}}},ho=new Set(["left","top"]);async function Is(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),c=ae(n),s=Me(n),l=oe(n)==="y",u=ho.has(c)?-1:1,d=i&&l?-1:1,p=ce(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:w}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return s&&typeof w=="number"&&(m=s==="end"?w*-1:w),l?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const Ds=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:c,middlewareData:s}=t,l=await Is(t,e);return c===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:c}}}}},_s=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:s={fn:g=>{let{x:y,y:v}=g;return{x:y,y:v}}},...l}=ce(e,t),u={x:n,y:o},d=await $e(t,l),p=oe(ae(r)),h=Gt(p);let m=u[h],w=u[p];if(i){const g=h==="y"?"top":"left",y=h==="y"?"bottom":"right",v=m+d[g],S=m-d[y];m=Mt(v,m,S)}if(c){const g=p==="y"?"top":"left",y=p==="y"?"bottom":"right",v=w+d[g],S=w-d[y];w=Mt(v,w,S)}const f=s.fn({...t,[h]:m,[p]:w});return{...f,data:{x:f.x-n,y:f.y-o,enabled:{[h]:i,[p]:c}}}}}},Ms=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:c}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=ce(e,t),d={x:n,y:o},p=oe(r),h=Gt(p);let m=d[h],w=d[p];const f=ce(s,t),g=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(l){const S=h==="y"?"height":"width",b=i.reference[h]-i.floating[S]+g.mainAxis,C=i.reference[h]+i.reference[S]-g.mainAxis;mC&&(m=C)}if(u){var y,v;const S=h==="y"?"width":"height",b=ho.has(ae(r)),C=i.reference[p]-i.floating[S]+(b&&((y=c.offset)==null?void 0:y[p])||0)+(b?0:g.crossAxis),R=i.reference[p]+i.reference[S]+(b?0:((v=c.offset)==null?void 0:v[p])||0)-(b?g.crossAxis:0);wR&&(w=R)}return{[h]:m,[p]:w}}}},Ls=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:c,elements:s}=t,{apply:l=()=>{},...u}=ce(e,t),d=await $e(t,u),p=ae(r),h=Me(r),m=oe(r)==="y",{width:w,height:f}=i.floating;let g,y;p==="top"||p==="bottom"?(g=p,y=h===(await(c.isRTL==null?void 0:c.isRTL(s.floating))?"start":"end")?"left":"right"):(y=p,g=h==="end"?"top":"bottom");const v=f-d.top-d.bottom,S=w-d.left-d.right,b=de(f-d[g],v),C=de(w-d[y],S),R=!t.middlewareData.shift;let E=b,O=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=S),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(E=v),R&&!h){const I=G(d.left,0),j=G(d.right,0),F=G(d.top,0),L=G(d.bottom,0);m?O=w-2*(I!==0||j!==0?I+j:G(d.left,d.right)):E=f-2*(F!==0||L!==0?F+L:G(d.top,d.bottom))}await l({...t,availableWidth:O,availableHeight:E});const _=await c.getDimensions(s.floating);return w!==_.width||f!==_.height?{reset:{rects:!0}}:{}}}};function dt(){return typeof window<"u"}function Le(e){return go(e)?(e.nodeName||"").toLowerCase():"#document"}function q(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function se(e){var t;return(t=(go(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function go(e){return dt()?e instanceof Node||e instanceof q(e).Node:!1}function J(e){return dt()?e instanceof Element||e instanceof q(e).Element:!1}function ie(e){return dt()?e instanceof HTMLElement||e instanceof q(e).HTMLElement:!1}function Pn(e){return!dt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof q(e).ShadowRoot}const ks=new Set(["inline","contents"]);function Ue(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!ks.has(r)}const js=new Set(["table","td","th"]);function Fs(e){return js.has(Le(e))}const Ws=[":popover-open",":modal"];function pt(e){return Ws.some(t=>{try{return e.matches(t)}catch{return!1}})}const $s=["transform","translate","scale","rotate","perspective"],Bs=["transform","translate","scale","rotate","perspective","filter"],Vs=["paint","layout","strict","content"];function Qt(e){const t=Jt(),n=J(e)?ee(e):e;return $s.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Bs.some(o=>(n.willChange||"").includes(o))||Vs.some(o=>(n.contain||"").includes(o))}function Hs(e){let t=pe(e);for(;ie(t)&&!De(t);){if(Qt(t))return t;if(pt(t))return null;t=pe(t)}return null}function Jt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Us=new Set(["html","body","#document"]);function De(e){return Us.has(Le(e))}function ee(e){return q(e).getComputedStyle(e)}function mt(e){return J(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function pe(e){if(Le(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Pn(e)&&e.host||se(e);return Pn(t)?t.host:t}function vo(e){const t=pe(e);return De(t)?e.ownerDocument?e.ownerDocument.body:e.body:ie(t)&&Ue(t)?t:vo(t)}function Be(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=vo(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),c=q(r);if(i){const s=kt(c);return t.concat(c,c.visualViewport||[],Ue(r)?r:[],s&&n?Be(s):[])}return t.concat(r,Be(r,[],n))}function kt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function yo(e){const t=ee(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=ie(e),i=r?e.offsetWidth:n,c=r?e.offsetHeight:o,s=ot(n)!==i||ot(o)!==c;return s&&(n=i,o=c),{width:n,height:o,$:s}}function en(e){return J(e)?e:e.contextElement}function Ie(e){const t=en(e);if(!ie(t))return re(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=yo(t);let c=(i?ot(n.width):n.width)/o,s=(i?ot(n.height):n.height)/r;return(!c||!Number.isFinite(c))&&(c=1),(!s||!Number.isFinite(s))&&(s=1),{x:c,y:s}}const zs=re(0);function wo(e){const t=q(e);return!Jt()||!t.visualViewport?zs:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ks(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==q(e)?!1:t}function be(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=en(e);let c=re(1);t&&(o?J(o)&&(c=Ie(o)):c=Ie(e));const s=Ks(i,n,o)?wo(i):re(0);let l=(r.left+s.x)/c.x,u=(r.top+s.y)/c.y,d=r.width/c.x,p=r.height/c.y;if(i){const h=q(i),m=o&&J(o)?q(o):o;let w=h,f=kt(w);for(;f&&o&&m!==w;){const g=Ie(f),y=f.getBoundingClientRect(),v=ee(f),S=y.left+(f.clientLeft+parseFloat(v.paddingLeft))*g.x,b=y.top+(f.clientTop+parseFloat(v.paddingTop))*g.y;l*=g.x,u*=g.y,d*=g.x,p*=g.y,l+=S,u+=b,w=q(f),f=kt(w)}}return it({width:d,height:p,x:l,y:u})}function ht(e,t){const n=mt(e).scrollLeft;return t?t.left+n:be(se(e)).left+n}function xo(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-ht(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Ys(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",c=se(o),s=t?pt(t.floating):!1;if(o===c||s&&i)return n;let l={scrollLeft:0,scrollTop:0},u=re(1);const d=re(0),p=ie(o);if((p||!p&&!i)&&((Le(o)!=="body"||Ue(c))&&(l=mt(o)),ie(o))){const m=be(o);u=Ie(o),d.x=m.x+o.clientLeft,d.y=m.y+o.clientTop}const h=c&&!p&&!i?xo(c,l):re(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-l.scrollTop*u.y+d.y+h.y}}function Xs(e){return Array.from(e.getClientRects())}function Gs(e){const t=se(e),n=mt(e),o=e.ownerDocument.body,r=G(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=G(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let c=-n.scrollLeft+ht(e);const s=-n.scrollTop;return ee(o).direction==="rtl"&&(c+=G(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:c,y:s}}const An=25;function qs(e,t){const n=q(e),o=se(e),r=n.visualViewport;let i=o.clientWidth,c=o.clientHeight,s=0,l=0;if(r){i=r.width,c=r.height;const d=Jt();(!d||d&&t==="fixed")&&(s=r.offsetLeft,l=r.offsetTop)}const u=ht(o);if(u<=0){const d=o.ownerDocument,p=d.body,h=getComputedStyle(p),m=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,w=Math.abs(o.clientWidth-p.clientWidth-m);w<=An&&(i-=w)}else u<=An&&(i+=u);return{width:i,height:c,x:s,y:l}}const Zs=new Set(["absolute","fixed"]);function Qs(e,t){const n=be(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=ie(e)?Ie(e):re(1),c=e.clientWidth*i.x,s=e.clientHeight*i.y,l=r*i.x,u=o*i.y;return{width:c,height:s,x:l,y:u}}function On(e,t,n){let o;if(t==="viewport")o=qs(e,n);else if(t==="document")o=Gs(se(e));else if(J(t))o=Qs(t,n);else{const r=wo(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return it(o)}function So(e,t){const n=pe(e);return n===t||!J(n)||De(n)?!1:ee(n).position==="fixed"||So(n,t)}function Js(e,t){const n=t.get(e);if(n)return n;let o=Be(e,[],!1).filter(s=>J(s)&&Le(s)!=="body"),r=null;const i=ee(e).position==="fixed";let c=i?pe(e):e;for(;J(c)&&!De(c);){const s=ee(c),l=Qt(c);!l&&s.position==="fixed"&&(r=null),(i?!l&&!r:!l&&s.position==="static"&&!!r&&Zs.has(r.position)||Ue(c)&&!l&&So(e,c))?o=o.filter(d=>d!==c):r=s,c=pe(c)}return t.set(e,o),o}function ec(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const c=[...n==="clippingAncestors"?pt(t)?[]:Js(t,this._c):[].concat(n),o],s=c[0],l=c.reduce((u,d)=>{const p=On(t,d,r);return u.top=G(p.top,u.top),u.right=de(p.right,u.right),u.bottom=de(p.bottom,u.bottom),u.left=G(p.left,u.left),u},On(t,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function tc(e){const{width:t,height:n}=yo(e);return{width:t,height:n}}function nc(e,t,n){const o=ie(t),r=se(t),i=n==="fixed",c=be(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=re(0);function u(){l.x=ht(r)}if(o||!o&&!i)if((Le(t)!=="body"||Ue(r))&&(s=mt(t)),o){const m=be(t,!0,i,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}else r&&u();i&&!o&&r&&u();const d=r&&!o&&!i?xo(r,s):re(0),p=c.left+s.scrollLeft-l.x-d.x,h=c.top+s.scrollTop-l.y-d.y;return{x:p,y:h,width:c.width,height:c.height}}function Nt(e){return ee(e).position==="static"}function Tn(e,t){if(!ie(e)||ee(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return se(e)===n&&(n=n.ownerDocument.body),n}function bo(e,t){const n=q(e);if(pt(e))return n;if(!ie(e)){let r=pe(e);for(;r&&!De(r);){if(J(r)&&!Nt(r))return r;r=pe(r)}return n}let o=Tn(e,t);for(;o&&Fs(o)&&Nt(o);)o=Tn(o,t);return o&&De(o)&&Nt(o)&&!Qt(o)?n:o||Hs(e)||n}const oc=async function(e){const t=this.getOffsetParent||bo,n=this.getDimensions,o=await n(e.floating);return{reference:nc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function rc(e){return ee(e).direction==="rtl"}const ic={convertOffsetParentRelativeRectToViewportRelativeRect:Ys,getDocumentElement:se,getClippingRect:ec,getOffsetParent:bo,getElementRects:oc,getClientRects:Xs,getDimensions:tc,getScale:Ie,isElement:J,isRTL:rc};function Co(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sc(e,t){let n=null,o;const r=se(e);function i(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function c(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),i();const u=e.getBoundingClientRect(),{left:d,top:p,width:h,height:m}=u;if(s||t(),!h||!m)return;const w=qe(p),f=qe(r.clientWidth-(d+h)),g=qe(r.clientHeight-(p+m)),y=qe(d),S={rootMargin:-w+"px "+-f+"px "+-g+"px "+-y+"px",threshold:G(0,de(1,l))||1};let b=!0;function C(R){const E=R[0].intersectionRatio;if(E!==l){if(!b)return c();E?c(!1,E):o=setTimeout(()=>{c(!1,1e-7)},1e3)}E===1&&!Co(u,e.getBoundingClientRect())&&c(),b=!1}try{n=new IntersectionObserver(C,{...S,root:r.ownerDocument})}catch{n=new IntersectionObserver(C,S)}n.observe(e)}return c(!0),i}function cc(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,u=en(e),d=r||i?[...u?Be(u):[],...Be(t)]:[];d.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const p=u&&s?sc(u,n):null;let h=-1,m=null;c&&(m=new ResizeObserver(y=>{let[v]=y;v&&v.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var S;(S=m)==null||S.observe(t)})),n()}),u&&!l&&m.observe(u),m.observe(t));let w,f=l?be(e):null;l&&g();function g(){const y=be(e);f&&!Co(f,y)&&n(),f=y,w=requestAnimationFrame(g)}return n(),()=>{var y;d.forEach(v=>{r&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),p?.(),(y=m)==null||y.disconnect(),m=null,l&&cancelAnimationFrame(w)}}const ac=Ds,lc=_s,uc=Ts,fc=Ls,dc=Ns,Nn=Os,pc=Ms,mc=(e,t,n)=>{const o=new Map,r={platform:ic,...n},i={...r.platform,_c:o};return As(e,t,{...r,platform:i})};var hc=typeof document<"u",gc=function(){},Je=hc?a.useLayoutEffect:gc;function st(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!st(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!st(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Eo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function In(e,t){const n=Eo(e);return Math.round(t*n)/n}function It(e){const t=a.useRef(e);return Je(()=>{t.current=e}),t}function vc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:c}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[d,p]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=a.useState(o);st(h,o)||m(o);const[w,f]=a.useState(null),[g,y]=a.useState(null),v=a.useCallback(A=>{A!==R.current&&(R.current=A,f(A))},[]),S=a.useCallback(A=>{A!==E.current&&(E.current=A,y(A))},[]),b=i||w,C=c||g,R=a.useRef(null),E=a.useRef(null),O=a.useRef(d),_=l!=null,I=It(l),j=It(r),F=It(u),L=a.useCallback(()=>{if(!R.current||!E.current)return;const A={placement:t,strategy:n,middleware:h};j.current&&(A.platform=j.current),mc(R.current,E.current,A).then(W=>{const X={...W,isPositioned:F.current!==!1};N.current&&!st(O.current,X)&&(O.current=X,at.flushSync(()=>{p(X)}))})},[h,t,n,j,F]);Je(()=>{u===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,p(A=>({...A,isPositioned:!1})))},[u]);const N=a.useRef(!1);Je(()=>(N.current=!0,()=>{N.current=!1}),[]),Je(()=>{if(b&&(R.current=b),C&&(E.current=C),b&&C){if(I.current)return I.current(b,C,L);L()}},[b,C,L,I,_]);const V=a.useMemo(()=>({reference:R,floating:E,setReference:v,setFloating:S}),[v,S]),T=a.useMemo(()=>({reference:b,floating:C}),[b,C]),D=a.useMemo(()=>{const A={position:n,left:0,top:0};if(!T.floating)return A;const W=In(T.floating,d.x),X=In(T.floating,d.y);return s?{...A,transform:"translate("+W+"px, "+X+"px)",...Eo(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:X}},[n,s,T.floating,d.x,d.y]);return a.useMemo(()=>({...d,update:L,refs:V,elements:T,floatingStyles:D}),[d,L,V,T,D])}const yc=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?Nn({element:o.current,padding:r}).fn(n):{}:o?Nn({element:o,padding:r}).fn(n):{}}}},wc=(e,t)=>({...ac(e),options:[e,t]}),xc=(e,t)=>({...lc(e),options:[e,t]}),Sc=(e,t)=>({...pc(e),options:[e,t]}),bc=(e,t)=>({...uc(e),options:[e,t]}),Cc=(e,t)=>({...fc(e),options:[e,t]}),Ec=(e,t)=>({...dc(e),options:[e,t]}),Rc=(e,t)=>({...yc(e),options:[e,t]});var Pc="Arrow",Ro=a.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...i}=e;return x.jsx(M.svg,{...i,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:x.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ro.displayName=Pc;var Ac=Ro,tn="Popper",[Po,Ao]=Ve(tn),[Oc,Oo]=Po(tn),To=e=>{const{__scopePopper:t,children:n}=e,[o,r]=a.useState(null);return x.jsx(Oc,{scope:t,anchor:o,onAnchorChange:r,children:n})};To.displayName=tn;var No="PopperAnchor",Io=a.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,i=Oo(No,n),c=a.useRef(null),s=H(t,c),l=a.useRef(null);return a.useEffect(()=>{const u=l.current;l.current=o?.current||c.current,u!==l.current&&i.onAnchorChange(l.current)}),o?null:x.jsx(M.div,{...r,ref:s})});Io.displayName=No;var nn="PopperContent",[Tc,Nc]=Po(nn),Do=a.forwardRef((e,t)=>{const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:i="center",alignOffset:c=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:p="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:w,...f}=e,g=Oo(nn,n),[y,v]=a.useState(null),S=H(t,P=>v(P)),[b,C]=a.useState(null),R=Ln(b),E=R?.width??0,O=R?.height??0,_=o+(i!=="center"?"-"+i:""),I=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},j=Array.isArray(u)?u:[u],F=j.length>0,L={padding:I,boundary:j.filter(Dc),altBoundary:F},{refs:N,floatingStyles:V,placement:T,isPositioned:D,middlewareData:A}=vc({strategy:"fixed",placement:_,whileElementsMounted:(...P)=>cc(...P,{animationFrame:m==="always"}),elements:{reference:g.anchor},middleware:[wc({mainAxis:r+O,alignmentAxis:c}),l&&xc({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Sc():void 0,...L}),l&&bc({...L}),Cc({...L,apply:({elements:P,rects:U,availableWidth:Y,availableHeight:$})=>{const{width:B,height:z}=U.reference,Z=P.floating.style;Z.setProperty("--radix-popper-available-width",`${Y}px`),Z.setProperty("--radix-popper-available-height",`${$}px`),Z.setProperty("--radix-popper-anchor-width",`${B}px`),Z.setProperty("--radix-popper-anchor-height",`${z}px`)}}),b&&Rc({element:b,padding:s}),_c({arrowWidth:E,arrowHeight:O}),h&&Ec({strategy:"referenceHidden",...L})]}),[W,X]=Lo(T),ge=xe(w);K(()=>{D&&ge?.()},[D,ge]);const je=A.arrow?.x,Fe=A.arrow?.y,le=A.arrow?.centerOffset!==0,[Re,ve]=a.useState();return K(()=>{y&&ve(window.getComputedStyle(y).zIndex)},[y]),x.jsx("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:D?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Re,"--radix-popper-transform-origin":[A.transformOrigin?.x,A.transformOrigin?.y].join(" "),...A.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:x.jsx(Tc,{scope:n,placedSide:W,onArrowChange:C,arrowX:je,arrowY:Fe,shouldHideArrow:le,children:x.jsx(M.div,{"data-side":W,"data-align":X,...f,ref:S,style:{...f.style,animation:D?void 0:"none"}})})})});Do.displayName=nn;var _o="PopperArrow",Ic={top:"bottom",right:"left",bottom:"top",left:"right"},Mo=a.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,i=Nc(_o,o),c=Ic[i.placedSide];return x.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:x.jsx(Ac,{...r,ref:n,style:{...r.style,display:"block"}})})});Mo.displayName=_o;function Dc(e){return e!==null}var _c=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,c=r.arrow?.centerOffset!==0,s=c?0:e.arrowWidth,l=c?0:e.arrowHeight,[u,d]=Lo(n),p={start:"0%",center:"50%",end:"100%"}[d],h=(r.arrow?.x??0)+s/2,m=(r.arrow?.y??0)+l/2;let w="",f="";return u==="bottom"?(w=c?p:`${h}px`,f=`${-l}px`):u==="top"?(w=c?p:`${h}px`,f=`${o.floating.height+l}px`):u==="right"?(w=`${-l}px`,f=c?p:`${m}px`):u==="left"&&(w=`${o.floating.width+l}px`,f=c?p:`${m}px`),{data:{x:w,y:f}}}});function Lo(e){const[t,n="center"]=e.split("-");return[t,n]}var Mc=To,Lc=Io,kc=Do,jc=Mo;function Fc(e){const t=Wc(e),n=a.forwardRef((o,r)=>{const{children:i,...c}=o,s=a.Children.toArray(i),l=s.find(Bc);if(l){const u=l.props.children,d=s.map(p=>p===l?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:p);return x.jsx(t,{...c,ref:r,children:a.isValidElement(u)?a.cloneElement(u,void 0,d):null})}return x.jsx(t,{...c,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function Wc(e){const t=a.forwardRef((n,o)=>{const{children:r,...i}=n;if(a.isValidElement(r)){const c=Hc(r),s=Vc(i,r.props);return r.type!==a.Fragment&&(s.ref=o?_e(o,c):c),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $c=Symbol("radix.slottable");function Bc(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$c}function Vc(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...s)=>{const l=i(...s);return r(...s),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Hc(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ko=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Uc="VisuallyHidden",jo=a.forwardRef((e,t)=>x.jsx(M.span,{...e,ref:t,style:{...ko,...e.style}}));jo.displayName=Uc;var _a=jo,zc=[" ","Enter","ArrowUp","ArrowDown"],Kc=[" ","Enter"],Ce="Select",[gt,vt,Yc]=Pr(Ce),[ke]=Ve(Ce,[Yc,Ao]),yt=Ao(),[Xc,me]=ke(Ce),[Gc,qc]=ke(Ce),Fo=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:i,value:c,defaultValue:s,onValueChange:l,dir:u,name:d,autoComplete:p,disabled:h,required:m,form:w}=e,f=yt(t),[g,y]=a.useState(null),[v,S]=a.useState(null),[b,C]=a.useState(!1),R=Br(u),[E,O]=et({prop:o,defaultProp:r??!1,onChange:i,caller:Ce}),[_,I]=et({prop:c,defaultProp:s,onChange:l,caller:Ce}),j=a.useRef(null),F=g?w||!!g.closest("form"):!0,[L,N]=a.useState(new Set),V=Array.from(L).map(T=>T.props.value).join(";");return x.jsx(Mc,{...f,children:x.jsxs(Xc,{required:m,scope:t,trigger:g,onTriggerChange:y,valueNode:v,onValueNodeChange:S,valueNodeHasChildren:b,onValueNodeHasChildrenChange:C,contentId:Te(),value:_,onValueChange:I,open:E,onOpenChange:O,dir:R,triggerPointerDownPosRef:j,disabled:h,children:[x.jsx(gt.Provider,{scope:t,children:x.jsx(Gc,{scope:e.__scopeSelect,onNativeOptionAdd:a.useCallback(T=>{N(D=>new Set(D).add(T))},[]),onNativeOptionRemove:a.useCallback(T=>{N(D=>{const A=new Set(D);return A.delete(T),A})},[]),children:n})}),F?x.jsxs(ar,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:p,value:_,onChange:T=>I(T.target.value),disabled:h,form:w,children:[_===void 0?x.jsx("option",{value:""}):null,Array.from(L)]},V):null]})})};Fo.displayName=Ce;var Wo="SelectTrigger",$o=a.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,i=yt(n),c=me(Wo,n),s=c.disabled||o,l=H(t,c.onTriggerChange),u=vt(n),d=a.useRef("touch"),[p,h,m]=ur(f=>{const g=u().filter(S=>!S.disabled),y=g.find(S=>S.value===c.value),v=fr(g,f,y);v!==void 0&&c.onValueChange(v.value)}),w=f=>{s||(c.onOpenChange(!0),m()),f&&(c.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return x.jsx(Lc,{asChild:!0,...i,children:x.jsx(M.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":lr(c.value)?"":void 0,...r,ref:l,onClick:k(r.onClick,f=>{f.currentTarget.focus(),d.current!=="mouse"&&w(f)}),onPointerDown:k(r.onPointerDown,f=>{d.current=f.pointerType;const g=f.target;g.hasPointerCapture(f.pointerId)&&g.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&f.pointerType==="mouse"&&(w(f),f.preventDefault())}),onKeyDown:k(r.onKeyDown,f=>{const g=p.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&h(f.key),!(g&&f.key===" ")&&zc.includes(f.key)&&(w(),f.preventDefault())})})})});$o.displayName=Wo;var Bo="SelectValue",Vo=a.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:i,placeholder:c="",...s}=e,l=me(Bo,n),{onValueNodeHasChildrenChange:u}=l,d=i!==void 0,p=H(t,l.onValueNodeChange);return K(()=>{u(d)},[u,d]),x.jsx(M.span,{...s,ref:p,style:{pointerEvents:"none"},children:lr(l.value)?x.jsx(x.Fragment,{children:c}):i})});Vo.displayName=Bo;var Zc="SelectIcon",Ho=a.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return x.jsx(M.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});Ho.displayName=Zc;var Qc="SelectPortal",Uo=e=>x.jsx(Ut,{asChild:!0,...e});Uo.displayName=Qc;var Ee="SelectContent",zo=a.forwardRef((e,t)=>{const n=me(Ee,e.__scopeSelect),[o,r]=a.useState();if(K(()=>{r(new DocumentFragment)},[]),!n.open){const i=o;return i?at.createPortal(x.jsx(Ko,{scope:e.__scopeSelect,children:x.jsx(gt.Slot,{scope:e.__scopeSelect,children:x.jsx("div",{children:e.children})})}),i):null}return x.jsx(Yo,{...e,ref:t})});zo.displayName=Ee;var Q=10,[Ko,he]=ke(Ee),Jc="SelectContentImpl",ea=Fc("SelectContent.RemoveScroll"),Yo=a.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:c,side:s,sideOffset:l,align:u,alignOffset:d,arrowPadding:p,collisionBoundary:h,collisionPadding:m,sticky:w,hideWhenDetached:f,avoidCollisions:g,...y}=e,v=me(Ee,n),[S,b]=a.useState(null),[C,R]=a.useState(null),E=H(t,P=>b(P)),[O,_]=a.useState(null),[I,j]=a.useState(null),F=vt(n),[L,N]=a.useState(!1),V=a.useRef(!1);a.useEffect(()=>{if(S)return qn(S)},[S]),Bn();const T=a.useCallback(P=>{const[U,...Y]=F().map(z=>z.ref.current),[$]=Y.slice(-1),B=document.activeElement;for(const z of P)if(z===B||(z?.scrollIntoView({block:"nearest"}),z===U&&C&&(C.scrollTop=0),z===$&&C&&(C.scrollTop=C.scrollHeight),z?.focus(),document.activeElement!==B))return},[F,C]),D=a.useCallback(()=>T([O,S]),[T,O,S]);a.useEffect(()=>{L&&D()},[L,D]);const{onOpenChange:A,triggerPointerDownPosRef:W}=v;a.useEffect(()=>{if(S){let P={x:0,y:0};const U=$=>{P={x:Math.abs(Math.round($.pageX)-(W.current?.x??0)),y:Math.abs(Math.round($.pageY)-(W.current?.y??0))}},Y=$=>{P.x<=10&&P.y<=10?$.preventDefault():S.contains($.target)||A(!1),document.removeEventListener("pointermove",U),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",U),document.addEventListener("pointerup",Y,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",Y,{capture:!0})}}},[S,A,W]),a.useEffect(()=>{const P=()=>A(!1);return window.addEventListener("blur",P),window.addEventListener("resize",P),()=>{window.removeEventListener("blur",P),window.removeEventListener("resize",P)}},[A]);const[X,ge]=ur(P=>{const U=F().filter(B=>!B.disabled),Y=U.find(B=>B.ref.current===document.activeElement),$=fr(U,P,Y);$&&setTimeout(()=>$.ref.current.focus())}),je=a.useCallback((P,U,Y)=>{const $=!V.current&&!Y;(v.value!==void 0&&v.value===U||$)&&(_(P),$&&(V.current=!0))},[v.value]),Fe=a.useCallback(()=>S?.focus(),[S]),le=a.useCallback((P,U,Y)=>{const $=!V.current&&!Y;(v.value!==void 0&&v.value===U||$)&&j(P)},[v.value]),Re=o==="popper"?jt:Xo,ve=Re===jt?{side:s,sideOffset:l,align:u,alignOffset:d,arrowPadding:p,collisionBoundary:h,collisionPadding:m,sticky:w,hideWhenDetached:f,avoidCollisions:g}:{};return x.jsx(Ko,{scope:n,content:S,viewport:C,onViewportChange:R,itemRefCallback:je,selectedItem:O,onItemLeave:Fe,itemTextRefCallback:le,focusSelectedItem:D,selectedItemText:I,position:o,isPositioned:L,searchRef:X,children:x.jsx(zt,{as:ea,allowPinchZoom:!0,children:x.jsx(Ht,{asChild:!0,trapped:v.open,onMountAutoFocus:P=>{P.preventDefault()},onUnmountAutoFocus:k(r,P=>{v.trigger?.focus({preventScroll:!0}),P.preventDefault()}),children:x.jsx(lt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:P=>P.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:x.jsx(Re,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:P=>P.preventDefault(),...y,...ve,onPlaced:()=>N(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:k(y.onKeyDown,P=>{const U=P.ctrlKey||P.altKey||P.metaKey;if(P.key==="Tab"&&P.preventDefault(),!U&&P.key.length===1&&ge(P.key),["ArrowUp","ArrowDown","Home","End"].includes(P.key)){let $=F().filter(B=>!B.disabled).map(B=>B.ref.current);if(["ArrowUp","End"].includes(P.key)&&($=$.slice().reverse()),["ArrowUp","ArrowDown"].includes(P.key)){const B=P.target,z=$.indexOf(B);$=$.slice(z+1)}setTimeout(()=>T($)),P.preventDefault()}})})})})})})});Yo.displayName=Jc;var ta="SelectItemAlignedPosition",Xo=a.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,i=me(Ee,n),c=he(Ee,n),[s,l]=a.useState(null),[u,d]=a.useState(null),p=H(t,E=>d(E)),h=vt(n),m=a.useRef(!1),w=a.useRef(!0),{viewport:f,selectedItem:g,selectedItemText:y,focusSelectedItem:v}=c,S=a.useCallback(()=>{if(i.trigger&&i.valueNode&&s&&u&&f&&g&&y){const E=i.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),_=i.valueNode.getBoundingClientRect(),I=y.getBoundingClientRect();if(i.dir!=="rtl"){const B=I.left-O.left,z=_.left-B,Z=E.left-z,ye=E.width+Z,xt=Math.max(ye,O.width),St=window.innerWidth-Q,bt=an(z,[Q,Math.max(Q,St-xt)]);s.style.minWidth=ye+"px",s.style.left=bt+"px"}else{const B=O.right-I.right,z=window.innerWidth-_.right-B,Z=window.innerWidth-E.right-z,ye=E.width+Z,xt=Math.max(ye,O.width),St=window.innerWidth-Q,bt=an(z,[Q,Math.max(Q,St-xt)]);s.style.minWidth=ye+"px",s.style.right=bt+"px"}const j=h(),F=window.innerHeight-Q*2,L=f.scrollHeight,N=window.getComputedStyle(u),V=parseInt(N.borderTopWidth,10),T=parseInt(N.paddingTop,10),D=parseInt(N.borderBottomWidth,10),A=parseInt(N.paddingBottom,10),W=V+T+L+A+D,X=Math.min(g.offsetHeight*5,W),ge=window.getComputedStyle(f),je=parseInt(ge.paddingTop,10),Fe=parseInt(ge.paddingBottom,10),le=E.top+E.height/2-Q,Re=F-le,ve=g.offsetHeight/2,P=g.offsetTop+ve,U=V+T+P,Y=W-U;if(U<=le){const B=j.length>0&&g===j[j.length-1].ref.current;s.style.bottom="0px";const z=u.clientHeight-f.offsetTop-f.offsetHeight,Z=Math.max(Re,ve+(B?Fe:0)+z+D),ye=U+Z;s.style.height=ye+"px"}else{const B=j.length>0&&g===j[0].ref.current;s.style.top="0px";const Z=Math.max(le,V+f.offsetTop+(B?je:0)+ve)+Y;s.style.height=Z+"px",f.scrollTop=U-le+f.offsetTop}s.style.margin=`${Q}px 0`,s.style.minHeight=X+"px",s.style.maxHeight=F+"px",o?.(),requestAnimationFrame(()=>m.current=!0)}},[h,i.trigger,i.valueNode,s,u,f,g,y,i.dir,o]);K(()=>S(),[S]);const[b,C]=a.useState();K(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);const R=a.useCallback(E=>{E&&w.current===!0&&(S(),v?.(),w.current=!1)},[S,v]);return x.jsx(oa,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:R,children:x.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:x.jsx(M.div,{...r,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});Xo.displayName=ta;var na="SelectPopperPosition",jt=a.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=Q,...i}=e,c=yt(n);return x.jsx(kc,{...c,...i,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});jt.displayName=na;var[oa,on]=ke(Ee,{}),Ft="SelectViewport",Go=a.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,i=he(Ft,n),c=on(Ft,n),s=H(t,i.onViewportChange),l=a.useRef(0);return x.jsxs(x.Fragment,{children:[x.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),x.jsx(gt.Slot,{scope:n,children:x.jsx(M.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:k(r.onScroll,u=>{const d=u.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:h}=c;if(h?.current&&p){const m=Math.abs(l.current-d.scrollTop);if(m>0){const w=window.innerHeight-Q*2,f=parseFloat(p.style.minHeight),g=parseFloat(p.style.height),y=Math.max(f,g);if(y0?b:0,p.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});Go.displayName=Ft;var qo="SelectGroup",[ra,ia]=ke(qo),sa=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Te();return x.jsx(ra,{scope:n,id:r,children:x.jsx(M.div,{role:"group","aria-labelledby":r,...o,ref:t})})});sa.displayName=qo;var Zo="SelectLabel",Qo=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=ia(Zo,n);return x.jsx(M.div,{id:r.id,...o,ref:t})});Qo.displayName=Zo;var ct="SelectItem",[ca,Jo]=ke(ct),er=a.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:i,...c}=e,s=me(ct,n),l=he(ct,n),u=s.value===o,[d,p]=a.useState(i??""),[h,m]=a.useState(!1),w=H(t,v=>l.itemRefCallback?.(v,o,r)),f=Te(),g=a.useRef("touch"),y=()=>{r||(s.onValueChange(o),s.onOpenChange(!1))};if(o==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return x.jsx(ca,{scope:n,value:o,disabled:r,textId:f,isSelected:u,onItemTextChange:a.useCallback(v=>{p(S=>S||(v?.textContent??"").trim())},[]),children:x.jsx(gt.ItemSlot,{scope:n,value:o,disabled:r,textValue:d,children:x.jsx(M.div,{role:"option","aria-labelledby":f,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...c,ref:w,onFocus:k(c.onFocus,()=>m(!0)),onBlur:k(c.onBlur,()=>m(!1)),onClick:k(c.onClick,()=>{g.current!=="mouse"&&y()}),onPointerUp:k(c.onPointerUp,()=>{g.current==="mouse"&&y()}),onPointerDown:k(c.onPointerDown,v=>{g.current=v.pointerType}),onPointerMove:k(c.onPointerMove,v=>{g.current=v.pointerType,r?l.onItemLeave?.():g.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:k(c.onPointerLeave,v=>{v.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:k(c.onKeyDown,v=>{l.searchRef?.current!==""&&v.key===" "||(Kc.includes(v.key)&&y(),v.key===" "&&v.preventDefault())})})})})});er.displayName=ct;var We="SelectItemText",tr=a.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...i}=e,c=me(We,n),s=he(We,n),l=Jo(We,n),u=qc(We,n),[d,p]=a.useState(null),h=H(t,y=>p(y),l.onItemTextChange,y=>s.itemTextRefCallback?.(y,l.value,l.disabled)),m=d?.textContent,w=a.useMemo(()=>x.jsx("option",{value:l.value,disabled:l.disabled,children:m},l.value),[l.disabled,l.value,m]),{onNativeOptionAdd:f,onNativeOptionRemove:g}=u;return K(()=>(f(w),()=>g(w)),[f,g,w]),x.jsxs(x.Fragment,{children:[x.jsx(M.span,{id:l.textId,...i,ref:h}),l.isSelected&&c.valueNode&&!c.valueNodeHasChildren?at.createPortal(i.children,c.valueNode):null]})});tr.displayName=We;var nr="SelectItemIndicator",or=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return Jo(nr,n).isSelected?x.jsx(M.span,{"aria-hidden":!0,...o,ref:t}):null});or.displayName=nr;var Wt="SelectScrollUpButton",rr=a.forwardRef((e,t)=>{const n=he(Wt,e.__scopeSelect),o=on(Wt,e.__scopeSelect),[r,i]=a.useState(!1),c=H(t,o.onScrollButtonChange);return K(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=l.scrollTop>0;i(u)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),r?x.jsx(sr,{...e,ref:c,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});rr.displayName=Wt;var $t="SelectScrollDownButton",ir=a.forwardRef((e,t)=>{const n=he($t,e.__scopeSelect),o=on($t,e.__scopeSelect),[r,i]=a.useState(!1),c=H(t,o.onScrollButtonChange);return K(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),r?x.jsx(sr,{...e,ref:c,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});ir.displayName=$t;var sr=a.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,i=he("SelectScrollButton",n),c=a.useRef(null),s=vt(n),l=a.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return a.useEffect(()=>()=>l(),[l]),K(()=>{s().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),x.jsx(M.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:k(r.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(o,50))}),onPointerMove:k(r.onPointerMove,()=>{i.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(o,50))}),onPointerLeave:k(r.onPointerLeave,()=>{l()})})}),aa="SelectSeparator",cr=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return x.jsx(M.div,{"aria-hidden":!0,...o,ref:t})});cr.displayName=aa;var Bt="SelectArrow",la=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=yt(n),i=me(Bt,n),c=he(Bt,n);return i.open&&c.position==="popper"?x.jsx(jc,{...r,...o,ref:t}):null});la.displayName=Bt;var ua="SelectBubbleInput",ar=a.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=a.useRef(null),i=H(o,r),c=Mn(t);return a.useEffect(()=>{const s=r.current;if(!s)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(c!==t&&d){const p=new Event("change",{bubbles:!0});d.call(s,t),s.dispatchEvent(p)}},[c,t]),x.jsx(M.select,{...n,style:{...ko,...n.style},ref:i,defaultValue:t})});ar.displayName=ua;function lr(e){return e===""||e===void 0}function ur(e){const t=xe(e),n=a.useRef(""),o=a.useRef(0),r=a.useCallback(c=>{const s=n.current+c;t(s),(function l(u){n.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>l(""),1e3))})(s)},[t]),i=a.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return a.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,i]}function fr(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let c=fa(e,Math.max(i,0));r.length===1&&(c=c.filter(u=>u!==n));const l=c.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function fa(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Ma=Fo,La=$o,ka=Vo,ja=Ho,Fa=Uo,Wa=zo,$a=Go,Ba=Qo,Va=er,Ha=tr,Ua=or,za=rr,Ka=ir,Ya=cr,wt="Checkbox",[da]=Ve(wt),[pa,rn]=da(wt);function ma(e){const{__scopeCheckbox:t,checked:n,children:o,defaultChecked:r,disabled:i,form:c,name:s,onCheckedChange:l,required:u,value:d="on",internal_do_not_use_render:p}=e,[h,m]=et({prop:n,defaultProp:r??!1,onChange:l,caller:wt}),[w,f]=a.useState(null),[g,y]=a.useState(null),v=a.useRef(!1),S=w?!!c||!!w.closest("form"):!0,b={checked:h,disabled:i,setChecked:m,control:w,setControl:f,name:s,form:c,value:d,hasConsumerStoppedPropagationRef:v,required:u,defaultChecked:fe(r)?!1:r,isFormControl:S,bubbleInput:g,setBubbleInput:y};return x.jsx(pa,{scope:t,...b,children:va(p)?p(b):o})}var dr="CheckboxTrigger",pr=a.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...o},r)=>{const{control:i,value:c,disabled:s,checked:l,required:u,setControl:d,setChecked:p,hasConsumerStoppedPropagationRef:h,isFormControl:m,bubbleInput:w}=rn(dr,e),f=H(r,d),g=a.useRef(l);return a.useEffect(()=>{const y=i?.form;if(y){const v=()=>p(g.current);return y.addEventListener("reset",v),()=>y.removeEventListener("reset",v)}},[i,p]),x.jsx(M.button,{type:"button",role:"checkbox","aria-checked":fe(l)?"mixed":l,"aria-required":u,"data-state":vr(l),"data-disabled":s?"":void 0,disabled:s,value:c,...o,ref:f,onKeyDown:k(t,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:k(n,y=>{p(v=>fe(v)?!0:!v),w&&m&&(h.current=y.isPropagationStopped(),h.current||y.stopPropagation())})})});pr.displayName=dr;var ha=a.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:o,checked:r,defaultChecked:i,required:c,disabled:s,value:l,onCheckedChange:u,form:d,...p}=e;return x.jsx(ma,{__scopeCheckbox:n,checked:r,defaultChecked:i,disabled:s,required:c,onCheckedChange:u,name:o,form:d,value:l,internal_do_not_use_render:({isFormControl:h})=>x.jsxs(x.Fragment,{children:[x.jsx(pr,{...p,ref:t,__scopeCheckbox:n}),h&&x.jsx(gr,{__scopeCheckbox:n})]})})});ha.displayName=wt;var mr="CheckboxIndicator",ga=a.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:o,...r}=e,i=rn(mr,n);return x.jsx(He,{present:o||fe(i.checked)||i.checked===!0,children:x.jsx(M.span,{"data-state":vr(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});ga.displayName=mr;var hr="CheckboxBubbleInput",gr=a.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:o,hasConsumerStoppedPropagationRef:r,checked:i,defaultChecked:c,required:s,disabled:l,name:u,value:d,form:p,bubbleInput:h,setBubbleInput:m}=rn(hr,e),w=H(n,m),f=Mn(i),g=Ln(o);a.useEffect(()=>{const v=h;if(!v)return;const S=window.HTMLInputElement.prototype,C=Object.getOwnPropertyDescriptor(S,"checked").set,R=!r.current;if(f!==i&&C){const E=new Event("click",{bubbles:R});v.indeterminate=fe(i),C.call(v,fe(i)?!1:i),v.dispatchEvent(E)}},[h,f,i,r]);const y=a.useRef(fe(i)?!1:i);return x.jsx(M.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??y.current,required:s,disabled:l,name:u,value:d,form:p,...t,tabIndex:-1,ref:w,style:{...t.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});gr.displayName=hr;function va(e){return typeof e=="function"}function fe(e){return e==="indeterminate"}function vr(e){return fe(e)?"indeterminate":e?"checked":"unchecked"}export{ha as $,Ha as A,Ya as B,Ta as C,Ia as D,Ma as E,ka as F,_e as G,Ut as H,ja as I,Ao as J,qn as K,Ba as L,zt as M,Bn as N,Oa as O,M as P,Ht as Q,xa as R,wa as S,Na as T,lt as U,$a as V,Ea as W,kc as X,Mc as Y,Lc as Z,jc as _,Pr as a,ga as a0,kr as a1,_a as a2,ba as a3,jo as a4,Sa as a5,k as b,Ve as c,H as d,Br as e,et as f,xe as g,He as h,K as i,an as j,_n as k,Mn as l,Ln as m,Aa as n,Da as o,Ra as p,Pa as q,Ca as r,La as s,za as t,Te as u,Ka as v,Fa as w,Wa as x,Va as y,Ua as z}; diff --git a/webui/dist/assets/uppy-DSH7n_-V.js b/webui/dist/assets/uppy-DSH7n_-V.js new file mode 100644 index 00000000..30adbfe5 --- /dev/null +++ b/webui/dist/assets/uppy-DSH7n_-V.js @@ -0,0 +1,11 @@ +import{ag as us,ah as hs}from"./charts-Dhri-zxi.js";import{g as ce}from"./react-vendor-Dtc2IqVY.js";import"./router-CWhjJi2n.js";import"./radix-extra-Cw1azsjZ.js";const cs=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function ps(i,e,t){const s=cs.exec(i),n=e.mimeType??s?.[1]??"plain/text";let r;if(s?.[2]!=null){const a=atob(decodeURIComponent(s[3])),o=new Uint8Array(a.length);for(let d=0;d(e+=`-${ms(t)}`,"/"))+e}function gs(i,e){let t=e||"uppy";return typeof i.name=="string"&&(t+=`-${At(i.name.toLowerCase())}`),i.type!==void 0&&(t+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(t+=`-${At(i.meta.relativePath.toLowerCase())}`),i.data?.size!==void 0&&(t+=`-${i.data.size}`),i.data.lastModified!==void 0&&(t+=`-${i.data.lastModified}`),t}function ys(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}function bs(i,e){if(ys(i))return i.id;const t=Fi(i);return gs({...i,type:t},e)}const re=Array.from;function vs(i){const e=re(i.files);return Promise.resolve(e)}function Si(i,e,t,{onSuccess:s}){i.readEntries(n=>{const r=[...e,...n];n.length?queueMicrotask(()=>{Si(i,r,t,{onSuccess:s})}):s(r)},n=>{t(n),s(e)})}function Pi(i,e){return i==null?i:{kind:i.isFile?"file":i.isDirectory?"directory":void 0,name:i.name,getFile(){return new Promise((t,s)=>i.file(t,s))},async*values(){const t=i.createReader();yield*await new Promise(n=>{Si(t,[],e,{onSuccess:r=>n(r.map(a=>Pi(a,e)))})})},isSameEntry:void 0}}async function*Ti(i,e,t=void 0){const s=()=>`${e}/${i.name}`;if(i.kind==="file"){const n=await i.getFile();n!=null?(n.relativePath=e?s():null,yield n):t!=null&&(yield t)}else if(i.kind==="directory")for await(const n of i.values())yield*Ti(n,e?s():i.name);else t!=null&&(yield t)}async function*ws(i,e){const t=await Promise.all(Array.from(i.items,async s=>{let n;return n??=Pi(typeof s.getAsEntry=="function"?s.getAsEntry():s.webkitGetAsEntry(),e),{fileSystemHandle:n,lastResortFile:s.getAsFile()}}));for(const{lastResortFile:s,fileSystemHandle:n}of t)if(n!=null)try{yield*Ti(n,"",s)}catch(r){s!=null?yield s:e(r)}else s!=null&&(yield s)}async function _s(i,e){const t=e?.logDropError??Function.prototype;try{const s=[];for await(const n of ws(i,t))s.push(n);return s}catch{return vs(i)}}function Fs(i){for(;i&&!i.dir;)i=i.parentNode;return i?.dir}function Ie(i){return i<10?`0${i}`:i.toString()}function Ce(){const i=new Date,e=Ie(i.getHours()),t=Ie(i.getMinutes()),s=Ie(i.getSeconds());return`${e}:${t}:${s}`}function Ss(){if(typeof window>"u")return!1;const i=document.body;return!(i==null||window==null||!("draggable"in i)||!("ondragstart"in i)||!("ondrop"in i)||!("FormData"in window)||!("FileReader"in window))}function Ut(i){return i.startsWith("blob:")}function Ot(i){return i?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(i):!1}function Ps(i){const e=Math.floor(i/3600)%24,t=Math.floor(i/60)%60,s=Math.floor(i%60);return{hours:e,minutes:t,seconds:s}}function Ts(i){const e=Ps(i),t=e.hours===0?"":`${e.hours}h`,s=e.minutes===0?"":`${e.hours===0?e.minutes:` ${e.minutes.toString(10).padStart(2,"0")}`}m`,n=e.hours!==0?"":`${e.minutes===0?e.seconds:` ${e.seconds.toString(10).padStart(2,"0")}`}s`;return`${t}${s}${n}`}function Cs(i,e,t){const s=[];return i.forEach(n=>typeof n!="string"?s.push(n):e[Symbol.split](n).forEach((r,a,o)=>{r!==""&&s.push(r),a{throw new Error(`missing string: ${i}`)};class Ci{locale;constructor(e,{onMissingKey:t=Es}={}){this.locale={strings:{},pluralize(s){return s===1?0:1}},Array.isArray(e)?e.forEach(this.#t,this):this.#t(e),this.#e=t}#e;#t(e){if(!e?.strings)return;const t=this.locale;Object.assign(this.locale,{strings:{...t.strings,...e.strings},pluralize:e.pluralize||t.pluralize})}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let s=this.locale.strings[e];if(s==null&&(this.#e(e),s=e),typeof s=="object"){if(t&&typeof t.smart_count<"u"){const r=this.locale.pluralize(t.smart_count);return Nt(s[r],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof s!="string")throw new Error("string was not a string");return Nt(s,t)}}const Be="...";function Ei(i,e){if(e===0)return"";if(i.length<=e)return i;if(e<=Be.length+1)return`${i.slice(0,e-1)}…`;const t=e-Be.length,s=Math.ceil(t/2),n=Math.floor(t/2);return i.slice(0,s)+Be+i.slice(-n)}var pe,S,ki,K,Dt,Ai,Ui,Oi,at,Qe,Je,oe={},Ni=[],ks=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,fe=Array.isArray;function H(i,e){for(var t in e)i[t]=e[t];return i}function ot(i){i&&i.parentNode&&i.parentNode.removeChild(i)}function lt(i,e,t){var s,n,r,a={};for(r in e)r=="key"?s=e[r]:r=="ref"?n=e[r]:a[r]=e[r];if(arguments.length>2&&(a.children=arguments.length>3?pe.call(arguments,2):t),typeof i=="function"&&i.defaultProps!=null)for(r in i.defaultProps)a[r]===void 0&&(a[r]=i.defaultProps[r]);return ae(i,a,s,n,null)}function ae(i,e,t,s,n){var r={type:i,props:e,key:t,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:n??++ki,__i:-1,__u:0};return n==null&&S.vnode!=null&&S.vnode(r),r}function As(){return{current:null}}function V(i){return i.children}function q(i,e){this.props=i,this.context=e}function Z(i,e){if(e==null)return i.__?Z(i.__,i.__i+1):null;for(var t;eo&&K.sort(Ui),i=K.shift(),o=K.length,i.__d&&(t=void 0,s=void 0,n=(s=(e=i).__v).__e,r=[],a=[],e.__P&&((t=H({},s)).__v=s.__v+1,S.vnode&&S.vnode(t),dt(e.__P,t,s,e.__n,e.__P.namespaceURI,32&s.__u?[n]:null,r,n??Z(s),!!(32&s.__u),a),t.__v=s.__v,t.__.__k[t.__i]=t,Mi(r,t,a),s.__e=s.__=null,t.__e!=n&&Di(t)));ke.__r=0}function Ii(i,e,t,s,n,r,a,o,d,u,c){var h,p,f,m,b,v,g,y=s&&s.__k||Ni,w=e.length;for(d=Us(t,e,y,d,w),h=0;h0?ae(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=i,a.__b=i.__b+1,o=null,(u=a.__i=Os(a,t,d,h))!=-1&&(h--,(o=t[u])&&(o.__u|=2)),o==null||o.__v==null?(u==-1&&(n>c?p--:nd?p--:p++,a.__u|=4))):i.__k[r]=null;if(h)for(r=0;r(c?1:0)){for(n=t-1,r=t+1;n>=0||r=0?n--:r++])!=null&&(2&u.__u)==0&&o==u.key&&d==u.type)return a}return-1}function Bt(i,e,t){e[0]=="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||ks.test(e)?t:t+"px"}function ge(i,e,t,s,n){var r,a;e:if(e=="style")if(typeof t=="string")i.style.cssText=t;else{if(typeof s=="string"&&(i.style.cssText=s=""),s)for(e in s)t&&e in t||Bt(i.style,e,"");if(t)for(e in t)s&&t[e]==s[e]||Bt(i.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")r=e!=(e=e.replace(Oi,"$1")),a=e.toLowerCase(),e=a in i||e=="onFocusOut"||e=="onFocusIn"?a.slice(2):e.slice(2),i.l||(i.l={}),i.l[e+r]=t,t?s?t.u=s.u:(t.u=at,i.addEventListener(e,r?Je:Qe,r)):i.removeEventListener(e,r?Je:Qe,r);else{if(n=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in i)try{i[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?i.removeAttribute(e):i.setAttribute(e,e=="popover"&&t==1?"":t))}}function Mt(i){return function(e){if(this.l){var t=this.l[e.type+i];if(e.t==null)e.t=at++;else if(e.t0?i:fe(i)?i.map(xi):H({},i)}function Ns(i,e,t,s,n,r,a,o,d){var u,c,h,p,f,m,b,v=t.props,g=e.props,y=e.type;if(y=="svg"?n="http://www.w3.org/2000/svg":y=="math"?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),r!=null){for(u=0;u2&&(o.children=arguments.length>3?pe.call(arguments,2):t),ae(i.type,o,s||i.key,n||i.ref,null)}pe=Ni.slice,S={__e:function(i,e,t,s){for(var n,r,a;e=e.__;)if((n=e.__c)&&!n.__)try{if((r=n.constructor)&&r.getDerivedStateFromError!=null&&(n.setState(r.getDerivedStateFromError(i)),a=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(i,s||{}),a=n.__d),a)return n.__E=n}catch(o){i=o}throw i}},ki=0,q.prototype.setState=function(i,e){var t;t=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=H({},this.state),typeof i=="function"&&(i=i(H({},t),this.props)),i&&H(t,i),i!=null&&this.__v&&(e&&this._sb.push(e),It(this))},q.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),It(this))},q.prototype.render=V,K=[],Ai=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ui=function(i,e){return i.__v.__b-e.__v.__b},ke.__r=0,Oi=/(PointerCapture)$|Capture$/i,at=0,Qe=Mt(!1),Je=Mt(!0);var Is=0;function l(i,e,t,s,n,r){e||(e={});var a,o,d=e;if("ref"in d)for(o in d={},e)o=="ref"?a=e[o]:d[o]=e[o];var u={type:i,props:d,key:t,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Is,__i:-1,__u:0,__source:n,__self:r};if(typeof i=="function"&&(a=i.defaultProps))for(o in a)d[o]===void 0&&(d[o]=a[o]);return S.vnode&&S.vnode(u),u}var le,C,Me,Rt,de=0,zi=[],E=S,Lt=E.__b,zt=E.__r,$t=E.diffed,Ht=E.__c,qt=E.unmount,jt=E.__;function ht(i,e){E.__h&&E.__h(C,i,de||e),de=0;var t=C.__H||(C.__H={__:[],__h:[]});return i>=t.__.length&&t.__.push({}),t.__[i]}function ee(i){return de=1,Bs(Hi,i)}function Bs(i,e,t){var s=ht(le++,2);if(s.t=i,!s.__c&&(s.__=[Hi(void 0,e),function(o){var d=s.__N?s.__N[0]:s.__[0],u=s.t(d,o);d!==u&&(s.__N=[u,s.__[1]],s.__c.setState({}))}],s.__c=C,!C.__f)){var n=function(o,d,u){if(!s.__c.__H)return!0;var c=s.__c.__H.__.filter(function(p){return!!p.__c});if(c.every(function(p){return!p.__N}))return!r||r.call(this,o,d,u);var h=s.__c.props!==o;return c.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(h=!0)}}),r&&r.call(this,o,d,u)||h};C.__f=!0;var r=C.shouldComponentUpdate,a=C.componentWillUpdate;C.componentWillUpdate=function(o,d,u){if(this.__e){var c=r;r=void 0,n(o,d,u),r=c}a&&a.call(this,o,d,u)},C.shouldComponentUpdate=n}return s.__N||s.__}function Ae(i,e){var t=ht(le++,3);!E.__s&&$i(t.__H,e)&&(t.__=i,t.u=e,C.__H.__h.push(t))}function J(i){return de=5,ct(function(){return{current:i}},[])}function ct(i,e){var t=ht(le++,7);return $i(t.__H,e)&&(t.__=i(),t.__H=e,t.__h=i),t.__}function Ue(i,e){return de=8,ct(function(){return i},e)}function Ms(){for(var i;i=zi.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(Ee),i.__H.__h.forEach(et),i.__H.__h=[]}catch(e){i.__H.__h=[],E.__e(e,i.__v)}}E.__b=function(i){C=null,Lt&&Lt(i)},E.__=function(i,e){i&&e.__k&&e.__k.__m&&(i.__m=e.__k.__m),jt&&jt(i,e)},E.__r=function(i){zt&&zt(i),le=0;var e=(C=i.__c).__H;e&&(Me===C?(e.__h=[],C.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.forEach(Ee),e.__h.forEach(et),e.__h=[],le=0)),Me=C},E.diffed=function(i){$t&&$t(i);var e=i.__c;e&&e.__H&&(e.__H.__h.length&&(zi.push(e)!==1&&Rt===E.requestAnimationFrame||((Rt=E.requestAnimationFrame)||xs)(Ms)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.u=void 0})),Me=C=null},E.__c=function(i,e){e.some(function(t){try{t.__h.forEach(Ee),t.__h=t.__h.filter(function(s){return!s.__||et(s)})}catch(s){e.some(function(n){n.__h&&(n.__h=[])}),e=[],E.__e(s,t.__v)}}),Ht&&Ht(i,e)},E.unmount=function(i){qt&&qt(i);var e,t=i.__c;t&&t.__H&&(t.__H.__.forEach(function(s){try{Ee(s)}catch(n){e=n}}),t.__H=void 0,e&&E.__e(e,t.__v))};var Vt=typeof requestAnimationFrame=="function";function xs(i){var e,t=function(){clearTimeout(s),Vt&&cancelAnimationFrame(e),setTimeout(i)},s=setTimeout(t,35);Vt&&(e=requestAnimationFrame(t))}function Ee(i){var e=C,t=i.__c;typeof t=="function"&&(i.__c=void 0,t()),C=e}function et(i){var e=C;i.__c=i.__(),C=e}function $i(i,e){return!i||i.length!==e.length||e.some(function(t,s){return t!==i[s]})}function Hi(i,e){return typeof e=="function"?e(i):e}const Rs={position:"relative",width:"100%",minHeight:"100%"},Ls={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"};function zs({data:i,rowHeight:e,renderRow:t,overscanCount:s=10,padding:n=4,...r}){const a=J(null),[o,d]=ee(0),[u,c]=ee(0);Ae(()=>{function y(){a.current!=null&&u!==a.current.offsetHeight&&c(a.current.offsetHeight)}return y(),window.addEventListener("resize",y),()=>{window.removeEventListener("resize",y)}},[u]);const h=Ue(()=>{a.current&&d(a.current.scrollTop)},[]);let p=Math.floor(o/e),f=Math.floor(u/e);s&&(p=Math.max(0,p-p%s),f+=s);const m=p+f+n,b=i.slice(p,m),v={...Rs,height:i.length*e},g={...Ls,top:p*e};return l("div",{onScroll:h,ref:a,...r,children:l("div",{role:"presentation",style:v,children:l("div",{role:"presentation",style:g,children:b.map(t)})})})}class $s{uppy;opts;id;defaultLocale;i18n;i18nArray;type;VERSION;constructor(e,t){this.uppy=e,this.opts=t??{}}getPluginState(){const{plugins:e}=this.uppy.getState();return e?.[this.id]||{}}setPluginState(e){const{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()}i18nInit(){const e=new Ci([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}}const Hs={debug:()=>{},warn:()=>{},error:(...i)=>console.error(`[Uppy] [${Ce()}]`,...i)},qs={debug:(...i)=>console.debug(`[Uppy] [${Ce()}]`,...i),warn:(...i)=>console.warn(`[Uppy] [${Ce()}]`,...i),error:(...i)=>console.error(`[Uppy] [${Ce()}]`,...i)};var xe,Wt;function js(){return Wt||(Wt=1,xe=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);const t=e<0;let s=Math.abs(e);if(t&&(s=-s),s===0)return"0 B";const n=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.min(Math.floor(Math.log(s)/Math.log(1024)),n.length-1),a=Number(s/1024**r),o=n[r];return`${a>=10||a%1===0?Math.round(a):a.toFixed(1)} ${o}`}),xe}var Vs=js();const X=ce(Vs);var Re,Gt;function Ws(){if(Gt)return Re;Gt=1;function i(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}return i.prototype.match=function(e){var t=!0,s=this.parts,n,r=s.length,a;if(typeof e=="string"||e instanceof String)if(!this.hasWild&&this.text!=e)t=!1;else{for(a=(e||"").split(this.separator),n=0;t&&n=2}return s?n(s.split(";")[0]):n},Le}var Ks=Gs();const Xs=ce(Ks),Ys={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class I extends Error{isUserFacing;file;constructor(e,t){super(e),this.isUserFacing=t?.isUserFacing??!0,t?.file&&(this.file=t.file)}isRestriction=!0}class Qs{getI18n;getOpts;constructor(e,t){this.getI18n=t,this.getOpts=()=>{const s=e();if(s.restrictions?.allowedFileTypes!=null&&!Array.isArray(s.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return s}}validateAggregateRestrictions(e,t){const{maxTotalFileSize:s,maxNumberOfFiles:n}=this.getOpts().restrictions;if(n&&e.filter(a=>!a.isGhost).length+t.length>n)throw new I(`${this.getI18n()("youCanOnlyUploadX",{smart_count:n})}`);if(s){const r=[...e,...t].reduce((a,o)=>a+(o.size??0),0);if(r>s)throw new I(this.getI18n()("aggregateExceedsSize",{sizeAllowed:X(s),size:X(r)}))}}validateSingleFile(e){const{maxFileSize:t,minFileSize:s,allowedFileTypes:n}=this.getOpts().restrictions;if(n&&!n.some(a=>a.includes("/")?e.type?Xs(e.type.replace(/;.*?$/,""),a):!1:a[0]==="."&&e.extension?e.extension.toLowerCase()===a.slice(1).toLowerCase():!1)){const a=n.join(", ");throw new I(this.getI18n()("youCanOnlyUploadFileTypes",{types:a}),{file:e})}if(t&&e.size!=null&&e.size>t)throw new I(this.getI18n()("exceedsSize",{size:X(t),file:e.name??this.getI18n()("unnamed")}),{file:e});if(s&&e.size!=null&&e.size{this.validateSingleFile(s)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){const{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length(t=s,e||(e=Promise.resolve().then(()=>(e=null,i(...t)))),e)}class ue extends $s{#e;isTargetDOMEl;el;parent;title;getTargetPlugin(e){let t;if(typeof e?.addTarget=="function")t=e,t instanceof ue||console.warn(new Error("The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.",{cause:{targetPlugin:t,UIPlugin:ue}}));else if(typeof e=="function"){const s=e;this.uppy.iteratePlugins(n=>{n instanceof s&&(t=n)})}return t}mount(e,t){const s=t.id,n=fs(e);if(n){this.isTargetDOMEl=!0;const o=document.createElement("div");return o.classList.add("uppy-Root"),this.#e=Js(d=>{this.uppy.getPlugin(this.id)&&(xt(this.render(d,o),o),this.afterUpdate())}),this.uppy.log(`Installing ${s} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(n.innerHTML=""),xt(this.render(this.uppy.getState(),o),o),this.el=o,n.appendChild(o),o.dir=this.opts.direction||Fs(o)||"ltr",this.onMount(),this.el}const r=this.getTargetPlugin(e);if(r)return this.uppy.log(`Installing ${s} to ${r.id}`),this.parent=r,this.el=r.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${s}`);let a=`Invalid target option given to ${s}.`;throw typeof e=="function"?a+=" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":a+="If you meant to target an HTML element, please make sure that the element exists. Check that the + - - - - - + + + + + + + + + + + + +