2025-03-05 12:54:15 +08:00
var cH = Object . defineProperty ; var dH = ( e , t , n ) => t in e ? cH ( e , t , { enumerable : ! 0 , configurable : ! 0 , writable : ! 0 , value : n } ) : e [ t ] = n ; var Ea = ( e , t , n ) => dH ( e , typeof t != "symbol" ? t + "" : t , n ) ; function fH ( e , t ) { for ( var n = 0 ; n < t . length ; n ++ ) { const r = t [ n ] ; if ( typeof r != "string" && ! Array . isArray ( r ) ) { for ( const a in r ) if ( a !== "default" && ! ( a in e ) ) { const i = Object . getOwnPropertyDescriptor ( r , a ) ; i && Object . defineProperty ( e , a , i . get ? i : { enumerable : ! 0 , get : ( ) => r [ a ] } ) } } } return Object . freeze ( Object . defineProperty ( e , Symbol . toStringTag , { value : "Module" } ) ) } ( function ( ) { const t = document . createElement ( "link" ) . relList ; if ( t && t . supports && t . supports ( "modulepreload" ) ) return ; for ( const a of document . querySelectorAll ( 'link[rel="modulepreload"]' ) ) r ( a ) ; new MutationObserver ( a => { for ( const i of a ) if ( i . type === "childList" ) for ( const l of i . addedNodes ) l . tagName === "LINK" && l . rel === "modulepreload" && r ( l ) } ) . observe ( document , { childList : ! 0 , subtree : ! 0 } ) ; function n ( a ) { const i = { } ; return a . integrity && ( i . integrity = a . integrity ) , a . referrerPolicy && ( i . referrerPolicy = a . referrerPolicy ) , a . crossOrigin === "use-credentials" ? i . credentials = "include" : a . crossOrigin === "anonymous" ? i . credentials = "omit" : i . credentials = "same-origin" , i } function r ( a ) { if ( a . ep ) return ; a . ep = ! 0 ; const i = n ( a ) ; fetch ( a . href , i ) } } ) ( ) ; var Cd = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : { } ; function an ( e ) { return e && e . _ _esModule && Object . prototype . hasOwnProperty . call ( e , "default" ) ? e . default : e } function pH ( e ) { if ( e . _ _esModule ) return e ; var t = e . default ; if ( typeof t == "function" ) { var n = function r ( ) { return this instanceof r ? Reflect . construct ( t , arguments , this . constructor ) : t . apply ( this , arguments ) } ; n . prototype = t . prototype } else n = { } ; return Object . defineProperty ( n , "__esModule" , { value : ! 0 } ) , Object . keys ( e ) . forEach ( function ( r ) { var a = Object . getOwnPropertyDescriptor ( e , r ) ; Object . defineProperty ( n , r , a . get ? a : { enumerable : ! 0 , get : function ( ) { return e [ r ] } } ) } ) , n } var eh = { exports : { } } , Is = { } ; / * *
2025-02-24 18:59:31 +08:00
* @ license React
* react - jsx - runtime . production . js
*
* Copyright ( c ) Meta Platforms , Inc . and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
2025-03-05 12:54:15 +08:00
* /var q1;function gH(){if(q1)return Is;q1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,i){var l=null;if(i!==void 0&&(l=""+i),a.key!==void 0&&(l=""+a.key),"key"in a){i={};for(var u in a)u!=="key"&&(i[u]=a[u])}else i=a;return a=i.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:i}}return Is.Fragment=t,Is.jsx=n,Is.jsxs=n,Is}var V1;function hH(){return V1||(V1=1,eh.exports=gH()),eh.exports}var w=hH(),th={exports:{}},at={};/ * *
2025-02-24 18:59:31 +08:00
* @ license React
* react . production . js
*
* Copyright ( c ) Meta Platforms , Inc . and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
2025-03-05 14:30:30 +08:00
* /var W1;function mH(){if(W1)return at;W1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.iterator;function b(D){return D===null||typeof D!="object"?null:(D=g&&D[g]||D["@@iterator"],typeof D=="function"?D:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,v={};function A(D,V,U){this.props=D,this.context=V,this.refs=v,this.updater=U||m}A.prototype.isReactComponent={},A.prototype.setState=function(D,V){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,V,"setState")},A.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function R(){}R.prototype=A.prototype;function x(D,V,U){this.props=D,this.context=V,this.refs=v,this.updater=U||m}var T=x.prototype=new R;T.constructor=x,S(T,A.prototype),T.isPureReactComponent=!0;var C=Array.isArray,N={H:null,A:null,T:null,S:null},_=Object.prototype.hasOwnProperty;function O(D,V,U,L,Y,Q){return U=Q.ref,{$$typeof:e,type:D,key:V,ref:U!==void 0?U:null,props:Q}}function z(D,V){return O(D.type,V,void 0,void 0,void 0,D.props)}function I(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function M(D){var V={"=":"=0",":":"=2"};return"$"+D.replace(/ [ = : ] / g , function ( U ) { return V [ U ] } ) } var H = /\/+/g ; function q ( D , V ) { return typeof D == "object" && D !== null && D . key != null ? M ( "" + D . key ) : V . toString ( 36 ) } function P ( ) { } function W ( D ) { switch ( D . status ) { case "fulfilled" : return D . value ; case "rejected" : throw D . reason ; default : switch ( typeof D . status == "string" ? D . then ( P , P ) : ( D . status = "pending" , D . then ( function ( V ) { D . status === "pending" && ( D . status = "fulfilled" , D . value = V ) } , function ( V ) { D . status === "pending" && ( D . status = "rejected" , D . reason = V ) } ) ) , D . status ) { case "fulfilled" : return D . value ; case "rejected" : throw D . reason } } throw D } function Z ( D , V , U , L , Y ) { var Q = typeof D ; ( Q === "undefined" || Q === "boolean" ) && ( D = null ) ; var se = ! 1 ; if ( D === null ) se = ! 0 ; else switch ( Q ) { case "bigint" : case "string" : case "number" : se = ! 0 ; break ; case "object" : switch ( D . $$typeof ) { case e : case t : se = ! 0 ; break ; case p : return se = D . _init , Z ( se ( D . _payload ) , V , U , L , Y ) } } if ( se ) return Y = Y ( D ) , se = L === "" ? "." + q ( D , 0 ) : L , C ( Y ) ? ( U = "" , se != null && ( U = se . replace ( H , "$&/" ) + "/" ) , Z ( Y , V , U , "" , function ( Ae ) { return Ae } ) ) : Y != null && ( I ( Y ) && ( Y = z ( Y , U + ( Y . key == null || D && D . key === Y . key ? "" : ( "" + Y . key ) . replace ( H , "$&/" ) + "/" ) + se ) ) , V . push ( Y ) ) , 1 ; se = 0 ; var re = L === "" ? "." : L + ":" ; if ( C ( D ) ) for ( var le = 0 ; le < D . length ; le ++ ) L = D [ le ] , Q = re + q ( L , le ) , se += Z ( L , V , U , Q , Y ) ; else if ( le = b ( D ) , typeof le == "function" ) for ( D = le . call ( D ) , le = 0 ; ! ( L = D . next ( ) ) . done ; ) L = L . value , Q = re + q ( L , le ++ ) , se += Z ( L , V , U , Q , Y ) ; else if ( Q === "object" ) { if ( typeof D . then == "function" ) return Z ( W ( D ) , V , U , L , Y ) ; throw V = String ( D ) , Error ( "Objects are not valid as a React child (found: " + ( V === "[object Object]" ? "object with keys {" + Object . keys ( D ) . join ( ", " ) + "}" : V ) + "). If you meant to render a collection of children, use an array instead." ) } return se } function j ( D , V , U ) { if ( D == null ) return D ; var L = [ ] , Y = 0 ; return Z ( D , L , "" , "" , function ( Q ) { return V . call ( U , Q , Y ++ ) } ) , L } function G ( D ) { if ( D . _status === - 1 ) { var V = D . _result ; V = V ( ) , V . then ( function ( U ) { ( D . _status === 0 || D . _status === - 1 ) && ( D . _status = 1 , D . _result = U ) } , function ( U ) { ( D . _status === 0 || D . _status === - 1 ) && ( D . _status = 2 , D . _result = U ) } ) , D . _status === - 1 && ( D . _status = 0 , D . _result = V ) } if ( D . _status === 1 ) return D . _result . default ; throw D . _result } var B = typeof reportError == "function" ? reportError : function ( D ) { if ( typeof window == "object" && typeof window . ErrorEvent == "function" ) { var V = new window . ErrorEvent ( "error" , { bubbles : ! 0 , cancelable : ! 0 , message : typeof D == "object" && D !== null && typeof D . message == "string" ? String ( D . message ) : String ( D ) , error : D } ) ; if ( ! window . dispatchEvent ( V ) ) return } else if ( typeof process == "object" && typeof p
2025-02-24 18:59:31 +08:00
* @ license React
* scheduler . production . js
*
* Copyright ( c ) Meta Platforms , Inc . and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
2025-03-05 14:30:30 +08:00
* / v a r K 1 ; f u n c t i o n y H ( ) { r e t u r n K 1 | | ( K 1 = 1 , f u n c t i o n ( e ) { f u n c t i o n t ( j , G ) { v a r B = j . l e n g t h ; j . p u s h ( G ) ; e : f o r ( ; 0 < B ; ) { v a r X = B - 1 > > > 1 , D = j [ X ] ; i f ( 0 < a ( D , G ) ) j [ X ] = G , j [ B ] = D , B = X ; e l s e b r e a k e } } f u n c t i o n n ( j ) { r e t u r n j . l e n g t h = = = 0 ? n u l l : j [ 0 ] } f u n c t i o n r ( j ) { i f ( j . l e n g t h = = = 0 ) r e t u r n n u l l ; v a r G = j [ 0 ] , B = j . p o p ( ) ; i f ( B ! = = G ) { j [ 0 ] = B ; e : f o r ( v a r X = 0 , D = j . l e n g t h , V = D > > > 1 ; X < V ; ) { v a r U = 2 * ( X + 1 ) - 1 , L = j [ U ] , Y = U + 1 , Q = j [ Y ] ; i f ( 0 > a ( L , B ) ) Y < D & & 0 > a ( Q , L ) ? ( j [ X ] = Q , j [ Y ] = B , X = Y ) : ( j [ X ] = L , j [ U ] = B , X = U ) ; e l s e i f ( Y < D & & 0 > a ( Q , B ) ) j [ X ] = Q , j [ Y ] = B , X = Y ; e l s e b r e a k e } } r e t u r n G } f u n c t i o n a ( j , G ) { v a r B = j . s o r t I n d e x - G . s o r t I n d e x ; r e t u r n B ! = = 0 ? B : j . i d - G . i d } i f ( e . u n s t a b l e _ n o w = v o i d 0 , t y p e o f p e r f o r m a n c e = = " o b j e c t " & & t y p e o f p e r f o r m a n c e . n o w = = " f u n c t i o n " ) { v a r i = p e r f o r m a n c e ; e . u n s t a b l e _ n o w = f u n c t i o n ( ) { r e t u r n i . n o w ( ) } } e l s e { v a r l = D a t e , u = l . n o w ( ) ; e . u n s t a b l e _ n o w = f u n c t i o n ( ) { r e t u r n l . n o w ( ) - u } } v a r c = [ ] , f = [ ] , p = 1 , g = n u l l , b = 3 , m = ! 1 , S = ! 1 , v = ! 1 , A = t y p e o f s e t T i m e o u t = = " f u n c t i o n " ? s e t T i m e o u t : n u l l , R = t y p e o f c l e a r T i m e o u t = = " f u n c t i o n " ? c l e a r T i m e o u t : n u l l , x = t y p e o f s e t I m m e d i a t e < " u " ? s e t I m m e d i a t e : n u l l ; f u n c t i o n T ( j ) { f o r ( v a r G = n ( f ) ; G ! = = n u l l ; ) { i f ( G . c a l l b a c k = = = n u l l ) r ( f ) ; e l s e i f ( G . s t a r t T i m e < = j ) r ( f ) , G . s o r t I n d e x = G . e x p i r a t i o n T i m e , t ( c , G ) ; e l s e b r e a k ; G = n ( f ) } } f u n c t i o n C ( j ) { i f ( v = ! 1 , T ( j ) , ! S ) i f ( n ( c ) ! = = n u l l ) S = ! 0 , W ( ) ; e l s e { v a r G = n ( f ) ; G ! = = n u l l & & Z ( C , G . s t a r t T i m e - j ) } } v a r N = ! 1 , _ = - 1 , O = 5 , z = - 1 ; f u n c t i o n I ( ) { r e t u r n ! ( e . u n s t a b l e _ n o w ( ) - z < O ) } f u n c t i o n M ( ) { i f ( N ) { v a r j = e . u n s t a b l e _ n o w ( ) ; z = j ; v a r G = ! 0 ; t r y { e : { S = ! 1 , v & & ( v = ! 1 , R ( _ ) , _ = - 1 ) , m = ! 0 ; v a r B = b ; t r y { t : { f o r ( T ( j ) , g = n ( c ) ; g ! = = n u l l & & ! ( g . e x p i r a t i o n T i m e > j & & I ( ) ) ; ) { v a r X = g . c a l l b a c k ; i f ( t y p e o f X = = " f u n c t i o n " ) { g . c a l l b a c k = n u l l , b = g . p r i o r i t y L e v e l ; v a r D = X ( g . e x p i r a t i o n T i m e < = j ) ; i f ( j = e . u n s t a b l e _ n o w ( ) , t y p e o f D = = " f u n c t i o n " ) { g . c a l l b a c k = D , T ( j ) , G = ! 0 ; b r e a k t } g = = = n ( c ) & & r ( c ) , T ( j ) } e l s e r ( c ) ; g = n ( c ) } i f ( g ! = = n u l l ) G = ! 0 ; e l s e { v a r V = n ( f ) ; V ! = = n u l l & & Z ( C , V . s t a r t T i m e - j ) , G = ! 1 } } b r e a k e } f i n a l l y { g = n u l l , b = B , m = ! 1 } G = v o i d 0 } } f i n a l l y { G ? H ( ) : N = ! 1 } } } v a r H ; i f ( t y p e o f x = = " f u n c t i o n " ) H = f u n c t i o n ( ) { x ( M ) } ; e l s e i f ( t y p e o f M e s s a g e C h a n n e l < " u " ) { v a r q = n e w M e s s a g e C h a n n e l , P = q . p o r t 2 ; q . p o r t 1 . o n m e s s a g e = M , H = f u n c t i o n ( ) { P . p o s t M e s s a g e ( n u l l ) } } e l s e H = f u n c t i o n ( ) { A ( M , 0 ) } ; f u n c t i o n W ( ) { N | | ( N = ! 0 , H ( ) ) } f u n c t i o n Z ( j , G ) { _ = A ( f u n c t i o n ( ) { j ( e . u n s t a b l e _ n o w ( ) ) } , G ) } e . u n s t a b l e _ I d l e P r i o r i t y = 5 , e . u n s t a b l e _ I m m e d i a t e P r i o r i t y = 1 , e . u n s t a b l e _ L o w P r i o r i t y = 4 , e . u n s t a b l e _ N o r m a l P r i o r i t y = 3 , e . u n s t a b l e _ P r o f i l i n g = n u l l , e . u n s t a b l e _ U s e r B l o c k i n g P r i o r i t y = 2 , e . u n s t a b l e _ c a n c e l C a l l b a c k = f u n c t i o n ( j ) { j . c a l l b a c k = n u l l } , e . u n s t a b l e _ c o n t i n u e E x e c u t i o n = f u n c t i o n ( ) { S | | m | | ( S = ! 0 , W ( ) ) } , e . u n s t a b l e _ f o r c e F r a m e R a t e = f u n c t i o n ( j ) { 0 > j | | 1 2 5 < j ? c o n s o l e . e r r o r ( " f o r c e F r a m e R a t e t a k e s a p o s i t i v e i n t b e t w e e n 0 a n d 1 2 5 , f o r c i n g f r a m e r a t e s h i g h e r t h a n 1 2 5 f p s i s n o t s u p p o r t e d " ) : O = 0 < j ? M a t h . f l o o r ( 1 e 3 / j ) : 5 } , e . u n s t a b l e _ g e t C u r r e n t P r i o r i t y L e v e l = f u n c t i o n ( ) { r e t u r n b } , e . u n s t a b l e _ g e t F i r s t C a l l b a c k N o d e = f u n c t i o n ( ) { r e t u r n n ( c ) } , e . u n s t a b l e _ n e x t = f u n c t i o n ( j ) { s w i t c h ( b ) { c a s e 1 : c a s e 2 : c a s e 3 : v a r G = 3 ; b r e a k ; d e f a u l t : G = b } v a r B = b ; b = G ; t r y { r e t u r n j ( ) } f i n a l l y { b = B } } , e . u n s t a b l e _ p a u s e E x e c u t i o n = f u n c t i o n ( ) { } , e . u n s t a b l e _ r e q u e s t P a i n t = f u n c t i o n ( ) { } , e . u n s t a b l e _ r u n W i t h P r i o r i t y = f u n c t i o n ( j , G ) { s w i t c h ( j ) { c a s e 1 : c a s e 2 : c a s e 3 : c a s e 4 : c a s e 5 : b r e a k ; d e f a u l t : j = 3 } v a r B = b ; b = j ; t r y { r e t u r n G ( ) } f i n a l l y { b = B } } , e . u n s t a b l e _ s c h e d u l e C a l l b a c k = f u n c t i o n ( j , G , B ) { v a r X = e . u n s t a b l e _ n o w ( ) ; s w i t c h ( t y p e o f B = = " o b j e c t " & & B ! = = n u l l ? ( B = B . d e l a y , B = t y p e o f B = = " n u m b e r " & & 0 < B ? X + B : X ) : B = X , j ) { c a s e 1 : v a r D = - 1 ; b r e a k ; c a s e 2 : D = 2 5 0 ; b r e a k ; c a s e 5 : D = 1 0 7 3 7 4 1 8 2 3 ; b r e a k ; c a s e 4 : D = 1 e 4 ; b r e a k ; d e f a u l t : D = 5 e 3 } r e t u r n D = B + D , j = { i d : p + + , c a l l b a c k : G , p r i o r i t y L e v e l : j , s t a r t T i m e : B , e x p i r a t i o n T i m e : D , s o r t I n d e x : - 1 } , B > X ? ( j . s o r t I n d e x = B , t ( f , j ) , n ( c ) = = = n u l l & & j = = = n ( f ) & & ( v ? ( R ( _ ) , _ = - 1 ) : v = ! 0 , Z ( C , B - X ) ) ) : ( j . s o r t I n d e x = D , t ( c , j ) , S | | m | | ( S = ! 0 , W ( ) ) ) , j } , e . u n s t a b l e _ s h o u l d Y i e l d = I , e . u n s t a b l e _ w r a p C a l l b a c k = f u n c t i o n ( j ) { v a r G = b ; r e t u r n f u n c t i o n ( ) { v a r B = b ; b = G ; t r y { r e t u r n j . a p p l y ( t h i s , a r g u m e n t s ) } f i n a l l y { b = B } } } } ( a h ) ) , a h } v a r X 1 ; f u n c t i o n v H ( ) { r e t u r n X 1 | | ( X 1 = 1 , r h . e x p o r t s = y H ( ) ) , r h . e x p o r t s } v a r o h = { e x p o r t s : { } } , b n = { } ; / * *
2025-02-24 18:59:31 +08:00
* @ license React
* react - dom . production . js
*
* Copyright ( c ) Meta Platforms , Inc . and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
2025-03-05 12:54:15 +08:00
* /var Z1;function SH(){if(Z1)return bn;Z1=1;var e=nf();function t(c){var f="https:/ / react . dev / errors / "+c;if(1<arguments.length){f+=" ? args [ ] = "+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+=" & args [ ] = "+encodeURIComponent(arguments[p])}return" Minified React error # "+c+" ; visit "+f+" for the full message or use the non - minified dev environment for full errors and additional helpful warnings . "}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for(" react . portal ");function i(c,f,p){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:g==null?null:" "+g,children:c,containerInfo:f,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(c,f){if(c===" font ")return" ";if(typeof f==" string ")return f===" use - credentials "?f:" "}return bn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,bn.createPortal=function(c,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return i(c,f,null,p)},bn.flushSync=function(c){var f=l.T,p=r.p;try{if(l.T=null,r.p=2,c)return c()}finally{l.T=f,r.p=p,r.d.f()}},bn.preconnect=function(c,f){typeof c==" string "&&(f?(f=f.crossOrigin,f=typeof f==" string "?f===" use - credentials "?f:" ":void 0):f=null,r.d.C(c,f))},bn.prefetchDNS=function(c){typeof c==" string "&&r.d.D(c)},bn.preinit=function(c,f){if(typeof c==" string "&&f&&typeof f.as==" string "){var p=f.as,g=u(p,f.crossOrigin),b=typeof f.integrity==" string "?f.integrity:void 0,m=typeof f.fetchPriority==" string "?f.fetchPriority:void 0;p===" style "?r.d.S(c,typeof f.precedence==" string "?f.precedence:void 0,{crossOrigin:g,integrity:b,fetchPriority:m}):p===" script "&&r.d.X(c,{crossOrigin:g,integrity:b,fetchPriority:m,nonce:typeof f.nonce==" string "?f.nonce:void 0})}},bn.preinitModule=function(c,f){if(typeof c==" string ")if(typeof f==" object "&&f!==null){if(f.as==null||f.as===" script "){var p=u(f.as,f.crossOrigin);r.d.M(c,{crossOrigin:p,integrity:typeof f.integrity==" string "?f.integrity:void 0,nonce:typeof f.nonce==" string "?f.nonce:void 0})}}else f==null&&r.d.M(c)},bn.preload=function(c,f){if(typeof c==" string "&&typeof f==" object "&&f!==null&&typeof f.as==" string "){var p=f.as,g=u(p,f.crossOrigin);r.d.L(c,p,{crossOrigin:g,integrity:typeof f.integrity==" string "?f.integrity:void 0,nonce:typeof f.nonce==" string "?f.nonce:void 0,type:typeof f.type==" string "?f.type:void 0,fetchPriority:typeof f.fetchPriority==" string "?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy==" string "?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet==" string "?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes==" string "?f.imageSizes:void 0,media:typeof f.media==" string "?f.media:void 0})}},bn.preloadModule=function(c,f){if(typeof c==" string ")if(f){var p=u(f.as,f.crossOrigin);r.d.m(c,{as:typeof f.as==" string "&&f.as!==" script "?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity==" string "?f.integrity:void 0})}else r.d.m(c)},bn.requestFormReset=function(c){r.d.r(c)},bn.unstable_batchedUpdates=function(c,f){return c(f)},bn.useFormState=function(c,f,p){return l.H.useFormState(c,f,p)},bn.useFormStatus=function(){return l.H.useHostTransitionStatus()},bn.version=" 19.0 . 0 ",bn}var Q1;function mz(){if(Q1)return oh.exports;Q1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>" u "||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=" function " ) ) try { _ _REACT _DEVTOOLS _GLOBAL _HOOK _ _ . checkDCE ( e ) } catch ( t ) { console . error ( t ) } } return e ( ) , oh . exports = SH ( ) , oh . exports } / * *
2025-02-24 18:59:31 +08:00
* @ license React
* react - dom - client . production . js
*
* Copyright ( c ) Meta Platforms , Inc . and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
2025-03-05 14:30:30 +08:00
* /var J1;function EH(){if(J1)return Ls;J1=1;var e=vH(),t=nf(),n=mz();function r(o){var s="https:/ / react . dev / errors / "+o;if(1<arguments.length){s+=" ? args [ ] = "+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)s+=" & args [ ] = "+encodeURIComponent(arguments[d])}return" Minified React error # "+o+" ; visit "+s+" for the full message or use the non - minified dev environment for full errors and additional helpful warnings . "}function a(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}var i=Symbol.for(" react . element "),l=Symbol.for(" react . transitional . element "),u=Symbol.for(" react . portal "),c=Symbol.for(" react . fragment "),f=Symbol.for(" react . strict _mode "),p=Symbol.for(" react . profiler "),g=Symbol.for(" react . provider "),b=Symbol.for(" react . consumer "),m=Symbol.for(" react . context "),S=Symbol.for(" react . forward _ref "),v=Symbol.for(" react . suspense "),A=Symbol.for(" react . suspense _list "),R=Symbol.for(" react . memo "),x=Symbol.for(" react . lazy "),T=Symbol.for(" react . offscreen "),C=Symbol.for(" react . memo _cache _sentinel "),N=Symbol.iterator;function _(o){return o===null||typeof o!=" object "?null:(o=N&&o[N]||o[" @ @ iterator "],typeof o==" function "?o:null)}var O=Symbol.for(" react . client . reference ");function z(o){if(o==null)return null;if(typeof o==" function ")return o.$$typeof===O?null:o.displayName||o.name||null;if(typeof o==" string ")return o;switch(o){case c:return" Fragment ";case u:return" Portal ";case p:return" Profiler ";case f:return" StrictMode ";case v:return" Suspense ";case A:return" SuspenseList "}if(typeof o==" object ")switch(o.$$typeof){case m:return(o.displayName||" Context ")+" . Provider ";case b:return(o._context.displayName||" Context ")+" . Consumer ";case S:var s=o.render;return o=o.displayName,o||(o=s.displayName||s.name||" ",o=o!==" "?" ForwardRef ( "+o+" ) ":" ForwardRef "),o;case R:return s=o.displayName||null,s!==null?s:z(o.type)||" Memo ";case x:s=o._payload,o=o._init;try{return z(o(s))}catch{}}return null}var I=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=Object.assign,H,q;function P(o){if(H===void 0)try{throw Error()}catch(d){var s=d.stack.trim().match(/\n( *(at )?)/);H=s&&s[1]||" " , q = - 1 < d . stack . indexOf ( `
2025-02-24 18:59:31 +08:00
at ` )?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return `
2025-02-25 18:36:34 +08:00
` +H+o+q}var W=!1;function Z(o,s){if(!o||W)return"";W=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(s){var Te=function(){throw Error()};if(Object.defineProperty(Te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Te,[])}catch(ge){var de=ge}Reflect.construct(o,[],Te)}else{try{Te.call()}catch(ge){de=ge}o.call(Te.prototype)}}else{try{throw Error()}catch(ge){de=ge}(Te=o())&&typeof Te.catch=="function"&&Te.catch(function(){})}}catch(ge){if(ge&&de&&typeof ge.stack=="string")return[ge.stack,de.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var E=h.DetermineComponentFrameRoot(),F=E[0], $ =E[1];if(F&& $ ){var K=F.split( `
` ),ne= $ .split( `
2025-02-24 18:59:31 +08:00
` );for(y=h=0;h<K.length&&!K[h].includes("DetermineComponentFrameRoot");)h++;for(;y<ne.length&&!ne[y].includes("DetermineComponentFrameRoot");)y++;if(h===K.length||y===ne.length)for(h=K.length-1,y=ne.length-1;1<=h&&0<=y&&K[h]!==ne[y];)y--;for(;1<=h&&0<=y;h--,y--)if(K[h]!==ne[y]){if(h!==1||y!==1)do if(h--,y--,0>y||K[h]!==ne[y]){var be= `
2025-03-05 12:54:15 +08:00
` +K[h].replace(" at new "," at ");return o.displayName&&be.includes("<anonymous>")&&(be=be.replace("<anonymous>",o.displayName)),be}while(1<=h&&0<=y);break}}}finally{W=!1,Error.prepareStackTrace=d}return(d=o?o.displayName||o.name:"")?P(d):""}function j(o){switch(o.tag){case 26:case 27:case 5:return P(o.type);case 16:return P("Lazy");case 13:return P("Suspense");case 19:return P("SuspenseList");case 0:case 15:return o=Z(o.type,!1),o;case 11:return o=Z(o.type.render,!1),o;case 1:return o=Z(o.type,!0),o;default:return""}}function G(o){try{var s="";do s+=j(o),o=o.return;while(o);return s}catch(d){return `
2025-02-24 18:59:31 +08:00
Error generating stack : ` +d.message+ `
2025-03-05 14:30:30 +08:00
` +d.stack}}function B(o){var s=o,d=o;if(o.alternate)for(;s.return;)s=s.return;else{o=s;do s=o,s.flags&4098&&(d=s.return),o=s.return;while(o)}return s.tag===3?d:null}function X(o){if(o.tag===13){var s=o.memoizedState;if(s===null&&(o=o.alternate,o!==null&&(s=o.memoizedState)),s!==null)return s.dehydrated}return null}function D(o){if(B(o)!==o)throw Error(r(188))}function V(o){var s=o.alternate;if(!s){if(s=B(o),s===null)throw Error(r(188));return s!==o?null:o}for(var d=o,h=s;;){var y=d.return;if(y===null)break;var E=y.alternate;if(E===null){if(h=y.return,h!==null){d=h;continue}break}if(y.child===E.child){for(E=y.child;E;){if(E===d)return D(y),o;if(E===h)return D(y),s;E=E.sibling}throw Error(r(188))}if(d.return!==h.return)d=y,h=E;else{for(var F=!1, $ =y.child; $ ;){if( $ ===d){F=!0,d=y,h=E;break}if( $ ===h){F=!0,h=y,d=E;break} $ = $ .sibling}if(!F){for( $ =E.child; $ ;){if( $ ===d){F=!0,d=E,h=y;break}if( $ ===h){F=!0,h=E,d=y;break} $ = $ .sibling}if(!F)throw Error(r(189))}}if(d.alternate!==h)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?o:s}function U(o){var s=o.tag;if(s===5||s===26||s===27||s===6)return o;for(o=o.child;o!==null;){if(s=U(o),s!==null)return s;o=o.sibling}return null}var L=Array.isArray,Y=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},se=[],re=-1;function le(o){return{current:o}}function Ae(o){0>re||(o.current=se[re],se[re]=null,re--)}function ae(o,s){re++,se[re]=o.current,o.current=s}var we=le(null),xe=le(null),Ie=le(null),Ce=le(null);function Ee(o,s){switch(ae(Ie,s),ae(xe,o),ae(we,null),o=s.nodeType,o){case 9:case 11:s=(s=s.documentElement)&&(s=s.namespaceURI)?S1(s):0;break;default:if(o=o===8?s.parentNode:s,s=o.tagName,o=o.namespaceURI)o=S1(o),s=E1(o,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}Ae(we),ae(we,s)}function J(){Ae(we),Ae(xe),Ae(Ie)}function fe(o){o.memoizedState!==null&&ae(Ce,o);var s=we.current,d=E1(s,o.type);s!==d&&(ae(xe,o),ae(we,d))}function ke(o){xe.current===o&&(Ae(we),Ae(xe)),Ce.current===o&&(Ae(Ce),Rs._currentValue=Q)}var me=Object.prototype.hasOwnProperty,ve=e.unstable_scheduleCallback,ie=e.unstable_cancelCallback,ze=e.unstable_shouldYield,Pe=e.unstable_requestPaint,he=e.unstable_now,Ne=e.unstable_getCurrentPriorityLevel,ee=e.unstable_ImmediatePriority,ce=e.unstable_UserBlockingPriority,Re=e.unstable_NormalPriority,Fe=e.unstable_LowPriority,qe=e.unstable_IdlePriority,mt=e.log,St=e.unstable_setDisableYieldValue,pt=null,Je=null;function wt(o){if(Je&&typeof Je.onCommitFiberRoot=="function")try{Je.onCommitFiberRoot(pt,o,void 0,(o.current.flags&128)===128)}catch{}}function rt(o){if(typeof mt=="function"&&St(o),Je&&typeof Je.setStrictMode=="function")try{Je.setStrictMode(pt,o)}catch{}}var bt=Math.clz32?Math.clz32:Mt,Bt=Math.log,sn=Math.LN2;function Mt(o){return o>>>=0,o===0?32:31-(Bt(o)/sn|0)|0}var er=128,zr=4194304;function Kt(o){var s=o&42;if(s!==0)return s;switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function na(o,s){var d=o.pendingLanes;if(d===0)return 0;var h=0,y=o.suspendedLanes,E=o.pingedLanes,F=o.warmLanes;o=o.finishedLanes!==0;var $ =d&134217727;return $ !==0?(d= $ &~y,d!==0?h=Kt(d):(E&= $ ,E!==0?h=Kt(E):o||(F= $ &~F,F!==0&&(h=Kt(F))))):( $ =d&~y, $ !==0?h=Kt( $ ):E!==0?h=Kt(E):o||(F=d&~F,F!==0&&(h=Kt(F)))),h===0?0:s!==0&&s!==h&&!(s&y)&&(y=h&-h,F=s&-s,y>=F||y===32&&(F&4194176)!==0)?s:h}function Ke(o,s){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&s)===0}function gt(o,s){switch(o){case 1:case 2:case 4:case 8:return s+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2
` ).replace(I6,"")}function v1(o,s){return s=y1(s),y1(o)===s}function xc(){}function At(o,s,d,h,y,E){switch(d){case"children":typeof h=="string"?s==="body"||s==="textarea"&&h===""||yi(o,h):(typeof h=="number"||typeof h=="bigint")&&s!=="body"&&yi(o,""+h);break;case"className":Ou(o,"class",h);break;case"tabIndex":Ou(o,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":Ou(o,d,h);break;case"style":CA(o,h,E);break;case"data":if(s!=="object"){Ou(o,"data",h);break}case"src":case"href":if(h===""&&(s!=="a"||d!=="href")){o.removeAttribute(d);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){o.removeAttribute(d);break}h=Lu(""+h),o.setAttribute(d,h);break;case"action":case"formAction":if(typeof h=="function"){o.setAttribute(d,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you \\ 're trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof E=="function"&&(d==="formAction"?(s!=="input"&&At(o,s,"name",y.name,y,null),At(o,s,"formEncType",y.formEncType,y,null),At(o,s,"formMethod",y.formMethod,y,null),At(o,s,"formTarget",y.formTarget,y,null)):(At(o,s,"encType",y.encType,y,null),At(o,s,"method",y.method,y,null),At(o,s,"target",y.target,y,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){o.removeAttribute(d);break}h=Lu(""+h),o.setAttribute(d,h);break;case"onClick":h!=null&&(o.onclick=xc);break;case"onScroll":h!=null&&dt("scroll",o);break;case"onScrollEnd":h!=null&&dt("scrollend",o);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(d=h.__html,d!=null){if(y.children!=null)throw Error(r(60));o.innerHTML=d}}break;case"multiple":o.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":o.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){o.removeAttribute("xlink:href");break}d=Lu(""+h),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?o.setAttribute(d,""+h):o.removeAttribute(d);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?o.setAttribute(d,""):o.removeAttribute(d);break;case"capture":case"download":h===!0?o.setAttribute(d,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?o.setAttribute(d,h):o.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?o.setAttribute(d,h):o.removeAttribute(d);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?o.removeAttribute(d):o.setAttribute(d,h);break;case"popover":dt("beforetoggle",o),dt("toggle",o),Nu(o,"popover",h);break;case"xlinkActuate":oa(o,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":oa(o,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":oa(o,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":oa(o,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":oa(o,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":oa(o,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":oa(o,"http://www.w3.org/XML/1998/nam
2025-03-05 12:54:15 +08:00
` ).forEach(function(l){a=l.indexOf(":"),n=l.substring(0,a).trim().toLowerCase(),r=l.substring(a+1).trim(),!(!n||t[n]&&I $ [n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},mR=Symbol("internals");function Ms(e){return e&&String(e).trim().toLowerCase()}function pd(e){return e===!1||e==null?e:pe.isArray(e)?e.map(pd):String(e)}function M $ (e){const t=Object.create(null),n=/([^ \s ,;=]+) \s *(?:= \s *([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const F $ =e=>/^[-_a-zA-Z0-9^ ` | ~ , ! # $ % & ' * + . ] + $ / . test ( e . trim ( ) ) ; function ch ( e , t , n , r , a ) { if ( pe . isFunction ( r ) ) return r . call ( this , t , n ) ; if ( a && ( t = n ) , ! ! pe . isString ( t ) ) { if ( pe . isString ( r ) ) return t . indexOf ( r ) !== - 1 ; if ( pe . isRegExp ( r ) ) return r . test ( t ) } } function z$ ( e ) { return e . trim ( ) . toLowerCase ( ) . replace ( /([a-z\d])(\w*)/g , ( t , n , r ) => n . toUpperCase ( ) + r ) } function P$ ( e , t ) { const n = pe . toCamelCase ( " " + t ) ; [ "get" , "set" , "has" ] . forEach ( r => { Object . defineProperty ( e , r + n , { value : function ( a , i , l ) { return this [ r ] . call ( this , t , a , i , l ) } , configurable : ! 0 } ) } ) } let zn = class { constructor ( t ) { t && this . set ( t ) } set ( t , n , r ) { const a = this ; function i ( u , c , f ) { const p = Ms ( c ) ; if ( ! p ) throw new Error ( "header name must be a non-empty string" ) ; const g = pe . findKey ( a , p ) ; ( ! g || a [ g ] === void 0 || f === ! 0 || f === void 0 && a [ g ] !== ! 1 ) && ( a [ g || c ] = pd ( u ) ) } const l = ( u , c ) => pe . forEach ( u , ( f , p ) => i ( f , p , c ) ) ; if ( pe . isPlainObject ( t ) || t instanceof this . constructor ) l ( t , n ) ; else if ( pe . isString ( t ) && ( t = t . trim ( ) ) && ! F$ ( t ) ) l ( L$ ( t ) , n ) ; else if ( pe . isHeaders ( t ) ) for ( const [ u , c ] of t . entries ( ) ) i ( c , u , r ) ; else t != null && i ( n , t , r ) ; return this } get ( t , n ) { if ( t = Ms ( t ) , t ) { const r = pe . findKey ( this , t ) ; if ( r ) { const a = this [ r ] ; if ( ! n ) return a ; if ( n === ! 0 ) return M$ ( a ) ; if ( pe . isFunction ( n ) ) return n . call ( this , a , r ) ; if ( pe . isRegExp ( n ) ) return n . exec ( a ) ; throw new TypeError ( "parser must be boolean|regexp|function" ) } } } has ( t , n ) { if ( t = Ms ( t ) , t ) { const r = pe . findKey ( this , t ) ; return ! ! ( r && this [ r ] !== void 0 && ( ! n || ch ( this , this [ r ] , r , n ) ) ) } return ! 1 } delete ( t , n ) { const r = this ; let a = ! 1 ; function i ( l ) { if ( l = Ms ( l ) , l ) { const u = pe . findKey ( r , l ) ; u && ( ! n || ch ( r , r [ u ] , u , n ) ) && ( delete r [ u ] , a = ! 0 ) } } return pe . isArray ( t ) ? t . forEach ( i ) : i ( t ) , a } clear ( t ) { const n = Object . keys ( this ) ; let r = n . length , a = ! 1 ; for ( ; r -- ; ) { const i = n [ r ] ; ( ! t || ch ( this , this [ i ] , i , t , ! 0 ) ) && ( delete this [ i ] , a = ! 0 ) } return a } normalize ( t ) { const n = this , r = { } ; return pe . forEach ( this , ( a , i ) => { const l = pe . findKey ( r , i ) ; if ( l ) { n [ l ] = pd ( a ) , delete n [ i ] ; return } const u = t ? z$ ( i ) : String ( i ) . trim ( ) ; u !== i && delete n [ i ] , n [ u ] = pd ( a ) , r [ u ] = ! 0 } ) , this } concat ( ... t ) { return this . constructor . concat ( this , ... t ) } toJSON ( t ) { const n = Object . create ( null ) ; return pe . forEach ( this , ( r , a ) => { r != null && r !== ! 1 && ( n [ a ] = t && pe . isArray ( r ) ? r . join ( ", " ) : r ) } ) , n } [ Symbol . iterator ] ( ) { return Object . entries ( this . toJSON ( ) ) [ Symbol . iterator ] ( ) } toString ( ) { return Object . entries ( this . toJSON ( ) ) . map ( ( [ t , n ] ) => t + ": " + n ) . join ( `
2025-03-05 14:30:30 +08:00
` )}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(a=>r.set(a)),r}static accessor(t){const r=(this[mR]=this[mR]={accessors:{}}).accessors,a=this.prototype;function i(l){const u=Ms(l);r[u]||(P $ (a,l),r[u]=!0)}return pe.isArray(t)?t.forEach(i):i(t),this}};zn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);pe.reduceDescriptors(zn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});pe.freezeMethods(zn);function dh(e,t){const n=this||pu,r=t||n,a=zn.from(r.headers);let i=r.data;return pe.forEach(e,function(u){i=u.call(n,i,a.normalize(),t?t.status:void 0)}),a.normalize(),i}function Kz(e){return!!(e&&e.__CANCEL__)}function _l(e,t,n){nt.call(this,e??"canceled",nt.ERR_CANCELED,t,n),this.name="CanceledError"}pe.inherits(_l,nt,{__CANCEL__:!0});function Xz(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new nt("Request failed with status code "+n.status,[nt.ERR_BAD_REQUEST,nt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function B $ (e){const t=/^([-+ \w ]{1,25})(:? \/ \/ |:)/.exec(e);return t&&t[1]||""}function U $ (e,t){e=e||10;const n=new Array(e),r=new Array(e);let a=0,i=0,l;return t=t!==void 0?t:1e3,function(c){const f=Date.now(),p=r[i];l||(l=f),n[a]=c,r[a]=f;let g=i,b=0;for(;g!==a;)b+=n[g++],g=g%e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),f-l<t)return;const m=p&&f-p;return m?Math.round(b*1e3/m):void 0}}function j $ (e,t){let n=0,r=1e3/t,a,i;const l=(f,p=Date.now())=>{n=p,a=null,i&&(clearTimeout(i),i=null),e.apply(null,f)};return[(...f)=>{const p=Date.now(),g=p-n;g>=r?l(f,p):(a=f,i||(i=setTimeout(()=>{i=null,l(a)},r-g)))},()=>a&&l(a)]}const Nd=(e,t,n=3)=>{let r=0;const a=U $ (50,250);return j $ (i=>{const l=i.loaded,u=i.lengthComputable?i.total:void 0,c=l-r,f=a(c),p=l<=u;r=l;const g={loaded:l,total:u,progress:u?l/u:void 0,bytes:c,rate:f||void 0,estimated:f&&u&&p?(u-l)/f:void 0,event:i,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(g)},n)},bR=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},yR=e=>(...t)=>pe.asap(()=>e(...t)),G $ =yn.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,yn.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(yn.origin),yn.navigator&&/(msie|trident)/i.test(yn.navigator.userAgent)):()=>!0,H $ =yn.hasStandardBrowserEnv?{write(e,t,n,r,a,i){const l=[e+"="+encodeURIComponent(t)];pe.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),pe.isString(r)&&l.push("path="+r),pe.isString(a)&&l.push("domain="+a),i===!0&&l.push("secure"),document.cookie=l.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|; \\ s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function $ $ (e){return/^([a-z][a-z \d + \- .]*:)? \/ \/ /i.test(e)}function q $ (e,t){return t?e.replace(/ \/ ? \/ $ /,"")+"/"+t.replace(/^ \/ +/,""):e}function Zz(e,t){return e&&! $ $ (t)?q $ (e,t):t}const vR=e=>e instanceof zn?{...e}:e;function ri(e,t){t=t||{};const n={};function r(f,p,g,b){return pe.isPlainObject(f)&&pe.isPlainObject(p)?pe.merge.call({caseless:b},f,p):pe.isPlainObject(p)?pe.merge({},p):pe.isArray(p)?p.slice():p}function a(f,p,g,b){if(pe.isUndefined(p)){if(!pe.isUndefined(f))return r(void 0,f,g,b)}else return r(f,p,g,b)}function i(f,p){if(!pe.isUndefined(p))return r(void 0,p)}function l(f,p){if(pe.isUndefined(p)){if(!pe.isUndefined(f))return r(void 0,f)}else return r(void 0,p)}function u(f,p,g){if(g in t)return r(f,p);if(g in e)return r(void 0,f)}const c={url:i,method:i,data:i,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateSt
2025-03-05 12:54:15 +08:00
` +i.map(wR).join( `
` ):" "+wR(i[0]):"as no adapter specified";throw new nt("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return r},adapters:Sx};function fh(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new _l(null,e)}function xR(e){return fh(e),e.headers=zn.from(e.headers),e.data=dh.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),tP.getAdapter(e.adapter||pu.adapter)(e).then(function(r){return fh(e),r.data=dh.call(e,e.transformResponse,r),r.headers=zn.from(r.headers),r},function(r){return Kz(r)||(fh(e),r&&r.response&&(r.response.data=dh.call(e,e.transformResponse,r.response),r.response.headers=zn.from(r.response.headers))),Promise.reject(r)})}const nP="1.7.9",uf={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{uf[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const kR={};uf.transitional=function(t,n,r){function a(i,l){return"[Axios v"+nP+"] Transitional option '"+i+"'"+l+(r?". "+r:"")}return(i,l,u)=>{if(t===!1)throw new nt(a(l," has been removed"+(n?" in "+n:"")),nt.ERR_DEPRECATED);return n&&!kR[l]&&(kR[l]=!0,console.warn(a(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,l,u):!0}};uf.spelling=function(t){return(n,r)=>(console.warn( ` $ { r } is likely a misspelling of $ { t } ` ),!0)};function aq(e,t,n){if(typeof e!="object")throw new nt("options must be an object",nt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const i=r[a],l=t[i];if(l){const u=e[i],c=u===void 0||l(u,i,e);if(c!==!0)throw new nt("option "+i+" must be "+c,nt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new nt("Unknown option "+i,nt.ERR_BAD_OPTION)}}const gd={assertOptions:aq,validators:uf},Hr=gd.validators;let ni=class{constructor(t){this.defaults=t,this.interceptors={request:new hR,response:new hR}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const i=a.stack?a.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(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ri(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:i}=n;r!==void 0&&gd.assertOptions(r,{silentJSONParsing:Hr.transitional(Hr.boolean),forcedJSONParsing:Hr.transitional(Hr.boolean),clarifyTimeoutError:Hr.transitional(Hr.boolean)},!1),a!=null&&(pe.isFunction(a)?n.paramsSerializer={serialize:a}:gd.assertOptions(a,{encode:Hr.function,serialize:Hr.function},!0)),gd.assertOptions(n,{baseUrl:Hr.spelling("baseURL"),withXsrfToken:Hr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=i&&pe.merge(i.common,i[n.method]);i&&pe.forEach(["delete","get","head","post","put","patch","common"],S=>{delete i[S]}),n.headers=zn.concat(l,i);const u=[];let c=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(c=c&&v.synchronous,u.unshift(v.fulfilled,v.rejected))});const f=[];this.interceptors.response.forEach(function(v){f.push(v.fulfilled,v.rejected)});let p,g=0,b;if(!c){const S=[xR.bind(this),void 0];for(S.unshift.apply(S,u),S.push.apply(S,f),b=S.length,p=Promise.resolve(n);g<b;)p=p.then(S[g++],S[g++]);return p}b=u.length;let m=n;for(g=0;g<b;){const S=u[g++],v=u[g++];try{m=S(m)}catch(A){v.call(this,A);break}}try{p=xR.call(this,m)}catch(S){return Promise.reject(S)}for(g=0,b=f.length;g<b;)p=p.then(f[g++],f[g++]);return p}getUri(t){t=ri(this.defaults,t);const n=Zz(t.baseURL,t.url);return Vz(n,t.params,t.paramsSerializer)}};pe.forEach(["delete","get","head","options"],function(t){ni.prototype[t]=function(n,r){return this.request(ri(r||{},{method:t,url:n,data:(r||{}).data}))}});pe.forEach(["post","put","patch"],function(t){function n(r){return function(i,l,u){return this.request(ri(u||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:l}))}}ni.prototype[t]=n(),ni.prototype[t+"Form"]=n(!0)});let oq=class rP{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(a=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](a);r._listeners=null}),this.promise.then=a=>{let i;const l=new Promise(u=>{r.subscribe(u),i=u}).then(a);return l.cancel=function(){r.unsubscribe(i)},l},t(function(i,l,u){r.reason||(r.reason=new _l(i,l,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new rP(function(a){t=a}),cancel:t}}};function iq(e){return function(n){return e.apply(null,n)}}function lq(e){return pe.isObject(e)&&e.isAxiosError===!0}const Ex={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,HttpVersionNotSupport
2025-02-24 18:59:31 +08:00
$ { JSON . stringify ( e . response . data ) }
2025-03-05 12:54:15 +08:00
$ { ( t = e . config ) == null ? void 0 : t . url } ` ):e});const sq=async(e,t,n)=>(await Mr.get( ` / graphs ? label = $ { encodeURIComponent ( e ) } & max _depth = $ { t } & min _degree = $ { n } ` )).data,uq=async()=>(await Mr.get("/graph/label/list")).data,cq=async()=>{try{return(await Mr.get("/health")).data}catch(e){return{status:"error",message:Nr(e)}}},dq=async()=>(await Mr.get("/documents")).data,fq=async()=>(await Mr.post("/documents/scan")).data,pq=async e=>(await Mr.post("/query",e)).data,gq=async(e,t,n)=>{try{let r="";if(await Mr.post("/query/stream",e,{responseType:"text",headers:{Accept:"application/x-ndjson"},transformResponse:[a=>{r+=a;const i=r.split( `
` );r=i.pop()||"";for(const l of i)if(l.trim())try{const u=JSON.parse(l);u.response?t(u.response):u.error&&n&&n(u.error)}catch(u){console.error("Error parsing stream chunk:",u),n&&n("Error parsing server response")}return a}]}).catch(a=>{n&&n(Nr(a))}),r.trim())try{const a=JSON.parse(r);a.response?t(a.response):a.error&&n&&n(a.error)}catch(a){console.error("Error parsing final chunk:",a),n&&n("Error parsing server response")}}catch(r){const a=Nr(r);console.error("Stream request failed:",a),n&&n(a)}},hq=async(e,t)=>{const n=new FormData;return n.append("file",e),(await Mr.post("/documents/upload",n,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:t!==void 0?a=>{const i=Math.round(a.loaded*100/a.total);t(i)}:void 0})).data},mq=async()=>(await Mr.delete("/documents")).data,bq=xk()(e=>({health:!0,message:null,messageTitle:null,lastCheckTime:Date.now(),status:null,check:async()=>{const t=await cq();return t.status==="healthy"?(e({health:!0,message:null,messageTitle:null,lastCheckTime:Date.now(),status:t}),!0):(e({health:!1,message:t.message,messageTitle:"Backend Health Check Error!",lastCheckTime:Date.now(),status:null}),!1)},clear:()=>{e({health:!0,message:null,messageTitle:null})},setErrorMessage:(t,n)=>{e({health:!1,message:t,messageTitle:n})}})),Pn=Tk(bq);/**
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const yq=e=>e.replace(/ ( [ a - z0 - 9 ] ) ( [ A - Z ] ) / g , "$1-$2" ) . toLowerCase ( ) , lP = ( ... e ) => e . filter ( ( t , n , r ) => ! ! t && t . trim ( ) !== "" && r . indexOf ( t ) === n ) . join ( " " ) . trim ( ) ; / * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /var vq={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 " } ; / * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* / c o n s t S q = k . f o r w a r d R e f ( ( { c o l o r : e = " c u r r e n t C o l o r " , s i z e : t = 2 4 , s t r o k e W i d t h : n = 2 , a b s o l u t e S t r o k e W i d t h : r , c l a s s N a m e : a = " " , c h i l d r e n : i , i c o n N o d e : l , . . . u } , c ) = > k . c r e a t e E l e m e n t ( " s v g " , { r e f : c , . . . v q , w i d t h : t , h e i g h t : t , s t r o k e : e , s t r o k e W i d t h : r ? N u m b e r ( n ) * 2 4 / N u m b e r ( t ) : n , c l a s s N a m e : l P ( " l u c i d e " , a ) , . . . u } , [ . . . l . m a p ( ( [ f , p ] ) = > k . c r e a t e E l e m e n t ( f , p ) ) , . . . A r r a y . i s A r r a y ( i ) ? i : [ i ] ] ) ) ; / * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const xt=(e,t)=>{const n=k.forwardRef(({className:r,...a},i)=>k.createElement(Sq,{ref:i,iconNode:t,className:lP(`lucide-${yq(e)}`,r),...a}));return n.displayName=`${e}`,n};/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-03-05 12:54:15 +08:00
* /const Eq=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Nk=xt("Check",Eq);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-03-05 12:54:15 +08:00
* /const wq=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ok=xt("ChevronDown",wq);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const xq=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],sP=xt("ChevronUp",xq);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const kq=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Aq=xt("ChevronsUpDown",kq);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const Tq=[["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"}]],_q=xt("CircleAlert",Tq);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const Rq=[["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"}]],Cq=xt("Copy",Rq);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const Nq=[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]],uP=xt("Eraser",Nq);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const Oq=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Dq=xt("FileText",Oq);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const Iq=[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]],Lq=xt("Files",Iq);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const Mq=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["rect",{width:"10",height:"8",x:"7",y:"8",rx:"1",key:"vys8me"}]],Fq=xt("Fullscreen",Mq);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const zq=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],Pq=xt("Github",zq);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const Bq=[["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"19",cy:"5",r:"1",key:"w8mnmm"}],["circle",{cx:"5",cy:"5",r:"1",key:"lttvr7"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}],["circle",{cx:"19",cy:"19",r:"1",key:"shf9b7"}],["circle",{cx:"5",cy:"19",r:"1",key:"bfqh0e"}]],Uq=xt("Grip",Bq);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const jq=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],cP=xt("LoaderCircle",jq);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const Gq=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],Hq=xt("Loader",Gq);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const $q=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],qq=xt("Maximize",$q);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const Vq=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]],Wq=xt("Minimize",Vq);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const Yq=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Kq=xt("Moon",Yq);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const Xq=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],Zq=xt("Pause",Xq);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const Qq=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Jq=xt("Play",Qq);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const e8=[["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"}]],t8=xt("RefreshCw",e8);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const n8=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],r8=xt("Search",n8);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const a8=[["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"}]],o8=xt("Send",a8);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const i8=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],l8=xt("Settings",i8);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const s8=[["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"}]],u8=xt("Sun",s8);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-03-05 12:54:15 +08:00
* /const c8=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],wx=xt("Upload",c8);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const d8=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],dP=xt("X",d8);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const f8=[["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"}]],p8=xt("Zap",f8);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-02-25 18:36:34 +08:00
* /const g8=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],h8=xt("ZoomIn",g8);/ * *
2025-02-24 18:59:31 +08:00
* @ license lucide - react v0 . 475.0 - ISC
*
* This source code is licensed under the ISC license .
* See the LICENSE file in the root directory of this source tree .
2025-03-05 14:30:30 +08:00
* / c o n s t m 8 = [ [ " c i r c l e " , { c x : " 1 1 " , c y : " 1 1 " , r : " 8 " , k e y : " 4 e j 9 7 u " } ] , [ " l i n e " , { x 1 : " 2 1 " , x 2 : " 1 6 . 6 5 " , y 1 : " 2 1 " , y 2 : " 1 6 . 6 5 " , k e y : " 1 3 g j 7 c " } ] , [ " l i n e " , { x 1 : " 8 " , x 2 : " 1 4 " , y 1 : " 1 1 " , y 2 : " 1 1 " , k e y : " d u r y m u " } ] ] , b 8 = x t ( " Z o o m O u t " , m 8 ) , y 8 = ( ) = > { c o n s t e = P n . u s e . h e a l t h ( ) , t = P n . u s e . m e s s a g e ( ) , n = P n . u s e . m e s s a g e T i t l e ( ) , [ r , a ] = k . u s e S t a t e ( ! 1 ) ; r e t u r n k . u s e E f f e c t ( ( ) = > { s e t T i m e o u t ( ( ) = > { a ( ! 0 ) } , 5 0 ) } , [ ] ) , w . j s x s ( O z , { c l a s s N a m e : M e ( " b g - b a c k g r o u n d / 9 0 a b s o l u t e t o p - 1 2 l e f t - 1 / 2 f l e x w - a u t o m a x - w - l g - t r a n s l a t e - x - 1 / 2 t r a n s f o r m i t e m s - c e n t e r g a p - 4 s h a d o w - m d b a c k d r o p - b l u r - l g t r a n s i t i o n - a l l d u r a t i o n - 5 0 0 e a s e - i n - o u t " , r ? " t r a n s l a t e - y - 0 o p a c i t y - 1 0 0 " : " - t r a n s l a t e - y - 2 0 o p a c i t y - 0 " , ! e & & " b g - r e d - 7 0 0 t e x t - w h i t e " ) , c h i l d r e n : [ ! e & & w . j s x ( " d i v " , { c h i l d r e n : w . j s x ( _ q , { c l a s s N a m e : " s i z e - 4 " } ) } ) , w . j s x s ( " d i v " , { c h i l d r e n : [ w . j s x ( D z , { c l a s s N a m e : " f o n t - b o l d " , c h i l d r e n : n } ) , w . j s x ( I z , { c h i l d r e n : t } ) ] } ) ] } ) } ; f u n c t i o n v 8 ( e , t ) { c o n s t n = k . c r e a t e C o n t e x t ( t ) , r = i = > { c o n s t { c h i l d r e n : l , . . . u } = i , c = k . u s e M e m o ( ( ) = > u , O b j e c t . v a l u e s ( u ) ) ; r e t u r n w . j s x ( n . P r o v i d e r , { v a l u e : c , c h i l d r e n : l } ) } ; r . d i s p l a y N a m e = e + " P r o v i d e r " ; f u n c t i o n a ( i ) { c o n s t l = k . u s e C o n t e x t ( n ) ; i f ( l ) r e t u r n l ; i f ( t ! = = v o i d 0 ) r e t u r n t ; t h r o w n e w E r r o r ( ` \ ` $ { i } \ ` m u s t b e u s e d w i t h i n \ ` $ { e } \ ` ` ) } r e t u r n [ r , a ] } f u n c t i o n m r ( e , t = [ ] ) { l e t n = [ ] ; f u n c t i o n r ( i , l ) { c o n s t u = k . c r e a t e C o n t e x t ( l ) , c = n . l e n g t h ; n = [ . . . n , l ] ; c o n s t f = g = > { v a r R ; c o n s t { s c o p e : b , c h i l d r e n : m , . . . S } = g , v = ( ( R = b = = n u l l ? v o i d 0 : b [ e ] ) = = n u l l ? v o i d 0 : R [ c ] ) | | u , A = k . u s e M e m o ( ( ) = > S , O b j e c t . v a l u e s ( S ) ) ; r e t u r n w . j s x ( v . P r o v i d e r , { v a l u e : A , c h i l d r e n : m } ) } ; f . d i s p l a y N a m e = i + " P r o v i d e r " ; f u n c t i o n p ( g , b ) { v a r v ; c o n s t m = ( ( v = b = = n u l l ? v o i d 0 : b [ e ] ) = = n u l l ? v o i d 0 : v [ c ] ) | | u , S = k . u s e C o n t e x t ( m ) ; i f ( S ) r e t u r n S ; i f ( l ! = = v o i d 0 ) r e t u r n l ; t h r o w n e w E r r o r ( ` \ ` $ { g } \ ` m u s t b e u s e d w i t h i n \ ` $ { i } \ ` ` ) } r e t u r n [ f , p ] } c o n s t a = ( ) = > { c o n s t i = n . m a p ( l = > k . c r e a t e C o n t e x t ( l ) ) ; r e t u r n f u n c t i o n ( u ) { c o n s t c = ( u = = n u l l ? v o i d 0 : u [ e ] ) | | i ; r e t u r n k . u s e M e m o ( ( ) = > ( { [ ` _ _ s c o p e $ { e } ` ] : { . . . u , [ e ] : c } } ) , [ u , c ] ) } } ; r e t u r n a . s c o p e N a m e = e , [ r , S 8 ( a , . . . t ) ] } f u n c t i o n S 8 ( . . . e ) { c o n s t t = e [ 0 ] ; i f ( e . l e n g t h = = = 1 ) r e t u r n t ; c o n s t n = ( ) = > { c o n s t r = e . m a p ( a = > ( { u s e S c o p e : a ( ) , s c o p e N a m e : a . s c o p e N a m e } ) ) ; r e t u r n f u n c t i o n ( i ) { c o n s t l = r . r e d u c e ( ( u , { u s e S c o p e : c , s c o p e N a m e : f } ) = > { c o n s t g = c ( i ) [ ` _ _ s c o p e $ { f } ` ] ; r e t u r n { . . . u , . . . g } } , { } ) ; r e t u r n k . u s e M e m o ( ( ) = > ( { [ ` _ _ s c o p e $ { t . s c o p e N a m e } ` ] : l } ) , [ l ] ) } } ; r e t u r n n . s c o p e N a m e = t . s c o p e N a m e , n } f u n c t i o n A R ( e , t ) { i f ( t y p e o f e = = " f u n c t i o n " ) r e t u r n e ( t ) ; e ! = n u l l & & ( e . c u r r e n t = t ) } f u n c t i o n f P ( . . . e ) { r e t u r n t = > { l e t n = ! 1 ; c o n s t r = e . m a p ( a = > { c o n s t i = A R ( a , t ) ; r e t u r n ! n & & t y p e o f i = = " f u n c t i o n " & & ( n = ! 0 ) , i } ) ; i f ( n ) r e t u r n ( ) = > { f o r ( l e t a = 0 ; a < r . l e n g t h ; a + + ) { c o n s t i = r [ a ] ; t y p e o f i = = " f u n c t i o n " ? i ( ) : A R ( e [ a ] , n u l l ) } } } } f u n c t i o n f t ( . . . e ) { r e t u r n k . u s e C a l l b a c k ( f P ( . . . e ) , e ) } f u n c t i o n Y e ( e , t , { c h e c k F o r D e f a u l t P r e v e n t e d : n = ! 0 } = { } ) { r e t u r n f u n c t i o n ( a ) { i f ( e = = n u l l | | e ( a ) , n = = = ! 1 | | ! a . d e f a u l t P r e v e n t e d ) r e t u r n t = = n u l l ? v o i d 0 : t ( a ) } } v a r w n = g l o b a l T h i s ! = n u l l & & g l o b a l T h i s . d o c u m e n t ? k . u s e L a y o u t E f f e c t : ( ) = > { } , E 8 = b H . u s e I d | | ( ( ) = > { } ) , w 8 = 0 ; f u n c t i o n E n ( e ) { c o n s t [ t , n ] = k . u s e S t a t e ( E 8 ( ) ) ; r e t u r n w n ( ( ) = > { n ( r = > r ? ? S t r i n g ( w 8 + + ) ) } , [ e ] ) , t ? ` r a d i x - $ { t } ` : " " } f u n c t i o n p n ( e ) { c o n s t t = k . u s e R e f ( e ) ; r e t u r n k . u s e E f f e c t ( ( ) = > { t . c u r r e n t = e } ) , k . u s e M e m o ( ( ) = > ( . . . n ) = > { v a r r ; r e t u r n ( r = t . c u r r e n t ) = = n u l l ? v o i d 0 : r . c a l l ( t , . . . n ) } , [ ] ) } f u n c t i o n O a ( { p r o p : e , d e f a u l t P r o p : t , o n C h a n g e : n = ( ) = > { } } ) { c o n s t [ r , a ] = x 8 ( { d e f a u l t P r o p : t , o n C h a n g e : n } ) , i = e ! = = v o i d 0 , l = i ? e : r , u = p n ( n ) , c = k . u s e C a l l b a c k ( f = > { i f ( i ) { c o n s t g = t y p e o f f = = " f u n c t i o n " ? f ( e ) : f ; g ! = = e & & u ( g ) } e l s e a ( f ) } , [ i , e , a , u ] ) ; r e t u r n [ l , c ] } f u n c t i o n x 8 ( { d e f a u l t P r o p : e , o n C h a n g e : t } ) { c o n s t n = k . u s e S t a t e ( e ) , [ r ] = n , a = k . u s e R e f ( r ) , i = p n ( t ) ; r e t u r n k . u s e E f f e c t ( ( ) = > { a . c u r r e n t ! = = r & & ( i ( r ) , a . c u r r e n t = r ) } , [ r , a , i ] ) , n } v a r g u = m z ( ) ; c o n s t p P = a n ( g u ) ; v a r b o = k . f o r w a r d R e f ( ( e , t ) = > { c o n s t { c h i l d r e n : n , . . . r } = e , a = k . C h i l d r e n . t o A r r a y ( n ) , i = a . f i n d ( k 8 ) ; i f ( i ) { c o n s t l = i . p r o p s . c h i l d r e n , u = a . m a p ( c = > c = = = i ? k . C h i l d r e n . c o u n t ( l ) > 1 ? k . C h i l d r e n . o n l y ( n u l l ) : k . i s V a l i d E l e m e n t ( l ) ? l . p r o p s . c h i l d r e n : n u l l : c ) ; r e t u r n w . j s x ( x x , { . . . r , r e f : t , c h i l d r e n : k . i s V a l i d E l e m e n t ( l ) ? k . c l o n e E l e m e n t ( l , v o i d 0 , u ) : n u l l } ) } r e t u r n w . j s x ( x x , { . . . r , r e f : t , c h i l d r e n : n } ) } ) ; b o . d i s p l a y N a m e = " S l o t " ; v a r x x = k . f o r w a r d R e f ( ( e , t ) = > { c o n s t { c h i l d r e n : n , . . . r } = e ; i f ( k . i s V a l i d E l e m e n t ( n ) ) { c o n s t a = T 8 ( n ) , i = A 8 ( r , n . p r o p s ) ; r e t u r n n . t y p e ! = = k . F r a g m e n t & & ( i . r e f = t ? f P ( t , a ) : a ) , k . c l o n e E l e m e n t ( n , i ) } r e t u r n k . C h i l d r e n . c o u n t ( n ) > 1 ? k . C h i l d r e n . o n l y ( n u l l ) : n u l l } ) ; x x . d i s p l a y N a m e = " S l o t C l o n e " ; v a r D k = ( { c
2025-02-25 18:36:34 +08:00
. ` .concat(K8, ` {
2025-02-24 18:59:31 +08:00
overflow : hidden ` ).concat(r, ` ;
padding - right : ` ).concat(u,"px ").concat(r, ` ;
}
2025-03-05 12:54:15 +08:00
body [ ` ).concat(cl, ` ] {
2025-02-24 18:59:31 +08:00
overflow : hidden ` ).concat(r, ` ;
overscroll - behavior : contain ;
` ).concat([t&&"position: relative ".concat(r,";"),n==="margin"&& `
padding - left : ` .concat(a, ` px ;
padding - top : ` ).concat(i, ` px ;
padding - right : ` ).concat(l, ` px ;
margin - left : 0 ;
margin - top : 0 ;
margin - right : ` ).concat(u,"px ").concat(r, ` ;
` ),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""), `
}
2025-03-05 12:54:15 +08:00
2025-02-25 18:36:34 +08:00
. ` ).concat(hd, ` {
2025-02-24 18:59:31 +08:00
right : ` ).concat(u,"px ").concat(r, ` ;
}
2025-03-05 12:54:15 +08:00
2025-02-25 18:36:34 +08:00
. ` ).concat(md, ` {
2025-02-24 18:59:31 +08:00
margin - right : ` ).concat(u,"px ").concat(r, ` ;
}
2025-03-05 12:54:15 +08:00
2025-02-25 18:36:34 +08:00
. ` ).concat(hd," .").concat(hd, ` {
2025-02-24 18:59:31 +08:00
right : 0 ` ).concat(r, ` ;
}
2025-03-05 12:54:15 +08:00
2025-02-25 18:36:34 +08:00
. ` ).concat(md," .").concat(md, ` {
2025-02-24 18:59:31 +08:00
margin - right : 0 ` ).concat(r, ` ;
}
2025-03-05 12:54:15 +08:00
body [ ` ).concat(cl, ` ] {
2025-02-25 18:36:34 +08:00
` ).concat(X8,": ").concat(u, ` px ;
2025-02-24 18:59:31 +08:00
}
2025-03-05 12:54:15 +08:00
` )},LR=function(){var e=parseInt(document.body.getAttribute(cl)||"0",10);return isFinite(e)?e:0},h7=function(){k.useEffect(function(){return document.body.setAttribute(cl,(LR()+1).toString()),function(){var e=LR()-1;e<=0?document.body.removeAttribute(cl):document.body.setAttribute(cl,e.toString())}},[])},m7=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;h7();var i=k.useMemo(function(){return f7(a)},[a]);return k.createElement(p7,{styles:g7(i,!t,a,n?"":"!important")})},Ax=!1;if(typeof window<"u")try{var Bc=Object.defineProperty({},"passive",{get:function(){return Ax=!0,!0}});window.addEventListener("test",Bc,Bc),window.removeEventListener("test",Bc,Bc)}catch{Ax=!1}var Ki=Ax?{passive:!1}:!1,b7=function(e){return e.tagName==="TEXTAREA"},EP=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!b7(e)&&n[t]==="visible")},y7=function(e){return EP(e,"overflowY")},v7=function(e){return EP(e,"overflowX")},MR=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=wP(e,r);if(a){var i=xP(e,r),l=i[1],u=i[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},S7=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},E7=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},wP=function(e,t){return e==="v"?y7(t):v7(t)},xP=function(e,t){return e==="v"?S7(t):E7(t)},w7=function(e,t){return e==="h"&&t==="rtl"?-1:1},x7=function(e,t,n,r,a){var i=w7(e,window.getComputedStyle(t).direction),l=i*r,u=n.target,c=t.contains(u),f=!1,p=l>0,g=0,b=0;do{var m=xP(e,u),S=m[0],v=m[1],A=m[2],R=v-A-i*S;(S||R)&&wP(e,u)&&(g+=R,b+=S),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!c&&u!==document.body||c&&(t.contains(u)||t===u));return(p&&Math.abs(g)<1||!p&&Math.abs(b)<1)&&(f=!0),f},Uc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},FR=function(e){return[e.deltaX,e.deltaY]},zR=function(e){return e&&"current"in e?e.current:e},k7=function(e,t){return e[0]===t[0]&&e[1]===t[1]},A7=function(e){return `
2025-02-24 18:59:31 +08:00
. block - interactivity - ` .concat(e, ` { pointer - events : none ; }
. allow - interactivity - ` ).concat(e, ` { pointer - events : all ; }
2025-03-05 14:30:30 +08:00
` )},T7=0,Xi=[];function _7(e){var t=k.useRef([]),n=k.useRef([0,0]),r=k.useRef(),a=k.useState(T7++)[0],i=k.useState(SP)[0],l=k.useRef(e);k.useEffect(function(){l.current=e},[e]),k.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var v=Y8([e.lockRef.current],(e.shards||[]).map(zR),!0).filter(Boolean);return v.forEach(function(A){return A.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),v.forEach(function(A){return A.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=k.useCallback(function(v,A){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!l.current.allowPinchZoom;var R=Uc(v),x=n.current,T="deltaX"in v?v.deltaX:x[0]-R[0],C="deltaY"in v?v.deltaY:x[1]-R[1],N,_=v.target,O=Math.abs(T)>Math.abs(C)?"h":"v";if("touches"in v&&O==="h"&&_.type==="range")return!1;var z=MR(O,_);if(!z)return!0;if(z?N=O:(N=O==="v"?"h":"v",z=MR(O,_)),!z)return!1;if(!r.current&&"changedTouches"in v&&(T||C)&&(r.current=N),!N)return!0;var I=r.current||N;return x7(I,A,v,I==="h"?T:C)},[]),c=k.useCallback(function(v){var A=v;if(!(!Xi.length||Xi[Xi.length-1]!==i)){var R="deltaY"in A?FR(A):Uc(A),x=t.current.filter(function(N){return N.name===A.type&&(N.target===A.target||A.target===N.shadowParent)&&k7(N.delta,R)})[0];if(x&&x.should){A.cancelable&&A.preventDefault();return}if(!x){var T=(l.current.shards||[]).map(zR).filter(Boolean).filter(function(N){return N.contains(A.target)}),C=T.length>0?u(A,T[0]):!l.current.noIsolation;C&&A.cancelable&&A.preventDefault()}}},[]),f=k.useCallback(function(v,A,R,x){var T={name:v,delta:A,target:R,should:x,shadowParent:R7(R)};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(C){return C!==T})},1)},[]),p=k.useCallback(function(v){n.current=Uc(v),r.current=void 0},[]),g=k.useCallback(function(v){f(v.type,FR(v),v.target,u(v,e.lockRef.current))},[]),b=k.useCallback(function(v){f(v.type,Uc(v),v.target,u(v,e.lockRef.current))},[]);k.useEffect(function(){return Xi.push(i),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",c,Ki),document.addEventListener("touchmove",c,Ki),document.addEventListener("touchstart",p,Ki),function(){Xi=Xi.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,Ki),document.removeEventListener("touchmove",c,Ki),document.removeEventListener("touchstart",p,Ki)}},[]);var m=e.removeScrollBar,S=e.inert;return k.createElement(k.Fragment,null,S?k.createElement(i,{styles:A7(a)}):null,m?k.createElement(m7,{gapMode:e.gapMode}):null)}function R7(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const C7=r7(vP,_7);var pf=k.forwardRef(function(e,t){return k.createElement(ff,Vr({},e,{ref:t,sideCar:C7}))});pf.classNames=ff.classNames;var N7=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Zi=new WeakMap,jc=new WeakMap,Gc={},vh=0,kP=function(e){return e&&(e.host||kP(e.parentNode))},O7=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=kP(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},D7=function(e,t,n,r){var a=O7(t,Array.isArray(e)?e:[e]);Gc[n]||(Gc[n]=new WeakMap);var i=Gc[n],l=[],u=new Set,c=new Set(a),f=function(g){!g||u.has(g)||(u.add(g),f(g.parentNode))};a.forEach(f);var p=function(g){!g||c.has(g)||Array.prototype.forEach.call(g.children,function(b){if(u.has(b))p(b);else try{var m=b.getAttribute(r),S=m!==null&&m!=="false",v=(Zi.get(b)||0)+1,A=(i.get(b)||0)+1;Zi.set(b,v),i.set(b,A),l.push(b),v===1&&S&&jc.set(b,!0),A===1&&b.setAttribute(n,"true"),S||b.setAttribute(r,"true")}catch(R){console.error("aria-hidden: cannot operate on ",b,R)}})};return p(t),u.clear(),vh++,function(){l.forEach(function(g){var b=Zi.get(g)-1,m=i.get(g)-1;Zi.set(g,b),i.set(g,m),b||(jc.has(g)||g.removeAttribute(r),jc.delete(g)),m||g.remo
2025-02-24 18:59:31 +08:00
If you want to hide the \ ` ${ t . titleName } \` , you can wrap it with our VisuallyHidden component.
2025-03-05 12:54:15 +08:00
For more information , see https : //radix-ui.com/primitives/docs/components/${t.docsSlug}`;return k.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},U7="DialogDescriptionWarning",j7=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${jP(U7).contentName}}.`;return k.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Bk=_P,GP=CP,Uk=OP,gf=DP,hf=IP,jk=MP,Gk=zP,Hk=BP,HP="AlertDialog",[G7,Qye]=mr(HP,[TP]),La=TP(),$P=e=>{const{__scopeAlertDialog:t,...n}=e,r=La(t);return w.jsx(Bk,{...r,...n,modal:!0})};$P.displayName=HP;var H7="AlertDialogTrigger",$7=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(GP,{...a,...r,ref:t})});$7.displayName=H7;var q7="AlertDialogPortal",qP=e=>{const{__scopeAlertDialog:t,...n}=e,r=La(t);return w.jsx(Uk,{...r,...n})};qP.displayName=q7;var V7="AlertDialogOverlay",VP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(gf,{...a,...r,ref:t})});VP.displayName=V7;var dl="AlertDialogContent",[W7,Y7]=G7(dl),WP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,i=La(n),l=k.useRef(null),u=ft(t,l),c=k.useRef(null);return w.jsx(P7,{contentName:dl,titleName:YP,docsSlug:"alert-dialog",children:w.jsx(W7,{scope:n,cancelRef:c,children:w.jsxs(hf,{role:"alertdialog",...i,...a,ref:u,onOpenAutoFocus:Ye(a.onOpenAutoFocus,f=>{var p;f.preventDefault(),(p=c.current)==null||p.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[w.jsx(Dk,{children:r}),w.jsx(X7,{contentRef:l})]})})})});WP.displayName=dl;var YP="AlertDialogTitle",KP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(jk,{...a,...r,ref:t})});KP.displayName=YP;var XP="AlertDialogDescription",ZP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(Gk,{...a,...r,ref:t})});ZP.displayName=XP;var K7="AlertDialogAction",QP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(Hk,{...a,...r,ref:t})});QP.displayName=K7;var JP="AlertDialogCancel",eB=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=Y7(JP,n),i=La(n),l=ft(t,a);return w.jsx(Hk,{...i,...r,ref:l})});eB.displayName=JP;var X7=({contentRef:e})=>{const t=`\`${dl}\` requires a description for the component to be accessible for screen reader users.
2025-02-24 18:59:31 +08:00
2025-03-05 12:54:15 +08:00
You can add a description to the \ ` ${ dl } \` by passing a \` ${ XP } \` component as a child, which also benefits sighted users by adding visible context to the dialog.
2025-02-24 18:59:31 +08:00
2025-03-05 12:54:15 +08:00
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 \` ${ dl } \` . 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.
2025-02-24 18:59:31 +08:00
2025-03-05 14:30:30 +08:00
For more information , see https : //radix-ui.com/primitives/docs/components/alert-dialog`;return k.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Z7=$P,Q7=qP,tB=VP,nB=WP,rB=QP,aB=eB,oB=KP,iB=ZP;const J7=["top","right","bottom","left"],yo=Math.min,Kn=Math.max,Id=Math.round,Hc=Math.floor,Kr=e=>({x:e,y:e}),eV={left:"right",right:"left",bottom:"top",top:"bottom"},tV={start:"end",end:"start"};function Tx(e,t,n){return Kn(e,yo(t,n))}function Da(e,t){return typeof e=="function"?e(t):e}function Ia(e){return e.split("-")[0]}function Rl(e){return e.split("-")[1]}function $k(e){return e==="x"?"y":"x"}function qk(e){return e==="y"?"height":"width"}function vo(e){return["top","bottom"].includes(Ia(e))?"y":"x"}function Vk(e){return $k(vo(e))}function nV(e,t,n){n===void 0&&(n=!1);const r=Rl(e),a=Vk(e),i=qk(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Ld(l)),[l,Ld(l)]}function rV(e){const t=Ld(e);return[_x(e),t,_x(t)]}function _x(e){return e.replace(/start|end/g,t=>tV[t])}function aV(e,t,n){const r=["left","right"],a=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:r:t?r:a;case"left":case"right":return t?i:l;default:return[]}}function oV(e,t,n,r){const a=Rl(e);let i=aV(Ia(e),n==="start",r);return a&&(i=i.map(l=>l+"-"+a),t&&(i=i.concat(i.map(_x)))),i}function Ld(e){return e.replace(/left|right|bottom|top/g,t=>eV[t])}function iV(e){return{top:0,right:0,bottom:0,left:0,...e}}function lB(e){return typeof e!="number"?iV(e):{top:e,right:e,bottom:e,left:e}}function Md(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function PR(e,t,n){let{reference:r,floating:a}=e;const i=vo(t),l=Vk(t),u=qk(l),c=Ia(t),f=i==="y",p=r.x+r.width/2-a.width/2,g=r.y+r.height/2-a.height/2,b=r[u]/2-a[u]/2;let m;switch(c){case"top":m={x:p,y:r.y-a.height};break;case"bottom":m={x:p,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:g};break;case"left":m={x:r.x-a.width,y:g};break;default:m={x:r.x,y:r.y}}switch(Rl(t)){case"start":m[l]-=b*(n&&f?-1:1);break;case"end":m[l]+=b*(n&&f?-1:1);break}return m}const lV=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:l}=n,u=i.filter(Boolean),c=await(l.isRTL==null?void 0:l.isRTL(t));let f=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:p,y:g}=PR(f,r,c),b=r,m={},S=0;for(let v=0;v<u.length;v++){const{name:A,fn:R}=u[v],{x,y:T,data:C,reset:N}=await R({x:p,y:g,initialPlacement:r,placement:b,strategy:a,middlewareData:m,rects:f,platform:l,elements:{reference:e,floating:t}});p=x??p,g=T??g,m={...m,[A]:{...m[A],...C}},N&&S<=50&&(S++,typeof N=="object"&&(N.placement&&(b=N.placement),N.rects&&(f=N.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:a}):N.rects),{x:p,y:g}=PR(f,b,c)),v=-1)}return{x:p,y:g,placement:b,strategy:a,middlewareData:m}};async function eu(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:l,elements:u,strategy:c}=e,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:g="floating",altBoundary:b=!1,padding:m=0}=Da(t,e),S=lB(m),A=u[b?g==="floating"?"reference":"floating":g],R=Md(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(A)))==null||n?A:A.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:f,rootBoundary:p,strategy:c})),x=g==="floating"?{x:r,y:a,width:l.floating.width,height:l.floating.height}:l.reference,T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),C=await(i.isElement==null?void 0:i.isElement(T))?await(i.getScale==null?void 0:i.getScale(T))||{x:1,y:1}:{x:1,y:1},N=Md(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:x,offsetParent:T,strategy:c}):x);return{top:(R.top-N.top+S.top)/C.y,bottom:(N.bottom-R.bottom+S.bottom)/C.y,left:(R.left-N.left+S.left)/C.x,right:(N.right
` );function $ c(e){return e.label!==void 0}var qW=3,VW="32px",WW="16px",VR=4e3,YW=356,KW=14,XW=20,ZW=200;function Ar(...e){return e.filter(Boolean).join(" ")}function QW(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var JW=e=>{var t,n,r,a,i,l,u,c,f,p,g;let{invert:b,toast:m,unstyled:S,interacting:v,setHeights:A,visibleToasts:R,heights:x,index:T,toasts:C,expanded:N,removeToast:_,defaultRichColors:O,closeButton:z,style:I,cancelButtonStyle:M,actionButtonStyle:H,className:q="",descriptionClassName:P="",duration:W,position:Z,gap:j,loadingIcon:G,expandByDefault:B,classNames:X,icons:D,closeButtonAriaLabel:V="Close toast",pauseWhenPageIsHidden:U}=e,[L,Y]=ye.useState(null),[Q,se]=ye.useState(null),[re,le]=ye.useState(!1),[Ae,ae]=ye.useState(!1),[we,xe]=ye.useState(!1),[Ie,Ce]=ye.useState(!1),[Ee,J]=ye.useState(!1),[fe,ke]=ye.useState(0),[me,ve]=ye.useState(0),ie=ye.useRef(m.duration||W||VR),ze=ye.useRef(null),Pe=ye.useRef(null),he=T===0,Ne=T+1<=R,ee=m.type,ce=m.dismissible!==!1,Re=m.className||"",Fe=m.descriptionClassName||"",qe=ye.useMemo(()=>x.findIndex(Ke=>Ke.toastId===m.id)||0,[x,m.id]),mt=ye.useMemo(()=>{var Ke;return(Ke=m.closeButton)!=null?Ke:z},[m.closeButton,z]),St=ye.useMemo(()=>m.duration||W||VR,[m.duration,W]),pt=ye.useRef(0),Je=ye.useRef(0),wt=ye.useRef(0),rt=ye.useRef(null),[bt,Bt]=Z.split("-"),sn=ye.useMemo(()=>x.reduce((Ke,gt,_t)=>_t>=qe?Ke:Ke+gt.height,0),[x,qe]),Mt=zW(),er=m.invert||b,zr=ee==="loading";Je.current=ye.useMemo(()=>qe*j+sn,[qe,sn]),ye.useEffect(()=>{ie.current=St},[St]),ye.useEffect(()=>{le(!0)},[]),ye.useEffect(()=>{let Ke=Pe.current;if(Ke){let gt=Ke.getBoundingClientRect().height;return ve(gt),A(_t=>[{toastId:m.id,height:gt,position:m.position},..._t]),()=>A(_t=>_t.filter(Rn=>Rn.toastId!==m.id))}},[A,m.id]),ye.useLayoutEffect(()=>{if(!re)return;let Ke=Pe.current,gt=Ke.style.height;Ke.style.height="auto";let _t=Ke.getBoundingClientRect().height;Ke.style.height=gt,ve(_t),A(Rn=>Rn.find(kn=>kn.toastId===m.id)?Rn.map(kn=>kn.toastId===m.id?{...kn,height:_t}:kn):[{toastId:m.id,height:_t,position:m.position},...Rn])},[re,m.title,m.description,A,m.id]);let Kt=ye.useCallback(()=>{ae(!0),ke(Je.current),A(Ke=>Ke.filter(gt=>gt.toastId!==m.id)),setTimeout(()=>{_(m)},ZW)},[m,_,A,Je]);ye.useEffect(()=>{if(m.promise&&ee==="loading"||m.duration===1/0||m.type==="loading")return;let Ke;return N||v||U&&Mt?(()=>{if(wt.current<pt.current){let gt=new Date().getTime()-pt.current;ie.current=ie.current-gt}wt.current=new Date().getTime()})():ie.current!==1/0&&(pt.current=new Date().getTime(),Ke=setTimeout(()=>{var gt;(gt=m.onAutoClose)==null||gt.call(m,m),Kt()},ie.current)),()=>clearTimeout(Ke)},[N,v,m,ee,U,Mt,Kt]),ye.useEffect(()=>{m.delete&&Kt()},[Kt,m.delete]);function na(){var Ke,gt,_t;return D!=null&&D.loading?ye.createElement("div",{className:Ar(X==null?void 0:X.loader,(Ke=m==null?void 0:m.classNames)==null?void 0:Ke.loader,"sonner-loader"),"data-visible":ee==="loading"},D.loading):G?ye.createElement("div",{className:Ar(X==null?void 0:X.loader,(gt=m==null?void 0:m.classNames)==null?void 0:gt.loader,"sonner-loader"),"data-visible":ee==="loading"},G):ye.createElement(OW,{className:Ar(X==null?void 0:X.loader,(_t=m==null?void 0:m.classNames)==null?void 0:_t.loader),visible:ee==="loading"})}return ye.createElement("li",{tabIndex:0,ref:Pe,className:Ar(q,Re,X==null?void 0:X.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,X==null?void 0:X.default,X==null?void 0:X[ee],(n=m==null?void 0:m.classNames)==null?void 0:n[ee]),"data-sonner-toast":"","data-rich-colors":(r=m.richColors)!=null?r:O,"data-styled":!(m.jsx||m.unstyled||S),"data-mounted":re,"data-promise":!!m.promise,"data-swiped":Ee,"data-removed":Ae,"data-visible":Ne,"data-y-position":bt,"data-x-position":Bt,"data-index":T,"data-front":he,"data-swiping":we,"data-dismissible":ce,"data-type":ee,"data-invert":er,"data-swipe-out":Ie,"data-swipe-direction":Q,"data-expanded":!!(N||B&&re),style:{"--index":T,"--toasts-before":T,"--z-index":C.length-T,"--offset": ` $ { Ae ? fe : Je . current } px ` ,"--initial-height":B?"auto": ` $ { me } px ` ,...I,...m.style},onDragEnd:()=>{
2025-03-05 12:54:15 +08:00
In order to be iterable , non - array objects must have a [ Symbol . iterator ] ( ) method . ` )}function Sl(e,t){return VK(e)||WK(e,t)||PU(e,t)||YK()}var Ah={black:"#000000",silver:"#C0C0C0",gray:"#808080",grey:"#808080",white:"#FFFFFF",maroon:"#800000",red:"#FF0000",purple:"#800080",fuchsia:"#FF00FF",green:"#008000",lime:"#00FF00",olive:"#808000",yellow:"#FFFF00",navy:"#000080",blue:"#0000FF",teal:"#008080",aqua:"#00FFFF",darkblue:"#00008B",mediumblue:"#0000CD",darkgreen:"#006400",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",springgreen:"#00FF7F",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",rebeccapurple:"#663399",mediumaquamarine:"#66CDAA",dimgray:"#696969",dimgrey:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",slategrey:"#708090",lightslategray:"#778899",lightslategrey:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370DB",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",palevioletred:"#DB7093",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",lightyellow:"#FFFFE0",ivory:"#FFFFF0"},BU=new Int8Array(4),yd=new Int32Array(BU.buffer,0,1),UU=new Float32Array(BU.buffer,0,1),KK=/^ \s *rgba? \s * \( /,XK=/^ \s *rgba? \s * \( \s *([0-9]*) \s *, \s *([0-9]*) \s *, \s *([0-9]*)(?: \s *, \s *(.*)?)? \) \s * $ /;function ZK(e){var t=0,n=0,r=0,a=1;if(e[0]==="#")e.length===4?(t=parseInt(e.charAt(1)+e.charAt(1),16),n=parseInt(e.charAt(2)+e.charAt(2),16),r=parseInt(e.charAt(3)+e.charAt(3),16)):(t=parseInt(e.charAt(1)+e.charAt(2),16),n=parseInt(e.charAt(3)+e.charAt(4),16),r=parseInt(e.charAt(5)+e.charAt(6),16)),e.length===9&&(a=parseInt(e.charAt(7)+e.charAt(8),16)/255);else if(KK.test(e)){var i=e.match(XK);i&&(t=+i[1],n=+i[2],r=+i[3],i[4]&&(a=+i[4]))}return{r:t,g:n,b:r,a}}var pl={};for(var Yc in Ah)pl[Yc]=Qr(Ah[Yc]),pl[Ah[Yc]]=pl[Yc];function jU(e,t,n,r,a){return yd[0]=r<<24|n<<16|t<<8|e,yd[0]=yd[0]&4278190079,UU[0]}function Qr(e){if(e=e.toLowerCase(),typeof pl[e]<"u")return pl[e];var t=ZK(e),n=t.r,r=t.g,a=t.b,i=t.a;i=i*255|0;var l=jU(n,r,a,i);return pl[e]=l,l}function QK(e,t){UU[0]=Qr(e);var n=yd[0],r=n&25
2025-02-24 18:59:31 +08:00
` .concat(l, `
2025-03-05 12:54:15 +08:00
` ).concat(n))}return a}function tX(e,t){return $ U("VERTEX",e,t)}function nX(e,t){return $ U("FRAGMENT",e,t)}function rX(e,t){var n=e.createProgram();if(n===null)throw new Error("loadProgram: error while creating the program.");var r,a;for(r=0,a=t.length;r<a;r++)e.attachShader(n,t[r]);e.linkProgram(n);var i=e.getProgramParameter(n,e.LINK_STATUS);if(!i)throw e.deleteProgram(n),new Error("loadProgram: error while linking the program.");return n}function nC(e){var t=e.gl,n=e.buffer,r=e.program,a=e.vertexShader,i=e.fragmentShader;t.deleteShader(a),t.deleteShader(i),t.deleteProgram(r),t.deleteBuffer(n)}function rC(e){return e%1===0?e.toFixed(1):e.toString()}var aC= ` # define PICKING _MODE
2025-03-05 14:30:30 +08:00
` ,aX=_e(_e(_e(_e(_e(_e(_e(_e({},WebGL2RenderingContext.BOOL,1),WebGL2RenderingContext.BYTE,1),WebGL2RenderingContext.UNSIGNED_BYTE,1),WebGL2RenderingContext.SHORT,2),WebGL2RenderingContext.UNSIGNED_SHORT,2),WebGL2RenderingContext.INT,4),WebGL2RenderingContext.UNSIGNED_INT,4),WebGL2RenderingContext.FLOAT,4),qU=function(){function e(t,n,r){on(this,e),_e(this,"array",new Float32Array),_e(this,"constantArray",new Float32Array),_e(this,"capacity",0),_e(this,"verticesCount",0);var a=this.getDefinition();if(this.VERTICES=a.VERTICES,this.VERTEX_SHADER_SOURCE=a.VERTEX_SHADER_SOURCE,this.FRAGMENT_SHADER_SOURCE=a.FRAGMENT_SHADER_SOURCE,this.UNIFORMS=a.UNIFORMS,this.ATTRIBUTES=a.ATTRIBUTES,this.METHOD=a.METHOD,this.CONSTANT_ATTRIBUTES="CONSTANT_ATTRIBUTES"in a?a.CONSTANT_ATTRIBUTES:[],this.CONSTANT_DATA="CONSTANT_DATA"in a?a.CONSTANT_DATA:[],this.isInstanced="CONSTANT_ATTRIBUTES"in a,this.ATTRIBUTES_ITEMS_COUNT=_h(this.ATTRIBUTES),this.STRIDE=this.VERTICES*this.ATTRIBUTES_ITEMS_COUNT,this.renderer=r,this.normalProgram=this.getProgramInfo("normal",t,a.VERTEX_SHADER_SOURCE,a.FRAGMENT_SHADER_SOURCE,null),this.pickProgram=n?this.getProgramInfo("pick",t,aC+a.VERTEX_SHADER_SOURCE,aC+a.FRAGMENT_SHADER_SOURCE,n):null,this.isInstanced){var i=_h(this.CONSTANT_ATTRIBUTES);if(this.CONSTANT_DATA.length!==this.VERTICES)throw new Error("Program: error while getting constant data (expected ".concat(this.VERTICES," items, received ").concat(this.CONSTANT_DATA.length," instead)"));this.constantArray=new Float32Array(this.CONSTANT_DATA.length*i);for(var l=0;l<this.CONSTANT_DATA.length;l++){var u=this.CONSTANT_DATA[l];if(u.length!==i)throw new Error("Program: error while getting constant data (one vector has ".concat(u.length," items instead of ").concat(i,")"));for(var c=0;c<u.length;c++)this.constantArray[l*i+c]=u[c]}this.STRIDE=this.ATTRIBUTES_ITEMS_COUNT}}return ln(e,[{key:"kill",value:function(){nC(this.normalProgram),this.pickProgram&&(nC(this.pickProgram),this.pickProgram=null)}},{key:"getProgramInfo",value:function(n,r,a,i,l){var u=this.getDefinition(),c=r.createBuffer();if(c===null)throw new Error("Program: error while creating the WebGL buffer.");var f=tX(r,a),p=nX(r,i),g=rX(r,[f,p]),b={};u.UNIFORMS.forEach(function(v){var A=r.getUniformLocation(g,v);A&&(b[v]=A)});var m={};u.ATTRIBUTES.forEach(function(v){m[v.name]=r.getAttribLocation(g,v.name)});var S;if("CONSTANT_ATTRIBUTES"in u&&(u.CONSTANT_ATTRIBUTES.forEach(function(v){m[v.name]=r.getAttribLocation(g,v.name)}),S=r.createBuffer(),S===null))throw new Error("Program: error while creating the WebGL constant buffer.");return{name:n,program:g,gl:r,frameBuffer:l,buffer:c,constantBuffer:S||{},uniformLocations:b,attributeLocations:m,isPicking:n==="pick",vertexShader:f,fragmentShader:p}}},{key:"bindProgram",value:function(n){var r=this,a=0,i=n.gl,l=n.buffer;this.isInstanced?(i.bindBuffer(i.ARRAY_BUFFER,n.constantBuffer),a=0,this.CONSTANT_ATTRIBUTES.forEach(function(u){return a+=r.bindAttribute(u,n,a,!1)}),i.bufferData(i.ARRAY_BUFFER,this.constantArray,i.STATIC_DRAW),i.bindBuffer(i.ARRAY_BUFFER,n.buffer),a=0,this.ATTRIBUTES.forEach(function(u){return a+=r.bindAttribute(u,n,a,!0)}),i.bufferData(i.ARRAY_BUFFER,this.array,i.DYNAMIC_DRAW)):(i.bindBuffer(i.ARRAY_BUFFER,l),a=0,this.ATTRIBUTES.forEach(function(u){return a+=r.bindAttribute(u,n,a)}),i.bufferData(i.ARRAY_BUFFER,this.array,i.DYNAMIC_DRAW)),i.bindBuffer(i.ARRAY_BUFFER,null)}},{key:"unbindProgram",value:function(n){var r=this;this.isInstanced?(this.CONSTANT_ATTRIBUTES.forEach(function(a){return r.unbindAttribute(a,n,!1)}),this.ATTRIBUTES.forEach(function(a){return r.unbindAttribute(a,n,!0)})):this.ATTRIBUTES.forEach(function(a){return r.unbindAttribute(a,n)})}},{key:"bindAttribute",value:function(n,r,a,i){var l=aX[n.type];if(typeof l!="number")throw new Error('Program.bind: yet unsupported attribute type "'.concat(n.type,'"'));var u=r.attributeLocations[n.name],c=r.gl;if(u!==-1){c.enableVertexAttribArray(u);var f=this.isInstanced?(i?this.ATTRIBUTES_ITEMS_COUNT:_h(this.CONSTANT_ATTRIBUTES))*Float32Array.BYTES_PER_ELEMENT:this.ATTRIBUTES_ITEMS_C
2025-02-24 18:59:31 +08:00
precision highp float ;
varying vec4 v _color ;
varying vec2 v _diffVector ;
varying float v _radius ;
uniform float u _correctionRatio ;
const vec4 transparent = vec4 ( 0.0 , 0.0 , 0.0 , 0.0 ) ;
void main ( void ) {
float border = u _correctionRatio * 2.0 ;
float dist = length ( v _diffVector ) - v _radius + border ;
// No antialiasing for picking mode:
# ifdef PICKING _MODE
if ( dist > border )
gl _FragColor = transparent ;
else
gl _FragColor = v _color ;
# else
float t = 0.0 ;
if ( dist > border )
t = 1.0 ;
else if ( dist > 0.0 )
t = dist / border ;
gl _FragColor = mix ( v _color , transparent , t ) ;
# endif
}
2025-02-25 18:36:34 +08:00
` ,sX=lX,uX= `
2025-02-24 18:59:31 +08:00
attribute vec4 a _id ;
attribute vec4 a _color ;
attribute vec2 a _position ;
attribute float a _size ;
attribute float a _angle ;
uniform mat3 u _matrix ;
uniform float u _sizeRatio ;
uniform float u _correctionRatio ;
varying vec4 v _color ;
varying vec2 v _diffVector ;
varying float v _radius ;
varying float v _border ;
const float bias = 255.0 / 254.0 ;
void main ( ) {
float size = a _size * u _correctionRatio / u _sizeRatio * 4.0 ;
vec2 diffVector = size * vec2 ( cos ( a _angle ) , sin ( a _angle ) ) ;
vec2 position = a _position + diffVector ;
gl _Position = vec4 (
( u _matrix * vec3 ( position , 1 ) ) . xy ,
0 ,
1
) ;
v _diffVector = diffVector ;
v _radius = size / 2.0 ;
# ifdef PICKING _MODE
// For picking mode, we use the ID as the color:
v _color = a _id ;
# else
// For normal mode, we use the color:
v _color = a _color ;
# endif
v _color . a *= bias ;
}
2025-03-05 12:54:15 +08:00
` ,cX=uX,YU=WebGLRenderingContext,oC=YU.UNSIGNED_BYTE,Rh=YU.FLOAT,dX=["u_sizeRatio","u_correctionRatio","u_matrix"],Su=function(e){function t(){return on(this,t),Bn(this,t,arguments)}return Un(t,e),ln(t,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:cX,FRAGMENT_SHADER_SOURCE:sX,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:dX,ATTRIBUTES:[{name:"a_position",size:2,type:Rh},{name:"a_size",size:1,type:Rh},{name:"a_color",size:4,type:oC,normalized:!0},{name:"a_id",size:4,type:oC,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:Rh}],CONSTANT_DATA:[[t.ANGLE_1],[t.ANGLE_2],[t.ANGLE_3]]}}},{key:"processVisibleItem",value:function(r,a,i){var l=this.array,u=Qr(i.color);l[a++]=i.x,l[a++]=i.y,l[a++]=i.size,l[a++]=u,l[a++]=r}},{key:"setUniforms",value:function(r,a){var i=a.gl,l=a.uniformLocations,u=l.u_sizeRatio,c=l.u_correctionRatio,f=l.u_matrix;i.uniform1f(c,r.correctionRatio),i.uniform1f(u,r.sizeRatio),i.uniformMatrix3fv(f,!1,r.matrix)}}])}(g0);_e(Su,"ANGLE_1",0);_e(Su,"ANGLE_2",2*Math.PI/3);_e(Su,"ANGLE_3",4*Math.PI/3);var fX= `
2025-02-24 18:59:31 +08:00
precision mediump float ;
varying vec4 v _color ;
void main ( void ) {
gl _FragColor = v _color ;
}
2025-02-25 18:36:34 +08:00
` ,pX=fX,gX= `
2025-02-24 18:59:31 +08:00
attribute vec2 a _position ;
attribute vec2 a _normal ;
attribute float a _radius ;
attribute vec3 a _barycentric ;
# ifdef PICKING _MODE
attribute vec4 a _id ;
# else
attribute vec4 a _color ;
# endif
uniform mat3 u _matrix ;
uniform float u _sizeRatio ;
uniform float u _correctionRatio ;
uniform float u _minEdgeThickness ;
uniform float u _lengthToThicknessRatio ;
uniform float u _widenessToThicknessRatio ;
varying vec4 v _color ;
const float bias = 255.0 / 254.0 ;
void main ( ) {
float minThickness = u _minEdgeThickness ;
float normalLength = length ( a _normal ) ;
vec2 unitNormal = a _normal / normalLength ;
// These first computations are taken from edge.vert.glsl and
// edge.clamped.vert.glsl. Please read it to get better comments on what's
// happening:
float pixelsThickness = max ( normalLength / u _sizeRatio , minThickness ) ;
float webGLThickness = pixelsThickness * u _correctionRatio ;
float webGLNodeRadius = a _radius * 2.0 * u _correctionRatio / u _sizeRatio ;
float webGLArrowHeadLength = webGLThickness * u _lengthToThicknessRatio * 2.0 ;
float webGLArrowHeadThickness = webGLThickness * u _widenessToThicknessRatio ;
float da = a _barycentric . x ;
float db = a _barycentric . y ;
float dc = a _barycentric . z ;
vec2 delta = vec2 (
da * ( webGLNodeRadius * unitNormal . y )
+ db * ( ( webGLNodeRadius + webGLArrowHeadLength ) * unitNormal . y + webGLArrowHeadThickness * unitNormal . x )
+ dc * ( ( webGLNodeRadius + webGLArrowHeadLength ) * unitNormal . y - webGLArrowHeadThickness * unitNormal . x ) ,
da * ( - webGLNodeRadius * unitNormal . x )
+ db * ( - ( webGLNodeRadius + webGLArrowHeadLength ) * unitNormal . x + webGLArrowHeadThickness * unitNormal . y )
+ dc * ( - ( webGLNodeRadius + webGLArrowHeadLength ) * unitNormal . x - webGLArrowHeadThickness * unitNormal . y )
) ;
vec2 position = ( u _matrix * vec3 ( a _position + delta , 1 ) ) . xy ;
gl _Position = vec4 ( position , 0 , 1 ) ;
# ifdef PICKING _MODE
// For picking mode, we use the ID as the color:
v _color = a _id ;
# else
// For normal mode, we use the color:
v _color = a _color ;
# endif
v _color . a *= bias ;
}
2025-03-05 14:30:30 +08:00
` ,hX=gX,KU=WebGLRenderingContext,iC=KU.UNSIGNED_BYTE,Kc=KU.FLOAT,mX=["u_matrix","u_sizeRatio","u_correctionRatio","u_minEdgeThickness","u_lengthToThicknessRatio","u_widenessToThicknessRatio"],Eu={extremity:"target",lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};function Pd(e){var t=Be(Be({},Eu),e||{});return function(n){function r(){return on(this,r),Bn(this,r,arguments)}return Un(r,n),ln(r,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:hX,FRAGMENT_SHADER_SOURCE:pX,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:mX,ATTRIBUTES:[{name:"a_position",size:2,type:Kc},{name:"a_normal",size:2,type:Kc},{name:"a_radius",size:1,type:Kc},{name:"a_color",size:4,type:iC,normalized:!0},{name:"a_id",size:4,type:iC,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_barycentric",size:3,type:Kc}],CONSTANT_DATA:[[1,0,0],[0,1,0],[0,0,1]]}}},{key:"processVisibleItem",value:function(i,l,u,c,f){if(t.extremity==="source"){var p=[c,u];u=p[0],c=p[1]}var g=f.size||1,b=c.size||1,m=u.x,S=u.y,v=c.x,A=c.y,R=Qr(f.color),x=v-m,T=A-S,C=x*x+T*T,N=0,_=0;C&&(C=1/Math.sqrt(C),N=-T*C*g,_=x*C*g);var O=this.array;O[l++]=v,O[l++]=A,O[l++]=-N,O[l++]=-_,O[l++]=b,O[l++]=R,O[l++]=i}},{key:"setUniforms",value:function(i,l){var u=l.gl,c=l.uniformLocations,f=c.u_matrix,p=c.u_sizeRatio,g=c.u_correctionRatio,b=c.u_minEdgeThickness,m=c.u_lengthToThicknessRatio,S=c.u_widenessToThicknessRatio;u.uniformMatrix3fv(f,!1,i.matrix),u.uniform1f(p,i.sizeRatio),u.uniform1f(g,i.correctionRatio),u.uniform1f(b,i.minEdgeThickness),u.uniform1f(m,t.lengthToThicknessRatio),u.uniform1f(S,t.widenessToThicknessRatio)}}])}(vu)}Pd();var bX= `
2025-02-24 18:59:31 +08:00
precision mediump float ;
varying vec4 v _color ;
varying vec2 v _normal ;
varying float v _thickness ;
varying float v _feather ;
const vec4 transparent = vec4 ( 0.0 , 0.0 , 0.0 , 0.0 ) ;
void main ( void ) {
// We only handle antialiasing for normal mode:
# ifdef PICKING _MODE
gl _FragColor = v _color ;
# else
float dist = length ( v _normal ) * v _thickness ;
float t = smoothstep (
v _thickness - v _feather ,
v _thickness ,
dist
) ;
gl _FragColor = mix ( v _color , transparent , t ) ;
# endif
}
2025-03-05 12:54:15 +08:00
` ,h0=bX,yX= `
2025-02-24 18:59:31 +08:00
attribute vec4 a _id ;
attribute vec4 a _color ;
attribute vec2 a _normal ;
attribute float a _normalCoef ;
attribute vec2 a _positionStart ;
attribute vec2 a _positionEnd ;
attribute float a _positionCoef ;
attribute float a _radius ;
attribute float a _radiusCoef ;
uniform mat3 u _matrix ;
uniform float u _zoomRatio ;
uniform float u _sizeRatio ;
uniform float u _pixelRatio ;
uniform float u _correctionRatio ;
uniform float u _minEdgeThickness ;
uniform float u _lengthToThicknessRatio ;
uniform float u _feather ;
varying vec4 v _color ;
varying vec2 v _normal ;
varying float v _thickness ;
varying float v _feather ;
const float bias = 255.0 / 254.0 ;
void main ( ) {
float minThickness = u _minEdgeThickness ;
float radius = a _radius * a _radiusCoef ;
vec2 normal = a _normal * a _normalCoef ;
vec2 position = a _positionStart * ( 1.0 - a _positionCoef ) + a _positionEnd * a _positionCoef ;
float normalLength = length ( normal ) ;
vec2 unitNormal = normal / normalLength ;
// These first computations are taken from edge.vert.glsl. Please read it to
// get better comments on what's happening:
float pixelsThickness = max ( normalLength , minThickness * u _sizeRatio ) ;
float webGLThickness = pixelsThickness * u _correctionRatio / u _sizeRatio ;
// Here, we move the point to leave space for the arrow head:
float direction = sign ( radius ) ;
float webGLNodeRadius = direction * radius * 2.0 * u _correctionRatio / u _sizeRatio ;
float webGLArrowHeadLength = webGLThickness * u _lengthToThicknessRatio * 2.0 ;
vec2 compensationVector = vec2 ( - direction * unitNormal . y , direction * unitNormal . x ) * ( webGLNodeRadius + webGLArrowHeadLength ) ;
// Here is the proper position of the vertex
gl _Position = vec4 ( ( u _matrix * vec3 ( position + unitNormal * webGLThickness + compensationVector , 1 ) ) . xy , 0 , 1 ) ;
v _thickness = webGLThickness / u _zoomRatio ;
v _normal = unitNormal ;
v _feather = u _feather * u _correctionRatio / u _zoomRatio / u _pixelRatio * 2.0 ;
# ifdef PICKING _MODE
// For picking mode, we use the ID as the color:
v _color = a _id ;
# else
// For normal mode, we use the color:
v _color = a _color ;
# endif
v _color . a *= bias ;
}
2025-03-05 14:30:30 +08:00
` ,vX=yX,XU=WebGLRenderingContext,lC=XU.UNSIGNED_BYTE,Ko=XU.FLOAT,SX=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],EX={lengthToThicknessRatio:Eu.lengthToThicknessRatio};function ZU(e){var t=Be(Be({},EX),{});return function(n){function r(){return on(this,r),Bn(this,r,arguments)}return Un(r,n),ln(r,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:vX,FRAGMENT_SHADER_SOURCE:h0,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:SX,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Ko},{name:"a_positionEnd",size:2,type:Ko},{name:"a_normal",size:2,type:Ko},{name:"a_color",size:4,type:lC,normalized:!0},{name:"a_id",size:4,type:lC,normalized:!0},{name:"a_radius",size:1,type:Ko}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Ko},{name:"a_normalCoef",size:1,type:Ko},{name:"a_radiusCoef",size:1,type:Ko}],CONSTANT_DATA:[[0,1,0],[0,-1,0],[1,1,1],[1,1,1],[0,-1,0],[1,-1,-1]]}}},{key:"processVisibleItem",value:function(i,l,u,c,f){var p=f.size||1,g=u.x,b=u.y,m=c.x,S=c.y,v=Qr(f.color),A=m-g,R=S-b,x=c.size||1,T=A*A+R*R,C=0,N=0;T&&(T=1/Math.sqrt(T),C=-R*T*p,N=A*T*p);var _=this.array;_[l++]=g,_[l++]=b,_[l++]=m,_[l++]=S,_[l++]=C,_[l++]=N,_[l++]=v,_[l++]=i,_[l++]=x}},{key:"setUniforms",value:function(i,l){var u=l.gl,c=l.uniformLocations,f=c.u_matrix,p=c.u_zoomRatio,g=c.u_feather,b=c.u_pixelRatio,m=c.u_correctionRatio,S=c.u_sizeRatio,v=c.u_minEdgeThickness,A=c.u_lengthToThicknessRatio;u.uniformMatrix3fv(f,!1,i.matrix),u.uniform1f(p,i.zoomRatio),u.uniform1f(S,i.sizeRatio),u.uniform1f(m,i.correctionRatio),u.uniform1f(b,i.pixelRatio),u.uniform1f(g,i.antiAliasingFeather),u.uniform1f(v,i.minEdgeThickness),u.uniform1f(A,t.lengthToThicknessRatio)}}])}(vu)}ZU();function wX(e){return VU([ZU(),Pd(e)])}var xX=wX(),QU=xX,kX= `
2025-02-24 18:59:31 +08:00
attribute vec4 a _id ;
attribute vec4 a _color ;
attribute vec2 a _normal ;
attribute float a _normalCoef ;
attribute vec2 a _positionStart ;
attribute vec2 a _positionEnd ;
attribute float a _positionCoef ;
uniform mat3 u _matrix ;
uniform float u _sizeRatio ;
uniform float u _zoomRatio ;
uniform float u _pixelRatio ;
uniform float u _correctionRatio ;
uniform float u _minEdgeThickness ;
uniform float u _feather ;
varying vec4 v _color ;
varying vec2 v _normal ;
varying float v _thickness ;
varying float v _feather ;
const float bias = 255.0 / 254.0 ;
void main ( ) {
float minThickness = u _minEdgeThickness ;
vec2 normal = a _normal * a _normalCoef ;
vec2 position = a _positionStart * ( 1.0 - a _positionCoef ) + a _positionEnd * a _positionCoef ;
float normalLength = length ( normal ) ;
vec2 unitNormal = normal / normalLength ;
// We require edges to be at least "minThickness" pixels thick *on screen*
// (so we need to compensate the size ratio):
float pixelsThickness = max ( normalLength , minThickness * u _sizeRatio ) ;
// Then, we need to retrieve the normalized thickness of the edge in the WebGL
// referential (in a ([0, 1], [0, 1]) space), using our "magic" correction
// ratio:
float webGLThickness = pixelsThickness * u _correctionRatio / u _sizeRatio ;
// Here is the proper position of the vertex
gl _Position = vec4 ( ( u _matrix * vec3 ( position + unitNormal * webGLThickness , 1 ) ) . xy , 0 , 1 ) ;
// For the fragment shader though, we need a thickness that takes the "magic"
// correction ratio into account (as in webGLThickness), but so that the
// antialiasing effect does not depend on the zoom level. So here's yet
// another thickness version:
v _thickness = webGLThickness / u _zoomRatio ;
v _normal = unitNormal ;
v _feather = u _feather * u _correctionRatio / u _zoomRatio / u _pixelRatio * 2.0 ;
# ifdef PICKING _MODE
// For picking mode, we use the ID as the color:
v _color = a _id ;
# else
// For normal mode, we use the color:
v _color = a _color ;
# endif
v _color . a *= bias ;
}
2025-03-05 14:30:30 +08:00
` ,AX=kX,JU=WebGLRenderingContext,sC=JU.UNSIGNED_BYTE,Ps=JU.FLOAT,TX=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],_X=function(e){function t(){return on(this,t),Bn(this,t,arguments)}return Un(t,e),ln(t,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:AX,FRAGMENT_SHADER_SOURCE:h0,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:TX,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Ps},{name:"a_positionEnd",size:2,type:Ps},{name:"a_normal",size:2,type:Ps},{name:"a_color",size:4,type:sC,normalized:!0},{name:"a_id",size:4,type:sC,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Ps},{name:"a_normalCoef",size:1,type:Ps}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[1,1],[0,-1],[1,-1]]}}},{key:"processVisibleItem",value:function(r,a,i,l,u){var c=u.size||1,f=i.x,p=i.y,g=l.x,b=l.y,m=Qr(u.color),S=g-f,v=b-p,A=S*S+v*v,R=0,x=0;A&&(A=1/Math.sqrt(A),R=-v*A*c,x=S*A*c);var T=this.array;T[a++]=f,T[a++]=p,T[a++]=g,T[a++]=b,T[a++]=R,T[a++]=x,T[a++]=m,T[a++]=r}},{key:"setUniforms",value:function(r,a){var i=a.gl,l=a.uniformLocations,u=l.u_matrix,c=l.u_zoomRatio,f=l.u_feather,p=l.u_pixelRatio,g=l.u_correctionRatio,b=l.u_sizeRatio,m=l.u_minEdgeThickness;i.uniformMatrix3fv(u,!1,r.matrix),i.uniform1f(c,r.zoomRatio),i.uniform1f(b,r.sizeRatio),i.uniform1f(g,r.correctionRatio),i.uniform1f(p,r.pixelRatio),i.uniform1f(f,r.antiAliasingFeather),i.uniform1f(m,r.minEdgeThickness)}}])}(vu),m0=function(e){function t(){var n;return on(this,t),n=Bn(this,t),n.rawEmitter=n,n}return Un(t,e),ln(t)}(xU.EventEmitter),Ch,uC;function Jr(){return uC||(uC=1,Ch=function(t){return t!==null&&typeof t=="object"&&typeof t.addUndirectedEdgeWithKey=="function"&&typeof t.dropNode=="function"&&typeof t.multi=="boolean"}),Ch}var RX=Jr();const CX=an(RX);var NX=function(t){return t},OX=function(t){return t*t},DX=function(t){return t*(2-t)},IX=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},LX=function(t){return t*t*t},MX=function(t){return--t*t*t+1},FX=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},e3={linear:NX,quadraticIn:OX,quadraticOut:DX,quadraticInOut:IX,cubicIn:LX,cubicOut:MX,cubicInOut:FX},t3={easing:"quadraticInOut",duration:150};function zX(e,t,n,r){var a=Object.assign({},t3,n),i=typeof a.easing=="function"?a.easing:e3[a.easing],l=Date.now(),u={};for(var c in t){var f=t[c];u[c]={};for(var p in f)u[c][p]=e.getNodeAttribute(c,p)}var g=null,b=function(){g=null;var S=(Date.now()-l)/a.duration;if(S>=1){for(var v in t){var A=t[v];for(var R in A)e.setNodeAttribute(v,R,A[R])}return}S=i(S);for(var x in t){var T=t[x],C=u[x];for(var N in T)e.setNodeAttribute(x,N,T[N]*S+C[N]*(1-S))}g=requestAnimationFrame(b)};return b(),function(){g&&cancelAnimationFrame(g)}}function _r(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function Xc(e,t,n){return e[0]=t,e[4]=typeof n=="number"?n:t,e}function cC(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[3]=-n,e[4]=r,e}function dC(e,t,n){return e[6]=t,e[7]=n,e}function io(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],l=e[4],u=e[5],c=e[6],f=e[7],p=e[8],g=t[0],b=t[1],m=t[2],S=t[3],v=t[4],A=t[5],R=t[6],x=t[7],T=t[8];return e[0]=g*n+b*i+m*c,e[1]=g*r+b*l+m*f,e[2]=g*a+b*u+m*p,e[3]=S*n+v*i+A*c,e[4]=S*r+v*l+A*f,e[5]=S*a+v*u+A*p,e[6]=R*n+x*i+T*c,e[7]=R*r+x*l+T*f,e[8]=R*a+x*u+T*p,e}function Fx(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=e[0],a=e[1],i=e[3],l=e[4],u=e[6],c=e[7],f=t.x,p=t.y;return{x:f*r+p*i+u*n,y:f*a+p*l+c*n}}function PX(e,t){var n=e.height/e.width,r=t.height/t.width;return n<1&&r>1||n>1&&r<1?1:Math.min(Math.max(r,1/r),Math.max(1/n,n))}function Bs(e,t,n,r,a){var i=e.angle,l=e.ratio,u=e.x,c=e.y,f=t.width,p=t.height,g=_r(),b=Math.min(f,p)-2*r,m=PX(t,n);return a?(io(g,dC(_r(),u,c)),io(g,Xc(_r(),l)),io(g,cC(_r(),i)),io(g,Xc(_r(),f/b/2/m,p/b/2/m))):(io(g,Xc(_r(),2*(b/f)*m,2*(b/p)*m)),io(g,cC(_r(),-i)),io(g,Xc(_r(),1/l)),io(g,dC(_r(),-u,-c))),g}function BX(e,t,n){var r=Fx(e,{x:Math.cos(t.angle),y:Math.sin(t.angle)},0),a=r.x,i=r.y;return 1/Math.sqrt(Math.pow(a,2)+Math.pow(i,2))/n.width}function UX(e){if(!e.order)re
In order to be iterable , non - array objects must have a [ Symbol . iterator ] ( ) method . ` )}function bC(e){return eZ(e)||tZ(e)||PU(e)||nZ()}function rZ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function Dh(e,t){if(e==null)return{};var n,r,a=rZ(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var yC=function(){function e(t,n){on(this,e),this.key=t,this.size=n}return ln(e,null,[{key:"compare",value:function(n,r){return n.size>r.size?-1:n.size<r.size||n.key>r.key?1:-1}}])}(),vC=function(){function e(){on(this,e),_e(this,"width",0),_e(this,"height",0),_e(this,"cellSize",0),_e(this,"columns",0),_e(this,"rows",0),_e(this,"cells",{})}return ln(e,[{key:"resizeAndClear",value:function(n,r){this.width=n.width,this.height=n.height,this.cellSize=r,this.columns=Math.ceil(n.width/r),this.rows=Math.ceil(n.height/r),this.cells={}}},{key:"getIndex",value:function(n){var r=Math.floor(n.x/this.cellSize),a=Math.floor(n.y/this.cellSize);return a*this.columns+r}},{key:"add",value:function(n,r,a){var i=new yC(n,r),l=this.getIndex(a),u=this.cells[l];u||(u=[],this.cells[l]=u),u.push(i)}},{key:"organize",value:function(){for(var n in this.cells){var r=this.cells[n];r.sort(yC.compare)}}},{key:"getLabelsToDisplay",value:function(n,r){var a=this.cellSize*this.cellSize,i=a/n/n,l=i*r/a,u=Math.ceil(l),c=[];for(var f in this.cells)for(var p=this.cells[f],g=0;g<Math.min(u,p.length);g++)c.push(p[g].key);return c}}])}();function aZ(e){var t=e.graph,n=e.hoveredNode,r=e.highlightedNodes,a=e.displayedNodeLabels,i=[];return t.forEachEdge(function(l,u,c,f){(c===n||f===n||r.has(c)||r.has(f)||a.has(c)&&a.has(f))&&i.push(l)}),i}var oZ=150,iZ=50,Ca=Object.prototype.hasOwnProperty;function lZ(e,t,n){if(!Ca.call(n,"x")||!Ca.call(n,"y"))throw new Error('Sigma: could not find a valid position (x, y) for node "'.concat(t,'". All your nodes must have a number "x" and "y". Maybe your forgot to apply a layout or your "nodeReducer" is not returning the correct data?'));return n.color||(n.color=e.defaultNodeColor),!n.label&&n.label!==""&&(n.label=null),n.label!==void 0&&n.label!==null?n.label=""+n.label:n.label=null,n.size||(n.size=2),Ca.call(n,"hidden")||(n.hidden=!1),Ca.call(n,"highlighted")||(n.highlighted=!1),Ca.call(n,"forceLabel")||(n.forceLabel=!1),(!n.type||n.type==="")&&(n.type=e.defaultNodeType),n.zIndex||(n.zIndex=0),n}function sZ(e,t,n){return n.color||(n.color=e.defaultEdgeColor),n.label||(n.label=""),n.size||(n.size=.5),Ca.call(n,"hidden")||(n.hidden=!1),Ca.call(n,"forceLabel")||(n.forceLabel=!1),(!n.type||n.type==="")&&(n.type=e.defaultEdgeType),n.zIndex||(n.zIndex=0),n}var uZ=function(e){function t(n,r){var a,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(on(this,t),a=Bn(this,t),_e(a,"elements",{}),_e(a,"canvasContexts",{}),_e(a,"webGLContexts",{}),_e(a,"pickingLayers",new Set),_e(a,"textures",{}),_e(a,"frameBuffers",{}),_e(a,"activeListeners",{}),_e(a,"labelGrid",new vC),_e(a,"nodeDataCache",{}),_e(a,"edgeDataCache",{}),_e(a,"nodeProgramIndex",{}),_e(a,"edgeProgramIndex",{}),_e(a,"nodesWithForcedLabels",new Set),_e(a,"edgesWithForcedLabels",new Set),_e(a,"nodeExtent",{x:[0,1],y:[0,1]}),_e(a,"nodeZExtent",[1/0,-1/0]),_e(a,"edgeZExtent",[1/0,-1/0]),_e(a,"matrix",_r()),_e(a,"invMatrix",_r()),_e(a,"correctionRatio",1),_e(a,"customBBox",null),_e(a,"normalizationFunction",gC({x:[0,1],y:[0,1]})),_e(a,"graphToViewportRatio",1),_e(a,"itemIDsIndex",{}),_e(a,"nodeIndices",{}),_e(a,"edgeIndices",{}),_e(a,"width",0),_e(a,"height",0),_e(a,"pixelRatio",fC()),_e(a,"pickingDownSizingRatio",2*a.pixelRatio),_e(a,"displayedNodeLabels",new Set),_e(a,"displayedEdgeLabels",new Set),_e(a,"highlightedNodes",new Set),_e(a,"hoveredNode",null),_e(a,"hoveredEdge",null),_e(a,"renderFrame",null),_e(a,"renderHighlightedNodesFrame",null),_e(a,"needToProcess",!1),_e(a,"checkEdgesEventsFrame",null),_e(a,"nodePrograms",{}),_e(a,"nodeHoverPrograms",{}),_e(a,"edgePrograms",{}),
2025-02-24 18:59:31 +08:00
precision mediump float ;
varying vec4 v _color ;
varying float v _border ;
const float radius = 0.5 ;
const vec4 transparent = vec4 ( 0.0 , 0.0 , 0.0 , 0.0 ) ;
void main ( void ) {
vec2 m = gl _PointCoord - vec2 ( 0.5 , 0.5 ) ;
float dist = radius - length ( m ) ;
// No antialiasing for picking mode:
# ifdef PICKING _MODE
if ( dist > v _border )
gl _FragColor = v _color ;
else
gl _FragColor = transparent ;
# else
float t = 0.0 ;
if ( dist > v _border )
t = 1.0 ;
else if ( dist > 0.0 )
t = dist / v _border ;
gl _FragColor = mix ( transparent , v _color , t ) ;
# endif
}
2025-02-25 18:36:34 +08:00
` ,hZ=gZ,mZ= `
2025-02-24 18:59:31 +08:00
attribute vec4 a _id ;
attribute vec4 a _color ;
attribute vec2 a _position ;
attribute float a _size ;
uniform float u _sizeRatio ;
uniform float u _pixelRatio ;
uniform mat3 u _matrix ;
varying vec4 v _color ;
varying float v _border ;
const float bias = 255.0 / 254.0 ;
void main ( ) {
gl _Position = vec4 (
( u _matrix * vec3 ( a _position , 1 ) ) . xy ,
0 ,
1
) ;
// Multiply the point size twice:
// - x SCALING_RATIO to correct the canvas scaling
// - x 2 to correct the formulae
gl _PointSize = a _size / u _sizeRatio * u _pixelRatio * 2.0 ;
v _border = ( 0.5 / a _size ) * u _sizeRatio ;
# ifdef PICKING _MODE
// For picking mode, we use the ID as the color:
v _color = a _id ;
# else
// For normal mode, we use the color:
v _color = a _color ;
# endif
v _color . a *= bias ;
}
2025-03-05 12:54:15 +08:00
` ,bZ=mZ,s3=WebGLRenderingContext,kC=s3.UNSIGNED_BYTE,AC=s3.FLOAT,yZ=["u_sizeRatio","u_pixelRatio","u_matrix"],vZ=function(e){function t(){return on(this,t),Bn(this,t,arguments)}return Un(t,e),ln(t,[{key:"getDefinition",value:function(){return{VERTICES:1,VERTEX_SHADER_SOURCE:bZ,FRAGMENT_SHADER_SOURCE:hZ,METHOD:WebGLRenderingContext.POINTS,UNIFORMS:yZ,ATTRIBUTES:[{name:"a_position",size:2,type:AC},{name:"a_size",size:1,type:AC},{name:"a_color",size:4,type:kC,normalized:!0},{name:"a_id",size:4,type:kC,normalized:!0}]}}},{key:"processVisibleItem",value:function(r,a,i){var l=this.array;l[a++]=i.x,l[a++]=i.y,l[a++]=i.size,l[a++]=Qr(i.color),l[a++]=r}},{key:"setUniforms",value:function(r,a){var i=r.sizeRatio,l=r.pixelRatio,u=r.matrix,c=a.gl,f=a.uniformLocations,p=f.u_sizeRatio,g=f.u_pixelRatio,b=f.u_matrix;c.uniform1f(g,l),c.uniform1f(p,i),c.uniformMatrix3fv(b,!1,u)}}])}(g0),SZ= `
2025-02-24 18:59:31 +08:00
attribute vec4 a _id ;
attribute vec4 a _color ;
attribute vec2 a _normal ;
attribute float a _normalCoef ;
attribute vec2 a _positionStart ;
attribute vec2 a _positionEnd ;
attribute float a _positionCoef ;
attribute float a _sourceRadius ;
attribute float a _targetRadius ;
attribute float a _sourceRadiusCoef ;
attribute float a _targetRadiusCoef ;
uniform mat3 u _matrix ;
uniform float u _zoomRatio ;
uniform float u _sizeRatio ;
uniform float u _pixelRatio ;
uniform float u _correctionRatio ;
uniform float u _minEdgeThickness ;
uniform float u _lengthToThicknessRatio ;
uniform float u _feather ;
varying vec4 v _color ;
varying vec2 v _normal ;
varying float v _thickness ;
varying float v _feather ;
const float bias = 255.0 / 254.0 ;
void main ( ) {
float minThickness = u _minEdgeThickness ;
vec2 normal = a _normal * a _normalCoef ;
vec2 position = a _positionStart * ( 1.0 - a _positionCoef ) + a _positionEnd * a _positionCoef ;
float normalLength = length ( normal ) ;
vec2 unitNormal = normal / normalLength ;
// These first computations are taken from edge.vert.glsl. Please read it to
// get better comments on what's happening:
float pixelsThickness = max ( normalLength , minThickness * u _sizeRatio ) ;
float webGLThickness = pixelsThickness * u _correctionRatio / u _sizeRatio ;
// Here, we move the point to leave space for the arrow heads:
// Source arrow head
float sourceRadius = a _sourceRadius * a _sourceRadiusCoef ;
float sourceDirection = sign ( sourceRadius ) ;
float webGLSourceRadius = sourceDirection * sourceRadius * 2.0 * u _correctionRatio / u _sizeRatio ;
float webGLSourceArrowHeadLength = webGLThickness * u _lengthToThicknessRatio * 2.0 ;
vec2 sourceCompensationVector =
vec2 ( - sourceDirection * unitNormal . y , sourceDirection * unitNormal . x )
* ( webGLSourceRadius + webGLSourceArrowHeadLength ) ;
2025-03-05 12:54:15 +08:00
2025-02-24 18:59:31 +08:00
// Target arrow head
float targetRadius = a _targetRadius * a _targetRadiusCoef ;
float targetDirection = sign ( targetRadius ) ;
float webGLTargetRadius = targetDirection * targetRadius * 2.0 * u _correctionRatio / u _sizeRatio ;
float webGLTargetArrowHeadLength = webGLThickness * u _lengthToThicknessRatio * 2.0 ;
vec2 targetCompensationVector =
vec2 ( - targetDirection * unitNormal . y , targetDirection * unitNormal . x )
* ( webGLTargetRadius + webGLTargetArrowHeadLength ) ;
// Here is the proper position of the vertex
gl _Position = vec4 ( ( u _matrix * vec3 ( position + unitNormal * webGLThickness + sourceCompensationVector + targetCompensationVector , 1 ) ) . xy , 0 , 1 ) ;
v _thickness = webGLThickness / u _zoomRatio ;
v _normal = unitNormal ;
v _feather = u _feather * u _correctionRatio / u _zoomRatio / u _pixelRatio * 2.0 ;
# ifdef PICKING _MODE
// For picking mode, we use the ID as the color:
v _color = a _id ;
# else
// For normal mode, we use the color:
v _color = a _color ;
# endif
v _color . a *= bias ;
}
2025-03-05 14:30:30 +08:00
` ,EZ=SZ,u3=WebGLRenderingContext,TC=u3.UNSIGNED_BYTE,wa=u3.FLOAT,wZ=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],xZ={lengthToThicknessRatio:Eu.lengthToThicknessRatio};function c3(e){var t=Be(Be({},xZ),{});return function(n){function r(){return on(this,r),Bn(this,r,arguments)}return Un(r,n),ln(r,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:EZ,FRAGMENT_SHADER_SOURCE:h0,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:wZ,ATTRIBUTES:[{name:"a_positionStart",size:2,type:wa},{name:"a_positionEnd",size:2,type:wa},{name:"a_normal",size:2,type:wa},{name:"a_color",size:4,type:TC,normalized:!0},{name:"a_id",size:4,type:TC,normalized:!0},{name:"a_sourceRadius",size:1,type:wa},{name:"a_targetRadius",size:1,type:wa}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:wa},{name:"a_normalCoef",size:1,type:wa},{name:"a_sourceRadiusCoef",size:1,type:wa},{name:"a_targetRadiusCoef",size:1,type:wa}],CONSTANT_DATA:[[0,1,-1,0],[0,-1,1,0],[1,1,0,1],[1,1,0,1],[0,-1,1,0],[1,-1,0,-1]]}}},{key:"processVisibleItem",value:function(i,l,u,c,f){var p=f.size||1,g=u.x,b=u.y,m=c.x,S=c.y,v=Qr(f.color),A=m-g,R=S-b,x=u.size||1,T=c.size||1,C=A*A+R*R,N=0,_=0;C&&(C=1/Math.sqrt(C),N=-R*C*p,_=A*C*p);var O=this.array;O[l++]=g,O[l++]=b,O[l++]=m,O[l++]=S,O[l++]=N,O[l++]=_,O[l++]=v,O[l++]=i,O[l++]=x,O[l++]=T}},{key:"setUniforms",value:function(i,l){var u=l.gl,c=l.uniformLocations,f=c.u_matrix,p=c.u_zoomRatio,g=c.u_feather,b=c.u_pixelRatio,m=c.u_correctionRatio,S=c.u_sizeRatio,v=c.u_minEdgeThickness,A=c.u_lengthToThicknessRatio;u.uniformMatrix3fv(f,!1,i.matrix),u.uniform1f(p,i.zoomRatio),u.uniform1f(S,i.sizeRatio),u.uniform1f(m,i.correctionRatio),u.uniform1f(b,i.pixelRatio),u.uniform1f(g,i.antiAliasingFeather),u.uniform1f(v,i.minEdgeThickness),u.uniform1f(A,t.lengthToThicknessRatio)}}])}(vu)}c3();function kZ(e){return VU([c3(),Pd(e),Pd(Be(Be({},e),{},{extremity:"source"}))])}kZ();function AZ(e){if(Array.isArray(e))return e}function TZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,l,u=[],c=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);c=!0);}catch(p){f=!0,a=p}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw a}}return u}}function Px(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d3(e,t){if(e){if(typeof e=="string")return Px(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array $ /.test(n)?Px(e,t):void 0}}function _Z(){throw new TypeError( ` Invalid attempt to destructure non - iterable instance .
2025-03-05 12:54:15 +08:00
In order to be iterable , non - array objects must have a [ Symbol . iterator ] ( ) method . ` )}function RZ(e,t){return AZ(e)||TZ(e,t)||d3(e,t)||_Z()}function CZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NZ(e,t){if(typeof e!="object"||!e)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 f3(e){var t=NZ(e,"string");return typeof t=="symbol"?t:t+""}function OZ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f3(r.key),r)}}function DZ(e,t,n){return t&&OZ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bd(e){return Bd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bd(e)}function p3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(p3=function(){return!!e})()}function Bx(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function IZ(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 Bx(e)}function LZ(e,t,n){return t=Bd(t),IZ(e,p3()?Reflect.construct(t,n||[],Bd(e).constructor):t.apply(e,n))}function Ux(e,t){return Ux=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Ux(e,t)}function MZ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ux(e,t)}function al(e,t,n){return(t=f3(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FZ(e){if(Array.isArray(e))return Px(e)}function zZ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function PZ(){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 Ih(e){return FZ(e)||zZ(e)||d3(e)||PZ()}function _C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function RC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_C(Object(n),!0).forEach(function(r){al(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_C(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var BZ="relative",UZ={drawLabel:void 0,drawHover:void 0,borders:[{size:{value:.1},color:{attribute:"borderColor"}},{size:{fill:!0},color:{attribute:"color"}}]},jZ="#000000";function GZ(e){var t=e.borders,n=rC(t.filter(function(a){var i=a.size;return"fill"in i}).length),r= `
2025-02-24 18:59:31 +08:00
precision highp float ;
varying vec2 v _diffVector ;
varying float v _radius ;
# ifdef PICKING _MODE
varying vec4 v _color ;
# else
// For normal mode, we use the border colors defined in the program:
` .concat(t.flatMap(function(a,i){var l=a.size;return"attribute"in l?["varying float v_borderSize_".concat(i+1,";")]:[]}).join( `
` ), `
` ).concat(t.flatMap(function(a,i){var l=a.color;return"attribute"in l?["varying vec4 v_borderColor_".concat(i+1,";")]:"value"in l?["uniform vec4 u_borderColor_".concat(i+1,";")]:[]}).join( `
` ), `
# endif
uniform float u _correctionRatio ;
const float bias = 255.0 / 254.0 ;
const vec4 transparent = vec4 ( 0.0 , 0.0 , 0.0 , 0.0 ) ;
void main ( void ) {
float dist = length ( v _diffVector ) ;
float aaBorder = 2.0 * u _correctionRatio ;
float v _borderSize _0 = v _radius ;
vec4 v _borderColor _0 = transparent ;
// No antialiasing for picking mode:
# ifdef PICKING _MODE
if ( dist > v _radius )
gl _FragColor = transparent ;
else {
gl _FragColor = v _color ;
gl _FragColor . a *= bias ;
}
# else
// Sizes:
2025-03-05 12:54:15 +08:00
` ).concat(t.flatMap(function(a,i){var l=a.size;if("fill"in l)return[];l=l;var u="attribute"in l?"v_borderSize_".concat(i+1):rC(l.value),c=(l.mode||BZ)==="pixels"?"u_correctionRatio":"v_radius";return[" float borderSize_".concat(i+1," = ").concat(c," * ").concat(u,";")]}).join( `
2025-02-24 18:59:31 +08:00
` ), `
// Now, let's split the remaining space between "fill" borders:
float fillBorderSize = ( v _radius - ( ` ).concat(t.flatMap(function(a,i){var l=a.size;return"fill"in l?[]:["borderSize_".concat(i+1)]}).join(" + "),") ) / ").concat(n, ` ;
` ).concat(t.flatMap(function(a,i){var l=a.size;return"fill"in l?[" float borderSize_".concat(i+1," = fillBorderSize;")]:[]}).join( `
` ), `
// Finally, normalize all border sizes, to start from the full size and to end with the smallest:
float adjustedBorderSize _0 = v _radius ;
` ).concat(t.map(function(a,i){return" float adjustedBorderSize_".concat(i+1," = adjustedBorderSize_").concat(i," - borderSize_").concat(i+1,";")}).join( `
` ), `
// Colors:
vec4 borderColor _0 = transparent ;
` ).concat(t.map(function(a,i){var l=a.color,u=[];return"attribute"in l?u.push(" vec4 borderColor_".concat(i+1," = v_borderColor_").concat(i+1,";")):"transparent"in l?u.push(" vec4 borderColor_".concat(i+1," = vec4(0.0, 0.0, 0.0, 0.0);")):u.push(" vec4 borderColor_".concat(i+1," = u_borderColor_").concat(i+1,";")),u.push(" borderColor_".concat(i+1,".a *= bias;")),u.push(" if (borderSize_".concat(i+1," <= 1.0 * u_correctionRatio) { borderColor_").concat(i+1," = borderColor_").concat(i,"; }")),u.join( `
` )}).join( `
` ), `
if ( dist > adjustedBorderSize _0 ) {
gl _FragColor = borderColor _0 ;
} else ` ).concat(t.map(function(a,i){return"if (dist > adjustedBorderSize_".concat(i, ` - aaBorder ) {
gl _FragColor = mix ( borderColor _ ` ).concat(i+1,", borderColor_").concat(i,", (dist - adjustedBorderSize_").concat(i, ` + aaBorder ) / aaBorder ) ;
} else if ( dist > adjustedBorderSize _ ` ).concat(i+1, ` ) {
gl _FragColor = borderColor _ ` ).concat(i+1, ` ;
} else ` )}).join(""), ` { /* Nothing to add here */ }
# endif
}
2025-02-25 18:36:34 +08:00
` );return r}function HZ(e){var t=e.borders,n= `
2025-02-24 18:59:31 +08:00
attribute vec2 a _position ;
attribute float a _size ;
attribute float a _angle ;
uniform mat3 u _matrix ;
uniform float u _sizeRatio ;
uniform float u _correctionRatio ;
varying vec2 v _diffVector ;
varying float v _radius ;
# ifdef PICKING _MODE
attribute vec4 a _id ;
varying vec4 v _color ;
# else
` .concat(t.flatMap(function(r,a){var i=r.size;return"attribute"in i?["attribute float a_borderSize_".concat(a+1,";"),"varying float v_borderSize_".concat(a+1,";")]:[]}).join( `
` ), `
` ).concat(t.flatMap(function(r,a){var i=r.color;return"attribute"in i?["attribute vec4 a_borderColor_".concat(a+1,";"),"varying vec4 v_borderColor_".concat(a+1,";")]:[]}).join( `
` ), `
# endif
const float bias = 255.0 / 254.0 ;
const vec4 transparent = vec4 ( 0.0 , 0.0 , 0.0 , 0.0 ) ;
void main ( ) {
float size = a _size * u _correctionRatio / u _sizeRatio * 4.0 ;
vec2 diffVector = size * vec2 ( cos ( a _angle ) , sin ( a _angle ) ) ;
vec2 position = a _position + diffVector ;
gl _Position = vec4 (
( u _matrix * vec3 ( position , 1 ) ) . xy ,
0 ,
1
) ;
v _radius = size / 2.0 ;
v _diffVector = diffVector ;
# ifdef PICKING _MODE
v _color = a _id ;
# else
` ).concat(t.flatMap(function(r,a){var i=r.size;return"attribute"in i?[" v_borderSize_".concat(a+1," = a_borderSize_").concat(a+1,";")]:[]}).join( `
` ), `
` ).concat(t.flatMap(function(r,a){var i=r.color;return"attribute"in i?[" v_borderColor_".concat(a+1," = a_borderColor_").concat(a+1,";")]:[]}).join( `
` ), `
# endif
}
2025-03-05 14:30:30 +08:00
` );return n}var g3=WebGLRenderingContext,CC=g3.UNSIGNED_BYTE,Qc=g3.FLOAT;function $ Z(e){var t,n=RC(RC({},UZ),{}),r=n.borders,a=n.drawLabel,i=n.drawHover,l=["u_sizeRatio","u_correctionRatio","u_matrix"].concat(Ih(r.flatMap(function(u,c){var f=u.color;return"value"in f?["u_borderColor_".concat(c+1)]:[]})));return t=function(u){MZ(c,u);function c(){var f;CZ(this,c);for(var p=arguments.length,g=new Array(p),b=0;b<p;b++)g[b]=arguments[b];return f=LZ(this,c,[].concat(g)),al(Bx(f),"drawLabel",a),al(Bx(f),"drawHover",i),f}return DZ(c,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:HZ(n),FRAGMENT_SHADER_SOURCE:GZ(n),METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:l,ATTRIBUTES:[{name:"a_position",size:2,type:Qc},{name:"a_id",size:4,type:CC,normalized:!0},{name:"a_size",size:1,type:Qc}].concat(Ih(r.flatMap(function(p,g){var b=p.color;return"attribute"in b?[{name:"a_borderColor_".concat(g+1),size:4,type:CC,normalized:!0}]:[]})),Ih(r.flatMap(function(p,g){var b=p.size;return"attribute"in b?[{name:"a_borderSize_".concat(g+1),size:1,type:Qc}]:[]}))),CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:Qc}],CONSTANT_DATA:[[c.ANGLE_1],[c.ANGLE_2],[c.ANGLE_3]]}}},{key:"processVisibleItem",value:function(p,g,b){var m=this.array;m[g++]=b.x,m[g++]=b.y,m[g++]=p,m[g++]=b.size,r.forEach(function(S){var v=S.color;"attribute"in v&&(m[g++]=Qr(b[v.attribute]||v.defaultValue||jZ))}),r.forEach(function(S){var v=S.size;"attribute"in v&&(m[g++]=b[v.attribute]||v.defaultValue)})}},{key:"setUniforms",value:function(p,g){var b=g.gl,m=g.uniformLocations,S=m.u_sizeRatio,v=m.u_correctionRatio,A=m.u_matrix;b.uniform1f(v,p.correctionRatio),b.uniform1f(S,p.sizeRatio),b.uniformMatrix3fv(A,!1,p.matrix),r.forEach(function(R,x){var T=R.color;if("value"in T){var C=m["u_borderColor_".concat(x+1)],N=QK(T.value),_=RZ(N,4),O=_[0],z=_[1],I=_[2],M=_[3];b.uniform4f(C,O/255,z/255,I/255,M/255)}})}}]),c}(g0),al(t,"ANGLE_1",0),al(t,"ANGLE_2",2*Math.PI/3),al(t,"ANGLE_3",4*Math.PI/3),t}var qZ= $ Z();function VZ(e,t){if(typeof e!="object"||!e)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 h3(e){var t=VZ(e,"string");return typeof t=="symbol"?t:t+""}function m3(e,t,n){return(t=h3(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ud(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NC(Object(n),!0).forEach(function(r){m3(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function YZ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,h3(r.key),r)}}function KZ(e,t,n){return t&&YZ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function jd(e){return jd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},jd(e)}function b3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(b3=function(){return!!e})()}function y3(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function XZ(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 y3(e)}function ZZ(e,t,n){return t=jd(t),XZ(e,b3()?Reflect.construct(t,n||[],jd(e).constructor):t.apply(e,n))}function jx(e,t){r
In order to be iterable , non - array objects must have a [ Symbol . iterator ] ( ) method . ` )}function Lh(e){return JZ(e)||eQ(e)||tQ(e)||nQ()}function v3(e,t,n,r){var a=Math.pow(1-e,2)*t.x+2*(1-e)*e*n.x+Math.pow(e,2)*r.x,i=Math.pow(1-e,2)*t.y+2*(1-e)*e*n.y+Math.pow(e,2)*r.y;return{x:a,y:i}}function rQ(e,t,n){for(var r=20,a=0,i=e,l=0;l<r;l++){var u=v3((l+1)/r,e,t,n);a+=Math.sqrt(Math.pow(i.x-u.x,2)+Math.pow(i.y-u.y,2)),i=u}return a}function aQ(e){var t=e.curvatureAttribute,n=e.defaultCurvature,r=e.keepLabelUpright,a=r===void 0?!0:r;return function(i,l,u,c,f){var p=f.edgeLabelSize,g=l[t]||n,b=f.edgeLabelFont,m=f.edgeLabelWeight,S=f.edgeLabelColor.attribute?l[f.edgeLabelColor.attribute]||f.edgeLabelColor.color||"#000":f.edgeLabelColor.color,v=l.label;if(v){i.fillStyle=S,i.font="".concat(m," ").concat(p,"px ").concat(b);var A=!a||u.x<c.x,R=A?u.x:c.x,x=A?u.y:c.y,T=A?c.x:u.x,C=A?c.y:u.y,N=(R+T)/2,_=(x+C)/2,O=T-R,z=C-x,I=Math.sqrt(Math.pow(O,2)+Math.pow(z,2)),M=A?1:-1,H=N+z*g*M,q=_-O*g*M,P=l.size*.7+5,W={x:q-x,y:-(H-R)},Z=Math.sqrt(Math.pow(W.x,2)+Math.pow(W.y,2)),j={x:C-q,y:-(T-H)},G=Math.sqrt(Math.pow(j.x,2)+Math.pow(j.y,2));R+=P*W.x/Z,x+=P*W.y/Z,T+=P*j.x/G,C+=P*j.y/G,H+=P*z/I,q-=P*O/I;var B={x:H,y:q},X={x:R,y:x},D={x:T,y:C},V=rQ(X,B,D);if(!(V<u.size+c.size)){var U=i.measureText(v).width,L=V-u.size-c.size;if(U>L){var Y="…";for(v=v+Y,U=i.measureText(v).width;U>L&&v.length>1;)v=v.slice(0,-2)+Y,U=i.measureText(v).width;if(v.length<4)return}for(var Q={},se=0,re=v.length;se<re;se++){var le=v[se];Q[le]||(Q[le]=i.measureText(le).width*(1+g*.35))}for(var Ae=.5-U/V/2,ae=0,we=v.length;ae<we;ae++){var xe=v[ae],Ie=v3(Ae,X,B,D),Ce=2*(1-Ae)*(H-R)+2*Ae*(T-H),Ee=2*(1-Ae)*(q-x)+2*Ae*(C-q),J=Math.atan2(Ee,Ce);i.save(),i.translate(Ie.x,Ie.y),i.rotate(J),i.fillText(xe,0,0),i.restore(),Ae+=Q[xe]/V}}}}}function oQ(e){var t=e.arrowHead,n=(t==null?void 0:t.extremity)==="target"||(t==null?void 0:t.extremity)==="both",r=(t==null?void 0:t.extremity)==="source"||(t==null?void 0:t.extremity)==="both",a= `
2025-02-24 18:59:31 +08:00
precision highp float ;
varying vec4 v _color ;
varying float v _thickness ;
varying float v _feather ;
varying vec2 v _cpA ;
varying vec2 v _cpB ;
varying vec2 v _cpC ;
` .concat(n? `
varying float v _targetSize ;
varying vec2 v _targetPoint ; ` :"", `
` ).concat(r? `
varying float v _sourceSize ;
varying vec2 v _sourcePoint ; ` :"", `
` ).concat(t? `
uniform float u _lengthToThicknessRatio ;
uniform float u _widenessToThicknessRatio ; ` :"", `
float det ( vec2 a , vec2 b ) {
return a . x * b . y - b . x * a . y ;
}
vec2 getDistanceVector ( vec2 b0 , vec2 b1 , vec2 b2 ) {
float a = det ( b0 , b2 ) , b = 2.0 * det ( b1 , b0 ) , d = 2.0 * det ( b2 , b1 ) ;
float f = b * d - a * a ;
vec2 d21 = b2 - b1 , d10 = b1 - b0 , d20 = b2 - b0 ;
vec2 gf = 2.0 * ( b * d21 + d * d10 + a * d20 ) ;
gf = vec2 ( gf . y , - gf . x ) ;
vec2 pp = - f * gf / dot ( gf , gf ) ;
vec2 d0p = b0 - pp ;
float ap = det ( d0p , d20 ) , bp = 2.0 * det ( d10 , d0p ) ;
float t = clamp ( ( ap + bp ) / ( 2.0 * a + b + d ) , 0.0 , 1.0 ) ;
return mix ( mix ( b0 , b1 , t ) , mix ( b1 , b2 , t ) , t ) ;
}
float distToQuadraticBezierCurve ( vec2 p , vec2 b0 , vec2 b1 , vec2 b2 ) {
return length ( getDistanceVector ( b0 - p , b1 - p , b2 - p ) ) ;
}
const vec4 transparent = vec4 ( 0.0 , 0.0 , 0.0 , 0.0 ) ;
void main ( void ) {
float dist = distToQuadraticBezierCurve ( gl _FragCoord . xy , v _cpA , v _cpB , v _cpC ) ;
float thickness = v _thickness ;
` ).concat(n? `
float distToTarget = length ( gl _FragCoord . xy - v _targetPoint ) ;
float targetArrowLength = v _targetSize + thickness * u _lengthToThicknessRatio ;
if ( distToTarget < targetArrowLength ) {
thickness = ( distToTarget - v _targetSize ) / ( targetArrowLength - v _targetSize ) * u _widenessToThicknessRatio * thickness ;
} ` :"", `
` ).concat(r? `
float distToSource = length ( gl _FragCoord . xy - v _sourcePoint ) ;
float sourceArrowLength = v _sourceSize + thickness * u _lengthToThicknessRatio ;
if ( distToSource < sourceArrowLength ) {
thickness = ( distToSource - v _sourceSize ) / ( sourceArrowLength - v _sourceSize ) * u _widenessToThicknessRatio * thickness ;
} ` :"", `
float halfThickness = thickness / 2.0 ;
if ( dist < halfThickness ) {
# ifdef PICKING _MODE
gl _FragColor = v _color ;
# else
float t = smoothstep (
halfThickness - v _feather ,
halfThickness ,
dist
) ;
gl _FragColor = mix ( v _color , transparent , t ) ;
# endif
} else {
gl _FragColor = transparent ;
}
}
2025-02-25 18:36:34 +08:00
` );return a}function iQ(e){var t=e.arrowHead,n=(t==null?void 0:t.extremity)==="target"||(t==null?void 0:t.extremity)==="both",r=(t==null?void 0:t.extremity)==="source"||(t==null?void 0:t.extremity)==="both",a= `
2025-02-24 18:59:31 +08:00
attribute vec4 a _id ;
attribute vec4 a _color ;
attribute float a _direction ;
attribute float a _thickness ;
attribute vec2 a _source ;
attribute vec2 a _target ;
attribute float a _current ;
attribute float a _curvature ;
` .concat(n? ` attribute float a _targetSize ;
` :"", `
` ).concat(r? ` attribute float a _sourceSize ;
` :"", `
uniform mat3 u _matrix ;
uniform float u _sizeRatio ;
uniform float u _pixelRatio ;
uniform vec2 u _dimensions ;
uniform float u _minEdgeThickness ;
uniform float u _feather ;
varying vec4 v _color ;
varying float v _thickness ;
varying float v _feather ;
varying vec2 v _cpA ;
varying vec2 v _cpB ;
varying vec2 v _cpC ;
` ).concat(n? `
varying float v _targetSize ;
varying vec2 v _targetPoint ; ` :"", `
` ).concat(r? `
varying float v _sourceSize ;
varying vec2 v _sourcePoint ; ` :"", `
` ).concat(t? `
uniform float u _widenessToThicknessRatio ; ` :"", `
const float bias = 255.0 / 254.0 ;
const float epsilon = 0.7 ;
vec2 clipspaceToViewport ( vec2 pos , vec2 dimensions ) {
return vec2 (
( pos . x + 1.0 ) * dimensions . x / 2.0 ,
( pos . y + 1.0 ) * dimensions . y / 2.0
) ;
}
vec2 viewportToClipspace ( vec2 pos , vec2 dimensions ) {
return vec2 (
pos . x / dimensions . x * 2.0 - 1.0 ,
pos . y / dimensions . y * 2.0 - 1.0
) ;
}
void main ( ) {
float minThickness = u _minEdgeThickness ;
// Selecting the correct position
// Branchless "position = a_source if a_current == 1.0 else a_target"
vec2 position = a _source * max ( 0.0 , a _current ) + a _target * max ( 0.0 , 1.0 - a _current ) ;
position = ( u _matrix * vec3 ( position , 1 ) ) . xy ;
vec2 source = ( u _matrix * vec3 ( a _source , 1 ) ) . xy ;
vec2 target = ( u _matrix * vec3 ( a _target , 1 ) ) . xy ;
vec2 viewportPosition = clipspaceToViewport ( position , u _dimensions ) ;
vec2 viewportSource = clipspaceToViewport ( source , u _dimensions ) ;
vec2 viewportTarget = clipspaceToViewport ( target , u _dimensions ) ;
vec2 delta = viewportTarget . xy - viewportSource . xy ;
float len = length ( delta ) ;
vec2 normal = vec2 ( - delta . y , delta . x ) * a _direction ;
vec2 unitNormal = normal / len ;
float boundingBoxThickness = len * a _curvature ;
float curveThickness = max ( minThickness , a _thickness / u _sizeRatio ) ;
v _thickness = curveThickness * u _pixelRatio ;
v _feather = u _feather ;
v _cpA = viewportSource ;
v _cpB = 0.5 * ( viewportSource + viewportTarget ) + unitNormal * a _direction * boundingBoxThickness ;
v _cpC = viewportTarget ;
vec2 viewportOffsetPosition = (
viewportPosition +
unitNormal * ( boundingBoxThickness / 2.0 + sign ( boundingBoxThickness ) * ( ` ).concat(t?"curveThickness * u_widenessToThicknessRatio":"curveThickness", ` + epsilon ) ) *
max ( 0.0 , a _direction ) // NOTE: cutting the bounding box in half to avoid overdraw
) ;
position = viewportToClipspace ( viewportOffsetPosition , u _dimensions ) ;
gl _Position = vec4 ( position , 0 , 1 ) ;
2025-03-05 12:54:15 +08:00
2025-02-24 18:59:31 +08:00
` ).concat(n? `
v _targetSize = a _targetSize * u _pixelRatio / u _sizeRatio ;
v _targetPoint = viewportTarget ;
` :"", `
` ).concat(r? `
v _sourceSize = a _sourceSize * u _pixelRatio / u _sizeRatio ;
v _sourcePoint = viewportSource ;
` :"", `
# ifdef PICKING _MODE
// For picking mode, we use the ID as the color:
v _color = a _id ;
# else
// For normal mode, we use the color:
v _color = a _color ;
# endif
v _color . a *= bias ;
}
2025-03-05 14:30:30 +08:00
` );return a}var S3=.25,lQ={arrowHead:null,curvatureAttribute:"curvature",defaultCurvature:S3},E3=WebGLRenderingContext,OC=E3.UNSIGNED_BYTE,lo=E3.FLOAT;function v0(e){var t=Ud(Ud({},lQ),e||{}),n=t,r=n.arrowHead,a=n.curvatureAttribute,i=n.drawLabel,l=(r==null?void 0:r.extremity)==="target"||(r==null?void 0:r.extremity)==="both",u=(r==null?void 0:r.extremity)==="source"||(r==null?void 0:r.extremity)==="both",c=["u_matrix","u_sizeRatio","u_dimensions","u_pixelRatio","u_feather","u_minEdgeThickness"].concat(Lh(r?["u_lengthToThicknessRatio","u_widenessToThicknessRatio"]:[]));return function(f){QZ(p,f);function p(){var g;WZ(this,p);for(var b=arguments.length,m=new Array(b),S=0;S<b;S++)m[S]=arguments[S];return g=ZZ(this,p,[].concat(m)),m3(y3(g),"drawLabel",i||aQ(t)),g}return KZ(p,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:iQ(t),FRAGMENT_SHADER_SOURCE:oQ(t),METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:c,ATTRIBUTES:[{name:"a_source",size:2,type:lo},{name:"a_target",size:2,type:lo}].concat(Lh(l?[{name:"a_targetSize",size:1,type:lo}]:[]),Lh(u?[{name:"a_sourceSize",size:1,type:lo}]:[]),[{name:"a_thickness",size:1,type:lo},{name:"a_curvature",size:1,type:lo},{name:"a_color",size:4,type:OC,normalized:!0},{name:"a_id",size:4,type:OC,normalized:!0}]),CONSTANT_ATTRIBUTES:[{name:"a_current",size:1,type:lo},{name:"a_direction",size:1,type:lo}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[0,-1],[1,1],[1,-1]]}}},{key:"processVisibleItem",value:function(b,m,S,v,A){var R,x=A.size||1,T=S.x,C=S.y,N=v.x,_=v.y,O=Qr(A.color),z=(R=A[a])!==null&&R!==void 0?R:S3,I=this.array;I[m++]=T,I[m++]=C,I[m++]=N,I[m++]=_,l&&(I[m++]=v.size),u&&(I[m++]=S.size),I[m++]=x,I[m++]=z,I[m++]=O,I[m++]=b}},{key:"setUniforms",value:function(b,m){var S=m.gl,v=m.uniformLocations,A=v.u_matrix,R=v.u_pixelRatio,x=v.u_feather,T=v.u_sizeRatio,C=v.u_dimensions,N=v.u_minEdgeThickness;if(S.uniformMatrix3fv(A,!1,b.matrix),S.uniform1f(R,b.pixelRatio),S.uniform1f(T,b.sizeRatio),S.uniform1f(x,b.antiAliasingFeather),S.uniform2f(C,b.width*b.pixelRatio,b.height*b.pixelRatio),S.uniform1f(N,b.minEdgeThickness),r){var _=v.u_lengthToThicknessRatio,O=v.u_widenessToThicknessRatio;S.uniform1f(_,r.lengthToThicknessRatio),S.uniform1f(O,r.widenessToThicknessRatio)}}}]),p}(vu)}var sQ=v0(),uQ=v0({arrowHead:Eu});v0({arrowHead:Ud(Ud({},Eu),{},{extremity:"both"})});class cQ{constructor(){Ea(this,"nodes",[]);Ea(this,"edges",[]);Ea(this,"nodeIdMap",{});Ea(this,"edgeIdMap",{});Ea(this,"edgeDynamicIdMap",{});Ea(this,"getNode",t=>{const n=this.nodeIdMap[t];if(n!==void 0)return this.nodes[n]});Ea(this,"getEdge",(t,n=!0)=>{const r=n?this.edgeDynamicIdMap[t]:this.edgeIdMap[t];if(r!==void 0)return this.edges[r]});Ea(this,"buildDynamicMap",()=>{this.edgeDynamicIdMap={};for(let t=0;t<this.edges.length;t++){const n=this.edges[t];this.edgeDynamicIdMap[n.dynamicId]=t}})}}const dQ=xk()(e=>({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null,moveToSelectedNode:!1,rawGraph:null,sigmaGraph:null,setSelectedNode:(t,n)=>e({selectedNode:t,moveToSelectedNode:n}),setFocusedNode:t=>e({focusedNode:t}),setSelectedEdge:t=>e({selectedEdge:t}),setFocusedEdge:t=>e({focusedEdge:t}),clearSelection:()=>e({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null}),reset:()=>e({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null,rawGraph:null,sigmaGraph:null,moveToSelectedNode:!1}),setRawGraph:t=>e({rawGraph:t}),setSigmaGraph:t=>e({sigmaGraph:t}),setMoveToSelectedNode:t=>e({moveToSelectedNode:t})})),Et=Tk(dQ),fQ=({node:e,move:t})=>{const n=br(),{gotoNode:r}=l3();return k.useEffect(()=>{if(e)return n.getGraph().setNodeAttribute(e,"highlighted",!0),t&&(r(e),Et.getState().setMoveToSelectedNode(!1)),()=>{n.getGraph().setNodeAttribute(e,"highlighted",!1)}},[e,t,n,r]),null};function Ll(e,t){const n=br(),r=k.useRef(t);return wu(r.current,t)||(r.current=t),{positions:k.useCallback(()=>r.current?e(n.getGraph(),r.current):{},[n,r,e]),assign:k.useCallback(()=>{r.current&&e.assign(n.getGraph(),r.current)},[n,r,e])}}function S0(e,t){const n=br(),[r,a]=k.useState(!1),[i,l]=k.us
2025-02-24 18:59:31 +08:00
* @ license React
* use - sync - external - store - shim . production . js
*
* Copyright ( c ) Meta Platforms , Inc . and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
2025-03-05 14:30:30 +08:00
* /var aN;function uJ(){if(aN)return am;aN=1;var e=nf();function t(g,b){return g===b&&(g!==0||1/g === 1 / b ) || g !== g && b !== b } var n = typeof Object . is == "function" ? Object . is : t , r = e . useState , a = e . useEffect , i = e . useLayoutEffect , l = e . useDebugValue ; function u ( g , b ) { var m = b ( ) , S = r ( { inst : { value : m , getSnapshot : b } } ) , v = S [ 0 ] . inst , A = S [ 1 ] ; return i ( function ( ) { v . value = m , v . getSnapshot = b , c ( v ) && A ( { inst : v } ) } , [ g , m , b ] ) , a ( function ( ) { return c ( v ) && A ( { inst : v } ) , g ( function ( ) { c ( v ) && A ( { inst : v } ) } ) } , [ g ] ) , l ( m ) , m } function c ( g ) { var b = g . getSnapshot ; g = g . value ; try { var m = b ( ) ; return ! n ( g , m ) } catch { return ! 0 } } function f ( g , b ) { return b ( ) } var p = typeof window > "u" || typeof window . document > "u" || typeof window . document . createElement > "u" ? f : u ; return am . useSyncExternalStore = e . useSyncExternalStore !== void 0 ? e . useSyncExternalStore : p , am } var oN ; function cJ ( ) { return oN || ( oN = 1 , rm . exports = uJ ( ) ) , rm . exports } var dJ = cJ ( ) , Hs = '[cmdk-group=""]' , om = '[cmdk-group-items=""]' , fJ = '[cmdk-group-heading=""]' , w0 = '[cmdk-item=""]' , iN = ` ${ w0 } :not([aria-disabled="true"]) ` , $x = "cmdk-item-select" , Qo = "data-value" , pJ = ( e , t , n ) => sJ ( e , t , n ) , O3 = k . createContext ( void 0 ) , ku = ( ) => k . useContext ( O3 ) , D3 = k . createContext ( void 0 ) , x0 = ( ) => k . useContext ( D3 ) , I3 = k . createContext ( void 0 ) , L3 = k . forwardRef ( ( e , t ) => { let n = ol ( ( ) => { var U , L ; return { search : "" , value : ( L = ( U = e . value ) != null ? U : e . defaultValue ) != null ? L : "" , filtered : { count : 0 , items : new Map , groups : new Set } } } ) , r = ol ( ( ) => new Set ) , a = ol ( ( ) => new Map ) , i = ol ( ( ) => new Map ) , l = ol ( ( ) => new Set ) , u = M3 ( e ) , { label : c , children : f , value : p , onValueChange : g , filter : b , shouldFilter : m , loop : S , disablePointerSelection : v = ! 1 , vimBindings : A = ! 0 , ... R } = e , x = En ( ) , T = En ( ) , C = En ( ) , N = k . useRef ( null ) , _ = kJ ( ) ; ii ( ( ) => { if ( p !== void 0 ) { let U = p . trim ( ) ; n . current . value = U , O . emit ( ) } } , [ p ] ) , ii ( ( ) => { _ ( 6 , P ) } , [ ] ) ; let O = k . useMemo ( ( ) => ( { subscribe : U => ( l . current . add ( U ) , ( ) => l . current . delete ( U ) ) , snapshot : ( ) => n . current , setState : ( U , L , Y ) => { var Q , se , re ; if ( ! Object . is ( n . current [ U ] , L ) ) { if ( n . current [ U ] = L , U === "search" ) q ( ) , M ( ) , _ ( 1 , H ) ; else if ( U === "value" && ( Y || _ ( 5 , P ) , ( ( Q = u . current ) == null ? void 0 : Q . value ) !== void 0 ) ) { let le = L ? ? "" ; ( re = ( se = u . current ) . onValueChange ) == null || re . call ( se , le ) ; return } O . emit ( ) } } , emit : ( ) => { l . current . forEach ( U => U ( ) ) } } ) , [ ] ) , z = k . useMemo ( ( ) => ( { value : ( U , L , Y ) => { var Q ; L !== ( ( Q = i . current . get ( U ) ) == null ? void 0 : Q . value ) && ( i . current . set ( U , { value : L , keywords : Y } ) , n . current . filtered . items . set ( U , I ( L , Y ) ) , _ ( 2 , ( ) => { M ( ) , O . emit ( ) } ) ) } , item : ( U , L ) => ( r . current . add ( U ) , L && ( a . current . has ( L ) ? a . current . get ( L ) . add ( U ) : a . current . set ( L , new Set ( [ U ] ) ) ) , _ ( 3 , ( ) => { q ( ) , M ( ) , n . current . value || H ( ) , O . emit ( ) } ) , ( ) => { i . current . delete ( U ) , r . current . delete ( U ) , n . current . filtered . items . delete ( U ) ; let Y = W ( ) ; _ ( 4 , ( ) => { q ( ) , ( Y == null ? void 0 : Y . getAttribute ( "id" ) ) === U && H ( ) , O . emit ( ) } ) } ) , group : U => ( a . current . has ( U ) || a . current . set ( U , new Set ) , ( ) => { i . current . delete ( U ) , a . current . delete ( U ) } ) , filter : ( ) => u . current . shouldFilter , label : c || e [ "aria-label" ] , getDisablePointerSelection : ( ) => u . current . disablePointerSelection , listId : x , inputId : C , labelId : T , listInnerRef : N } ) , [ ] ) ; function I ( U , L ) { var Y , Q ; let se = ( Q = ( Y = u . current ) == null ? void 0 : Y . filter ) != null ? Q : pJ ; return U ? se ( U , n . current . search , L ) : 0 } function M ( ) { if ( ! n . current . search || u . current . shouldFilter === ! 1 ) return ; let U = n . current . filtered . items , L = [ ] ; n . current . filtered . groups . forEach ( Q => { let se = a . current . get ( Q ) , re = 0 ; se . forEach ( le => { let Ae = U . get ( le ) ; re = Math . max ( Ae , re ) } ) , L . push ( [ Q , re ] ) } ) ; let Y = N . current ; Z ( ) . sort ( ( Q , se ) => { var re , le ; let Ae = Q . getAttribute ( "id" ) , ae = se . getAttribute ( "id" ) ; return ( ( re = U . get ( ae ) ) != null ? re : 0 ) - ( ( le = U . get ( Ae ) ) != null ? le : 0 ) } ) . forEach ( Q => { let se = Q . closest ( om ) ; se ? se . appendChild ( Q . parentElement === se ? Q : Q . closest ( ` ${ om } > * ` ) ) : Y . appendChild ( Q . parentElement === Y ? Q : Q . closest ( ` ${ om } > * ` ) ) } ) , L . sort ( ( Q , se ) => se [ 1 ] - Q [ 1 ] ) . forEach ( Q => { var se ; let re = ( se = N . current ) == null ? void 0 : se . querySelector ( ` ${ Hs } [ ${ Qo } =" ${ encodeURIComponent ( Q [ 0 ] ) } "] ` ) ; re == null || re . parentElement . appendChild ( re ) } ) } function H ( ) { let U = Z ( ) . find ( Y => Y . getAttribute ( "aria-disabled" ) !== "true" ) , L = U == null ? void 0 : U . getAttribute ( Qo ) ; O . setState ( "value" , L || void 0 ) } function q ( ) { var U , L , Y , Q ; if ( ! n . current . search || u . current . shouldFilter === ! 1 ) { n . current . filtered . count = r . current . size ; return } n . current . filtered . groups = new Set ; let se = 0 ; for ( let re of r . curre
In order to be iterable , non - array objects must have a [ Symbol . iterator ] ( ) method . ` )}function Xx(e){return Aee(e)||Tee(e)||_ee(e)||Ree()}function Cee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Nee(e,t){if(e==null)return{};var n,r,a=Cee(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}const Oee={index:new mo({fields:[]})};k.createContext(Oee);const Zx=({label:e,color:t,hidden:n,labels:r={}})=>ye.createElement("div",{className:"node"},ye.createElement("span",{className:"render "+(n?"circle":"disc"),style:{backgroundColor:t||"#000"}}),ye.createElement("span",{className: ` label $ { n ? "text-muted" : "" } $ { e ? "" : "text-italic" } ` },e||r.no_label||"No label")),Dee=({id:e,labels:t})=>{const n=br(),r=k.useMemo(()=>{const a=n.getGraph().getNodeAttributes(e),i=n.getSetting("nodeReducer");return Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},a),i?i(e,a):{})},[n,e]);return ye.createElement(Zx,Object.assign({},r,{labels:t}))},Iee=({label:e,color:t,source:n,target:r,hidden:a,directed:i,labels:l={}})=>ye.createElement("div",{className:"edge"},ye.createElement(Zx,Object.assign({},n,{labels:l})),ye.createElement("div",{className:"body"},ye.createElement("div",{className:"render"},ye.createElement("span",{className:a?"dotted":"dash",style:{borderColor:t||"#000"}})," ",i&&ye.createElement("span",{className:"arrow",style:{borderTopColor:t||"#000"}})),ye.createElement("span",{className: ` label $ { a ? "text-muted" : "" } $ { e ? "" : "fst-italic" } ` },e||l.no_label||"No label")),ye.createElement(Zx,Object.assign({},r,{labels:l}))),Lee=({id:e,labels:t})=>{const n=br(),r=k.useMemo(()=>{const a=n.getGraph().getEdgeAttributes(e),i=n.getSetting("nodeReducer"),l=n.getSetting("edgeReducer"),u=n.getGraph().getNodeAttributes(n.getGraph().source(e)),c=n.getGraph().getNodeAttributes(n.getGraph().target(e));return Object.assign(Object.assign(Object.assign({color:n.getSetting("defaultEdgeColor"),directed:n.getGraph().isDirected(e)},a),l?l(e,a):{}),{source:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},u),i?i(e,u):{}),target:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},c),i?i(e,c):{})})},[n,e]);return ye.createElement(Iee,Object.assign({},r,{labels:t}))};function I0(e,t){const[n,r]=k.useState(e);return k.useEffect(()=>{const a=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(a)}},[e,t]),n}function Mee({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:a,notFound:i,loadingSkeleton:l,label:u,placeholder:c="Select...",value:f,onChange:p,onFocus:g,disabled:b=!1,className:m,noResultsMessage:S}){const[v,A]=k.useState(!1),[R,x]=k.useState(!1),[T,C]=k.useState([]),[N,_]=k.useState(!1),[O,z]=k.useState(null),[I,M]=k.useState(f),[H,q]=k.useState(null),[P,W]=k.useState(""),Z=I0(P,t?0:150),[j,G]=k.useState([]);k.useEffect(()=>{A(!0),M(f)},[f]),k.useEffect(()=>{v||(async()=>{try{_(!0),z(null);const V=f!==null?await e(f):[];G(V),C(V)}catch(V){z(V instanceof Error?V.message:"Failed to fetch options")}finally{_(!1)}})()},[v,e,f]),k.useEffect(()=>{const D=async()=>{try{_(!0),z(null);const V=await e(Z);G(V),C(V)}catch(V){z(V instanceof Error?V.message:"Failed to fetch options")}finally{_(!1)}};v&&t?t&&C(Z?j.filter(V=>n?n(V,Z):!0):j):D()},[e,Z,v,t,n]);const B=k.useCallback(D=>{D!==I&&(M(D),p(D)),x(!1)},[I,M,x,p]),X=k.useCallback(D=>{D!==H&&(q(D),g(D))},[H,q,g]);return w.jsx("div",{className:Me(b&&"cursor-not-allowed opacity-50",m),onFocus:()=>{x(!0)},onBlur:()=>x(!1),children:w.jsxs(Of,{shouldFilter:!1,className:"bg-transparent",children:[w.jsxs("div",{children:[w.jsx(R0,{placeholder:c,value:P,className:"max-h-8",onValueChange:D=>{W(D),D&&!R&&x(!0)}}),N&&T.length>0&&w.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:w.jsx(cP,{className:"h-4 w-4 animate-spin"})})]}),w.jsxs(Df,{hidden:!R||Z.length===0,children:[O&&w.jsx("div",{className:"text-dest
2025-03-05 12:54:15 +08:00
In order to be iterable , non - array objects must have a [ Symbol . iterator ] ( ) method . ` )}function vte(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ste(e){if(Array.isArray(e))return ek(e)}function CN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function NN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CN(Object(n),!0).forEach(function(r){s4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function s4(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lu(e,t){return xte(e)||wte(e,t)||u4(e,t)||Ete()}function Ete(){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 u4(e,t){if(e){if(typeof e=="string")return ek(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array $ /.test(n))return ek(e,t)}}function ek(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function wte(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],a=!0,i=!1,l,u;try{for(n=n.call(e);!(a=(l=n.next()).done)&&(r.push(l.value),!(t&&r.length===t));a=!0);}catch(c){i=!0,u=c}finally{try{!a&&n.return!=null&&n.return()}finally{if(i)throw u}}return r}}function xte(e){if(Array.isArray(e))return e}var kte=typeof bm=="function"?bm:bm.default,Ate="file-invalid-type",Tte="file-too-large",_te="file-too-small",Rte="too-many-files",Cte=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:Ate,message:"File type must be ".concat(r)}},ON=function(t){return{code:Tte,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},DN=function(t){return{code:_te,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},Nte={code:Rte,message:"Too many files"};function c4(e,t){var n=e.type==="application/x-moz-file"||kte(e,t);return[n,n?null:Cte(t)]}function d4(e,t,n){if(Jo(e.size))if(Jo(t)&&Jo(n)){if(e.size>n)return[!1,ON(n)];if(e.size<t)return[!1,DN(t)]}else{if(Jo(t)&&e.size<t)return[!1,DN(t)];if(Jo(n)&&e.size>n)return[!1,ON(n)]}return[!0,null]}function Jo(e){return e!=null}function Ote(e){var t=e.files,n=e.accept,r=e.minSize,a=e.maxSize,i=e.multiple,l=e.maxFiles,u=e.validator;return!i&&t.length>1||i&&l>=1&&t.length>l?!1:t.every(function(c){var f=c4(c,n),p=lu(f,1),g=p[0],b=d4(c,r,a),m=lu(b,1),S=m[0],v=u?u(c):null;return g&&S&&!v})}function Vd(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function od(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function IN(e){e.preventDefault()}function Dte(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Ite(e){return e.indexOf("Edge/")!==-1}function Lte(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Dte(e)||Ite(e)}function $ r(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var a=arguments.length,i=new Array(a>1?a-1:0),l=1;l<a;l++)i[l-1]=arguments[l];return t.some(function(u){return!Vd(r)&&u&&u.apply(void 0,[r].concat(i)),Vd(r)})}}function Mte(){return"showOpenFilePicker"in window}function Fte(e){if(Jo(e)){var t=Object.entries(e).filter(function(n){var r=lu(n,2),a=r[0],i=r[1],l=!0;return f4(a)||(console.warn('Skipped "'.concat(a,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),l=!1),(!Array.isArray(i)||!i.every(p4))&&(console.warn('Skipped "'.concat(a,'" because an invalid file extension was provided.')),l=!1),l}).reduce(function(n,r){var a=lu(r,2),i=a[0],l=a[1];return NN(NN({},n),{},s4({},i,l))},{});return[{description:"Files",accept:t}]}return e}function zte(e){if(Jo(e))return Object.entries(e).reduce(function(t,n){var r=lu(n,2),a=r[0],i=r[1];return[].concat(RN(t),[a],RN(i))},[]).filter(function(t){return f4(t)||p4(t)}).join(",")}function Pte(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function Bte(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function f4(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/ \w + \/ [-+. \w ]+/g.test(e)}function p4(e){return/^.* \. [ \w ]+ $ /.test(e)}var Ute=["children"],j
In order to be iterable , non - array objects must have a [ Symbol . iterator ] ( ) method . ` )}function Vte(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Wte(e){if(Array.isArray(e))return tk(e)}function ym(e,t){return Xte(e)||Kte(e,t)||g4(e,t)||Yte()}function Yte(){throw new TypeError( ` Invalid attempt to destructure non - iterable instance .
2025-03-05 14:30:30 +08:00
In order to be iterable , non - array objects must have a [ Symbol . iterator ] ( ) method . ` )}function g4(e,t){if(e){if(typeof e=="string")return tk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array $ /.test(n))return tk(e,t)}}function tk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Kte(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],a=!0,i=!1,l,u;try{for(n=n.call(e);!(a=(l=n.next()).done)&&(r.push(l.value),!(t&&r.length===t));a=!0);}catch(c){i=!0,u=c}finally{try{!a&&n.return!=null&&n.return()}finally{if(i)throw u}}return r}}function Xte(e){if(Array.isArray(e))return e}function LN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Pt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LN(Object(n),!0).forEach(function(r){nk(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nk(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wd(e,t){if(e==null)return{};var n=Zte(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Zte(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}var Lf=k.forwardRef(function(e,t){var n=e.children,r=Wd(e,Ute),a=Qte(r),i=a.open,l=Wd(a,jte);return k.useImperativeHandle(t,function(){return{open:i}},[i]),ye.createElement(k.Fragment,null,n(Pt(Pt({},l),{},{open:i})))});Lf.displayName="Dropzone";var h4={disabled:!1,getFilesFromEvent:lte,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};Lf.defaultProps=h4;Lf.propTypes={children:Ct.func,accept:Ct.objectOf(Ct.arrayOf(Ct.string)),multiple:Ct.bool,preventDropOnDocument:Ct.bool,noClick:Ct.bool,noKeyboard:Ct.bool,noDrag:Ct.bool,noDragEventsBubbling:Ct.bool,minSize:Ct.number,maxSize:Ct.number,maxFiles:Ct.number,disabled:Ct.bool,getFilesFromEvent:Ct.func,onFileDialogCancel:Ct.func,onFileDialogOpen:Ct.func,useFsAccessApi:Ct.bool,autoFocus:Ct.bool,onDragEnter:Ct.func,onDragLeave:Ct.func,onDragOver:Ct.func,onDrop:Ct.func,onDropAccepted:Ct.func,onDropRejected:Ct.func,onError:Ct.func,validator:Ct.func};var rk={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Qte(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Pt(Pt({},h4),e),n=t.accept,r=t.disabled,a=t.getFilesFromEvent,i=t.maxSize,l=t.minSize,u=t.multiple,c=t.maxFiles,f=t.onDragEnter,p=t.onDragLeave,g=t.onDragOver,b=t.onDrop,m=t.onDropAccepted,S=t.onDropRejected,v=t.onFileDialogCancel,A=t.onFileDialogOpen,R=t.useFsAccessApi,x=t.autoFocus,T=t.preventDropOnDocument,C=t.noClick,N=t.noKeyboard,_=t.noDrag,O=t.noDragEventsBubbling,z=t.onError,I=t.validator,M=k.useMemo(function(){return zte(n)},[n]),H=k.useMemo(function(){return Fte(n)},[n]),q=k.useMemo(function(){return typeof A=="function"?A:MN},[A]),P=k.useMemo(function(){return typeof v=="function"?v:MN},[v]),W=k.useRef(null),Z=k.useRef(null),j=k.useReducer(Jte,rk),G=ym(j,2),B=G[0],X=G[1],D=B.isFocused,V=B.isFileDialogActive,U=k.useRef(typeof window<"u"&&window.isSecureContext&&R&&Mte()),L=function(){!U.current&&V&&setTimeout(function(){if(Z.current){var Ne=Z.current.files;Ne.length||(X({type:"closeDialog"}),P())}},300)};k.useEffe
2025-02-24 18:59:31 +08:00
- a positive number
2025-03-05 12:54:15 +08:00
- less than the value passed to \ ` max \` (or ${ M0 } if no \` max \` prop is set)
2025-02-24 18:59:31 +08:00
- \ ` null \` or \` undefined \` if the progress is indeterminate.
2025-03-05 14:30:30 +08:00
Defaulting to \ ` null \` . ` } var S4 = m4 , ine = y4 ; const E4 = k . forwardRef ( ( { className : e , value : t , ... n } , r ) => w . jsx ( S4 , { ref : r , className : Me ( "bg-secondary relative h-4 w-full overflow-hidden rounded-full" , e ) , ... n , children : w . jsx ( ine , { className : "bg-primary h-full w-full flex-1 transition-all" , style : { transform : ` translateX(- ${ 100 - ( t || 0 ) } %) ` } } ) } ) ) ; E4 . displayName = S4 . displayName ; function ak ( e , [ t , n ] ) { return Math . min ( n , Math . max ( t , e ) ) } function lne ( e , t ) { return k . useReducer ( ( n , r ) => t [ n ] [ r ] ? ? n , e ) } var F0 = "ScrollArea" , [ w4 , ove ] = mr ( F0 ) , [ sne , yr ] = w4 ( F0 ) , x4 = k . forwardRef ( ( e , t ) => { const { _ _scopeScrollArea : n , type : r = "hover" , dir : a , scrollHideDelay : i = 600 , ... l } = e , [ u , c ] = k . useState ( null ) , [ f , p ] = k . useState ( null ) , [ g , b ] = k . useState ( null ) , [ m , S ] = k . useState ( null ) , [ v , A ] = k . useState ( null ) , [ R , x ] = k . useState ( 0 ) , [ T , C ] = k . useState ( 0 ) , [ N , _ ] = k . useState ( ! 1 ) , [ O , z ] = k . useState ( ! 1 ) , I = ft ( t , H => c ( H ) ) , M = Tf ( a ) ; return w . jsx ( sne , { scope : n , type : r , dir : M , scrollHideDelay : i , scrollArea : u , viewport : f , onViewportChange : p , content : g , onContentChange : b , scrollbarX : m , onScrollbarXChange : S , scrollbarXEnabled : N , onScrollbarXEnabledChange : _ , scrollbarY : v , onScrollbarYChange : A , scrollbarYEnabled : O , onScrollbarYEnabledChange : z , onCornerWidthChange : x , onCornerHeightChange : C , children : w . jsx ( Xe . div , { dir : M , ... l , ref : I , style : { position : "relative" , "--radix-scroll-area-corner-width" : R + "px" , "--radix-scroll-area-corner-height" : T + "px" , ... e . style } } ) } ) } ) ; x4 . displayName = F0 ; var k4 = "ScrollAreaViewport" , A4 = k . forwardRef ( ( e , t ) => { const { _ _scopeScrollArea : n , children : r , nonce : a , ... i } = e , l = yr ( k4 , n ) , u = k . useRef ( null ) , c = ft ( t , u , l . onViewportChange ) ; return w . jsxs ( w . Fragment , { children : [ w . 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 : a } ) , w . jsx ( Xe . div , { "data-radix-scroll-area-viewport" : "" , ... i , ref : c , style : { overflowX : l . scrollbarXEnabled ? "scroll" : "hidden" , overflowY : l . scrollbarYEnabled ? "scroll" : "hidden" , ... e . style } , children : w . jsx ( "div" , { ref : l . onContentChange , style : { minWidth : "100%" , display : "table" } , children : r } ) } ) ] } ) } ) ; A4 . displayName = k4 ; var ea = "ScrollAreaScrollbar" , z0 = k . forwardRef ( ( e , t ) => { const { forceMount : n , ... r } = e , a = yr ( ea , e . _ _scopeScrollArea ) , { onScrollbarXEnabledChange : i , onScrollbarYEnabledChange : l } = a , u = e . orientation === "horizontal" ; return k . useEffect ( ( ) => ( u ? i ( ! 0 ) : l ( ! 0 ) , ( ) => { u ? i ( ! 1 ) : l ( ! 1 ) } ) , [ u , i , l ] ) , a . type === "hover" ? w . jsx ( une , { ... r , ref : t , forceMount : n } ) : a . type === "scroll" ? w . jsx ( cne , { ... r , ref : t , forceMount : n } ) : a . type === "auto" ? w . jsx ( T4 , { ... r , ref : t , forceMount : n } ) : a . type === "always" ? w . jsx ( P0 , { ... r , ref : t } ) : null } ) ; z0 . displayName = ea ; var une = k . forwardRef ( ( e , t ) => { const { forceMount : n , ... r } = e , a = yr ( ea , e . _ _scopeScrollArea ) , [ i , l ] = k . useState ( ! 1 ) ; return k . useEffect ( ( ) => { const u = a . scrollArea ; let c = 0 ; if ( u ) { const f = ( ) => { window . clearTimeout ( c ) , l ( ! 0 ) } , p = ( ) => { c = window . setTimeout ( ( ) => l ( ! 1 ) , a . scrollHideDelay ) } ; return u . addEventListener ( "pointerenter" , f ) , u . addEventListener ( "pointerleave" , p ) , ( ) => { window . clearTimeout ( c ) , u . removeEventListener ( "pointerenter" , f ) , u . removeEventListener ( "pointerleave" , p ) } } } , [ a . scrollArea , a . scrollHideDelay ] ) , w . jsx ( Jn , { present : n || i , children : w . jsx ( T4 , { "data-state" : i ? "visible" : "hidden" , ... r , ref : t } ) } ) } ) , cne = k . forwardRef ( ( e , t ) => { const { forceMount : n , ... r } = e , a = yr ( ea , e . _ _scopeScrollArea ) , i = e . orientation === "horizontal" , l = Ff ( ( ) => c ( "SCROLL_END" ) , 100 ) , [ u , c ] = lne ( "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 k . useEffect ( ( ) => { if ( u === "idle" ) { const f = window . setTimeout ( ( ) => c ( "HIDE" ) , a . scrollHideDelay ) ; return ( ) => window . clearTimeout ( f ) } } , [ u , a . scrollHideDelay , c ] ) , k . useEffect ( ( ) => { const f = a . viewport , p = i ? "scrollLeft" : "scrollTop" ; if ( f ) { let g = f [ p ] ; const b = ( ) => { const m = f [ p ] ; g !== m && ( c ( "SCROLL" ) , l ( ) ) , g = m } ; return f . addEventListener ( "scroll" , b ) , ( ) => f . removeEventListener ( "scroll" , b ) } } , [ a . viewport , i , c , l ] ) , w . jsx ( Jn , { present : n || u !== "hidden" , children : w . jsx ( P0 , { "data-state" : u === "hidden" ? "hidden" : "visible" , ... r , ref : t , onPointerEnter : Ye ( e . onPointerEn
files ( up to $ { ok ( l ) } each ) ` : ` a file with $ { ok ( l ) } ` ,"Supported formats: TXT, MD, DOCX, PDF, PPTX, RTF, ODT, EPUB, HTML, HTM, TEX, JSON, XML, YAML, YML, CSV, LOG, CONF, INI, PROPERTIES, SQL, BAT, SH, C, CPP, PY, JAVA, JS, TS, SWIFT, GO, RB, PHP, CSS, SCSS, LESS"]})]})]})]})}),m!=null&&m.length?w.jsx(M4,{className:"h-fit w-full px-3",children:w.jsx("div",{className:"flex max-h-48 flex-col gap-4",children:m==null?void 0:m.map((x,T)=>w.jsx(Ene,{file:x,onRemove:()=>A(T),progress:a==null?void 0:a[x.name]},T))})}):null]})}function Ene({file:e,progress:t,onRemove:n}){return w.jsxs("div",{className:"relative flex items-center gap-2.5",children:[w.jsxs("div",{className:"flex flex-1 gap-2.5",children:[z4(e)?w.jsx(wne,{file:e}):null,w.jsxs("div",{className:"flex w-full flex-col gap-2",children:[w.jsxs("div",{className:"flex flex-col gap-px",children:[w.jsx("p",{className:"text-foreground/80 line-clamp-1 text-sm font-medium",children:e.name}),w.jsx("p",{className:"text-muted-foreground text-xs",children:ok(e.size)})]}),t?w.jsx(E4,{value:t}):null]})]}),w.jsx("div",{className:"flex items-center gap-2",children:w.jsxs(Lt,{type:"button",variant:"outline",size:"icon",className:"size-7",onClick:n,children:[w.jsx(dP,{className:"size-4","aria-hidden":"true"}),w.jsx("span",{className:"sr-only",children:"Remove file"})]})})]})}function z4(e){return"preview"in e&&typeof e.preview=="string"}function wne({file:e}){return e.type.startsWith("image/")?w.jsx("div",{className:"aspect-square shrink-0 rounded-md object-cover"}):w.jsx(Dq,{className:"text-muted-foreground size-10","aria-hidden":"true"})}function xne(){const[e,t]=k.useState(!1),[n,r]=k.useState(!1),[a,i]=k.useState({}),l=k.useCallback(async u=>{r(!0);try{await Promise.all(u.map(async c=>{try{const f=await hq(c,p=>{console.debug( ` Uploading $ { c . name } : $ { p } % ` ),i(g=>({...g,[c.name]:p}))});f.status==="success"?vn.success( ` Upload Success :
2025-02-24 18:59:31 +08:00
$ { c . name } uploaded successfully ` ):vn.error( ` Upload Failed :
$ { c . name }
$ { f . message } ` )}catch(f){vn.error( ` Upload Failed :
$ { c . name }
$ { Nr ( f ) } ` )}}))}catch(c){vn.error( ` Upload Failed
2025-03-05 12:54:15 +08:00
` +Nr(c))}finally{r(!1)}},[r,i]);return w.jsxs(z3,{open:e,onOpenChange:u=>{n&&!u||t(u)},children:[w.jsx(P3,{asChild:!0,children:w.jsxs(Lt,{variant:"default",side:"bottom",tooltip:"Upload documents",size:"sm",children:[w.jsx(wx,{})," Upload"]})}),w.jsxs(k0,{className:"sm:max-w-xl",onCloseAutoFocus:u=>u.preventDefault(),children:[w.jsxs(A0,{children:[w.jsx(T0,{children:"Upload documents"}),w.jsx(_0,{children:"Drag and drop your documents here or click to browse."})]}),w.jsx(Sne,{maxFileCount:1/0,maxSize:200*1024*1024,description:"supported types: TXT, MD, DOCX, PDF, PPTX, RTF, ODT, EPUB, HTML, HTM, TEX, JSON, XML, YAML, YML, CSV, LOG, CONF, INI, PROPERTIES, SQL, BAT, SH, C, CPP, PY, JAVA, JS, TS, SWIFT, GO, RB, PHP, CSS, SCSS, LESS",onUpload:l,progresses:a,disabled:n})]})]})}function kne(){const[e,t]=k.useState(!1),n=k.useCallback(async()=>{try{const r=await mq();r.status==="success"?(vn.success("Documents cleared successfully"),t(!1)):vn.error( ` Clear Documents Failed :
2025-02-24 18:59:31 +08:00
$ { r . message } ` )}catch(r){vn.error( ` Clear Documents Failed :
2025-03-05 12:54:15 +08:00
` +Nr(r))}},[t]);return w.jsxs(z3,{open:e,onOpenChange:t,children:[w.jsx(P3,{asChild:!0,children:w.jsxs(Lt,{variant:"outline",side:"bottom",tooltip:"Clear documents",size:"sm",children:[w.jsx(uP,{})," Clear"]})}),w.jsxs(k0,{className:"sm:max-w-xl",onCloseAutoFocus:r=>r.preventDefault(),children:[w.jsxs(A0,{children:[w.jsx(T0,{children:"Clear documents"}),w.jsx(_0,{children:"Do you really want to clear all documents?"})]}),w.jsx(Lt,{variant:"destructive",onClick:n,children:"YES"})]})]})}function Ane(){const e=Pn.use.health(),[t,n]=k.useState(null),r=k.useCallback(async()=>{try{const i=await dq();i&&i.statuses&&Object.values(i.statuses).reduce((u,c)=>u+c.length,0)>0?n(i):n(null)}catch(i){vn.error( ` Failed to load documents
2025-02-25 18:36:34 +08:00
` +Nr(i))}},[n]);k.useEffect(()=>{r()},[]);const a=k.useCallback(async()=>{try{const{status:i}=await fq();vn.message(i)}catch(i){vn.error( ` Failed to load documents
` +Nr(i))}},[]);return k.useEffect(()=>{const i=setInterval(async()=>{if(e)try{await r()}catch(l){vn.error( ` Failed to get scan progress
2025-03-05 14:30:30 +08:00
` +Nr(l))}},5e3);return()=>clearInterval(i)},[e,r]),w.jsxs(ou,{className:"!size-full !rounded-none !border-none",children:[w.jsx(Hd,{children:w.jsx(iu,{className:"text-lg",children:"Document Management"})}),w.jsxs( $ d,{className:"space-y-4",children:[w.jsxs("div",{className:"flex gap-2",children:[w.jsxs(Lt,{variant:"outline",onClick:a,side:"bottom",tooltip:"Scan documents",size:"sm",children:[w.jsx(t8,{})," Scan"]}),w.jsx("div",{className:"flex-1"}),w.jsx(kne,{}),w.jsx(xne,{})]}),w.jsxs(ou,{children:[w.jsxs(Hd,{children:[w.jsx(iu,{children:"Uploaded documents"}),w.jsx(If,{children:"view the uploaded documents here"})]}),w.jsxs( $ d,{children:[!t&&w.jsx(Jee,{title:"No documents uploaded",description:"upload documents to see them here"}),t&&w.jsxs(r4,{children:[w.jsx(a4,{children:w.jsxs(Qx,{children:[w.jsx(Ta,{children:"ID"}),w.jsx(Ta,{children:"Summary"}),w.jsx(Ta,{children:"Status"}),w.jsx(Ta,{children:"Length"}),w.jsx(Ta,{children:"Chunks"}),w.jsx(Ta,{children:"Created"}),w.jsx(Ta,{children:"Updated"}),w.jsx(Ta,{children:"Metadata"})]})}),w.jsx(o4,{className:"text-sm",children:Object.entries(t.statuses).map(([i,l])=>l.map(u=>w.jsxs(Qx,{children:[w.jsx(_a,{className:"truncate font-mono",children:u.id}),w.jsx(_a,{className:"max-w-xs min-w-24 truncate",children:w.jsx(Mn,{text:u.content_summary,tooltip:u.content_summary,tooltipClassName:"max-w-none overflow-visible block"})}),w.jsxs(_a,{children:[i==="processed"&&w.jsx("span",{className:"text-green-600",children:"Completed"}),i==="processing"&&w.jsx("span",{className:"text-blue-600",children:"Processing"}),i==="pending"&&w.jsx("span",{className:"text-yellow-600",children:"Pending"}),i==="failed"&&w.jsx("span",{className:"text-red-600",children:"Failed"}),u.error&&w.jsx("span",{className:"ml-2 text-red-500",title:u.error,children:"⚠️"})]}),w.jsx(_a,{children:u.content_length??"-"}),w.jsx(_a,{children:u.chunks_count??"-"}),w.jsx(_a,{className:"truncate",children:new Date(u.created_at).toLocaleString()}),w.jsx(_a,{className:"truncate",children:new Date(u.updated_at).toLocaleString()}),w.jsx(_a,{className:"max-w-xs truncate",children:u.metadata?JSON.stringify(u.metadata):"-"})]},u.id)))})]})]})]})]})]})}function P4(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}var su;(function(e){e.event="event",e.props="prop"})(su||(su={}));function fo(){}function Tne(e){var t,n=void 0;return function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return t&&r.length===t.length&&r.every(function(i,l){return i===t[l]})||(t=r,n=e.apply(void 0,r)),n}}function uu(e){return!!(e||"").match(/ \d /)}function gl(e){return e==null}function _ne(e){return typeof e=="number"&&isNaN(e)}function B4(e){return gl(e)||_ne(e)||typeof e=="number"&&!isFinite(e)}function U4(e){return e.replace(/[-[ \] /{}()*+?. \\ ^ $ |]/g," \\ $ &")}function Rne(e){switch(e){case"lakh":return/( \d +?)(?=( \d \d )+( \d )(?! \d ))( \. \d +)?/g;case"wan":return/( \d )(?=( \d {4})+(?! \d ))/g;case"thousand":default:return/( \d )(?=( \d {3})+(?! \d ))/g}}function Cne(e,t,n){var r=Rne(n),a=e.search(/[1-9]/);return a=a===-1?e.length:a,e.substring(0,a)+e.substring(a,e.length).replace(r," $ 1"+t)}function Nne(e){var t=k.useRef(e);t.current=e;var n=k.useRef(function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return t.current.apply(t,r)});return n.current}function U0(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var a=e.split("."),i=a[0],l=a[1]||"";return{beforeDecimal:i,afterDecimal:l,hasNegation:n,addNegation:r}}function One(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",a=n[1]||"";return(t?"-":"")+r+(a?"."+a:"")}function j4(e,t,n){for(var r="",a=n?"0":"",i=0;i<=t-1;i++)r+=e[i]||a;return r}function BN(e,t){return Array(t+1).join(e)}function G4(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1
2025-02-24 18:59:31 +08:00
Decimal separator can ' t be same as thousand separator .
thousandSeparator : ` +n+ ` ( thousandSeparator = { true } is same as thousandSeparator = "," )
decimalSeparator : ` +r+ ` ( default value for decimalSeparator is . )
` );return a.startsWith("-")&&i&&(console.error( `
Prefix can 't start with ' - ' when allowNegative is true .
prefix : ` +a+ `
allowNegative : ` +i+ `
2025-03-05 14:30:30 +08:00
` ),i=!1),Object.assign(Object.assign({},e),{allowNegative:i})}function Yne(e){e=Wne(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,a=e.onKeyDown;a===void 0&&(a=fo);var i=e.onBlur;i===void 0&&(i=fo);var l=e.thousandSeparator,u=e.decimalScale,c=e.fixedDecimalScale,f=e.prefix;f===void 0&&(f="");var p=e.defaultValue,g=e.value,b=e.valueIsNumericString,m=e.onValueChange,S=P4(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),v=zf(e),A=v.decimalSeparator,R=v.allowedDecimalSeparators,x=function(j){return GN(j,e)},T=function(j,G){return qne(j,G,e)},C=gl(g)?p:g,N=b?? $ ne(C,f,t);gl(g)?gl(p)||(N=N||typeof p=="number"):N=N||typeof g=="number";var _=function(j){return B4(j)?j:(typeof j=="number"&&(j=G4(j)),N&&typeof u=="number"?UN(j,u,!!c):j)},O= $ 4(_(g),_(p),!!N,x,T,m),z=O[0],I=z.numAsString,M=z.formattedValue,H=O[1],q=function(j){var G=j.target,B=j.key,X=G.selectionStart,D=G.selectionEnd,V=G.value;if(V===void 0&&(V=""),(B==="Backspace"||B==="Delete")&&D<f.length){j.preventDefault();return}if(X!==D){a(j);return}B==="Backspace"&&V[0]==="-"&&X===f.length+1&&n&&ei(G,1),u&&c&&(B==="Backspace"&&V[X-1]===A?(ei(G,X-1),j.preventDefault()):B==="Delete"&&V[X]===A&&j.preventDefault()),R!=null&&R.includes(B)&&V[X]===A&&ei(G,X+1);var U=l===!0?",":l;B==="Backspace"&&V[X-1]===U&&ei(G,X-1),B==="Delete"&&V[X]===U&&ei(G,X+1),a(j)},P=function(j){var G=I;if(G.match(/ \d /g)||(G=""),r||(G=One(G)),c&&u&&(G=UN(G,u,c)),G!==I){var B=GN(G,e);H({formattedValue:B,value:G,floatValue:parseFloat(G)},{event:j,source:su.event})}i(j)},W=function(j){return j===A?!0:uu(j)},Z=function(j){var G=j.currentValue,B=j.lastValue,X=j.formattedValue,D=j.currentValueIndex,V=j.formattedValueIndex,U=G[D],L=X[V],Y=H4(B,G),Q=Y.to,se=function(re){return T(re).indexOf(".")+f.length};return g===0&&c&&u&&G[Q.start]===A&&se(G)<D&&se(X)>V?!1:D>=Q.start&&D<Q.end&&R&&R.includes(U)&&L===A?!0:U===L};return Object.assign(Object.assign({},S),{value:M,valueIsNumericString:!1,isValidInputCharacter:W,isCharacterSame:Z,onValueChange:H,format:x,removeFormatting:T,getCaretBoundary:function(j){return Vne(j,e)},onKeyDown:q,onBlur:P})}function Kne(e){var t=Yne(e);return ye.createElement(jne,Object.assign({},t))}const ll=k.forwardRef(({stepper:e,thousandSeparator:t,placeholder:n,defaultValue:r,min:a=-1/0,max:i=1/0,onValueChange:l,fixedDecimalScale:u=!1,decimalScale:c=0,className:f=void 0,suffix:p,prefix:g,value:b,...m},S)=>{const[v,A]=k.useState(b??r),R=k.useCallback(()=>{A(N=>N===void 0?e??1:Math.min(N+(e??1),i))},[e,i]),x=k.useCallback(()=>{A(N=>N===void 0?-(e??1):Math.max(N-(e??1),a))},[e,a]);k.useEffect(()=>{b!==void 0&&A(b)},[b]);const T=N=>{const _=N.floatValue===void 0?void 0:N.floatValue;A(_),l&&l(_)},C=()=>{v!==void 0&&(v<a?(A(a),S.current.value=String(a)):v>i&&(A(i),S.current.value=String(i)))};return w.jsxs("div",{className:"relative flex",children:[w.jsx(Kne,{value:v,onValueChange:T,thousandSeparator:t,decimalScale:c,fixedDecimalScale:u,allowNegative:a<0,valueIsNumericString:!0,onBlur:C,max:i,min:a,suffix:p,prefix:g,customInput:N=>w.jsx(Eo,{...N,className:Me("w-full",f)}),placeholder:n,className:"[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",getInputRef:S,...m}),w.jsxs("div",{className:"absolute top-0 right-0 bottom-0 flex flex-col",children:[w.jsx(Lt,{"aria-label":"Increase value",className:"border-input h-1/2 rounded-l-none rounded-br-none border-b border-l px-2 focus-visible:relative",variant:"outline",onClick:R,disabled:v===i,children:w.jsx(sP,{size:15})}),w.jsx(Lt,{"aria-label":"Decrease value",className:"border-input h-1/2 rounded-l-none rounded-tr-none border-b border-l px-2 focus-visible:relative",variant:"outline",onClick:x,disabled:v===a,children:w.jsx(Ok,{size:15})})]})]})});ll.displayName="NumberInput";var Xne=[" ","Enter"
` ,f="/",p="*",g="",b="comment",m="declaration";Em=function(v,A){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];A=A||{};var R=1,x=1;function T(P){var W=P.match(t);W&&(R+=W.length);var Z=P.lastIndexOf(c);x=~Z?P.length-Z:x+P.length}function C(){var P={line:R,column:x};return function(W){return W.position=new N(P),z(),W}}function N(P){this.start=P,this.end={line:R,column:x},this.source=A.source}N.prototype.content=v;function _(P){var W=new Error(A.source+":"+R+":"+x+": "+P);if(W.reason=P,W.filename=A.source,W.line=R,W.column=x,W.source=v,!A.silent)throw W}function O(P){var W=P.exec(v);if(W){var Z=W[0];return T(Z),v=v.slice(Z.length),W}}function z(){O(n)}function I(P){var W;for(P=P||[];W=M();)W!==!1&&P.push(W);return P}function M(){var P=C();if(!(f!=v.charAt(0)||p!=v.charAt(1))){for(var W=2;g!=v.charAt(W)&&(p!=v.charAt(W)||f!=v.charAt(W+1));)++W;if(W+=2,g===v.charAt(W-1))return _("End of comment missing");var Z=v.slice(2,W-2);return x+=2,T(Z),v=v.slice(W),x+=2,P({type:b,comment:Z})}}function H(){var P=C(),W=O(r);if(W){if(M(),!O(a))return _("property missing ':'");var Z=O(i),j=P({type:m,property:S(W[0].replace(e,g)),value:Z?S(Z[0].replace(e,g)):g});return O(l),j}}function q(){var P=[];I(P);for(var W;W=H();)W!==!1&&(P.push(W),I(P));return P}return z(),q()};function S(v){return v?v.replace(u,g):g}return Em}var ZN;function $ re(){if(ZN)return nl;ZN=1;var e=nl&&nl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(nl,"__esModule",{value:!0}),nl.default=n;var t=e(Hre());function n(r,a){var i=null;if(!r||typeof r!="string")return i;var l=(0,t.default)(r),u=typeof a=="function";return l.forEach(function(c){if(c.type==="declaration"){var f=c.property,p=c.value;u?a(f,p,c):p&&(i=i||{},i[f]=p)}}),i}return nl}var qre= $ re();const QN=an(qre),Vre=QN.default||QN,zj=Pj("end"), $ 0=Pj("start");function Pj(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};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 Wre(e){const t= $ 0(e),n=zj(e);if(t&&n)return{start:t,end:n}}function Xs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?JN(e.position):"start"in e||"end"in e?JN(e):"line"in e||"column"in e?hk(e):""}function hk(e){return eO(e&&e.line)+":"+eO(e&&e.column)}function JN(e){return hk(e&&e.start)+"-"+hk(e&&e.end)}function eO(e){return e&&typeof e=="number"?e:1}class xn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",i={},l=!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 t=="string"?a=t:!i.cause&&t&&(l=!0,a=t.message,i.cause=t),!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 u=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=u?u.column:void 0,this.fatal=void 0,this.file,this.message=a,this.line=u?u.line:void 0,this.name=Xs(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=l&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}xn.prototype.file="";xn.prototype.name="";xn.prototype.reason="";xn.prototype.message="";xn.prototype.stack="";xn.prototype.column=void 0;xn.prototype.line=void 0;xn.prototype.ancestors=void 0;xn.prototype.cause=void 0;xn.prototype.fatal=void 0;xn.prototype.place=void 0;xn.prototype.ruleId=void 0;xn.prototype.source=void 0;const q0={}.hasOwnProperty,Yre=new Map,Kre=/[A-Z]/g,Xre=/-([a-z])/g,Zre=new Set(["table","tbody","thead","tfoot","tr"]),Qre=new Set(["td","th"]),Bj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Uj(e,t){if(!t||t.Fragment===vo
2025-02-24 18:59:31 +08:00
` ;break}case-3:{l= ` \ r
2025-03-05 14:30:30 +08:00
` ;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&a)continue;l=" ";break}default:l=String.fromCharCode(i)}a=i===-2,r.push(l)}return r.join("")}function lie(e){const r={constructs:qj([rie,...(e||{}).extensions||[]]),content:a(wae),defined:[],document:a(kae),flow:a(Goe),lazy:{},string:a(qoe),text:a(Voe)};return r;function a(i){return l;function l(u){return aie(r,i,u)}}}function sie(e){for(;!Xj(e););return e}const cO=/[ \0 \t \n \r ]/g;function uie(){let e=1,t="",n=!0,r;return a;function a(i,l,u){const c=[];let f,p,g,b,m;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(l||void 0).decode(i)),g=0,t="",n&&(i.charCodeAt(0)===65279&&g++,n=void 0);g<i.length;){if(cO.lastIndex=g,f=cO.exec(i),b=f&&f.index!==void 0?f.index:i.length,m=i.charCodeAt(b),!f){t=i.slice(g);break}if(m===10&&g===b&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),g<b&&(c.push(i.slice(g,b)),e+=b-g),m){case 0:{c.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,c.push(-2);e++<p;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}g=b+1}return u&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const cie=/ \\ ([!-/:-@[- ` { - ~ ] ) | & ( # ( ? : \ d { 1 , 7 } | x [ \ da - f ] { 1 , 6 } ) | [ \ da - z ] { 1 , 31 } ) ; / g i ; f u n c t i o n d i e ( e ) { r e t u r n e . r e p l a c e ( c i e , f i e ) } f u n c t i o n f i e ( e , t , n ) { i f ( t ) r e t u r n t ; i f ( n . c h a r C o d e A t ( 0 ) = = = 3 5 ) { c o n s t a = n . c h a r C o d e A t ( 1 ) , i = a = = = 1 2 0 | | a = = = 8 8 ; r e t u r n V j ( n . s l i c e ( i ? 2 : 1 ) , i ? 1 6 : 1 0 ) } r e t u r n K 0 ( n ) | | e } c o n s t n 5 = { } . h a s O w n P r o p e r t y ; f u n c t i o n p i e ( e , t , n ) { r e t u r n t y p e o f t ! = " s t r i n g " & & ( n = t , t = v o i d 0 ) , g i e ( n ) ( s i e ( l i e ( n ) . d o c u m e n t ( ) . w r i t e ( u i e ( ) ( e , t , ! 0 ) ) ) ) } f u n c t i o n g i e ( e ) { c o n s t t = { t r a n s f o r m s : [ ] , c a n C o n t a i n E o l s : [ " e m p h a s i s " , " f r a g m e n t " , " h e a d i n g " , " p a r a g r a p h " , " s t r o n g " ] , e n t e r : { a u t o l i n k : i ( m e ) , a u t o l i n k P r o t o c o l : I , a u t o l i n k E m a i l : I , a t x H e a d i n g : i ( E e ) , b l o c k Q u o t e : i ( a e ) , c h a r a c t e r E s c a p e : I , c h a r a c t e r R e f e r e n c e : I , c o d e F e n c e d : i ( w e ) , c o d e F e n c e d F e n c e I n f o : l , c o d e F e n c e d F e n c e M e t a : l , c o d e I n d e n t e d : i ( w e , l ) , c o d e T e x t : i ( x e , l ) , c o d e T e x t D a t a : I , d a t a : I , c o d e F l o w V a l u e : I , d e f i n i t i o n : i ( I e ) , d e f i n i t i o n D e s t i n a t i o n S t r i n g : l , d e f i n i t i o n L a b e l S t r i n g : l , d e f i n i t i o n T i t l e S t r i n g : l , e m p h a s i s : i ( C e ) , h a r d B r e a k E s c a p e : i ( J ) , h a r d B r e a k T r a i l i n g : i ( J ) , h t m l F l o w : i ( f e , l ) , h t m l F l o w D a t a : I , h t m l T e x t : i ( f e , l ) , h t m l T e x t D a t a : I , i m a g e : i ( k e ) , l a b e l : l , l i n k : i ( m e ) , l i s t I t e m : i ( i e ) , l i s t I t e m V a l u e : b , l i s t O r d e r e d : i ( v e , g ) , l i s t U n o r d e r e d : i ( v e ) , p a r a g r a p h : i ( z e ) , r e f e r e n c e : L , r e f e r e n c e S t r i n g : l , r e s o u r c e D e s t i n a t i o n S t r i n g : l , r e s o u r c e T i t l e S t r i n g : l , s e t e x t H e a d i n g : i ( E e ) , s t r o n g : i ( P e ) , t h e m a t i c B r e a k : i ( N e ) } , e x i t : { a t x H e a d i n g : c ( ) , a t x H e a d i n g S e q u e n c e : N , a u t o l i n k : c ( ) , a u t o l i n k E m a i l : A e , a u t o l i n k P r o t o c o l : l e , b l o c k Q u o t e : c ( ) , c h a r a c t e r E s c a p e V a l u e : M , c h a r a c t e r R e f e r e n c e M a r k e r H e x a d e c i m a l : Q , c h a r a c t e r R e f e r e n c e M a r k e r N u m e r i c : Q , c h a r a c t e r R e f e r e n c e V a l u e : s e , c h a r a c t e r R e f e r e n c e : r e , c o d e F e n c e d : c ( A ) , c o d e F e n c e d F e n c e : v , c o d e F e n c e d F e n c e I n f o : m , c o d e F e n c e d F e n c e M e t a : S , c o d e F l o w V a l u e : M , c o d e I n d e n t e d : c ( R ) , c o d e T e x t : c ( Z ) , c o d e T e x t D a t a : M , d a t a : M , d e f i n i t i o n : c ( ) , d e f i n i t i o n D e s t i n a t i o n S t r i n g : C , d e f i n i t i o n L a b e l S t r i n g : x , d e f i n i t i o n T i t l e S t r i n g : T , e m p h a s i s : c ( ) , h a r d B r e a k E s c a p e : c ( q ) , h a r d B r e a k T r a i l i n g : c ( q ) , h t m l F l o w : c ( P ) , h t m l F l o w D a t a : M , h t m l T e x t : c ( W ) , h t m l T e x t D a t a : M , i m a g e : c ( G ) , l a b e l : X , l a b e l T e x t : B , l i n e E n d i n g : H , l i n k : c ( j ) , l i s t I t e m : c ( ) , l i s t O r d e r e d : c ( ) , l i s t U n o r d e r e d : c ( ) , p a r a g r a p h : c ( ) , r e f e r e n c e S t r i n g : Y , r e s o u r c e D e s t i n a t i o n S t r i n g : D , r e s o u r c e T i t l e S t r i n g : V , r e s o u r c e : U , s e t e x t H e a d i n g : c ( z ) , s e t e x t H e a d i n g L i n e S e q u e n c e : O , s e t e x t H e a d i n g T e x t : _ , s t r o n g : c ( ) , t h e m a t i c B r e a k : c ( ) } } ; r 5 ( t , ( e | | { } ) . m d a s t E x t e n s i o n s | | [ ] ) ; c o n s t n = { } ; r e t u r n r ; f u n c t i o n r ( e e ) { l e t c e = { t y p e : " r o o t " , c h i l d r e n : [ ] } ; c o n s t R e = { s t a c k : [ c e ] , t o k e n S t a c k : [ ] , c o n f i g : t , e n t e r : u , e x i t : f , b u f f e r : l , r e s u m e : p , d a t a : n } , F e = [ ] ; l e t q e = - 1 ; f o r ( ; + + q e < e e . l e n g t h ; ) i f ( e e [ q e ] [ 1 ] . t y p e = = = " l i s t O r d e r e d " | | e e [ q e ] [ 1 ] . t y p e = = = " l i s t U n o r d e r e d " ) i f ( e e [ q e ] [ 0 ] = = = " e n t e r " ) F e . p u s h ( q e ) ; e l s e { c o n s t m t = F e . p o p ( ) ; q e = a ( e e , m t , q e ) } f o r ( q e = - 1 ; + + q e < e e . l e n g t h ; ) { c o n s t m t = t [ e e [ q e ] [ 0 ] ] ; n 5 . c a l l ( m t , e e [ q e ] [ 1 ] . t y p e ) & & m t [ e e [ q e ] [ 1 ] . t y p e ] . c a l l ( O b j e c t . a s s i g n ( { s l i c e S e r i a l i z e : e e [ q e ] [ 2 ] . s l i c e S e r i a l i z e } , R e ) , e e [ q e ] [ 1 ] ) } i f ( R e . t o k e n S t a c k . l e n g t h > 0 ) { c o n s t m t = R e . t o k e n S t a c k [ R e . t o k e n S t a c k . l e n g t h - 1 ] ; ( m t [ 1 ] | | d O ) . c a l l ( R e , v o i d 0 , m t [ 0 ] ) } f o r ( c e . p o s i t i o n = { s t a r t : u o ( e e . l e n g t h > 0 ? e e [ 0 ] [ 1 ] . s t a r t : { l i n e : 1 , c o l u m n : 1 , o f f s e t : 0 } ) , e n d : u o ( e e . l e n g t h > 0 ? e e [ e e . l e n g t h - 2 ] [ 1 ] . e n d : { l i n e : 1 , c o l u m n : 1 , o f f s e t : 0 } ) } , q e = - 1 ; + + q e < t . t r a n s f o r m s . l e n g t h ; ) c e = t . t r a n s f o r m s
2025-02-25 18:36:34 +08:00
` }]}function vie(e,t){const n=t.value?t.value+ `
2025-03-05 12:54:15 +08:00
` :"",r={};t.lang&&(r.className=["language-"+t.lang]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function Sie(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Eie(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wie(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=Bl(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let l,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=i+1,u+=1,e.footnoteCounts.set(r,u);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,c);const f={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,f),e.applyData(t,f)}function xie(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kie(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function a5(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const a=e.all(t),i=a[0];i&&i.type==="text"?i.value="["+i.value:a.unshift({type:"text",value:"["});const l=a[a.length-1];return l&&l.type==="text"?l.value+=r:a.push({type:"text",value:r}),a}function Aie(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return a5(e,t);const a={src:Bl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const i={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,i),e.applyData(t,i)}function Tie(e,t){const n={src:Bl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function _ie(e,t){const n={type:"text",value:t.value.replace(/ \r ? \n | \r /g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Rie(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return a5(e,t);const a={href:Bl(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const i={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function Cie(e,t){const n={href:Bl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Nie(e,t,n){const r=e.all(t),a=n?Oie(n):o5(t),i={},l=[];if(typeof t.checked=="boolean"){const p=r[0];let g;p&&p.type==="element"&&p.tagName==="p"?g=p:(g={type:"element",tagName:"p",properties:{},children:[]},r.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const p=r[u];(a||u!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value: `
2025-02-24 18:59:31 +08:00
` }),p.type==="element"&&p.tagName==="p"&&!a?l.push(...p.children):l.push(p)}const c=r[r.length-1];c&&(a||c.type!=="element"||c.tagName!=="p")&&l.push({type:"text",value: `
2025-03-05 12:54:15 +08:00
` });const f={type:"element",tagName:"li",properties:i,children:l};return e.patch(t,f),e.applyData(t,f)}function Oie(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=o5(n[r])}return t}function o5(e){const t=e.spread;return t??e.children.length>1}function Die(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const l=r[a];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function Iie(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Lie(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Mie(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Fie(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),a.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u= $ 0(t.children[1]),c=zj(t.children[t.children.length-1]);u&&c&&(l.position={start:u,end:c}),a.push(l)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,i),e.applyData(t,i)}function zie(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,u=l?l.length:t.children.length;let c=-1;const f=[];for(;++c<u;){const g=t.children[c],b={},m=l?l[c]:void 0;m&&(b.align=m);let S={type:"element",tagName:i,properties:b,children:[]};g&&(S.children=e.all(g),e.patch(g,S),S=e.applyData(g,S)),f.push(S)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function Pie(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const fO=9,pO=32;function Bie(e){const t=String(e),n=/ \r ? \n | \r /g;let r=n.exec(t),a=0;const i=[];for(;r;)i.push(gO(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return i.push(gO(t.slice(a),a>0,!1)),i.join("")}function gO(e,t,n){let r=0,a=e.length;if(t){let i=e.codePointAt(r);for(;i===fO||i===pO;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(a-1);for(;i===fO||i===pO;)a--,i=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function Uie(e,t){const n={type:"text",value:Bie(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function jie(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Gie={blockquote:bie,break:yie,code:vie,delete:Sie,emphasis:Eie,footnoteReference:wie,heading:xie,html:kie,imageReference:Aie,image:Tie,inlineCode:_ie,linkReference:Rie,link:Cie,listItem:Nie,list:Die,paragraph:Iie,root:Lie,strong:Mie,table:Fie,tableCell:Pie,tableRow:zie,text:Uie,thematicBreak:jie,toml:id,yaml:id,definition:id,footnoteDefinition:id};function id(){}const i5=-1,Hf=0,Qs=1,Jd=2,Z0=3,Q0=4,J0=5,eA=6,l5=7,s5=8,hO=typeof self=="object"?self:globalThis,Hie=(e,t)=>{const n=(a,i)=>(e.set(i,a),a),r=a=>{if(e.has(a))return e.get(a);const[i,l]=t[a];switch(i){case Hf:case i5:return n(l,a);case Qs:{const u=n([],a);for(const c of l)u.push(r(c));return u}case Jd:{const u=n({},a);for(const[c,f]of l)u[r(c)]=r(f);return u}case Z0:return n(new Date(l),a);case Q0:{const{source:u,flags:c}=l;return n(new RegExp(u,c),a)}case J0:{const u=n(new Map,a);for(const[c,f]of l)u.set(r(c),r(f));return u}case eA:{const u=n(new Set,a);for(const c of l)u.add(r(c));return u}case l5:{const{name:u,message:c}=l;return n(new hO[u](c),a)}case s5:return n(BigInt(l),a);case"BigInt":return n(Object(BigInt(l)),a);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:u}=new Uint8Array(l);return n(new DataView(u),l)}}return
2025-02-24 18:59:31 +08:00
` },{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value: `
2025-03-05 12:54:15 +08:00
` }]}}const $ f=function(e){if(e==null)return Jie;if(typeof e=="function")return qf(e);if(typeof e=="object")return Array.isArray(e)?Xie(e):Zie(e);if(typeof e=="string")return Qie(e);throw new Error("Expected function, string, or object as test")};function Xie(e){const t=[];let n=-1;for(;++n<e.length;)t[n]= $ f(e[n]);return qf(r);function r(...a){let i=-1;for(;++i<t.length;)if(t[i].apply(this,a))return!0;return!1}}function Zie(e){const t=e;return qf(n);function n(r){const a=r;let i;for(i in e)if(a[i]!==t[i])return!1;return!0}}function Qie(e){return qf(t);function t(n){return n&&n.type===e}}function qf(e){return t;function t(n,r,a){return!!(ele(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function Jie(){return!0}function ele(e){return e!==null&&typeof e=="object"&&"type"in e}const u5=[],tle=!0,yk=!1,nle="skip";function c5(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const i= $ f(a),l=r?-1:1;u(e,void 0,[])();function u(c,f,p){const g=c&&typeof c=="object"?c:{};if(typeof g.type=="string"){const m=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(c.type+(m?"<"+m+">":""))+")"})}return b;function b(){let m=u5,S,v,A;if((!t||i(c,f,p[p.length-1]||void 0))&&(m=rle(n(c,p)),m[0]===yk))return m;if("children"in c&&c.children){const R=c;if(R.children&&m[0]!==nle)for(v=(r?R.children.length:-1)+l,A=p.concat(R);v>-1&&v<R.children.length;){const x=R.children[v];if(S=u(x,v,A)(),S[0]===yk)return S;v=typeof S[1]=="number"?S[1]:v+l}}return m}}}function rle(e){return Array.isArray(e)?e:typeof e=="number"?[tle,e]:e==null?u5:[e]}function tA(e,t,n,r){let a,i,l;typeof t=="function"?(i=void 0,l=t,a=n):(i=t,l=n,a=r),c5(e,i,u,a);function u(c,f){const p=f[f.length-1],g=p?p.children.indexOf(c):void 0;return l(c,g,p)}}const vk={}.hasOwnProperty,ale={};function ole(e,t){const n=t||ale,r=new Map,a=new Map,i=new Map,l={...Gie,...n.handlers},u={all:f,applyData:lle,definitionById:r,footnoteById:a,footnoteCounts:i,footnoteOrder:[],handlers:l,one:c,options:n,patch:ile,wrap:ule};return tA(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const g=p.type==="definition"?r:a,b=String(p.identifier).toUpperCase();g.has(b)||g.set(b,p)}}),u;function c(p,g){const b=p.type,m=u.handlers[b];if(vk.call(u.handlers,b)&&m)return m(u,p,g);if(u.options.passThrough&&u.options.passThrough.includes(b)){if("children"in p){const{children:v,...A}=p,R=ef(A);return R.children=u.all(p),R}return ef(p)}return(u.options.unknownHandler||sle)(u,p,g)}function f(p){const g=[];if("children"in p){const b=p.children;let m=-1;for(;++m<b.length;){const S=u.one(b[m],p);if(S){if(m&&b[m-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=yO(S.value)),!Array.isArray(S)&&S.type==="element")){const v=S.children[0];v&&v.type==="text"&&(v.value=yO(v.value))}Array.isArray(S)?g.push(...S):g.push(S)}}}return g}}function ile(e,t){e.position&&(t.position=Wre(e))}function lle(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&i&&Object.assign(n.properties,ef(i)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function sle(e,t){const n=t.data||{},r="value"in t&&!(vk.call(n,"hProperties")||vk.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ule(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value: `
2025-02-24 18:59:31 +08:00
` });++r<e.length;)r&&n.push({type:"text",value: `
` }),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value: `
2025-02-25 18:36:34 +08:00
` }),n}function yO(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function vO(e,t){const n=ole(e,t),r=n.one(e,void 0),a=Kie(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&i.children.push({type:"text",value: `
2025-03-05 14:30:30 +08:00
` },a),i}function cle(e,t){return e&&"run"in e?async function(n,r){const a=vO(n,{file:r,...t});await e.run(a,r)}:function(n,r){return vO(n,{file:r,...e||t})}}function SO(e){if(e)throw e}var Am,EO;function dle(){if(EO)return Am;EO=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},i=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),g=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!g)return!1;var b;for(b in f);return typeof b>"u"||e.call(f,b)},l=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},u=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return Am=function c(){var f,p,g,b,m,S,v=arguments[0],A=1,R=arguments.length,x=!1;for(typeof v=="boolean"&&(x=v,v=arguments[1]||{},A=2),(v==null||typeof v!="object"&&typeof v!="function")&&(v={});A<R;++A)if(f=arguments[A],f!=null)for(p in f)g=u(v,p),b=u(f,p),v!==b&&(x&&b&&(i(b)||(m=a(b)))?(m?(m=!1,S=g&&a(g)?g:[]):S=g&&i(g)?g:{},l(v,{name:p,newValue:c(x,S,b)})):typeof b<"u"&&l(v,{name:p,newValue:b}));return v},Am}var fle=dle();const Tm=an(fle);function Sk(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function ple(){const e=[],t={run:n,use:r};return t;function n(...a){let i=-1;const l=a.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);u(null,...a);function u(c,...f){const p=e[++i];let g=-1;if(c){l(c);return}for(;++g<a.length;)(f[g]===null||f[g]===void 0)&&(f[g]=a[g]);a=f,p?gle(p,u)(...f):l(null,...f)}}function r(a){if(typeof a!="function")throw new TypeError("Expected ` middelware ` to be a function, not "+a);return e.push(a),t}}function gle(e,t){let n;return r;function r(...l){const u=e.length>l.length;let c;u&&l.push(a);try{c=e.apply(this,l)}catch(f){const p=f;if(u&&n)throw p;return a(p)}u||(c&&c.then&&typeof c.then=="function"?c.then(i,a):c instanceof Error?a(c):i(c))}function a(l,...u){n||(n=!0,t(l,...u))}function i(l){a(null,l)}}const qr={basename:hle,dirname:mle,extname:ble,join:yle,sep:"/"};function hle(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ru(e);let n=0,r=-1,a=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else r<0&&(i=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,u=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else l<0&&(i=!0,l=a+1),u>-1&&(e.codePointAt(a)===t.codePointAt(u--)?u<0&&(r=a):(u=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function mle(e){if(Ru(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function ble(e){Ru(e);let t=e.length,n=-1,r=0,a=-1,i=0,l;for(;t--;){const u=e.codePointAt(t);if(u===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),u===46?a<0?a=t:i!==1&&(i=1):a>-1&&(i=-1)}return a<0||n<0||i===0||i===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function yle(...e){let t=-1,n;for(;++t<e.length;)Ru(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":vle(n)}function vle(e){Ru(e);const t=e.codePointAt(0)===47;let n=Sle(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Sle(e,t){let n="",r=0,a=-1,i=0,l=-1,u,c;for(;++l<=e.length;){if(l<e.length)u=e.codePointAt(l);else{if(u===47)break;u=47}if(u===47){if(!(a===l-1||i===1))if(a!==l-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?
` :" ")+i.indentLines(i.containerFlow(r,u.current()),t?g5:gse))),f(),c}}function gse(e,t,n){return t===0?e:g5(e,t,n)}function g5(e,t,n){return(n?"":" ")+e}const hse=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];h5.peek=Sse;function mse(){return{canContainEols:["delete"],enter:{strikethrough:yse},exit:{strikethrough:vse}}}function bse(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:hse}],handlers:{delete:h5}}}function yse(e){this.enter({type:"delete",children:[]},e)}function vse(e){this.exit(e)}function h5(e,t,n,r){const a=n.createTracker(r),i=n.enter("strikethrough");let l=a.move("~~");return l+=n.containerPhrasing(e,{...a.current(),before:l,after:"~"}),l+=a.move("~~"),i(),l}function Sse(){return"~"}function Ese(e){return e.length}function wse(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||Ese,i=[],l=[],u=[],c=[];let f=0,p=-1;for(;++p<e.length;){const v=[],A=[];let R=-1;for(e[p].length>f&&(f=e[p].length);++R<e[p].length;){const x=xse(e[p][R]);if(n.alignDelimiters!==!1){const T=a(x);A[R]=T,(c[R]===void 0||T>c[R])&&(c[R]=T)}v.push(x)}l[p]=v,u[p]=A}let g=-1;if(typeof r=="object"&&"length"in r)for(;++g<f;)i[g]=RO(r[g]);else{const v=RO(r);for(;++g<f;)i[g]=v}g=-1;const b=[],m=[];for(;++g<f;){const v=i[g];let A="",R="";v===99?(A=":",R=":"):v===108?A=":":v===114&&(R=":");let x=n.alignDelimiters===!1?1:Math.max(1,c[g]-A.length-R.length);const T=A+"-".repeat(x)+R;n.alignDelimiters!==!1&&(x=A.length+x+R.length,x>c[g]&&(c[g]=x),m[g]=x),b[g]=T}l.splice(1,0,b),u.splice(1,0,m),p=-1;const S=[];for(;++p<l.length;){const v=l[p],A=u[p];g=-1;const R=[];for(;++g<f;){const x=v[g]||"";let T="",C="";if(n.alignDelimiters!==!1){const N=c[g]-(A[g]||0),_=i[g];_===114?T=" ".repeat(N):_===99?N%2?(T=" ".repeat(N/2+.5),C=" ".repeat(N/2-.5)):(T=" ".repeat(N/2),C=T):C=" ".repeat(N)}n.delimiterStart!==!1&&!g&&R.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&x==="")&&(n.delimiterStart!==!1||g)&&R.push(" "),n.alignDelimiters!==!1&&R.push(T),R.push(x),n.alignDelimiters!==!1&&R.push(C),n.padding!==!1&&R.push(" "),(n.delimiterEnd!==!1||g!==f-1)&&R.push("|")}S.push(n.delimiterEnd===!1?R.join("").replace(/ + $ /,""):R.join(""))}return S.join( `
2025-02-25 18:36:34 +08:00
` )}function xse(e){return e==null?"":String(e)}function RO(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function kse(e,t,n,r){const a=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const l=n.indentLines(n.containerFlow(e,i.current()),Ase);return a(),l}function Ase(e,t,n){return">"+(n?"":" ")+e}function Tse(e,t){return CO(e,t.inConstruct,!0)&&!CO(e,t.notInConstruct,!1)}function CO(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function NO(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character=== `
` &&Tse(n.stack,n.unsafe[a]))return/[ \t ]/.test(r.before)?"":" ";return ` \ \
` }function m5(e,t){const n=String(e);let r=n.indexOf(t),a=r,i=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++i>l&&(l=i):i=1,a=r+t.length,r=n.indexOf(t,a);return l}function _se(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 Rse(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 Cse(e,t,n,r){const a=Rse(n),i=e.value||" ",l=a===" ` "?"GraveAccent":"Tilde";if(_se(e,n)){const g=n.enter("codeIndented"),b=n.indentLines(i,Nse);return g(),b}const u=n.createTracker(r),c=a.repeat(Math.max(m5(i,a)+1,3)),f=n.enter("codeFenced");let p=u.move(c);if(e.lang){const g=n.enter( ` codeFencedLang$ { l } ` );p+=u.move(n.safe(e.lang,{before:p,after:" ",encode:[" ` "],...u.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${l}`);p+=u.move(" " ) , p += u . move ( n . safe ( e . meta , { before : p , after : `
2025-02-24 18:59:31 +08:00
` ,encode:[" ` " ] , ... u . current ( ) } ) ) , g ( ) } return p += u . move ( `
` ),i&&(p+=u.move(i+ `
2025-03-05 12:54:15 +08:00
` )),p+=u.move(c),f(),p}function Nse(e,t,n){return(n?"":" ")+e}function rA(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 Ose ( e , t , n , r ) { const a = rA ( n ) , i = a === '"' ? "Quote" : "Apostrophe" , l = n . enter ( "definition" ) ; let u = n . enter ( "label" ) ; const c = n . createTracker ( r ) ; let f = c . move ( "[" ) ; return f += c . move ( n . safe ( n . associationId ( e ) , { before : f , after : "]" , ... c . current ( ) } ) ) , f += c . move ( "]: " ) , u ( ) , ! e . url || /[\0- \u007F]/ . test ( e . url ) ? ( u = n . enter ( "destinationLiteral" ) , f += c . move ( "<" ) , f += c . move ( n . safe ( e . url , { before : f , after : ">" , ... c . current ( ) } ) ) , f += c . move ( ">" ) ) : ( u = n . enter ( "destinationRaw" ) , f += c . move ( n . safe ( e . url , { before : f , after : e . title ? " " : `
` ,...c.current()}))),u(),e.title&&(u=n.enter( ` title$ { i } ` ),f+=c.move(" "+a),f+=c.move(n.safe(e.title,{before:f,after:a,...c.current()})),f+=c.move(a),u()),l(),f}function Dse(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 du(e){return"&#x"+e.toString(16).toUpperCase()+";"}function tf(e,t,n){const r=xl(e),a=xl(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}b5.peek=Ise;function b5(e,t,n,r){const a=Dse(n),i=n.enter("emphasis"),l=n.createTracker(r),u=l.move(a);let c=l.move(n.containerPhrasing(e,{after:a,before:u,...l.current()}));const f=c.charCodeAt(0),p=tf(r.before.charCodeAt(r.before.length-1),f,a);p.inside&&(c=du(f)+c.slice(1));const g=c.charCodeAt(c.length-1),b=tf(r.after.charCodeAt(0),g,a);b.inside&&(c=c.slice(0,-1)+du(g));const m=l.move(a);return i(),n.attentionEncodeSurroundingInfo={after:b.outside,before:p.outside},u+c+m}function Ise(e,t,n){return n.options.emphasis||"*"}function Lse(e,t){let n=!1;return tA(e,function(r){if("value"in r&&/ \r ? \n | \r /.test(r.value)||r.type==="break")return n=!0,yk}),!!((!e.depth||e.depth<3)&&Y0(e)&&(t.options.setext||n))}function Mse(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(Lse(e,n)){const p=n.enter("headingSetext"),g=n.enter("phrasing"),b=n.containerPhrasing(e,{...i.current(),before: `
2025-02-24 18:59:31 +08:00
` ,after: `
` });return g(),p(),b+ `
` +(a===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf(" \r "),b.lastIndexOf( `
` ))+1))}const l="#".repeat(a),u=n.enter("headingAtx"),c=n.enter("phrasing");i.move(l+" ");let f=n.containerPhrasing(e,{before:"# ",after: `
2025-03-05 12:54:15 +08:00
` ,...i.current()});return/^[ \t ]/.test(f)&&(f=du(f.charCodeAt(0))+f.slice(1)),f=f?l+" "+f:l,n.options.closeAtx&&(f+=" "+l),c(),u(),f}y5.peek=Fse;function y5(e){return e.value||""}function Fse(){return"<"}v5.peek=zse;function v5(e,t,n,r){const a=rA(n),i=a==='"'?"Quote":"Apostrophe",l=n.enter("image");let u=n.enter("label");const c=n.createTracker(r);let f=c.move("![");return f+=c.move(n.safe(e.alt,{before:f,after:"]",...c.current()})),f+=c.move("]("),u(),!e.url&&e.title||/[ \0 - \u 007F]/.test(e.url)?(u=n.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(n.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(u=n.enter("destinationRaw"),f+=c.move(n.safe(e.url,{before:f,after:e.title?" ":")",...c.current()}))),u(),e.title&&(u=n.enter( ` title$ { i } ` ),f+=c.move(" "+a),f+=c.move(n.safe(e.title,{before:f,after:a,...c.current()})),f+=c.move(a),u()),f+=c.move(")"),l(),f}function zse(){return"!"}S5.peek=Pse;function S5(e,t,n,r){const a=e.referenceType,i=n.enter("imageReference");let l=n.enter("label");const u=n.createTracker(r);let c=u.move("![");const f=n.safe(e.alt,{before:c,after:"]",...u.current()});c+=u.move(f+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const g=n.safe(n.associationId(e),{before:c,after:"]",...u.current()});return l(),n.stack=p,i(),a==="full"||!f||f!==g?c+=u.move(g+"]"):a==="shortcut"?c=c.slice(0,-1):c+=u.move("]"),c}function Pse(){return"!"}E5.peek=Bse;function E5(e,t,n){let r=e.value||"",a=" ` ",i=-1;for(;new RegExp(" ( ^ | [ ^ ` ])"+a+"([^ ` ] | $ ) ").test(r);)a+=" ` ";for(/[^ \r \n ]/.test(r)&&(/^[ \r \n ]/.test(r)&&/[ \r \n ] $ /.test(r)||/^ ` | ` $ /.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const l=n.unsafe[i],u=n.compilePattern(l);let c;if(l.atBreak)for(;c=u.exec(r);){let f=c.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(c.index+1)}}return a+r+a}function Bse(){return" ` "}function w5(e,t){const n=Y0(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===" text "&&(n===e.url||" mailto : "+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}x5.peek=Use;function x5(e,t,n,r){const a=rA(n),i=a==='" ' ? "Quote" : "Apostrophe" , l = n . createTracker ( r ) ; let u , c ; if ( w5 ( e , n ) ) { const p = n . stack ; n . stack = [ ] , u = n . enter ( "autolink" ) ; let g = l . move ( "<" ) ; return g += l . move ( n . containerPhrasing ( e , { before : g , after : ">" , ... l . current ( ) } ) ) , g += l . move ( ">" ) , u ( ) , n . stack = p , g } u = n . enter ( "link" ) , c = n . enter ( "label" ) ; let f = l . move ( "[" ) ; return f += l . move ( n . containerPhrasing ( e , { before : f , after : "](" , ... l . current ( ) } ) ) , f += l . move ( "](" ) , c ( ) , ! e . url && e . title || /[\0- \u007F]/ . test ( e . url ) ? ( c = n . enter ( "destinationLiteral" ) , f += l . move ( "<" ) , f += l . move ( n . safe ( e . url , { before : f , after : ">" , ... l . current ( ) } ) ) , f += l . move ( ">" ) ) : ( c = n . enter ( "destinationRaw" ) , f += l . move ( n . safe ( e . url , { before : f , after : e . title ? " " : ")" , ... l . current ( ) } ) ) ) , c ( ) , e . title && ( c = n . enter ( ` title ${ i } ` ) , f += l . move ( " " + a ) , f += l . move ( n . safe ( e . title , { before : f , after : a , ... l . current ( ) } ) ) , f += l . move ( a ) , c ( ) ) , f += l . move ( ")" ) , u ( ) , f } function Use ( e , t , n ) { return w5 ( e , n ) ? "<" : "[" } k5 . peek = jse ; function k5 ( e , t , n , r ) { const a = e . referenceType , i = n . enter ( "linkReference" ) ; let l = n . enter ( "label" ) ; const u = n . createTracker ( r ) ; let c = u . move ( "[" ) ; const f = n . containerPhrasing ( e , { before : c , after : "]" , ... u . current ( ) } ) ; c += u . move ( f + "][" ) , l ( ) ; const p = n . stack ; n . stack = [ ] , l = n . enter ( "reference" ) ; const g = n . safe ( n . associationId ( e ) , { before : c , after : "]" , ... u . current ( ) } ) ; return l ( ) , n . stack = p , i ( ) , a === "full" || ! f || f !== g ? c += u . move ( g + "]" ) : a === "shortcut" ? c = c . slice ( 0 , - 1 ) : c += u . move ( "]" ) , c } function jse ( ) { return "[" } function aA ( 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 Gse ( e ) { const t = aA ( e ) , n = e . options . bulletOther ; if ( ! n ) return t === "*" ? "-" : "*" ; if ( n !== "*" && n !== "+" && n !== "-" ) throw new Error ( "Cannot serialize items with `" + n + "` for `options.bulletOther`, expected `*`, `+`, or `-`" ) ; if ( n === t ) throw new Error ( "Expected `bullet` (`" + t + "`) and `bulletOther` (`" + n + "`) to be different" ) ; return n } function Hse ( e ) { const t = e . options . bulletOrdered || "." ; if ( t !== "."
2025-02-25 18:36:34 +08:00
` ,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:l,tableCell:c,tableRow:u}};function l(m,S,v,A){return f(p(m,v,A),m.align)}function u(m,S,v,A){const R=g(m,v,A),x=f([R]);return x.slice(0,x.indexOf( `
2025-03-05 14:30:30 +08:00
` ))}function c(m,S,v,A){const R=v.enter("tableCell"),x=v.enter("phrasing"),T=v.containerPhrasing(m,{...A,before:i,after:i});return x(),R(),T}function f(m,S){return wse(m,{align:S,alignDelimiters:r,padding:n,stringLength:a})}function p(m,S,v){const A=m.children;let R=-1;const x=[],T=S.enter("table");for(;++R<A.length;)x[R]=g(A[R],S,v);return T(),x}function g(m,S,v){const A=m.children;let R=-1;const x=[],T=S.enter("tableRow");for(;++R<A.length;)x[R]=c(A[R],m,S,v);return T(),x}function b(m,S,v){let A=_5.inlineCode(m,S,v);return v.stack.includes("tableCell")&&(A=A.replace(/ \| /g," \\ $ &")),A}}function sue(){return{exit:{taskListCheckValueChecked:DO,taskListCheckValueUnchecked:DO,paragraph:cue}}}function uue(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:due}}}function DO(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function cue(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const a=t.children;let i=-1,l;for(;++i<a.length;){const u=a[i];if(u.type==="paragraph"){l=u;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function due(e,t,n,r){const a=e.children[0],i=typeof e.checked=="boolean"&&a&&a.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",u=n.createTracker(r);i&&u.move(l);let c=_5.listItem(e,t,n,{...r,...u.current()});return i&&(c=c.replace(/^(?:[*+-]| \d + \. )([ \r \n ]| {1,3})/,f)),c;function f(p){return p+l}}function fue(){return[qle(),fse(),mse(),tue(),sue()]}function pue(e){return{extensions:[Vle(),pse(e),bse(),lue(e),uue()]}}const gue={tokenize:Sue,partial:!0},R5={tokenize:Eue,partial:!0},C5={tokenize:wue,partial:!0},N5={tokenize:xue,partial:!0},hue={tokenize:kue,partial:!0},O5={name:"wwwAutolink",tokenize:yue,previous:I5},D5={name:"protocolAutolink",tokenize:vue,previous:L5},Fa={name:"emailAutolink",tokenize:bue,previous:M5},ta={};function mue(){return{text:ta}}let Zo=48;for(;Zo<123;)ta[Zo]=Fa,Zo++,Zo===58?Zo=65:Zo===91&&(Zo=97);ta[43]=Fa;ta[45]=Fa;ta[46]=Fa;ta[95]=Fa;ta[72]=[Fa,D5];ta[104]=[Fa,D5];ta[87]=[Fa,O5];ta[119]=[Fa,O5];function bue(e,t,n){const r=this;let a,i;return l;function l(g){return!wk(g)||!M5.call(r,r.previous)||oA(r.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(g))}function u(g){return wk(g)?(e.consume(g),u):g===64?(e.consume(g),c):n(g)}function c(g){return g===46?e.check(hue,p,f)(g):g===45||g===95||Sn(g)?(i=!0,e.consume(g),c):p(g)}function f(g){return e.consume(g),a=!0,c}function p(g){return i&&a&&_n(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function yue(e,t,n){const r=this;return a;function a(l){return l!==87&&l!==119||!I5.call(r,r.previous)||oA(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(gue,e.attempt(R5,e.attempt(C5,i),n),n)(l))}function i(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function vue(e,t,n){const r=this;let a="",i=!1;return l;function l(g){return(g===72||g===104)&&L5.call(r,r.previous)&&!oA(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(g),e.consume(g),u):n(g)}function u(g){if(_n(g)&&a.length<5)return a+=String.fromCodePoint(g),e.consume(g),u;if(g===58){const b=a.toLowerCase();if(b==="http"||b==="https")return e.consume(g),c}return n(g)}function c(g){return g===47?(e.consume(g),i?f:(i=!0,c)):n(g)}function f(g){return g===null||Qd(g)||Nt(g)||ui(g)||jf(g)?n(g):e.attempt(R5,e.attempt(C5,p),n)(g)}function p(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function Sue(e,t,n){let r=0;return a;function a(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),a):l===46&&r===3?(e.consume(l),i):n(l)}function i(l){return l===null?n(l):t(l)}}function Eue(e,t,n){let r,a,i;ret
2025-02-25 18:36:34 +08:00
` ,inConstruct:"mathFlowMeta"},{character:" $ ",after:t?void 0:" \\ $ ",inConstruct:"phrasing"},{character:" $ ",inConstruct:"mathFlowMeta"},{atBreak:!0,character:" $ ",after:" \\ $ "}],handlers:{math:n,inlineMath:r}};function n(i,l,u,c){const f=i.value||"",p=u.createTracker(c),g=" $ ".repeat(Math.max(m5(f," $ ")+1,2)),b=u.enter("mathFlow");let m=p.move(g);if(i.meta){const S=u.enter("mathFlowMeta");m+=p.move(u.safe(i.meta,{after: `
2025-02-24 18:59:31 +08:00
` ,before:m,encode:[" $ "],...p.current()})),S()}return m+=p.move( `
` ),f&&(m+=p.move(f+ `
2025-03-05 14:30:30 +08:00
` )),m+=p.move(g),b(),m}function r(i,l,u){let c=i.value||"",f=1;for(t||f++;new RegExp("(^|[^ $ ])"+" \\ $ ".repeat(f)+"([^ $ ]| $ )").test(c);)f++;const p=" $ ".repeat(f);/[^ \r \n ]/.test(c)&&(/^[ \r \n ]/.test(c)&&/[ \r \n ] $ /.test(c)||/^ \$ | \$ $ /.test(c))&&(c=" "+c+" ");let g=-1;for(;++g<u.unsafe.length;){const b=u.unsafe[g];if(!b.atBreak)continue;const m=u.compilePattern(b);let S;for(;S=m.exec(c);){let v=S.index;c.codePointAt(v)===10&&c.codePointAt(v-1)===13&&v--,c=c.slice(0,v)+" "+c.slice(S.index+1)}}return p+c+p}function a(){return" $ "}}const Zue={tokenize:Que,concrete:!0,name:"mathFlow"},LO={tokenize:Jue,partial:!0};function Que(e,t,n){const r=this,a=r.events[r.events.length-1],i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0;let l=0;return u;function u(x){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),c(x)}function c(x){return x===36?(e.consume(x),l++,c):l<2?n(x):(e.exit("mathFlowFenceSequence"),lt(e,f,"whitespace")(x))}function f(x){return x===null|| $ e(x)?g(x):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===null|| $ e(x)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),g(x)):x===36?n(x):(e.consume(x),p)}function g(x){return e.exit("mathFlowFence"),r.interrupt?t(x):e.attempt(LO,b,A)(x)}function b(x){return e.attempt({tokenize:R,partial:!0},A,m)(x)}function m(x){return(i?lt(e,S,"linePrefix",i+1):S)(x)}function S(x){return x===null?A(x): $ e(x)?e.attempt(LO,b,A)(x):(e.enter("mathFlowValue"),v(x))}function v(x){return x===null|| $ e(x)?(e.exit("mathFlowValue"),S(x)):(e.consume(x),v)}function A(x){return e.exit("mathFlow"),t(x)}function R(x,T,C){let N=0;return lt(x,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function _(I){return x.enter("mathFlowFence"),x.enter("mathFlowFenceSequence"),O(I)}function O(I){return I===36?(N++,x.consume(I),O):N<l?C(I):(x.exit("mathFlowFenceSequence"),lt(x,z,"whitespace")(I))}function z(I){return I===null|| $ e(I)?(x.exit("mathFlowFence"),T(I)):C(I)}}}function Jue(e,t,n){const r=this;return a;function a(l){return l===null?t(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function ece(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:r,resolve:tce,previous:nce,name:"mathText"};function r(a,i,l){let u=0,c,f;return p;function p(v){return a.enter("mathText"),a.enter("mathTextSequence"),g(v)}function g(v){return v===36?(a.consume(v),u++,g):u<2&&!n?l(v):(a.exit("mathTextSequence"),b(v))}function b(v){return v===null?l(v):v===36?(f=a.enter("mathTextSequence"),c=0,S(v)):v===32?(a.enter("space"),a.consume(v),a.exit("space"),b): $ e(v)?(a.enter("lineEnding"),a.consume(v),a.exit("lineEnding"),b):(a.enter("mathTextData"),m(v))}function m(v){return v===null||v===32||v===36|| $ e(v)?(a.exit("mathTextData"),b(v)):(a.consume(v),m)}function S(v){return v===36?(a.consume(v),c++,S):c===u?(a.exit("mathTextSequence"),a.exit("mathText"),i(v)):(f.type="mathTextData",m(v))}}}function tce(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="mathTextData"){e[t][1].type="mathTextPadding",e[n][1].type="mathTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="mathTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function nce(e){return e!==36||this.events[this.events.length-1][1].type==="characterEscape"}function rce(e){return{flow:{36:Zue},text:{36:ece(e)}}}const ace={};function oce(e){const t=this,n=e||ace,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(rce(n)),i.push(Kue()),l.push(Xue(n))}function MO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e
2025-02-25 18:36:34 +08:00
` ))})}function hce(e){var t=e.codeString,n=e.codeStyle,r=e.containerStyle,a=r===void 0?{float:"left",paddingRight:"10px"}:r,i=e.numberStyle,l=i===void 0?{}:i,u=e.startingLineNumber;return ye.createElement("code",{style:Object.assign({},n,a)},gce({lines:t.replace(/ \n $ /,"").split( `
2025-03-05 14:30:30 +08:00
` ),style:l,startingLineNumber:u}))}function mce(e){return"".concat(e.toString().length,".25em")}function z5(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function P5(e,t,n){var r={display:"inline-block",minWidth:mce(n),paddingRight:"1em",textAlign:"right",userSelect:"none"},a=typeof e=="function"?e(t):e,i=go(go({},r),a);return i}function Rd(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,a=e.largestLineNumber,i=e.showInlineLineNumbers,l=e.lineProps,u=l===void 0?{}:l,c=e.className,f=c===void 0?[]:c,p=e.showLineNumbers,g=e.wrapLongLines,b=e.wrapLines,m=b===void 0?!1:b,S=m?go({},typeof u=="function"?u(n):u):{};if(S.className=S.className?[].concat(Xx(S.className.trim().split(/ \s +/)),Xx(f)):f,n&&i){var v=P5(r,n,a);t.unshift(z5(n,v))}return g&p&&(S.style=go({display:"flex"},S.style)),{type:"element",tagName:"span",properties:S,children:t}}function B5(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=0;r<e.length;r++){var a=e[r];if(a.type==="text")n.push(Rd({children:[a],className:Xx(new Set(t))}));else if(a.children){var i=t.concat(a.properties.className);B5(a.children,i).forEach(function(l){return n.push(l)})}}return n}function bce(e,t,n,r,a,i,l,u,c){var f,p=B5(e.value),g=[],b=-1,m=0;function S(N,_){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return Rd({children:N,lineNumber:_,lineNumberStyle:u,largestLineNumber:l,showInlineLineNumbers:a,lineProps:n,className:O,showLineNumbers:r,wrapLongLines:c,wrapLines:t})}function v(N,_){if(r&&_&&a){var O=P5(u,_,l);N.unshift(z5(_,O))}return N}function A(N,_){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return t||O.length>0?S(N,_,O):v(N,_)}for(var R=function(){var _=p[m],O=_.children[0].value,z=pce(O);if(z){var I=O.split( `
2025-03-05 12:54:15 +08:00
` );I.forEach(function(M,H){var q=r&&g.length+i,P={type:"text",value:"".concat(M, `
2025-03-05 14:30:30 +08:00
` )};if(H===0){var W=p.slice(b+1,m).concat(Rd({children:[P],className:_.properties.className})),Z=A(W,q);g.push(Z)}else if(H===I.length-1){var j=p[m+1]&&p[m+1].children&&p[m+1].children[0],G={type:"text",value:"".concat(M)};if(j){var B=Rd({children:[G],className:_.properties.className});p.splice(m+1,0,B)}else{var X=[G],D=A(X,q,_.properties.className);g.push(D)}}else{var V=[P],U=A(V,q,_.properties.className);g.push(U)}}),b=m}m++};m<p.length;)R();if(b!==p.length-1){var x=p.slice(b+1,p.length);if(x&&x.length){var T=r&&g.length+i,C=A(x,T);g.push(C)}}return t?g:(f=[]).concat.apply(f,g)}function yce(e){var t=e.rows,n=e.stylesheet,r=e.useInlineStyles;return t.map(function(a,i){return F5({node:a,stylesheet:n,useInlineStyles:r,key:"code-segement".concat(i)})})}function U5(e){return e&&typeof e.highlightAuto<"u"}function vce(e){var t=e.astGenerator,n=e.language,r=e.code,a=e.defaultCodeValue;if(U5(t)){var i=cce(t,n);return n==="text"?{value:a,language:"text"}:i?t.highlight(n,r):t.highlightAuto(r)}try{return n&&n!=="text"?{value:t.highlight(r,n)}:{value:a}}catch{return{value:a}}}function Sce(e,t){return function(r){var a=r.language,i=r.children,l=r.style,u=l===void 0?t:l,c=r.customStyle,f=c===void 0?{}:c,p=r.codeTagProps,g=p===void 0?{className:a?"language-".concat(a):void 0,style:go(go({},u['code[class*="language-"]']),u['code[class*="language-'.concat(a,'"]')])}:p,b=r.useInlineStyles,m=b===void 0?!0:b,S=r.showLineNumbers,v=S===void 0?!1:S,A=r.showInlineLineNumbers,R=A===void 0?!0:A,x=r.startingLineNumber,T=x===void 0?1:x,C=r.lineNumberContainerStyle,N=r.lineNumberStyle,_=N===void 0?{}:N,O=r.wrapLines,z=r.wrapLongLines,I=z===void 0?!1:z,M=r.lineProps,H=M===void 0?{}:M,q=r.renderer,P=r.PreTag,W=P===void 0?"pre":P,Z=r.CodeTag,j=Z===void 0?"code":Z,G=r.code,B=G===void 0?(Array.isArray(i)?i[0]:i)||"":G,X=r.astGenerator,D=Nee(r,dce);X=X||e;var V=v?ye.createElement(hce,{containerStyle:C,codeStyle:g.style||{},numberStyle:_,startingLineNumber:T,codeString:B}):null,U=u.hljs||u['pre[class*="language-"]']||{backgroundColor:"#fff"},L=U5(X)?"hljs":"prismjs",Y=m?Object.assign({},D,{style:Object.assign({},U,f)}):Object.assign({},D,{className:D.className?"".concat(L," ").concat(D.className):L,style:Object.assign({},f)});if(I?g.style=go({whiteSpace:"pre-wrap"},g.style):g.style=go({whiteSpace:"pre"},g.style),!X)return ye.createElement(W,Y,V,ye.createElement(j,g,B));(O===void 0&&q||I)&&(O=!0),q=q||yce;var Q=[{type:"text",value:B}],se=vce({astGenerator:X,language:a,code:B,defaultCodeValue:Q});se.language===null&&(se.value=Q);var re=se.value.length;re===1&&se.value[0].type==="text"&&(re=se.value[0].value.split( `
` ).length);var le=re+T,Ae=bce(se,O,H,v,R,T,le,_,I);return ye.createElement(W,Y,ye.createElement(j,g,!R&&V,q({rows:Ae,stylesheet:u,useInlineStyles:m})))}}const Ece=["abap","abnf","actionscript","ada","agda","al","antlr4","apacheconf","apex","apl","applescript","aql","arduino","arff","asciidoc","asm6502","asmatmel","aspnet","autohotkey","autoit","avisynth","avro-idl","bash","basic","batch","bbcode","bicep","birb","bison","bnf","brainfuck","brightscript","bro","bsl","c","cfscript","chaiscript","cil","clike","clojure","cmake","cobol","coffeescript","concurnas","coq","cpp","crystal","csharp","cshtml","csp","css-extras","css","csv","cypher","d","dart","dataweave","dax","dhall","diff","django","dns-zone-file","docker","dot","ebnf","editorconfig","eiffel","ejs","elixir","elm","erb","erlang","etlua","excel-formula","factor","false","firestore-security-rules","flow","fortran","fsharp","ftl","gap","gcode","gdscript","gedcom","gherkin","git","glsl","gml","gn","go-module","go","graphql","groovy","haml","handlebars","haskell","haxe","hcl","hlsl","hoon","hpkp","hsts","http","ichigojam","icon","icu-message-format","idris","iecst","ignore","inform7","ini","io","j","java","javadoc","javadoclike","javascript","javastacktrace","jexl","jolie","jq","js-extras","js-templates","jsdoc","json","json5","jsonp","jsstacktrace","jsx","julia","keepalived","keyman","kotlin","kumir","kusto","latex","latte","less","lilypond","liquid","lisp","livescript","llvm","log","lolcode","lua","magma","makefile","markdown","markup-templating","markup","matlab","maxscript","mel","mermaid","mizar","mongodb","monkey","moonscript","n1ql","n4js","nand2tetris-hdl","naniscript","nasm","neon","nevod","nginx","nim","nix","nsis","objectivec","ocaml","opencl","openqasm","oz","parigp","parser","pascal","pascaligo","pcaxis","peoplecode","perl","php-extras","php","phpdoc","plsql","powerquery","powershell","processing","prolog","promql","properties","protobuf","psl","pug","puppet","pure","purebasic","purescript","python","q","qml","qore","qsharp","r","racket","reason","regex","rego","renpy","rest","rip","roboconf","robotframework","ruby","rust","sas","sass","scala","scheme","scss","shell-session","smali","smalltalk","smarty","sml","solidity","solution-file","soy","sparql","splunk-spl","sqf","sql","squirrel","stan","stylus","swift","systemd","t4-cs","t4-templating","t4-vb","tap","tcl","textile","toml","tremor","tsx","tt2","turtle","twig","typescript","typoscript","unrealscript","uorazor","uri","v","vala","vbnet","velocity","verilog","vhdl","vim","visual-basic","warpscript","wasm","web-idl","wiki","wolfram","wren","xeora","xml-doc","xojo","xquery","yaml","yang","zig"];var Pm,PO;function wce(){if(PO)return Pm;PO=1,Pm=t;var e=Object.prototype.hasOwnProperty;function t(){for(var n={},r=0;r<arguments.length;r++){var a=arguments[r];for(var i in a)e.call(a,i)&&(n[i]=a[i])}return n}return Pm}var Bm,BO;function j5(){if(BO)return Bm;BO=1,Bm=t;var e=t.prototype;e.space=null,e.normal={},e.property={};function t(n,r,a){this.property=n,this.normal=r,a&&(this.space=a)}return Bm}var Um,UO;function xce(){if(UO)return Um;UO=1;var e=wce(),t=j5();Um=n;function n(r){for(var a=r.length,i=[],l=[],u=-1,c,f;++u<a;)c=r[u],i.push(c.property),l.push(c.normal),f=c.space;return new t(e.apply(null,i),e.apply(null,l),f)}return Um}var jm,jO;function iA(){if(jO)return jm;jO=1,jm=e;function e(t){return t.toLowerCase()}return jm}var Gm,GO;function G5(){if(GO)return Gm;GO=1,Gm=t;var e=t.prototype;e.space=null,e.attribute=null,e.property=null,e.boolean=!1,e.booleanish=!1,e.overloadedBoolean=!1,e.number=!1,e.commaSeparated=!1,e.spaceSeparated=!1,e.commaOrSpaceSeparated=!1,e.mustUseProperty=!1,e.defined=!1;function t(n,r){this.property=n,this.attribute=r}return Gm}var ka={},HO;function lA(){if(HO)return ka;HO=1;var e=0;ka.boolean=t(),ka.booleanish=t(),ka.overloadedBoolean=t(),ka.number=t(),ka.spaceSeparated=t(),ka.commaSeparated=t(),ka.commaOrSpaceSeparated=t();function t(){return Math.pow(2,++e)}return ka}var Hm, $ O;function H5(){if( $ O)return Hm; $ O=1;var e=G5(),t=lA();Hm=a,a.prototype=new e,a.prototype.defined=!0;var n=
2025-02-24 18:59:31 +08:00
* Prism : Lightweight , robust , elegant syntax highlighting
*
* @ license MIT < https : //opensource.org/licenses/MIT>
* @ author Lea Verou < https : //lea.verou.me>
* @ namespace
* @ public
2025-03-05 14:30:30 +08:00
* /var n=function(r){var a=/ ( ? : ^ | \ s ) lang ( ? : uage ) ? - ( [ \ w - ] + ) ( ? = \ s | $ ) / i , i = 0 , l = { } , u = { manual : r . Prism && r . Prism . manual , disableWorkerMessageHandler : r . Prism && r . Prism . disableWorkerMessageHandler , util : { encode : function x ( T ) { return T instanceof c ? new c ( T . type , x ( T . content ) , T . alias ) : Array . isArray ( T ) ? T . map ( x ) : T . replace ( /&/g , "&" ) . replace ( /</g , "<" ) . replace ( /\u00a0/g , " " ) } , type : function ( x ) { return Object . prototype . toString . call ( x ) . slice ( 8 , - 1 ) } , objId : function ( x ) { return x . _ _id || Object . defineProperty ( x , "__id" , { value : ++ i } ) , x . _ _id } , clone : function x ( T , C ) { C = C || { } ; var N , _ ; switch ( u . util . type ( T ) ) { case "Object" : if ( _ = u . util . objId ( T ) , C [ _ ] ) return C [ _ ] ; N = { } , C [ _ ] = N ; for ( var O in T ) T . hasOwnProperty ( O ) && ( N [ O ] = x ( T [ O ] , C ) ) ; return N ; case "Array" : return _ = u . util . objId ( T ) , C [ _ ] ? C [ _ ] : ( N = [ ] , C [ _ ] = N , T . forEach ( function ( z , I ) { N [ I ] = x ( z , C ) } ) , N ) ; default : return T } } , getLanguage : function ( x ) { for ( ; x ; ) { var T = a . exec ( x . className ) ; if ( T ) return T [ 1 ] . toLowerCase ( ) ; x = x . parentElement } return "none" } , setLanguage : function ( x , T ) { x . className = x . className . replace ( RegExp ( a , "gi" ) , "" ) , x . classList . add ( "language-" + T ) } , currentScript : function ( ) { if ( typeof document > "u" ) return null ; if ( "currentScript" in document ) return document . currentScript ; try { throw new Error } catch ( N ) { var x = ( /at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i . exec ( N . stack ) || [ ] ) [ 1 ] ; if ( x ) { var T = document . getElementsByTagName ( "script" ) ; for ( var C in T ) if ( T [ C ] . src == x ) return T [ C ] } return null } } , isActive : function ( x , T , C ) { for ( var N = "no-" + T ; x ; ) { var _ = x . classList ; if ( _ . contains ( T ) ) return ! 0 ; if ( _ . contains ( N ) ) return ! 1 ; x = x . parentElement } return ! ! C } } , languages : { plain : l , plaintext : l , text : l , txt : l , extend : function ( x , T ) { var C = u . util . clone ( u . languages [ x ] ) ; for ( var N in T ) C [ N ] = T [ N ] ; return C } , insertBefore : function ( x , T , C , N ) { N = N || u . languages ; var _ = N [ x ] , O = { } ; for ( var z in _ ) if ( _ . hasOwnProperty ( z ) ) { if ( z == T ) for ( var I in C ) C . hasOwnProperty ( I ) && ( O [ I ] = C [ I ] ) ; C . hasOwnProperty ( z ) || ( O [ z ] = _ [ z ] ) } var M = N [ x ] ; return N [ x ] = O , u . languages . DFS ( u . languages , function ( H , q ) { q === M && H != x && ( this [ H ] = O ) } ) , O } , DFS : function x ( T , C , N , _ ) { _ = _ || { } ; var O = u . util . objId ; for ( var z in T ) if ( T . hasOwnProperty ( z ) ) { C . call ( T , z , T [ z ] , N || z ) ; var I = T [ z ] , M = u . util . type ( I ) ; M === "Object" && ! _ [ O ( I ) ] ? ( _ [ O ( I ) ] = ! 0 , x ( I , C , null , _ ) ) : M === "Array" && ! _ [ O ( I ) ] && ( _ [ O ( I ) ] = ! 0 , x ( I , C , z , _ ) ) } } } , plugins : { } , highlightAll : function ( x , T ) { u . highlightAllUnder ( document , x , T ) } , highlightAllUnder : function ( x , T , C ) { var N = { callback : C , container : x , selector : 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code' } ; u . hooks . run ( "before-highlightall" , N ) , N . elements = Array . prototype . slice . apply ( N . container . querySelectorAll ( N . selector ) ) , u . hooks . run ( "before-all-elements-highlight" , N ) ; for ( var _ = 0 , O ; O = N . elements [ _ ++ ] ; ) u . highlightElement ( O , T === ! 0 , N . callback ) } , highlightElement : function ( x , T , C ) { var N = u . util . getLanguage ( x ) , _ = u . languages [ N ] ; u . util . setLanguage ( x , N ) ; var O = x . parentElement ; O && O . nodeName . toLowerCase ( ) === "pre" && u . util . setLanguage ( O , N ) ; var z = x . textContent , I = { element : x , language : N , grammar : _ , code : z } ; function M ( q ) { I . highlightedCode = q , u . hooks . run ( "before-insert" , I ) , I . element . innerHTML = I . highlightedCode , u . hooks . run ( "after-highlight" , I ) , u . hooks . run ( "complete" , I ) , C && C . call ( I . element ) } if ( u . hooks . run ( "before-sanity-check" , I ) , O = I . element . parentElement , O && O . nodeName . toLowerCase ( ) === "pre" && ! O . hasAttribute ( "tabindex" ) && O . setAttribute ( "tabindex" , "0" ) , ! I . code ) { u . hooks . run ( "complete" , I ) , C && C . call ( I . element ) ; return } if ( u . hooks . run ( "before-highlight" , I ) , ! I . grammar ) { M ( u . util . encode ( I . code ) ) ; return } if ( T && r . Worker ) { var H = new Worker ( u . filename ) ; H . onmessage = function ( q ) { M ( q . data ) } , H . postMessage ( JSON . stringify ( { language : I . language , code : I . code , immediateClose : ! 0 } ) ) } else M ( u . highlight ( I . code , I . grammar , I . language ) ) } , highlight : function ( x , T , C ) { var N = { code : x , grammar : T , language : C } ; if ( u . hooks . run ( "before-tokenize" , N ) , ! N . grammar ) throw new Error ( 'The language "' + N . language + '" has no grammar.' ) ; return N . tokens = u . tokenize ( N . code , N . grammar ) , u . hooks . run ( "after-tokenize" , N ) , c . stringify ( u . util . encode ( N . tokens ) , N . language ) } , tokenize : function ( x , T ) { var C = T . rest ; if ( C ) { for ( var N in C ) T [ N ] = C [ N ] ; delete T . rest } var _ = new g ; return b ( _ , _ . head , x ) , p ( x , _ , T , _ . head , 0 ) , S ( _ ) } , hooks : { all : { } , add : function ( x , T )
2025-02-24 18:59:31 +08:00
? |
2025-03-05 14:30:30 +08:00
| ( ? ! [ \ \ s \ \ S ] ) ) ) + ` ,"m"),alias:l,inside:{line:{pattern:/(.)(?=[ \s \S ]).*(?: \r \n ?| \n )?/,lookbehind:!0},prefix:{pattern:/[ \s \S ]/,alias:/ \w +/.exec(a)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:r})})(t)}return Ey}var wy,AI;function Gn(){if(AI)return wy;AI=1,wy=e,e.displayName="markupTemplating",e.aliases=[];function e(t){(function(n){function r(a,i){return"___"+a.toUpperCase()+i+"___"}Object.defineProperties(n.languages["markup-templating"]={},{buildPlaceholders:{value:function(a,i,l,u){if(a.language===i){var c=a.tokenStack=[];a.code=a.code.replace(l,function(f){if(typeof u=="function"&&!u(f))return f;for(var p=c.length,g;a.code.indexOf(g=r(i,p))!==-1;)++p;return c[p]=f,g}),a.grammar=n.languages.markup}}},tokenizePlaceholders:{value:function(a,i){if(a.language!==i||!a.tokenStack)return;a.grammar=n.languages[i];var l=0,u=Object.keys(a.tokenStack);function c(f){for(var p=0;p<f.length&&!(l>=u.length);p++){var g=f[p];if(typeof g=="string"||g.content&&typeof g.content=="string"){var b=u[l],m=a.tokenStack[b],S=typeof g=="string"?g:g.content,v=r(i,b),A=S.indexOf(v);if(A>-1){++l;var R=S.substring(0,A),x=new n.Token(i,n.tokenize(m,a.grammar),"language-"+i,m),T=S.substring(A+v.length),C=[];R&&C.push.apply(C,c([R])),C.push(x),T&&C.push.apply(C,c([T])),typeof g=="string"?f.splice.apply(f,[p,1].concat(C)):g.content=C}}else g.content&&c(g.content)}return f}c(a.tokens)}}})})(t)}return wy}var xy,TI;function Kpe(){if(TI)return xy;TI=1;var e=Gn();xy=t,t.displayName="django",t.aliases=["jinja2"];function t(n){n.register(e),function(r){r.languages.django={comment:/^ \{ #[ \s \S ]*?# \} $ /,tag:{pattern:/(^ \{ %[+-]? \s *) \w +/,lookbehind:!0,alias:"keyword"},delimiter:{pattern:/^ \{ [{%][+-]?|[+-]?[}%] \} $ /,alias:"punctuation"},string:{pattern:/("|')(?: \\ .|(?! \1 )[^ \\ \r \n ])* \1 /,greedy:!0},filter:{pattern:/( \| ) \w +/,lookbehind:!0,alias:"function"},test:{pattern:/( \b is \s +(?:not \s +)?)(?!not \b ) \w +/,lookbehind:!0,alias:"function"},function:/ \b [a-z_] \w +(?= \s * \( )/i,keyword:/ \b (?:and|as|by|else|for|if|import|in|is|loop|not|or|recursive|with|without) \b /,operator:/[-+%=]=?|!=| \* \* ?=?| \/ \/ ?=?|<[<=>]?|>[=>]?|[&|^~]/,number:/ \b \d +(?: \. \d +)? \b /,boolean:/[Ff]alse|[Nn]one|[Tt]rue/,variable:/ \b \w + \b /,punctuation:/[{}[ \] (),.:;]/};var a=/ \{ \{ [ \s \S ]*? \} \} | \{ %[ \s \S ]*?% \} | \{ #[ \s \S ]*?# \} /g,i=r.languages["markup-templating"];r.hooks.add("before-tokenize",function(l){i.buildPlaceholders(l,"django",a)}),r.hooks.add("after-tokenize",function(l){i.tokenizePlaceholders(l,"django")}),r.languages.jinja2=r.languages.django,r.hooks.add("before-tokenize",function(l){i.buildPlaceholders(l,"jinja2",a)}),r.hooks.add("after-tokenize",function(l){i.tokenizePlaceholders(l,"jinja2")})}(n)}return xy}var ky,_I;function Xpe(){if(_I)return ky;_I=1,ky=e,e.displayName="dnsZoneFile",e.aliases=[];function e(t){t.languages["dns-zone-file"]={comment:/;.*/,string:{pattern:/"(?: \\ .|[^" \\ \r \n ])*"/,greedy:!0},variable:[{pattern:/(^ \$ ORIGIN[ \t ]+) \S +/m,lookbehind:!0},{pattern:/(^| \s )@(?= \s | $ )/,lookbehind:!0}],keyword:/^ \$ (?:INCLUDE|ORIGIN|TTL)(?= \s | $ )/m,class:{pattern:/(^| \s )(?:CH|CS|HS|IN)(?= \s | $ )/,lookbehind:!0,alias:"keyword"},type:{pattern:/(^| \s )(?:A|A6|AAAA|AFSDB|APL|ATMA|CAA|CDNSKEY|CDS|CERT|CNAME|DHCID|DLV|DNAME|DNSKEY|DS|EID|GID|GPOS|HINFO|HIP|IPSECKEY|ISDN|KEY|KX|LOC|MAILA|MAILB|MB|MD|MF|MG|MINFO|MR|MX|NAPTR|NB|NBSTAT|NIMLOC|NINFO|NS|NSAP|NSAP-PTR|NSEC|NSEC3|NSEC3PARAM|NULL|NXT|OPENPGPKEY|PTR|PX|RKEY|RP|RRSIG|RT|SIG|SINK|SMIMEA|SOA|SPF|SRV|SSHFP|TA|TKEY|TLSA|TSIG|TXT|UID|UINFO|UNSPEC|URI|WKS|X25)(?= \s | $ )/,lookbehind:!0,alias:"keyword"},punctuation:/[()]/},t.languages["dns-zone"]=t.languages["dns-zone-file"]}return ky}var Ay,RI;function Zpe(){if(RI)return Ay;RI=1,Ay=e,e.displayName="docker",e.aliases=["dockerfile"];function e(t){(function(n){var r=/ \\ [ \r \n ](?: \s | \\ [ \r \n ]|#.*(?!.))*(?![ \s #]| \\ [ \r \n ])/.source,a=/(?:[ \t ]+(?![ \t ])(?:<SP_BS>)?|<SP_BS>)/.source.replace(/<SP_BS>/g,function(){return r}),i=/"(?:[^" \\ \r \n ]| \\ (?: \r \n |[ \s \S ]))*"|'(?:[^' \\ \r \n ]| \\ (?: \r \n |[ \s \S ]))*'/.source,l=/--[ \w -]+=(?:<STR>|(?!["'])(?:[^ \s \\ ]| \\ .)+)/.source.replace(/<STR>/g,function(){return i}),u={pattern:RegExp(
] ) ) ( ? : ` +(/[^ \s \\ ]/.source+'|[ ]+(?:(?![ "])|'+a+")|"+/ \\ [ \r \n ]+(?:[#;].*[ \r \n ]+)*(?![#;])/.source)+")*"),lookbehind:!0,greedy:!0,alias:"attr-value",inside:{comment:r,quoted:{pattern:RegExp(/(^| \s )/.source+a),lookbehind:!0,greedy:!0},punctuation:/ \\ $ /m,boolean:{pattern:/^(?:false|no|off|on|true|yes) $ /,greedy:!0}}},punctuation:/=/}})(t)}return FE}var zE,UM;function hA(){if(UM)return zE;UM=1,zE=e,e.displayName="t4Templating",e.aliases=[];function e(t){(function(n){function r(i,l,u){return{pattern:RegExp("<#"+i+"[ \\ s \\ S]*?#>"),alias:"block",inside:{delimiter:{pattern:RegExp("^<#"+i+"|#> $ "),alias:"important"},content:{pattern:/[ \s \S ]+/,inside:l,alias:u}}}}function a(i){var l=n.languages[i],u="language-"+i;return{block:{pattern:/<#[ \s \S ]+?#>/,inside:{directive:r("@",{"attr-value":{pattern:/=(?:("|')(?: \\ [ \s \S ]|(?! \1 )[^ \\ ])* \1 |[^ \s '">=]+)/,inside:{punctuation:/^=|^["']|["'] $ /}},keyword:/ \b \w +(?= \s )/,"attr-name":/ \b \w +/}),expression:r("=",l,u),"class-feature":r(" \\ +",l,u),standard:r("",l,u)}}}}n.languages["t4-templating"]=Object.defineProperty({},"createT4",{value:a})})(t)}return zE}var PE,jM;function Jme(){if(jM)return PE;jM=1;var e=hA(),t=Vf();PE=n,n.displayName="t4Cs",n.aliases=[];function n(r){r.register(e),r.register(t),r.languages.t4=r.languages["t4-cs"]=r.languages["t4-templating"].createT4("csharp")}return PE}var BE,GM;function Z5(){if(GM)return BE;GM=1;var e=W5();BE=t,t.displayName="vbnet",t.aliases=[];function t(n){n.register(e),n.languages.vbnet=n.languages.extend("basic",{comment:[{pattern:/(?:!|REM \b ).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^ \\ :])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?: \b (?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)| \B (?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?: \$ | \b )/i,punctuation:/[,;:(){}]/})}return BE}var UE,HM;function ebe(){if(HM)return UE;HM=1;var e=hA(),t=Z5();UE=n,n.displayName="t4Vb",n.aliases=[];function n(r){r.register(e),r.register(t),r.languages["t4-vb"]=r.languages["t4-templating"].createT4("vbnet")}return UE}var jE, $ M;function Q5(){if( $ M)return jE; $ M=1,jE=e,e.displayName="yaml",e.aliases=["yml"];function e(t){(function(n){var r=/[*&][^ \s [ \] {},]+/,a=/!(?:<[ \w \- %#;/?:@&=+ $ ,.!~*'()[ \] ]+>|(?:[a-zA-Z \d -]*!)?[ \w \- %#;/?:@&=+ $ .~*'()]+)?/,i="(?:"+a.source+"(?:[ ]+"+r.source+")?|"+r.source+"(?:[ ]+"+a.source+")?)",l=/(?:[^ \s \x 00- \x 08 \x 0e- \x 1f!"#%&'*, \- :>?@[ \] ` { | } \ x7f - \ x84 \ x86 - \ x9f\ud800 - \udfff\ufffe\uffff ] | [ ? : - ] < PLAIN > ) ( ? : [ \ t ] * ( ? : ( ? ! [ # : ] ) < PLAIN > | : < PLAIN > ) ) * /.source.replace(/ < PLAIN > /g,function(){return/ [ ^ \ s \ x00 - \ x08 \ x0e - \ x1f , [ \ ] { } \ x7f - \ x84 \ x86 - \ x9f\ud800 - \udfff\ufffe\uffff ] / . source } ) , u = /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/ . source ; function c ( f , p ) { p = ( p || "" ) . replace ( /m/g , "" ) + "m" ; var g = /
` ),Cye=({className:e,children:t,node:n,...r})=>{const{theme:a}=l0(),i=e==null?void 0:e.match(/language-( \w +)/),l=i?i[1]:void 0;return(n?Rye(n):!1)?w.jsx("code",{className:Me(e,"mx-1 rounded-xs bg-black/10 px-1 dark:bg-gray-100/20"),...r,children:t}):w.jsx(J5,{style:a==="dark"?hz.oneDark:hz.oneLight,PreTag:"div",language:l,...r,children:String(t).replace(/ \n $ /,"")})};function Nye(){const[e,t]=k.useState(()=>We.getState().retrievalHistory||[]),[n,r]=k.useState(""),[a,i]=k.useState(!1),l=k.useRef(null),u=k.useCallback(()=>{var g;(g=l.current)==null||g.scrollIntoView({behavior:"smooth"})},[]),c=k.useCallback(async g=>{if(g.preventDefault(),!n.trim()||a)return;const b={content:n,role:"user"},m={content:"",role:"assistant"},S=[...e];t([...S,b,m]),r(""),i(!0);const v=(x,T)=>{m.content+=x,t(C=>{const N=[...C],_=N[N.length-1];return _.role==="assistant"&&(_.content=m.content,_.isError=T),N})},A=We.getState(),R={...A.querySettings,query:b.content,conversation_history:S.filter(x=>x.isError!==!0).map(x=>({role:x.role,content:x.content}))};try{if(A.querySettings.stream){let x="";await gq(R,v,T=>{x+=T}),x&&(m.content&&(x=m.content+ `
2025-02-25 18:36:34 +08:00
` +x),v(x,!0))}else{const x=await pq(R);v(x.response)}}catch(x){v( ` Error : Failed to get response
2025-03-05 12:54:15 +08:00
$ { Nr ( x ) } ` ,!0)}finally{i(!1),We.getState().setRetrievalHistory([...S,b,m])}},[n,a,e,t]),f=I0(e,100);k.useEffect(()=>u(),[f,u]);const p=k.useCallback(()=>{t([]),We.getState().setRetrievalHistory([])},[t]);return w.jsxs("div",{className:"flex size-full gap-2 px-2 pb-12",children:[w.jsxs("div",{className:"flex grow flex-col gap-4",children:[w.jsx("div",{className:"relative grow",children:w.jsx("div",{className:"bg-primary-foreground/60 absolute inset-0 flex flex-col overflow-auto rounded-lg border p-2",children:w.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2",children:[e.length===0?w.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center text-lg",children:"Start a retrieval by typing your query below"}):e.map((g,b)=>w.jsx("div",{className: ` flex $ { g . role === "user" ? "justify-end" : "justify-start" } ` ,children:w.jsx(_ye,{message:g})},b)),w.jsx("div",{ref:l,className:"pb-1"})]})})}),w.jsxs("form",{onSubmit:c,className:"flex shrink-0 items-center gap-2",children:[w.jsxs(Lt,{type:"button",variant:"outline",onClick:p,disabled:a,size:"sm",children:[w.jsx(uP,{}),"Clear"]}),w.jsx(Eo,{className:"flex-1",value:n,onChange:g=>r(g.target.value),placeholder:"Type your query...",disabled:a}),w.jsxs(Lt,{type:"submit",variant:"default",disabled:a,size:"sm",children:[w.jsx(o8,{}),"Send"]})]})]}),w.jsx(kre,{})]})}function Oye(){return w.jsx("iframe",{src:Rz+"/docs",className:"size-full"})}function Dye(){const e=Pn.use.message(),t=We.use.enableHealthCheck(),[n]=k.useState(()=>We.getState().currentTab),[r,a]=k.useState(!1);k.useEffect(()=>{if(!t)return;Pn.getState().check();const l=setInterval(async()=>{await Pn.getState().check()},T9*1e3);return()=>clearInterval(l)},[t]);const i=k.useCallback(l=>We.getState().setCurrentTab(l),[]);return k.useEffect(()=>{if(e&&(e.includes(oP)||e.includes(iP))){a(!0);return}a(!1)},[e,a]),w.jsx(N9,{children:w.jsxs("main",{className:"flex h-screen w-screen overflow-x-hidden",children:[w.jsxs(LY,{defaultValue:n,className:"!m-0 flex grow flex-col !p-0",onValueChange:i,children:[w.jsx(FY,{}),w.jsxs("div",{className:"relative grow",children:[w.jsx(Vs,{value:"documents",className:"absolute top-0 right-0 bottom-0 left-0",children:w.jsx(Ane,{})}),w.jsx(Vs,{value:"knowledge-graph",className:"absolute top-0 right-0 bottom-0 left-0",children:w.jsx(Kee,{})}),w.jsx(Vs,{value:"retrieval",className:"absolute top-0 right-0 bottom-0 left-0",children:w.jsx(Nye,{})}),w.jsx(Vs,{value:"api",className:"absolute top-0 right-0 bottom-0 left-0",children:w.jsx(Oye,{})})]})]}),t&&w.jsx(mY,{}),e!==null&&!r&&w.jsx(y8,{}),r&&w.jsx(nY,{}),w.jsx(tY,{})]})})}xH.createRoot(document.getElementById("root")).render(w.jsx(k.StrictMode,{children:w.jsx(Dye,{})}));