mirror of
https://gitee.com/270580156/weiyu.git
synced 2026-05-18 13:17:50 +00:00
2 lines
14 KiB
JavaScript
2 lines
14 KiB
JavaScript
import{S as A,z as g,C as N,L as Q,N as J,O as I,y as c,v as M,P as k,Q as Te,R as Ee,T as Ce,U as ee,V as we,W as te,X as $,H as ne,Y as w,E as re,Z as Ie,$ as Pe,a0 as Le,a1 as je,a2 as ie,a3 as Se,G as Fe,a4 as se,a5 as Ne,F as Me,D as ae,A as $e,x as De,a6 as xe,a7 as L,a8 as oe,a9 as ve,aa as Re,p as Ge,ab as Ue,I as E,f as G,i as U}from"./index-JW_xMAog.js";import{an as Be}from"./mermaid.core-D_f8Rnih.js";function ue(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var B=A?A.prototype:void 0,K=B?B.toString:void 0;function fe(e){if(typeof e=="string")return e;if(g(e))return ue(e,fe)+"";if(N(e))return K?K.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ke(){}function he(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function Ye(e,t,n,r){for(var i=e.length,s=n+-1;++s<i;)if(t(e[s],s,e))return s;return-1}function He(e){return e!==e}function Ze(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function ze(e,t,n){return t===t?Ze(e,t,n):Ye(e,He,n)}function qe(e,t){var n=e==null?0:e.length;return!!n&&ze(e,t,0)>-1}var Ve=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,We=/^\w*$/;function D(e,t){if(g(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||N(e)?!0:We.test(e)||!Ve.test(e)||t!=null&&e in Object(t)}var Xe=500;function Qe(e){var t=Be(e,function(r){return n.size===Xe&&n.clear(),r}),n=t.cache;return t}var Je=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ke=/\\(\\)?/g,et=Qe(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Je,function(n,r,i,s){t.push(i?s.replace(ke,"$1"):r||n)}),t});function tt(e){return e==null?"":fe(e)}function de(e,t){return g(e)?e:D(e,t)?[e]:et(tt(e))}function P(e){if(typeof e=="string"||N(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function ce(e,t){t=de(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[P(t[n++])];return n&&n==r?e:void 0}function nt(e,t,n){var r=e==null?void 0:ce(e,t);return r===void 0?n:r}var Y=A?A.isConcatSpreadable:void 0;function rt(e){return g(e)||Q(e)||!!(Y&&e&&e[Y])}function it(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=rt),i||(i=[]);++s<a;){var o=e[s];n(o)?J(i,o):r||(i[i.length]=o)}return i}function st(e,t,n,r){var i=-1,s=e==null?0:e.length;for(r&&s&&(n=e[++i]);++i<s;)n=t(n,e[i],i,e);return n}function at(e,t){return e&&I(t,c(t),e)}function ot(e,t){return e&&I(t,M(t),e)}function ut(e,t){return I(e,k(e),t)}var ft=Object.getOwnPropertySymbols,ge=ft?function(e){for(var t=[];e;)J(t,k(e)),e=Ee(e);return t}:Te;function ht(e,t){return I(e,ge(e),t)}function dt(e){return Ce(e,M,ge)}var ct=Object.prototype,gt=ct.hasOwnProperty;function lt(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&>.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function _t(e,t){var n=t?ee(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var pt=/\w*$/;function bt(e){var t=new e.constructor(e.source,pt.exec(e));return t.lastIndex=e.lastIndex,t}var H=A?A.prototype:void 0,Z=H?H.valueOf:void 0;function yt(e){return Z?Object(Z.call(e)):{}}var mt="[object Boolean]",At="[object Date]",Ot="[object Map]",Tt="[object Number]",Et="[object RegExp]",Ct="[object Set]",wt="[object String]",It="[object Symbol]",Pt="[object ArrayBuffer]",Lt="[object DataView]",jt="[object Float32Array]",St="[object Float64Array]",Ft="[object Int8Array]",Nt="[object Int16Array]",Mt="[object Int32Array]",$t="[object Uint8Array]",Dt="[object Uint8ClampedArray]",xt="[object Uint16Array]",vt="[object Uint32Array]";function Rt(e,t,n){var r=e.constructor;switch(t){case Pt:return ee(e);case mt:case At:return new r(+e);case Lt:return _t(e,n);case jt:case St:case Ft:case Nt:case Mt:case $t:case Dt:case xt:case vt:return we(e,n);case Ot:return new r;case Tt:case wt:return new r(e);case Et:return bt(e);case Ct:return new r;case It:return yt(e)}}var Gt="[object Map]";function Ut(e){return te(e)&&$(e)==Gt}var z=w&&w.isMap,Bt=z?ne(z):Ut,Kt="[object Set]";function Yt(e){return te(e)&&$(e)==Kt}var q=w&&w.isSet,Ht=q?ne(q):Yt,Zt=1,zt=2,qt=4,le="[object Arguments]",Vt="[object Array]",Wt="[object Boolean]",Xt="[object Date]",Qt="[object Error]",_e="[object Function]",Jt="[object GeneratorFunction]",kt="[object Map]",en="[object Number]",pe="[object Object]",tn="[object RegExp]",nn="[object Set]",rn="[object String]",sn="[object Symbol]",an="[object WeakMap]",on="[object ArrayBuffer]",un="[object DataView]",fn="[object Float32Array]",hn="[object Float64Array]",dn="[object Int8Array]",cn="[object Int16Array]",gn="[object Int32Array]",ln="[object Uint8Array]",_n="[object Uint8ClampedArray]",pn="[object Uint16Array]",bn="[object Uint32Array]",u={};u[le]=u[Vt]=u[on]=u[un]=u[Wt]=u[Xt]=u[fn]=u[hn]=u[dn]=u[cn]=u[gn]=u[kt]=u[en]=u[pe]=u[tn]=u[nn]=u[rn]=u[sn]=u[ln]=u[_n]=u[pn]=u[bn]=!0;u[Qt]=u[_e]=u[an]=!1;function j(e,t,n,r,i,s){var a,o=t&Zt,f=t&zt,y=t&qt;if(a!==void 0)return a;if(!re(e))return e;var d=g(e);if(d){if(a=lt(e),!o)return Ie(e,a)}else{var h=$(e),O=h==_e||h==Jt;if(Pe(e))return Le(e,o);if(h==pe||h==le||O&&!i){if(a=f||O?{}:je(e),!o)return f?ht(e,ot(a,e)):ut(e,at(a,e))}else{if(!u[h])return i?e:{};a=Rt(e,h,o)}}s||(s=new ie);var v=s.get(e);if(v)return v;s.set(e,a),Ht(e)?e.forEach(function(l){a.add(j(l,t,n,l,e,s))}):Bt(e)&&e.forEach(function(l,_){a.set(_,j(l,t,n,_,e,s))});var Oe=y?f?dt:Se:f?M:c,R=d?void 0:Oe(e);return he(R||e,function(l,_){R&&(_=l,l=e[_]),Fe(a,_,j(l,t,n,_,e,s))}),a}var yn=1,mn=2;function An(e,t,n,r){var i=n.length,s=i;if(e==null)return!s;for(e=Object(e);i--;){var a=n[i];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<s;){a=n[i];var o=a[0],f=e[o],y=a[1];if(a[2]){if(f===void 0&&!(o in e))return!1}else{var d=new ie,h;if(!(h===void 0?se(y,f,yn|mn,r,d):h))return!1}}return!0}function be(e){return e===e&&!re(e)}function On(e){for(var t=c(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,be(i)]}return t}function ye(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function Tn(e){var t=On(e);return t.length==1&&t[0][2]?ye(t[0][0],t[0][1]):function(n){return n===e||An(n,e,t)}}function En(e,t){return e!=null&&t in Object(e)}function Cn(e,t,n){t=de(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=P(t[r]);if(!(s=e!=null&&n(e,a)))break;e=e[a]}return s||++r!=i?s:(i=e==null?0:e.length,!!i&&Ne(i)&&Me(a,i)&&(g(e)||Q(e)))}function wn(e,t){return e!=null&&Cn(e,t,En)}var In=1,Pn=2;function Ln(e,t){return D(e)&&be(t)?ye(P(e),t):function(n){var r=nt(n,e);return r===void 0&&r===t?wn(n,e):se(t,r,In|Pn)}}function jn(e){return function(t){return t==null?void 0:t[e]}}function Sn(e){return function(t){return ce(t,e)}}function Fn(e){return D(e)?jn(P(e)):Sn(e)}function me(e){return typeof e=="function"?e:e==null?ae:typeof e=="object"?g(e)?Ln(e[0],e[1]):Tn(e):Fn(e)}function Nn(e,t){return e&&$e(e,t,c)}function Mn(e,t){return function(n,r){if(n==null)return n;if(!De(n))return e(n,r);for(var i=n.length,s=-1,a=Object(n);++s<i&&r(a[s],s,a)!==!1;);return n}}var x=Mn(Nn);function $n(e){return typeof e=="function"?e:ae}function p(e,t){var n=g(e)?he:x;return n(e,$n(t))}function Dn(e,t){var n=[];return x(e,function(r,i,s){t(r,i,s)&&n.push(r)}),n}function C(e,t){var n=g(e)?xe:Dn;return n(e,me(t))}function xn(e,t){return ue(t,function(n){return e[n]})}function S(e){return e==null?[]:xn(e,c(e))}function m(e){return e===void 0}function vn(e,t,n,r,i){return i(e,function(s,a,o){n=r?(r=!1,s):t(n,s,a,o)}),n}function Rn(e,t,n){var r=g(e)?st:vn,i=arguments.length<3;return r(e,me(t),n,i,x)}var Gn=1/0,Un=L&&1/oe(new L([,-0]))[1]==Gn?function(e){return new L(e)}:Ke,Bn=200;function Kn(e,t,n){var r=-1,i=qe,s=e.length,a=!0,o=[],f=o;if(s>=Bn){var y=Un(e);if(y)return oe(y);a=!1,i=Re,f=new ve}else f=o;e:for(;++r<s;){var d=e[r],h=d;if(d=d!==0?d:0,a&&h===h){for(var O=f.length;O--;)if(f[O]===h)continue e;o.push(d)}else i(f,h,n)||(f!==o&&f.push(h),o.push(d))}return o}var Yn=Ge(function(e){return Kn(it(e,1,Ue,!0))}),Hn="\0",b="\0",V="";class Ae{constructor(t={}){this._isDirected=Object.prototype.hasOwnProperty.call(t,"directed")?t.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(t,"multigraph")?t.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=E(void 0),this._defaultEdgeLabelFn=E(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[b]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return G(t)||(t=E(t)),this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return c(this._nodes)}sources(){var t=this;return C(this.nodes(),function(n){return U(t._in[n])})}sinks(){var t=this;return C(this.nodes(),function(n){return U(t._out[n])})}setNodes(t,n){var r=arguments,i=this;return p(t,function(s){r.length>1?i.setNode(s,n):i.setNode(s)}),this}setNode(t,n){return Object.prototype.hasOwnProperty.call(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=n),this):(this._nodes[t]=arguments.length>1?n:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=b,this._children[t]={},this._children[b][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var n=r=>this.removeEdge(this._edgeObjs[r]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],p(this.children(t),r=>{this.setParent(r)}),delete this._children[t]),p(c(this._in[t]),n),delete this._in[t],delete this._preds[t],p(c(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,n){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(m(n))n=b;else{n+="";for(var r=n;!m(r);r=this.parent(r))if(r===t)throw new Error("Setting "+n+" as parent of "+t+" would create a cycle");this.setNode(n)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=n,this._children[n][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var n=this._parent[t];if(n!==b)return n}}children(t){if(m(t)&&(t=b),this._isCompound){var n=this._children[t];if(n)return c(n)}else{if(t===b)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var n=this._preds[t];if(n)return c(n)}successors(t){var n=this._sucs[t];if(n)return c(n)}neighbors(t){var n=this.predecessors(t);if(n)return Yn(n,this.successors(t))}isLeaf(t){var n;return this.isDirected()?n=this.successors(t):n=this.neighbors(t),n.length===0}filterNodes(t){var n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph());var r=this;p(this._nodes,function(a,o){t(o)&&n.setNode(o,a)}),p(this._edgeObjs,function(a){n.hasNode(a.v)&&n.hasNode(a.w)&&n.setEdge(a,r.edge(a))});var i={};function s(a){var o=r.parent(a);return o===void 0||n.hasNode(o)?(i[a]=o,o):o in i?i[o]:s(o)}return this._isCompound&&p(n.nodes(),function(a){n.setParent(a,s(a))}),n}setDefaultEdgeLabel(t){return G(t)||(t=E(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return S(this._edgeObjs)}setPath(t,n){var r=this,i=arguments;return Rn(t,function(s,a){return i.length>1?r.setEdge(s,a,n):r.setEdge(s,a),a}),this}setEdge(){var t,n,r,i,s=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(t=a.v,n=a.w,r=a.name,arguments.length===2&&(i=arguments[1],s=!0)):(t=a,n=arguments[1],r=arguments[3],arguments.length>2&&(i=arguments[2],s=!0)),t=""+t,n=""+n,m(r)||(r=""+r);var o=T(this._isDirected,t,n,r);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return s&&(this._edgeLabels[o]=i),this;if(!m(r)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(n),this._edgeLabels[o]=s?i:this._defaultEdgeLabelFn(t,n,r);var f=Zn(this._isDirected,t,n,r);return t=f.v,n=f.w,Object.freeze(f),this._edgeObjs[o]=f,W(this._preds[n],t),W(this._sucs[t],n),this._in[n][o]=f,this._out[t][o]=f,this._edgeCount++,this}edge(t,n,r){var i=arguments.length===1?F(this._isDirected,arguments[0]):T(this._isDirected,t,n,r);return this._edgeLabels[i]}hasEdge(t,n,r){var i=arguments.length===1?F(this._isDirected,arguments[0]):T(this._isDirected,t,n,r);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(t,n,r){var i=arguments.length===1?F(this._isDirected,arguments[0]):T(this._isDirected,t,n,r),s=this._edgeObjs[i];return s&&(t=s.v,n=s.w,delete this._edgeLabels[i],delete this._edgeObjs[i],X(this._preds[n],t),X(this._sucs[t],n),delete this._in[n][i],delete this._out[t][i],this._edgeCount--),this}inEdges(t,n){var r=this._in[t];if(r){var i=S(r);return n?C(i,function(s){return s.v===n}):i}}outEdges(t,n){var r=this._out[t];if(r){var i=S(r);return n?C(i,function(s){return s.w===n}):i}}nodeEdges(t,n){var r=this.inEdges(t,n);if(r)return r.concat(this.outEdges(t,n))}}Ae.prototype._nodeCount=0;Ae.prototype._edgeCount=0;function W(e,t){e[t]?e[t]++:e[t]=1}function X(e,t){--e[t]||delete e[t]}function T(e,t,n,r){var i=""+t,s=""+n;if(!e&&i>s){var a=i;i=s,s=a}return i+V+s+V+(m(r)?Hn:r)}function Zn(e,t,n,r){var i=""+t,s=""+n;if(!e&&i>s){var a=i;i=s,s=a}var o={v:i,w:s};return r&&(o.name=r),o}function F(e,t){return T(e,t.v,t.w,t.name)}export{Ae as G,j as a,it as b,me as c,Ye as d,x as e,ue as f,$n as g,Nn as h,m as i,Cn as j,de as k,ce as l,wn as m,tt as n,p as o,C as p,Rn as r,P as t,S as v};
|