zen-gitsync 2.17.49 → 2.17.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/package.json +3 -2
- package/src/cli/ai/modelSetup.js +63 -2
- package/src/cli/ai/modelSetup.test.js +28 -2
- package/src/ui/public/assets/{AgentView-uHf-KMCH.css → AgentView-CAPlZLDq.css} +1 -1
- package/src/ui/public/assets/AgentView-D3EyOwN5.js +1 -0
- package/src/ui/public/assets/{AppVersionBadge-DyhIkbbF.js → AppVersionBadge-U0CyGRID.js} +2 -2
- package/src/ui/public/assets/{BranchSelector-CDQZlH-y.js → BranchSelector-CJQb9Z16.js} +1 -1
- package/src/ui/public/assets/{CommitForm-DpIXE8z1.js → CommitForm-D25Wj9NR.js} +1 -1
- package/src/ui/public/assets/{CommonDialog-NqZURH2F.js → CommonDialog-33jIvgti.js} +1 -1
- package/src/ui/public/assets/{AgentEngineSelector-D7DmG6PU.css → CopySessionButton-BLUHPwDR.css} +1 -1
- package/src/ui/public/assets/CopySessionButton-Bpe-A3h0.js +20 -0
- package/src/ui/public/assets/{EditorView-0T5LR5Hz.css → EditorView-B3bNe9Ic.css} +1 -1
- package/src/ui/public/assets/EditorView-Ce4rZawb.js +1 -0
- package/src/ui/public/assets/{FlowExecutionViewer-DxDKzmaP.js → FlowExecutionViewer-CAiAPsVH.js} +1 -1
- package/src/ui/public/assets/{FlowOrchestrationWorkspace-BHASB5iW.js → FlowOrchestrationWorkspace-CV84hp8i.js} +1 -1
- package/src/ui/public/assets/{LogList-CdtFyrLd.js → LogList-DMM6xsft.js} +1 -1
- package/src/ui/public/assets/{MindmapView-2tt7W7A3.js → MindmapView-FEdyCLvB.js} +1 -1
- package/src/ui/public/assets/{MonitorView--IW5ll8A.js → MonitorView-DSngr6xg.js} +1 -1
- package/src/ui/public/assets/{ProjectStartupButton-CWKSZVGw.js → ProjectStartupButton-DzodaStk.js} +1 -1
- package/src/ui/public/assets/{RecentDirectoriesChat-DINPN4ju.js → RecentDirectoriesChat-DvNSA3M_.js} +1 -1
- package/src/ui/public/assets/{RemoteManagerDialog-BVwpcCAu.js → RemoteManagerDialog-B8A7vQ0s.js} +1 -1
- package/src/ui/public/assets/{RemoteRepoCard-Dy3AF_XZ.js → RemoteRepoCard-ChdaJMso.js} +1 -1
- package/src/ui/public/assets/{SourceMapView-BnHeu5wE.js → SourceMapView-DxBk0ftU.js} +1 -1
- package/src/ui/public/assets/{SvgIcon-DcVasCdo.js → SvgIcon-IjDm7vQ-.js} +1 -1
- package/src/ui/public/assets/{UserInputNode-B313MadX.js → UserInputNode-DE8GEC3J.js} +1 -1
- package/src/ui/public/assets/WorkbenchView--CxNdUys.js +8 -0
- package/src/ui/public/assets/{WorkbenchView-rscs76HF.css → WorkbenchView-BaUAQnQR.css} +1 -1
- package/src/ui/public/assets/{_plugin-vue_export-helper-Bsx6Zj3t.js → _plugin-vue_export-helper-DcVJ6Vx3.js} +3 -3
- package/src/ui/public/assets/{agentConversations-BnG4a1oH.js → agentConversations-Dzt5oiO3.js} +5 -5
- package/src/ui/public/assets/{configStore-DQSKV2_Y.js → configStore-jJrldIrT.js} +1 -1
- package/src/ui/public/assets/{dagre-BmYeUlEa.js → dagre-Dkbv4_Ri.js} +3 -3
- package/src/ui/public/assets/{element-plus-DTtm3XCd.js → element-plus-BFy5M3jt.js} +1 -1
- package/src/ui/public/assets/{flow-mindmap-JxOspgwx.js → flow-mindmap-Qo4JDluG.js} +1 -1
- package/src/ui/public/assets/{index-BApctCNq.js → index-Do0MeO4E.js} +7 -7
- package/src/ui/public/assets/{monaco-D3R9OM26.js → monaco-Eb1VRwsF.js} +1 -1
- package/src/ui/public/assets/{office-docx-CO7mIaWO.js → office-docx-BeV9kLXP.js} +1 -1
- package/src/ui/public/assets/{office-excel-gA4KEkK4.js → office-excel-CILIK4LB.js} +1 -1
- package/src/ui/public/assets/{office-pptx-CQK4l_1Q.js → office-pptx-SxwVIVqF.js} +1 -1
- package/src/ui/public/assets/{vendor-O17eRefg.js → vendor-BXLxNxh-.js} +418 -416
- package/src/ui/public/assets/{vendor-U3ZXMgeO.css → vendor-aCkTc13z.css} +1 -1
- package/src/ui/public/assets/{vue-flow-BG6ZF1It.js → vue-flow--96Pa3sG.js} +1 -1
- package/src/ui/public/index.html +12 -12
- package/src/utils/aiEndpoint.js +48 -0
- package/src/utils/aiEndpoint.test.js +51 -1
- package/src/ui/public/assets/AgentEngineSelector-Bm_wrfGT.js +0 -1
- package/src/ui/public/assets/AgentView-BwqOHAs3.js +0 -1
- package/src/ui/public/assets/EditorView-BC6V8V5_.js +0 -1
- package/src/ui/public/assets/WorkbenchView-0cY9WHPM.js +0 -20
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$n as e,Bn as t,Cn as n,Cr as r,Dn as i,En as a,Fn as o,Gn as s,Gr as c,Hn as l,In as u,Jn as d,Kr as f,Mn as p,Mr as m,On as h,Pn as g,Qn as _,Rn as v,Sr as y,Tn as b,Vn as x,Wn as S,Xn as C,Xr as w,Yn as T,Zn as E,_r as D,ar as O,cr as k,dr as A,er as j,gr as M,hr as N,ir as P,jn as F,lr as I,mr as L,or as R,pr as z,qn as B,qr as V,rr as H,tr as U,ur as ee,vr as W,wn as G,wr as K,xr as q,yn as J,yr as te,zn as ne}from"./element-plus-DTtm3XCd.js";A(),v(),m();function re(e){return ee()?(N(e),!0):!1}function ie(e){return typeof e==`function`?e():K(e)}var ae=typeof window<`u`&&typeof document<`u`,oe=e=>e!==void 0,se=Object.prototype.toString,ce=e=>se.call(e)===`[object Object]`,le=()=>{};function ue(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return n}var de=e=>e();function fe(e=de){let t=W(!0);function n(){t.value=!1}function r(){t.value=!0}return{isActive:D(t),pause:n,resume:r,eventFilter:(...n)=>{t.value&&e(...n)}}}function pe(e,t=!1,n=`Timeout`){return new Promise((r,i)=>{setTimeout(t?()=>i(n):r,e)})}function me(e,t,n={}){let{eventFilter:r=de,...i}=n;return P(e,ue(r,t),i)}function he(e,t,n={}){let{eventFilter:r,...i}=n,{eventFilter:a,pause:o,resume:s,isActive:c}=fe(r);return{stop:me(e,t,{...i,eventFilter:a}),pause:o,resume:s,isActive:c}}function ge(e,t={}){if(!z(e))return y(e);let n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(let r in e.value)n[r]=k(()=>({get(){return e.value[r]},set(n){if(ie(t.replaceRef)??!0){if(Array.isArray(e.value)){let t=[...e.value];t[r]=n,e.value=t}else{let t={...e.value,[r]:n};Object.setPrototypeOf(t,Object.getPrototypeOf(e.value)),e.value=t}}else e.value[r]=n}}));return n}function _e(e,t=!1){function n(n,{flush:r=`sync`,deep:i=!1,timeout:a,throwOnTimeout:o}={}){let s=null,c=[new Promise(a=>{s=P(e,e=>{n(e)!==t&&(s?.(),a(e))},{flush:r,deep:i,immediate:!0})})];return a!=null&&c.push(pe(a,o).then(()=>ie(e)).finally(()=>s?.())),Promise.race(c)}function r(r,i){if(!z(r))return n(e=>e===r,i);let{flush:a=`sync`,deep:o=!1,timeout:s,throwOnTimeout:c}=i??{},l=null,u=[new Promise(n=>{l=P([e,r],([e,r])=>{t!==(e===r)&&(l?.(),n(e))},{flush:a,deep:o,immediate:!0})})];return s!=null&&u.push(pe(s,c).then(()=>ie(e)).finally(()=>(l?.(),ie(e)))),Promise.race(u)}function i(e){return n(e=>!!e,e)}function a(e){return r(null,e)}function o(e){return r(void 0,e)}function s(e){return n(Number.isNaN,e)}function c(e,t){return n(t=>{let n=Array.from(t);return n.includes(e)||n.includes(ie(e))},t)}function l(e){return u(1,e)}function u(e=1,t){let r=-1;return n(()=>(r+=1,r>=e),t)}return Array.isArray(ie(e))?{toMatch:n,toContains:c,changed:l,changedTimes:u,get not(){return _e(e,!t)}}:{toMatch:n,toBe:r,toBeTruthy:i,toBeNull:a,toBeNaN:s,toBeUndefined:o,changed:l,changedTimes:u,get not(){return _e(e,!t)}}}function ve(e){return _e(e)}function ye(e){let t=ie(e);return t?.$el??t}var be=ae?window:void 0;function xe(...e){let t,n,r,i;if(typeof e[0]==`string`||Array.isArray(e[0])?([n,r,i]=e,t=be):[t,n,r,i]=e,!t)return le;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);let a=[],o=()=>{a.forEach(e=>e()),a.length=0},s=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),c=P(()=>[ye(t),ie(i)],([e,t])=>{if(o(),!e)return;let i=ce(t)?{...t}:t;a.push(...n.flatMap(t=>r.map(n=>s(e,t,n,i))))},{immediate:!0,flush:`post`}),l=()=>{c(),o()};return re(l),l}function Se(e){return typeof e==`function`?e:typeof e==`string`?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Ce(...e){let t,n,r={};e.length===3?(t=e[0],n=e[1],r=e[2]):e.length===2?typeof e[1]==`object`?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);let{target:i=be,eventName:a=`keydown`,passive:o=!1,dedupe:s=!1}=r,c=Se(t);return xe(i,a,e=>{e.repeat&&ie(s)||c(e)&&n(e)},o)}function we(e){return JSON.parse(JSON.stringify(e))}function Te(e,t,r,i={}){let{clone:a=!1,passive:s=!1,eventName:c,deep:u=!1,defaultValue:d,shouldEmit:f}=i,p=o(),m=r||p?.emit||(p?.$emit)?.bind(p)||(p?.proxy?.$emit)?.bind(p?.proxy),h=c;t||=`modelValue`,h||=`update:${t.toString()}`;let g=e=>a?typeof a==`function`?a(e):we(e):e,_=()=>oe(e[t])?g(e[t]):d,v=e=>{f?f(e)&&m(h,e):m(h,e)};if(s){let n=_(),r=W(n),i=!1;return P(()=>e[t],e=>{i||(i=!0,r.value=g(e),l(()=>i=!1))}),P(r,n=>{!i&&(n!==e[t]||u)&&v(n)},{deep:u}),r}return n({get(){return _()},set(e){v(e)}})}var Ee={value:()=>{}};function De(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new Oe(n)}function Oe(e){this._=e}function ke(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}Oe.prototype=De.prototype={constructor:Oe,on:function(e,t){var n=this._,r=ke(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Ae(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=je(n[i],e.name,t);else if(t==null)for(i in n)n[i]=je(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Oe(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function Ae(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function je(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Ee,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Me=`http://www.w3.org/1999/xhtml`,Ne={svg:`http://www.w3.org/2000/svg`,xhtml:Me,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function Pe(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),Ne.hasOwnProperty(t)?{space:Ne[t],local:e}:e}function Fe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Me&&t.documentElement.namespaceURI===Me?t.createElement(e):t.createElementNS(n,e)}}function Ie(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Le(e){var t=Pe(e);return(t.local?Ie:Fe)(t)}function Re(){}function ze(e){return e==null?Re:function(){return this.querySelector(e)}}function Be(e){typeof e!=`function`&&(e=ze(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new kn(r,this._parents)}function Ve(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function He(){return[]}function Ue(e){return e==null?He:function(){return this.querySelectorAll(e)}}function We(e){return function(){return Ve(e.apply(this,arguments))}}function Ge(e){e=typeof e==`function`?We(e):Ue(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new kn(r,i)}function Ke(e){return function(){return this.matches(e)}}function qe(e){return function(t){return t.matches(e)}}var Je=Array.prototype.find;function Ye(e){return function(){return Je.call(this.children,e)}}function Xe(){return this.firstElementChild}function Ze(e){return this.select(e==null?Xe:Ye(typeof e==`function`?e:qe(e)))}var Qe=Array.prototype.filter;function $e(){return Array.from(this.children)}function et(e){return function(){return Qe.call(this.children,e)}}function tt(e){return this.selectAll(e==null?$e:et(typeof e==`function`?e:qe(e)))}function nt(e){typeof e!=`function`&&(e=Ke(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new kn(r,this._parents)}function rt(e){return Array(e.length)}function it(){return new kn(this._enter||this._groups.map(rt),this._parents)}function at(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}at.prototype={constructor:at,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function ot(e){return function(){return e}}function st(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new at(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function ct(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new at(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function lt(e){return e.__data__}function ut(e,t){if(!arguments.length)return Array.from(this,lt);var n=t?ct:st,r=this._parents,i=this._groups;typeof e!=`function`&&(e=ot(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=dt(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new kn(o,r),o._enter=s,o._exit=c,o}function dt(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function ft(){return new kn(this._exit||this._groups.map(rt),this._parents)}function pt(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function mt(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new kn(s,this._parents)}function ht(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function gt(e){e||=_t;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new kn(i,this._parents).order()}function _t(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function vt(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function yt(){return Array.from(this)}function bt(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function xt(){let e=0;for(let t of this)++e;return e}function St(){return!this.node()}function Ct(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function wt(e){return function(){this.removeAttribute(e)}}function Tt(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Et(e,t){return function(){this.setAttribute(e,t)}}function Dt(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ot(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function kt(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function At(e,t){var n=Pe(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Tt:wt:typeof t==`function`?n.local?kt:Ot:n.local?Dt:Et)(n,t))}function jt(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Mt(e){return function(){this.style.removeProperty(e)}}function Nt(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Pt(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Ft(e,t,n){return arguments.length>1?this.each((t==null?Mt:typeof t==`function`?Pt:Nt)(e,t,n??``)):It(this.node(),e)}function It(e,t){return e.style.getPropertyValue(t)||jt(e).getComputedStyle(e,null).getPropertyValue(t)}function Lt(e){return function(){delete this[e]}}function Rt(e,t){return function(){this[e]=t}}function zt(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Bt(e,t){return arguments.length>1?this.each((t==null?Lt:typeof t==`function`?zt:Rt)(e,t)):this.node()[e]}function Vt(e){return e.trim().split(/^|\s+/)}function Ht(e){return e.classList||new Ut(e)}function Ut(e){this._node=e,this._names=Vt(e.getAttribute(`class`)||``)}Ut.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function Wt(e,t){for(var n=Ht(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Gt(e,t){for(var n=Ht(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Kt(e){return function(){Wt(this,e)}}function qt(e){return function(){Gt(this,e)}}function Jt(e,t){return function(){(t.apply(this,arguments)?Wt:Gt)(this,e)}}function Yt(e,t){var n=Vt(e+``);if(arguments.length<2){for(var r=Ht(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?Jt:t?Kt:qt)(n,t))}function Xt(){this.textContent=``}function Zt(e){return function(){this.textContent=e}}function Qt(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function $t(e){return arguments.length?this.each(e==null?Xt:(typeof e==`function`?Qt:Zt)(e)):this.node().textContent}function en(){this.innerHTML=``}function tn(e){return function(){this.innerHTML=e}}function nn(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function rn(e){return arguments.length?this.each(e==null?en:(typeof e==`function`?nn:tn)(e)):this.node().innerHTML}function an(){this.nextSibling&&this.parentNode.appendChild(this)}function on(){return this.each(an)}function sn(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function cn(){return this.each(sn)}function ln(e){var t=typeof e==`function`?e:Le(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function un(){return null}function dn(e,t){var n=typeof e==`function`?e:Le(e),r=t==null?un:typeof t==`function`?t:ze(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function fn(){var e=this.parentNode;e&&e.removeChild(this)}function pn(){return this.each(fn)}function mn(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function hn(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function gn(e){return this.select(e?hn:mn)}function _n(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function vn(e){return function(t){e.call(this,t,this.__data__)}}function yn(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function bn(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function xn(e,t,n){return function(){var r=this.__on,i,a=vn(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Sn(e,t,n){var r=yn(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?xn:bn,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function Cn(e,t,n){var r=jt(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function wn(e,t){return function(){return Cn(this,e,t)}}function Tn(e,t){return function(){return Cn(this,e,t.apply(this,arguments))}}function En(e,t){return this.each((typeof t==`function`?Tn:wn)(e,t))}function*Dn(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var On=[null];function kn(e,t){this._groups=e,this._parents=t}function An(){return new kn([[document.documentElement]],On)}function jn(){return this}kn.prototype=An.prototype={constructor:kn,select:Be,selectAll:Ge,selectChild:Ze,selectChildren:tt,filter:nt,data:ut,enter:it,exit:ft,join:pt,merge:mt,selection:jn,order:ht,sort:gt,call:vt,nodes:yt,node:bt,size:xt,empty:St,each:Ct,attr:At,style:Ft,property:Bt,classed:Yt,text:$t,html:rn,raise:on,lower:cn,append:ln,insert:dn,remove:pn,clone:gn,datum:_n,on:Sn,dispatch:En,[Symbol.iterator]:Dn};function Mn(e){return typeof e==`string`?new kn([[document.querySelector(e)]],[document.documentElement]):new kn([[e]],On)}function Nn(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Pn(e,t){if(e=Nn(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var Fn={passive:!1},In={capture:!0,passive:!1};function Ln(e){e.stopImmediatePropagation()}function Rn(e){e.preventDefault(),e.stopImmediatePropagation()}function zn(e){var t=e.document.documentElement,n=Mn(e).on(`dragstart.drag`,Rn,In);`onselectstart`in t?n.on(`selectstart.drag`,Rn,In):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function Bn(e,t){var n=e.document.documentElement,r=Mn(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,Rn,In),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Vn=e=>()=>e;function Hn(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}Hn.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Un(e){return!e.ctrlKey&&!e.button}function Wn(){return this.parentNode}function Gn(e,t){return t??{x:e.x,y:e.y}}function Kn(){return navigator.maxTouchPoints||`ontouchstart`in this}function qn(){var e=Un,t=Wn,n=Gn,r=Kn,i={},a=De(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,Fn).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(Mn(n.view).on(`mousemove.drag`,m,In).on(`mouseup.drag`,h,In),zn(n.view),Ln(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(Rn(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){Mn(e.view).on(`mousemove.drag mouseup.drag`,null),Bn(e.view,l),Rn(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(Ln(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(Rn(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(Ln(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=Pn(l||r,t),p,m,h;if((h=n.call(e,new Hn(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=Pn(l||a,t),_=o}u.call(r,e,new Hn(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Vn(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:Vn(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:Vn(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:Vn(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function Jn(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Yn(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Xn(){}var Zn=.7,Qn=1/Zn,$n=`\\s*([+-]?\\d+)\\s*`,er=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,tr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,nr=/^#([0-9a-f]{3,8})$/,rr=RegExp(`^rgb\\(${$n},${$n},${$n}\\)$`),ir=RegExp(`^rgb\\(${tr},${tr},${tr}\\)$`),ar=RegExp(`^rgba\\(${$n},${$n},${$n},${er}\\)$`),or=RegExp(`^rgba\\(${tr},${tr},${tr},${er}\\)$`),sr=RegExp(`^hsl\\(${er},${tr},${tr}\\)$`),cr=RegExp(`^hsla\\(${er},${tr},${tr},${er}\\)$`),lr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Jn(Xn,mr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ur,formatHex:ur,formatHex8:dr,formatHsl:fr,formatRgb:pr,toString:pr});function ur(){return this.rgb().formatHex()}function dr(){return this.rgb().formatHex8()}function fr(){return Dr(this).formatHsl()}function pr(){return this.rgb().formatRgb()}function mr(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=nr.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?hr(t):n===3?new yr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?gr(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?gr(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=rr.exec(e))?new yr(t[1],t[2],t[3],1):(t=ir.exec(e))?new yr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ar.exec(e))?gr(t[1],t[2],t[3],t[4]):(t=or.exec(e))?gr(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=sr.exec(e))?Er(t[1],t[2]/100,t[3]/100,1):(t=cr.exec(e))?Er(t[1],t[2]/100,t[3]/100,t[4]):lr.hasOwnProperty(e)?hr(lr[e]):e===`transparent`?new yr(NaN,NaN,NaN,0):null}function hr(e){return new yr(e>>16&255,e>>8&255,e&255,1)}function gr(e,t,n,r){return r<=0&&(e=t=n=NaN),new yr(e,t,n,r)}function _r(e){return e instanceof Xn||(e=mr(e)),e?(e=e.rgb(),new yr(e.r,e.g,e.b,e.opacity)):new yr}function vr(e,t,n,r){return arguments.length===1?_r(e):new yr(e,t,n,r??1)}function yr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Jn(yr,vr,Yn(Xn,{brighter(e){return e=e==null?Qn:Qn**+e,new yr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Zn:Zn**+e,new yr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new yr(wr(this.r),wr(this.g),wr(this.b),Cr(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:br,formatHex:br,formatHex8:xr,formatRgb:Sr,toString:Sr}));function br(){return`#${Tr(this.r)}${Tr(this.g)}${Tr(this.b)}`}function xr(){return`#${Tr(this.r)}${Tr(this.g)}${Tr(this.b)}${Tr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Sr(){let e=Cr(this.opacity);return`${e===1?`rgb(`:`rgba(`}${wr(this.r)}, ${wr(this.g)}, ${wr(this.b)}${e===1?`)`:`, ${e})`}`}function Cr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function wr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Tr(e){return e=wr(e),(e<16?`0`:``)+e.toString(16)}function Er(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new kr(e,t,n,r)}function Dr(e){if(e instanceof kr)return new kr(e.h,e.s,e.l,e.opacity);if(e instanceof Xn||(e=mr(e)),!e)return new kr;if(e instanceof kr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new kr(o,s,c,e.opacity)}function Or(e,t,n,r){return arguments.length===1?Dr(e):new kr(e,t,n,r??1)}function kr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Jn(kr,Or,Yn(Xn,{brighter(e){return e=e==null?Qn:Qn**+e,new kr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Zn:Zn**+e,new kr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new yr(Mr(e>=240?e-240:e+120,i,r),Mr(e,i,r),Mr(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new kr(Ar(this.h),jr(this.s),jr(this.l),Cr(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Cr(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Ar(this.h)}, ${jr(this.s)*100}%, ${jr(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Ar(e){return e=(e||0)%360,e<0?e+360:e}function jr(e){return Math.max(0,Math.min(1,e||0))}function Mr(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var Nr=e=>()=>e;function Pr(e,t){return function(n){return e+n*t}}function Fr(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Ir(e){return(e=+e)==1?Lr:function(t,n){return n-t?Fr(t,n,e):Nr(isNaN(t)?n:t)}}function Lr(e,t){var n=t-e;return n?Pr(e,n):Nr(isNaN(e)?t:e)}var Rr=function e(t){var n=Ir(t);function r(e,t){var r=n((e=vr(e)).r,(t=vr(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Lr(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r}(1);function zr(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function Br(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Vr(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=Xr(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function Hr(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ur(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Wr(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=Xr(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var Gr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Kr=new RegExp(Gr.source,`g`);function qr(e){return function(){return e}}function Jr(e){return function(t){return e(t)+``}}function Yr(e,t){var n=Gr.lastIndex=Kr.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=Gr.exec(e))&&(i=Kr.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:Ur(r,i)})),n=Kr.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Jr(c[0].x):qr(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function Xr(e,t){var n=typeof t,r;return t==null||n===`boolean`?Nr(t):(n===`number`?Ur:n===`string`?(r=mr(t))?(t=r,Rr):Yr:t instanceof mr?Rr:t instanceof Date?Hr:Br(t)?zr:Array.isArray(t)?Vr:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?Wr:Ur)(e,t)}var Zr=180/Math.PI,Qr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function $r(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*Zr,skewX:Math.atan(c)*Zr,scaleX:o,scaleY:s}}var ei;function ti(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?Qr:$r(t.a,t.b,t.c,t.d,t.e,t.f)}function ni(e){return e==null||(ei||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),ei.setAttribute(`transform`,e),!(e=ei.transform.baseVal.consolidate()))?Qr:(e=e.matrix,$r(e.a,e.b,e.c,e.d,e.e,e.f))}function ri(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:Ur(e,i)},{i:c-2,x:Ur(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:Ur(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:Ur(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:Ur(e,n)},{i:s-2,x:Ur(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var ii=ri(ti,`px, `,`px)`,`deg)`),ai=ri(ni,`, `,`)`,`)`),oi=1e-12;function si(e){return((e=Math.exp(e))+1/e)/2}function ci(e){return((e=Math.exp(e))-1/e)/2}function li(e){return((e=Math.exp(2*e))-1)/(e+1)}var ui=function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<oi)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=si(y),c=s/(n*g)*(i*li(t*r+y)-ci(y));return[a+c*d,o+c*f,s*i/si(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i}(Math.SQRT2,2,4),di=0,fi=0,pi=0,mi=1e3,hi,gi,_i=0,vi=0,yi=0,bi=typeof performance==`object`&&performance.now?performance:Date,xi=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Si(){return vi||=(xi(Ci),bi.now()+yi)}function Ci(){vi=0}function wi(){this._call=this._time=this._next=null}wi.prototype=Ti.prototype={constructor:wi,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Si():+n)+(t==null?0:+t),!this._next&&gi!==this&&(gi?gi._next=this:hi=this,gi=this),this._call=e,this._time=n,Ai()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ai())}};function Ti(e,t,n){var r=new wi;return r.restart(e,t,n),r}function Ei(){Si(),++di;for(var e=hi,t;e;)(t=vi-e._time)>=0&&e._call.call(void 0,t),e=e._next;--di}function Di(){vi=(_i=bi.now())+yi,di=fi=0;try{Ei()}finally{di=0,ki(),vi=0}}function Oi(){var e=bi.now(),t=e-_i;t>mi&&(yi-=t,_i=e)}function ki(){for(var e,t=hi,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:hi=n);gi=e,Ai(r)}function Ai(e){di||(fi&&=clearTimeout(fi),e-vi>24?(e<1/0&&(fi=setTimeout(Di,e-bi.now()-yi)),pi&&=clearInterval(pi)):(pi||=(_i=bi.now(),setInterval(Oi,mi)),di=1,xi(Di)))}function ji(e,t,n){var r=new wi;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var Mi=De(`start`,`end`,`cancel`,`interrupt`),Ni=[],Pi=0,Fi=1,Ii=2,Li=3,Ri=4,zi=5,Bi=6;function Vi(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Gi(e,n,{name:t,index:r,group:i,on:Mi,tween:Ni,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Pi})}function Hi(e,t){var n=Wi(e,t);if(n.state>Pi)throw Error(`too late; already scheduled`);return n}function Ui(e,t){var n=Wi(e,t);if(n.state>Li)throw Error(`too late; already running`);return n}function Wi(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function Gi(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Ti(a,0,n.time);function a(e){n.state=Fi,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==Fi)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===Li)return ji(o);f.state===Ri?(f.state=Bi,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=Bi,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(ji(function(){n.state===Li&&(n.state=Ri,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=Ii,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===Ii){for(n.state=Li,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=zi,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===zi&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=Bi,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function Ki(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>Ii&&r.state<zi,r.state=Bi,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function qi(e){return this.each(function(){Ki(this,e)})}function Ji(e,t){var n,r;return function(){var i=Ui(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Yi(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=Ui(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function Xi(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=Wi(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?Ji:Yi)(n,e,t))}function Zi(e,t,n){var r=e._id;return e.each(function(){var e=Ui(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return Wi(e,r).value[t]}}function Qi(e,t){var n;return(typeof t==`number`?Ur:t instanceof mr?Rr:(n=mr(t))?(t=n,Rr):Yr)(e,t)}function $i(e){return function(){this.removeAttribute(e)}}function ea(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ta(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function na(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function ra(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function ia(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function aa(e,t){var n=Pe(e),r=n===`transform`?ai:Qi;return this.attrTween(e,typeof t==`function`?(n.local?ia:ra)(n,r,Zi(this,`attr.`+e,t)):t==null?(n.local?ea:$i)(n):(n.local?na:ta)(n,r,t))}function oa(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function sa(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function ca(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&sa(e,i)),n}return i._value=t,i}function la(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&oa(e,i)),n}return i._value=t,i}function ua(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=Pe(e);return this.tween(n,(r.local?ca:la)(r,t))}function da(e,t){return function(){Hi(this,e).delay=+t.apply(this,arguments)}}function fa(e,t){return t=+t,function(){Hi(this,e).delay=t}}function pa(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?da:fa)(t,e)):Wi(this.node(),t).delay}function ma(e,t){return function(){Ui(this,e).duration=+t.apply(this,arguments)}}function ha(e,t){return t=+t,function(){Ui(this,e).duration=t}}function ga(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?ma:ha)(t,e)):Wi(this.node(),t).duration}function _a(e,t){if(typeof t!=`function`)throw Error();return function(){Ui(this,e).ease=t}}function va(e){var t=this._id;return arguments.length?this.each(_a(t,e)):Wi(this.node(),t).ease}function ya(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();Ui(this,e).ease=n}}function ba(e){if(typeof e!=`function`)throw Error();return this.each(ya(this._id,e))}function xa(e){typeof e!=`function`&&(e=Ke(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Xa(r,this._parents,this._name,this._id)}function Sa(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new Xa(o,this._parents,this._name,this._id)}function Ca(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function wa(e,t,n){var r,i,a=Ca(t)?Hi:Ui;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Ta(e,t){var n=this._id;return arguments.length<2?Wi(this.node(),n).on.on(e):this.each(wa(n,e,t))}function Ea(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Da(){return this.on(`end.remove`,Ea(this._id))}function Oa(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=ze(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,Vi(l[f],t,n,f,l,Wi(u,n)));return new Xa(a,this._parents,t,n)}function ka(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Ue(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=Wi(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&Vi(p,t,n,h,f,m);a.push(f),o.push(u)}return new Xa(a,o,t,n)}var Aa=An.prototype.constructor;function ja(){return new Aa(this._groups,this._parents)}function Ma(e,t){var n,r,i;return function(){var a=It(this,e),o=(this.style.removeProperty(e),It(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Na(e){return function(){this.style.removeProperty(e)}}function Pa(e,t,n){var r,i=n+``,a;return function(){var o=It(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Fa(e,t,n){var r,i,a;return function(){var o=It(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),It(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function Ia(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=Ui(this,e),l=c.on,u=c.value[a]==null?s||=Na(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function La(e,t,n){var r=(e+=``)==`transform`?ii:Qi;return t==null?this.styleTween(e,Ma(e,r)).on(`end.style.`+e,Na(e)):typeof t==`function`?this.styleTween(e,Fa(e,r,Zi(this,`style.`+e,t))).each(Ia(this._id,e)):this.styleTween(e,Pa(e,r,t),n).on(`end.style.`+e,null)}function Ra(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function za(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Ra(e,a,n)),r}return a._value=t,a}function Ba(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,za(e,t,n??``))}function Va(e){return function(){this.textContent=e}}function Ha(e){return function(){var t=e(this);this.textContent=t??``}}function Ua(e){return this.tween(`text`,typeof e==`function`?Ha(Zi(this,`text`,e)):Va(e==null?``:e+``))}function Wa(e){return function(t){this.textContent=e.call(this,t)}}function Ga(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Wa(r)),t}return r._value=e,r}function Ka(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,Ga(e))}function qa(){for(var e=this._name,t=this._id,n=Za(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=Wi(c,t);Vi(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Xa(r,this._parents,e,n)}function Ja(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=Ui(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var Ya=0;function Xa(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Za(){return++Ya}var Qa=An.prototype;Xa.prototype={constructor:Xa,select:Oa,selectAll:ka,selectChild:Qa.selectChild,selectChildren:Qa.selectChildren,filter:xa,merge:Sa,selection:ja,transition:qa,call:Qa.call,nodes:Qa.nodes,node:Qa.node,size:Qa.size,empty:Qa.empty,each:Qa.each,on:Ta,attr:aa,attrTween:ua,style:La,styleTween:Ba,text:Ua,textTween:Ka,remove:Da,tween:Xi,delay:pa,duration:ga,ease:va,easeVarying:ba,end:Ja,[Symbol.iterator]:Qa[Symbol.iterator]};function $a(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var eo={time:null,delay:0,duration:250,ease:$a};function to(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function no(e){var t,n;e instanceof Xa?(t=e._id,e=e._name):(t=Za(),(n=eo).time=Si(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&Vi(c,e,t,l,o,n||to(c,t));return new Xa(r,this._parents,e,t)}An.prototype.interrupt=qi,An.prototype.transition=no;var ro=e=>()=>e;function io(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function ao(e,t,n){this.k=e,this.x=t,this.y=n}ao.prototype={constructor:ao,scale:function(e){return e===1?this:new ao(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ao(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var oo=new ao(1,0,0);ao.prototype;function so(e){e.stopImmediatePropagation()}function co(e){e.preventDefault(),e.stopImmediatePropagation()}function lo(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function uo(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function fo(){return this.__zoom||oo}function po(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function mo(){return navigator.maxTouchPoints||`ontouchstart`in this}function ho(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function go(){var e=lo,t=uo,n=ho,r=po,i=mo,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=ui,l=De(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,fo).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,fo),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(oo.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new ao(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new ao(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new ao(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=Mn(this.that).datum();l.call(e,this.that,new io(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=Pn(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],Ki(this),s.start();co(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=Mn(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=Pn(t,i),l=t.clientX,u=t.clientY;zn(t.view),so(t),a.mouse=[c,this.__zoom.invert(c)],Ki(this),a.start();function d(e){if(co(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=Pn(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),Bn(e.view,a.moved),co(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=Pn(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);co(r),s>0?Mn(this).transition().duration(s).call(x,d,c,r):Mn(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(so(t),s=0;s<i;++s)c=r[s],l=Pn(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),Ki(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(co(e),s=0;s<a;++s)c=i[s],l=Pn(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(so(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=Pn(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=Mn(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:ro(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:ro(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:ro(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:ro([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var Y=(e=>(e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`,e))(Y||{}),_o=(e=>(e.Partial=`partial`,e.Full=`full`,e))(_o||{}),vo=(e=>(e.Bezier=`default`,e.SimpleBezier=`simple-bezier`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e))(vo||{}),yo=(e=>(e.Strict=`strict`,e.Loose=`loose`,e))(yo||{}),bo=(e=>(e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`,e))(bo||{}),xo=(e=>(e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`,e))(xo||{}),So=(e=>(e.TopLeft=`top-left`,e.TopCenter=`top-center`,e.TopRight=`top-right`,e.BottomLeft=`bottom-left`,e.BottomCenter=`bottom-center`,e.BottomRight=`bottom-right`,e))(So||{}),Co=[`INPUT`,`SELECT`,`TEXTAREA`],wo=typeof document<`u`?document:null;function To(e){let t=e.composedPath?.call(e)?.[0]||e.target,n=typeof t?.hasAttribute==`function`&&t.hasAttribute(`contenteditable`),r=typeof t?.closest==`function`?t.closest(`.nokey`):null;return Co.includes(t?.nodeName)||n||!!r}function Eo(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function Do(e,t,n,r){let i=t.replace(`+`,`
|
|
1
|
+
import{$n as e,Bn as t,Cn as n,Cr as r,Dn as i,En as a,Fn as o,Gn as s,Gr as c,Hn as l,In as u,Jn as d,Kr as f,Mn as p,Mr as m,On as h,Pn as g,Qn as _,Rn as v,Sr as y,Tn as b,Vn as x,Wn as S,Xn as C,Xr as w,Yn as T,Zn as E,_r as D,ar as O,cr as k,dr as A,er as j,gr as M,hr as N,ir as P,jn as F,lr as I,mr as L,or as R,pr as z,qn as B,qr as V,rr as H,tr as U,ur as ee,vr as W,wn as G,wr as K,xr as q,yn as J,yr as te,zn as ne}from"./element-plus-BFy5M3jt.js";A(),v(),m();function re(e){return ee()?(N(e),!0):!1}function ie(e){return typeof e==`function`?e():K(e)}var ae=typeof window<`u`&&typeof document<`u`,oe=e=>e!==void 0,se=Object.prototype.toString,ce=e=>se.call(e)===`[object Object]`,le=()=>{};function ue(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return n}var de=e=>e();function fe(e=de){let t=W(!0);function n(){t.value=!1}function r(){t.value=!0}return{isActive:D(t),pause:n,resume:r,eventFilter:(...n)=>{t.value&&e(...n)}}}function pe(e,t=!1,n=`Timeout`){return new Promise((r,i)=>{setTimeout(t?()=>i(n):r,e)})}function me(e,t,n={}){let{eventFilter:r=de,...i}=n;return P(e,ue(r,t),i)}function he(e,t,n={}){let{eventFilter:r,...i}=n,{eventFilter:a,pause:o,resume:s,isActive:c}=fe(r);return{stop:me(e,t,{...i,eventFilter:a}),pause:o,resume:s,isActive:c}}function ge(e,t={}){if(!z(e))return y(e);let n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(let r in e.value)n[r]=k(()=>({get(){return e.value[r]},set(n){if(ie(t.replaceRef)??!0){if(Array.isArray(e.value)){let t=[...e.value];t[r]=n,e.value=t}else{let t={...e.value,[r]:n};Object.setPrototypeOf(t,Object.getPrototypeOf(e.value)),e.value=t}}else e.value[r]=n}}));return n}function _e(e,t=!1){function n(n,{flush:r=`sync`,deep:i=!1,timeout:a,throwOnTimeout:o}={}){let s=null,c=[new Promise(a=>{s=P(e,e=>{n(e)!==t&&(s?.(),a(e))},{flush:r,deep:i,immediate:!0})})];return a!=null&&c.push(pe(a,o).then(()=>ie(e)).finally(()=>s?.())),Promise.race(c)}function r(r,i){if(!z(r))return n(e=>e===r,i);let{flush:a=`sync`,deep:o=!1,timeout:s,throwOnTimeout:c}=i??{},l=null,u=[new Promise(n=>{l=P([e,r],([e,r])=>{t!==(e===r)&&(l?.(),n(e))},{flush:a,deep:o,immediate:!0})})];return s!=null&&u.push(pe(s,c).then(()=>ie(e)).finally(()=>(l?.(),ie(e)))),Promise.race(u)}function i(e){return n(e=>!!e,e)}function a(e){return r(null,e)}function o(e){return r(void 0,e)}function s(e){return n(Number.isNaN,e)}function c(e,t){return n(t=>{let n=Array.from(t);return n.includes(e)||n.includes(ie(e))},t)}function l(e){return u(1,e)}function u(e=1,t){let r=-1;return n(()=>(r+=1,r>=e),t)}return Array.isArray(ie(e))?{toMatch:n,toContains:c,changed:l,changedTimes:u,get not(){return _e(e,!t)}}:{toMatch:n,toBe:r,toBeTruthy:i,toBeNull:a,toBeNaN:s,toBeUndefined:o,changed:l,changedTimes:u,get not(){return _e(e,!t)}}}function ve(e){return _e(e)}function ye(e){let t=ie(e);return t?.$el??t}var be=ae?window:void 0;function xe(...e){let t,n,r,i;if(typeof e[0]==`string`||Array.isArray(e[0])?([n,r,i]=e,t=be):[t,n,r,i]=e,!t)return le;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);let a=[],o=()=>{a.forEach(e=>e()),a.length=0},s=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),c=P(()=>[ye(t),ie(i)],([e,t])=>{if(o(),!e)return;let i=ce(t)?{...t}:t;a.push(...n.flatMap(t=>r.map(n=>s(e,t,n,i))))},{immediate:!0,flush:`post`}),l=()=>{c(),o()};return re(l),l}function Se(e){return typeof e==`function`?e:typeof e==`string`?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Ce(...e){let t,n,r={};e.length===3?(t=e[0],n=e[1],r=e[2]):e.length===2?typeof e[1]==`object`?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);let{target:i=be,eventName:a=`keydown`,passive:o=!1,dedupe:s=!1}=r,c=Se(t);return xe(i,a,e=>{e.repeat&&ie(s)||c(e)&&n(e)},o)}function we(e){return JSON.parse(JSON.stringify(e))}function Te(e,t,r,i={}){let{clone:a=!1,passive:s=!1,eventName:c,deep:u=!1,defaultValue:d,shouldEmit:f}=i,p=o(),m=r||p?.emit||(p?.$emit)?.bind(p)||(p?.proxy?.$emit)?.bind(p?.proxy),h=c;t||=`modelValue`,h||=`update:${t.toString()}`;let g=e=>a?typeof a==`function`?a(e):we(e):e,_=()=>oe(e[t])?g(e[t]):d,v=e=>{f?f(e)&&m(h,e):m(h,e)};if(s){let n=_(),r=W(n),i=!1;return P(()=>e[t],e=>{i||(i=!0,r.value=g(e),l(()=>i=!1))}),P(r,n=>{!i&&(n!==e[t]||u)&&v(n)},{deep:u}),r}return n({get(){return _()},set(e){v(e)}})}var Ee={value:()=>{}};function De(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new Oe(n)}function Oe(e){this._=e}function ke(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}Oe.prototype=De.prototype={constructor:Oe,on:function(e,t){var n=this._,r=ke(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Ae(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=je(n[i],e.name,t);else if(t==null)for(i in n)n[i]=je(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Oe(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function Ae(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function je(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Ee,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Me=`http://www.w3.org/1999/xhtml`,Ne={svg:`http://www.w3.org/2000/svg`,xhtml:Me,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function Pe(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),Ne.hasOwnProperty(t)?{space:Ne[t],local:e}:e}function Fe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Me&&t.documentElement.namespaceURI===Me?t.createElement(e):t.createElementNS(n,e)}}function Ie(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Le(e){var t=Pe(e);return(t.local?Ie:Fe)(t)}function Re(){}function ze(e){return e==null?Re:function(){return this.querySelector(e)}}function Be(e){typeof e!=`function`&&(e=ze(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new kn(r,this._parents)}function Ve(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function He(){return[]}function Ue(e){return e==null?He:function(){return this.querySelectorAll(e)}}function We(e){return function(){return Ve(e.apply(this,arguments))}}function Ge(e){e=typeof e==`function`?We(e):Ue(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new kn(r,i)}function Ke(e){return function(){return this.matches(e)}}function qe(e){return function(t){return t.matches(e)}}var Je=Array.prototype.find;function Ye(e){return function(){return Je.call(this.children,e)}}function Xe(){return this.firstElementChild}function Ze(e){return this.select(e==null?Xe:Ye(typeof e==`function`?e:qe(e)))}var Qe=Array.prototype.filter;function $e(){return Array.from(this.children)}function et(e){return function(){return Qe.call(this.children,e)}}function tt(e){return this.selectAll(e==null?$e:et(typeof e==`function`?e:qe(e)))}function nt(e){typeof e!=`function`&&(e=Ke(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new kn(r,this._parents)}function rt(e){return Array(e.length)}function it(){return new kn(this._enter||this._groups.map(rt),this._parents)}function at(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}at.prototype={constructor:at,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function ot(e){return function(){return e}}function st(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new at(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function ct(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new at(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function lt(e){return e.__data__}function ut(e,t){if(!arguments.length)return Array.from(this,lt);var n=t?ct:st,r=this._parents,i=this._groups;typeof e!=`function`&&(e=ot(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=dt(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new kn(o,r),o._enter=s,o._exit=c,o}function dt(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function ft(){return new kn(this._exit||this._groups.map(rt),this._parents)}function pt(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function mt(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new kn(s,this._parents)}function ht(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function gt(e){e||=_t;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new kn(i,this._parents).order()}function _t(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function vt(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function yt(){return Array.from(this)}function bt(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function xt(){let e=0;for(let t of this)++e;return e}function St(){return!this.node()}function Ct(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function wt(e){return function(){this.removeAttribute(e)}}function Tt(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Et(e,t){return function(){this.setAttribute(e,t)}}function Dt(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ot(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function kt(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function At(e,t){var n=Pe(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Tt:wt:typeof t==`function`?n.local?kt:Ot:n.local?Dt:Et)(n,t))}function jt(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Mt(e){return function(){this.style.removeProperty(e)}}function Nt(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Pt(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Ft(e,t,n){return arguments.length>1?this.each((t==null?Mt:typeof t==`function`?Pt:Nt)(e,t,n??``)):It(this.node(),e)}function It(e,t){return e.style.getPropertyValue(t)||jt(e).getComputedStyle(e,null).getPropertyValue(t)}function Lt(e){return function(){delete this[e]}}function Rt(e,t){return function(){this[e]=t}}function zt(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Bt(e,t){return arguments.length>1?this.each((t==null?Lt:typeof t==`function`?zt:Rt)(e,t)):this.node()[e]}function Vt(e){return e.trim().split(/^|\s+/)}function Ht(e){return e.classList||new Ut(e)}function Ut(e){this._node=e,this._names=Vt(e.getAttribute(`class`)||``)}Ut.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function Wt(e,t){for(var n=Ht(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Gt(e,t){for(var n=Ht(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Kt(e){return function(){Wt(this,e)}}function qt(e){return function(){Gt(this,e)}}function Jt(e,t){return function(){(t.apply(this,arguments)?Wt:Gt)(this,e)}}function Yt(e,t){var n=Vt(e+``);if(arguments.length<2){for(var r=Ht(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?Jt:t?Kt:qt)(n,t))}function Xt(){this.textContent=``}function Zt(e){return function(){this.textContent=e}}function Qt(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function $t(e){return arguments.length?this.each(e==null?Xt:(typeof e==`function`?Qt:Zt)(e)):this.node().textContent}function en(){this.innerHTML=``}function tn(e){return function(){this.innerHTML=e}}function nn(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function rn(e){return arguments.length?this.each(e==null?en:(typeof e==`function`?nn:tn)(e)):this.node().innerHTML}function an(){this.nextSibling&&this.parentNode.appendChild(this)}function on(){return this.each(an)}function sn(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function cn(){return this.each(sn)}function ln(e){var t=typeof e==`function`?e:Le(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function un(){return null}function dn(e,t){var n=typeof e==`function`?e:Le(e),r=t==null?un:typeof t==`function`?t:ze(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function fn(){var e=this.parentNode;e&&e.removeChild(this)}function pn(){return this.each(fn)}function mn(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function hn(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function gn(e){return this.select(e?hn:mn)}function _n(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function vn(e){return function(t){e.call(this,t,this.__data__)}}function yn(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function bn(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function xn(e,t,n){return function(){var r=this.__on,i,a=vn(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Sn(e,t,n){var r=yn(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?xn:bn,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function Cn(e,t,n){var r=jt(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function wn(e,t){return function(){return Cn(this,e,t)}}function Tn(e,t){return function(){return Cn(this,e,t.apply(this,arguments))}}function En(e,t){return this.each((typeof t==`function`?Tn:wn)(e,t))}function*Dn(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var On=[null];function kn(e,t){this._groups=e,this._parents=t}function An(){return new kn([[document.documentElement]],On)}function jn(){return this}kn.prototype=An.prototype={constructor:kn,select:Be,selectAll:Ge,selectChild:Ze,selectChildren:tt,filter:nt,data:ut,enter:it,exit:ft,join:pt,merge:mt,selection:jn,order:ht,sort:gt,call:vt,nodes:yt,node:bt,size:xt,empty:St,each:Ct,attr:At,style:Ft,property:Bt,classed:Yt,text:$t,html:rn,raise:on,lower:cn,append:ln,insert:dn,remove:pn,clone:gn,datum:_n,on:Sn,dispatch:En,[Symbol.iterator]:Dn};function Mn(e){return typeof e==`string`?new kn([[document.querySelector(e)]],[document.documentElement]):new kn([[e]],On)}function Nn(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Pn(e,t){if(e=Nn(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var Fn={passive:!1},In={capture:!0,passive:!1};function Ln(e){e.stopImmediatePropagation()}function Rn(e){e.preventDefault(),e.stopImmediatePropagation()}function zn(e){var t=e.document.documentElement,n=Mn(e).on(`dragstart.drag`,Rn,In);`onselectstart`in t?n.on(`selectstart.drag`,Rn,In):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function Bn(e,t){var n=e.document.documentElement,r=Mn(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,Rn,In),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Vn=e=>()=>e;function Hn(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}Hn.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Un(e){return!e.ctrlKey&&!e.button}function Wn(){return this.parentNode}function Gn(e,t){return t??{x:e.x,y:e.y}}function Kn(){return navigator.maxTouchPoints||`ontouchstart`in this}function qn(){var e=Un,t=Wn,n=Gn,r=Kn,i={},a=De(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,Fn).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(Mn(n.view).on(`mousemove.drag`,m,In).on(`mouseup.drag`,h,In),zn(n.view),Ln(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(Rn(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){Mn(e.view).on(`mousemove.drag mouseup.drag`,null),Bn(e.view,l),Rn(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(Ln(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(Rn(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(Ln(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=Pn(l||r,t),p,m,h;if((h=n.call(e,new Hn(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=Pn(l||a,t),_=o}u.call(r,e,new Hn(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Vn(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:Vn(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:Vn(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:Vn(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function Jn(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Yn(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Xn(){}var Zn=.7,Qn=1/Zn,$n=`\\s*([+-]?\\d+)\\s*`,er=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,tr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,nr=/^#([0-9a-f]{3,8})$/,rr=RegExp(`^rgb\\(${$n},${$n},${$n}\\)$`),ir=RegExp(`^rgb\\(${tr},${tr},${tr}\\)$`),ar=RegExp(`^rgba\\(${$n},${$n},${$n},${er}\\)$`),or=RegExp(`^rgba\\(${tr},${tr},${tr},${er}\\)$`),sr=RegExp(`^hsl\\(${er},${tr},${tr}\\)$`),cr=RegExp(`^hsla\\(${er},${tr},${tr},${er}\\)$`),lr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Jn(Xn,mr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ur,formatHex:ur,formatHex8:dr,formatHsl:fr,formatRgb:pr,toString:pr});function ur(){return this.rgb().formatHex()}function dr(){return this.rgb().formatHex8()}function fr(){return Dr(this).formatHsl()}function pr(){return this.rgb().formatRgb()}function mr(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=nr.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?hr(t):n===3?new yr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?gr(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?gr(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=rr.exec(e))?new yr(t[1],t[2],t[3],1):(t=ir.exec(e))?new yr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ar.exec(e))?gr(t[1],t[2],t[3],t[4]):(t=or.exec(e))?gr(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=sr.exec(e))?Er(t[1],t[2]/100,t[3]/100,1):(t=cr.exec(e))?Er(t[1],t[2]/100,t[3]/100,t[4]):lr.hasOwnProperty(e)?hr(lr[e]):e===`transparent`?new yr(NaN,NaN,NaN,0):null}function hr(e){return new yr(e>>16&255,e>>8&255,e&255,1)}function gr(e,t,n,r){return r<=0&&(e=t=n=NaN),new yr(e,t,n,r)}function _r(e){return e instanceof Xn||(e=mr(e)),e?(e=e.rgb(),new yr(e.r,e.g,e.b,e.opacity)):new yr}function vr(e,t,n,r){return arguments.length===1?_r(e):new yr(e,t,n,r??1)}function yr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Jn(yr,vr,Yn(Xn,{brighter(e){return e=e==null?Qn:Qn**+e,new yr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Zn:Zn**+e,new yr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new yr(wr(this.r),wr(this.g),wr(this.b),Cr(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:br,formatHex:br,formatHex8:xr,formatRgb:Sr,toString:Sr}));function br(){return`#${Tr(this.r)}${Tr(this.g)}${Tr(this.b)}`}function xr(){return`#${Tr(this.r)}${Tr(this.g)}${Tr(this.b)}${Tr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Sr(){let e=Cr(this.opacity);return`${e===1?`rgb(`:`rgba(`}${wr(this.r)}, ${wr(this.g)}, ${wr(this.b)}${e===1?`)`:`, ${e})`}`}function Cr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function wr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Tr(e){return e=wr(e),(e<16?`0`:``)+e.toString(16)}function Er(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new kr(e,t,n,r)}function Dr(e){if(e instanceof kr)return new kr(e.h,e.s,e.l,e.opacity);if(e instanceof Xn||(e=mr(e)),!e)return new kr;if(e instanceof kr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new kr(o,s,c,e.opacity)}function Or(e,t,n,r){return arguments.length===1?Dr(e):new kr(e,t,n,r??1)}function kr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Jn(kr,Or,Yn(Xn,{brighter(e){return e=e==null?Qn:Qn**+e,new kr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Zn:Zn**+e,new kr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new yr(Mr(e>=240?e-240:e+120,i,r),Mr(e,i,r),Mr(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new kr(Ar(this.h),jr(this.s),jr(this.l),Cr(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Cr(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Ar(this.h)}, ${jr(this.s)*100}%, ${jr(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Ar(e){return e=(e||0)%360,e<0?e+360:e}function jr(e){return Math.max(0,Math.min(1,e||0))}function Mr(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var Nr=e=>()=>e;function Pr(e,t){return function(n){return e+n*t}}function Fr(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Ir(e){return(e=+e)==1?Lr:function(t,n){return n-t?Fr(t,n,e):Nr(isNaN(t)?n:t)}}function Lr(e,t){var n=t-e;return n?Pr(e,n):Nr(isNaN(e)?t:e)}var Rr=function e(t){var n=Ir(t);function r(e,t){var r=n((e=vr(e)).r,(t=vr(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Lr(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r}(1);function zr(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function Br(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Vr(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=Xr(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function Hr(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ur(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Wr(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=Xr(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var Gr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Kr=new RegExp(Gr.source,`g`);function qr(e){return function(){return e}}function Jr(e){return function(t){return e(t)+``}}function Yr(e,t){var n=Gr.lastIndex=Kr.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=Gr.exec(e))&&(i=Kr.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:Ur(r,i)})),n=Kr.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Jr(c[0].x):qr(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function Xr(e,t){var n=typeof t,r;return t==null||n===`boolean`?Nr(t):(n===`number`?Ur:n===`string`?(r=mr(t))?(t=r,Rr):Yr:t instanceof mr?Rr:t instanceof Date?Hr:Br(t)?zr:Array.isArray(t)?Vr:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?Wr:Ur)(e,t)}var Zr=180/Math.PI,Qr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function $r(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*Zr,skewX:Math.atan(c)*Zr,scaleX:o,scaleY:s}}var ei;function ti(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?Qr:$r(t.a,t.b,t.c,t.d,t.e,t.f)}function ni(e){return e==null||(ei||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),ei.setAttribute(`transform`,e),!(e=ei.transform.baseVal.consolidate()))?Qr:(e=e.matrix,$r(e.a,e.b,e.c,e.d,e.e,e.f))}function ri(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:Ur(e,i)},{i:c-2,x:Ur(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:Ur(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:Ur(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:Ur(e,n)},{i:s-2,x:Ur(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var ii=ri(ti,`px, `,`px)`,`deg)`),ai=ri(ni,`, `,`)`,`)`),oi=1e-12;function si(e){return((e=Math.exp(e))+1/e)/2}function ci(e){return((e=Math.exp(e))-1/e)/2}function li(e){return((e=Math.exp(2*e))-1)/(e+1)}var ui=function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<oi)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=si(y),c=s/(n*g)*(i*li(t*r+y)-ci(y));return[a+c*d,o+c*f,s*i/si(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i}(Math.SQRT2,2,4),di=0,fi=0,pi=0,mi=1e3,hi,gi,_i=0,vi=0,yi=0,bi=typeof performance==`object`&&performance.now?performance:Date,xi=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Si(){return vi||=(xi(Ci),bi.now()+yi)}function Ci(){vi=0}function wi(){this._call=this._time=this._next=null}wi.prototype=Ti.prototype={constructor:wi,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Si():+n)+(t==null?0:+t),!this._next&&gi!==this&&(gi?gi._next=this:hi=this,gi=this),this._call=e,this._time=n,Ai()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ai())}};function Ti(e,t,n){var r=new wi;return r.restart(e,t,n),r}function Ei(){Si(),++di;for(var e=hi,t;e;)(t=vi-e._time)>=0&&e._call.call(void 0,t),e=e._next;--di}function Di(){vi=(_i=bi.now())+yi,di=fi=0;try{Ei()}finally{di=0,ki(),vi=0}}function Oi(){var e=bi.now(),t=e-_i;t>mi&&(yi-=t,_i=e)}function ki(){for(var e,t=hi,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:hi=n);gi=e,Ai(r)}function Ai(e){di||(fi&&=clearTimeout(fi),e-vi>24?(e<1/0&&(fi=setTimeout(Di,e-bi.now()-yi)),pi&&=clearInterval(pi)):(pi||=(_i=bi.now(),setInterval(Oi,mi)),di=1,xi(Di)))}function ji(e,t,n){var r=new wi;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var Mi=De(`start`,`end`,`cancel`,`interrupt`),Ni=[],Pi=0,Fi=1,Ii=2,Li=3,Ri=4,zi=5,Bi=6;function Vi(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Gi(e,n,{name:t,index:r,group:i,on:Mi,tween:Ni,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Pi})}function Hi(e,t){var n=Wi(e,t);if(n.state>Pi)throw Error(`too late; already scheduled`);return n}function Ui(e,t){var n=Wi(e,t);if(n.state>Li)throw Error(`too late; already running`);return n}function Wi(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function Gi(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Ti(a,0,n.time);function a(e){n.state=Fi,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==Fi)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===Li)return ji(o);f.state===Ri?(f.state=Bi,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=Bi,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(ji(function(){n.state===Li&&(n.state=Ri,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=Ii,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===Ii){for(n.state=Li,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=zi,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===zi&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=Bi,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function Ki(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>Ii&&r.state<zi,r.state=Bi,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function qi(e){return this.each(function(){Ki(this,e)})}function Ji(e,t){var n,r;return function(){var i=Ui(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Yi(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=Ui(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function Xi(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=Wi(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?Ji:Yi)(n,e,t))}function Zi(e,t,n){var r=e._id;return e.each(function(){var e=Ui(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return Wi(e,r).value[t]}}function Qi(e,t){var n;return(typeof t==`number`?Ur:t instanceof mr?Rr:(n=mr(t))?(t=n,Rr):Yr)(e,t)}function $i(e){return function(){this.removeAttribute(e)}}function ea(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ta(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function na(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function ra(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function ia(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function aa(e,t){var n=Pe(e),r=n===`transform`?ai:Qi;return this.attrTween(e,typeof t==`function`?(n.local?ia:ra)(n,r,Zi(this,`attr.`+e,t)):t==null?(n.local?ea:$i)(n):(n.local?na:ta)(n,r,t))}function oa(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function sa(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function ca(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&sa(e,i)),n}return i._value=t,i}function la(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&oa(e,i)),n}return i._value=t,i}function ua(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=Pe(e);return this.tween(n,(r.local?ca:la)(r,t))}function da(e,t){return function(){Hi(this,e).delay=+t.apply(this,arguments)}}function fa(e,t){return t=+t,function(){Hi(this,e).delay=t}}function pa(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?da:fa)(t,e)):Wi(this.node(),t).delay}function ma(e,t){return function(){Ui(this,e).duration=+t.apply(this,arguments)}}function ha(e,t){return t=+t,function(){Ui(this,e).duration=t}}function ga(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?ma:ha)(t,e)):Wi(this.node(),t).duration}function _a(e,t){if(typeof t!=`function`)throw Error();return function(){Ui(this,e).ease=t}}function va(e){var t=this._id;return arguments.length?this.each(_a(t,e)):Wi(this.node(),t).ease}function ya(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();Ui(this,e).ease=n}}function ba(e){if(typeof e!=`function`)throw Error();return this.each(ya(this._id,e))}function xa(e){typeof e!=`function`&&(e=Ke(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Xa(r,this._parents,this._name,this._id)}function Sa(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new Xa(o,this._parents,this._name,this._id)}function Ca(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function wa(e,t,n){var r,i,a=Ca(t)?Hi:Ui;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Ta(e,t){var n=this._id;return arguments.length<2?Wi(this.node(),n).on.on(e):this.each(wa(n,e,t))}function Ea(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Da(){return this.on(`end.remove`,Ea(this._id))}function Oa(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=ze(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,Vi(l[f],t,n,f,l,Wi(u,n)));return new Xa(a,this._parents,t,n)}function ka(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Ue(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=Wi(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&Vi(p,t,n,h,f,m);a.push(f),o.push(u)}return new Xa(a,o,t,n)}var Aa=An.prototype.constructor;function ja(){return new Aa(this._groups,this._parents)}function Ma(e,t){var n,r,i;return function(){var a=It(this,e),o=(this.style.removeProperty(e),It(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Na(e){return function(){this.style.removeProperty(e)}}function Pa(e,t,n){var r,i=n+``,a;return function(){var o=It(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Fa(e,t,n){var r,i,a;return function(){var o=It(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),It(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function Ia(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=Ui(this,e),l=c.on,u=c.value[a]==null?s||=Na(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function La(e,t,n){var r=(e+=``)==`transform`?ii:Qi;return t==null?this.styleTween(e,Ma(e,r)).on(`end.style.`+e,Na(e)):typeof t==`function`?this.styleTween(e,Fa(e,r,Zi(this,`style.`+e,t))).each(Ia(this._id,e)):this.styleTween(e,Pa(e,r,t),n).on(`end.style.`+e,null)}function Ra(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function za(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Ra(e,a,n)),r}return a._value=t,a}function Ba(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,za(e,t,n??``))}function Va(e){return function(){this.textContent=e}}function Ha(e){return function(){var t=e(this);this.textContent=t??``}}function Ua(e){return this.tween(`text`,typeof e==`function`?Ha(Zi(this,`text`,e)):Va(e==null?``:e+``))}function Wa(e){return function(t){this.textContent=e.call(this,t)}}function Ga(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Wa(r)),t}return r._value=e,r}function Ka(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,Ga(e))}function qa(){for(var e=this._name,t=this._id,n=Za(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=Wi(c,t);Vi(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Xa(r,this._parents,e,n)}function Ja(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=Ui(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var Ya=0;function Xa(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Za(){return++Ya}var Qa=An.prototype;Xa.prototype={constructor:Xa,select:Oa,selectAll:ka,selectChild:Qa.selectChild,selectChildren:Qa.selectChildren,filter:xa,merge:Sa,selection:ja,transition:qa,call:Qa.call,nodes:Qa.nodes,node:Qa.node,size:Qa.size,empty:Qa.empty,each:Qa.each,on:Ta,attr:aa,attrTween:ua,style:La,styleTween:Ba,text:Ua,textTween:Ka,remove:Da,tween:Xi,delay:pa,duration:ga,ease:va,easeVarying:ba,end:Ja,[Symbol.iterator]:Qa[Symbol.iterator]};function $a(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var eo={time:null,delay:0,duration:250,ease:$a};function to(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function no(e){var t,n;e instanceof Xa?(t=e._id,e=e._name):(t=Za(),(n=eo).time=Si(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&Vi(c,e,t,l,o,n||to(c,t));return new Xa(r,this._parents,e,t)}An.prototype.interrupt=qi,An.prototype.transition=no;var ro=e=>()=>e;function io(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function ao(e,t,n){this.k=e,this.x=t,this.y=n}ao.prototype={constructor:ao,scale:function(e){return e===1?this:new ao(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ao(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var oo=new ao(1,0,0);ao.prototype;function so(e){e.stopImmediatePropagation()}function co(e){e.preventDefault(),e.stopImmediatePropagation()}function lo(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function uo(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function fo(){return this.__zoom||oo}function po(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function mo(){return navigator.maxTouchPoints||`ontouchstart`in this}function ho(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function go(){var e=lo,t=uo,n=ho,r=po,i=mo,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=ui,l=De(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,fo).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,fo),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(oo.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new ao(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new ao(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new ao(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=Mn(this.that).datum();l.call(e,this.that,new io(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=Pn(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],Ki(this),s.start();co(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=Mn(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=Pn(t,i),l=t.clientX,u=t.clientY;zn(t.view),so(t),a.mouse=[c,this.__zoom.invert(c)],Ki(this),a.start();function d(e){if(co(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=Pn(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),Bn(e.view,a.moved),co(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=Pn(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);co(r),s>0?Mn(this).transition().duration(s).call(x,d,c,r):Mn(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(so(t),s=0;s<i;++s)c=r[s],l=Pn(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),Ki(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(co(e),s=0;s<a;++s)c=i[s],l=Pn(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(so(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=Pn(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=Mn(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:ro(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:ro(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:ro(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:ro([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var Y=(e=>(e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`,e))(Y||{}),_o=(e=>(e.Partial=`partial`,e.Full=`full`,e))(_o||{}),vo=(e=>(e.Bezier=`default`,e.SimpleBezier=`simple-bezier`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e))(vo||{}),yo=(e=>(e.Strict=`strict`,e.Loose=`loose`,e))(yo||{}),bo=(e=>(e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`,e))(bo||{}),xo=(e=>(e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`,e))(xo||{}),So=(e=>(e.TopLeft=`top-left`,e.TopCenter=`top-center`,e.TopRight=`top-right`,e.BottomLeft=`bottom-left`,e.BottomCenter=`bottom-center`,e.BottomRight=`bottom-right`,e))(So||{}),Co=[`INPUT`,`SELECT`,`TEXTAREA`],wo=typeof document<`u`?document:null;function To(e){let t=e.composedPath?.call(e)?.[0]||e.target,n=typeof t?.hasAttribute==`function`&&t.hasAttribute(`contenteditable`),r=typeof t?.closest==`function`?t.closest(`.nokey`):null;return Co.includes(t?.nodeName)||n||!!r}function Eo(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function Do(e,t,n,r){let i=t.replace(`+`,`
|
|
2
2
|
`).replace(`
|
|
3
3
|
|
|
4
4
|
`,`
|
package/src/ui/public/index.html
CHANGED
|
@@ -10,21 +10,21 @@
|
|
|
10
10
|
<meta name="theme-color" content="#141820" media="(prefers-color-scheme: dark)" />
|
|
11
11
|
<title>Zen GitSync</title>
|
|
12
12
|
<!-- 字体改为自托管(@font-face 见 src/main.css),不再依赖 Google Fonts 外链 -->
|
|
13
|
-
<script type="module" crossorigin src="/assets/index-
|
|
13
|
+
<script type="module" crossorigin src="/assets/index-Do0MeO4E.js"></script>
|
|
14
14
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-C0FnF6B9.js">
|
|
15
|
-
<link rel="modulepreload" crossorigin href="/assets/dagre-
|
|
16
|
-
<link rel="modulepreload" crossorigin href="/assets/element-plus-
|
|
17
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-
|
|
18
|
-
<link rel="modulepreload" crossorigin href="/assets/_plugin-vue_export-helper-
|
|
19
|
-
<link rel="modulepreload" crossorigin href="/assets/SvgIcon-
|
|
15
|
+
<link rel="modulepreload" crossorigin href="/assets/dagre-Dkbv4_Ri.js">
|
|
16
|
+
<link rel="modulepreload" crossorigin href="/assets/element-plus-BFy5M3jt.js">
|
|
17
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-BXLxNxh-.js">
|
|
18
|
+
<link rel="modulepreload" crossorigin href="/assets/_plugin-vue_export-helper-DcVJ6Vx3.js">
|
|
19
|
+
<link rel="modulepreload" crossorigin href="/assets/SvgIcon-IjDm7vQ-.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/assets/socket-io-TBtw0msS.js">
|
|
21
|
-
<link rel="modulepreload" crossorigin href="/assets/configStore-
|
|
22
|
-
<link rel="modulepreload" crossorigin href="/assets/monaco-
|
|
23
|
-
<link rel="modulepreload" crossorigin href="/assets/flow-mindmap-
|
|
24
|
-
<link rel="modulepreload" crossorigin href="/assets/CommonDialog-
|
|
25
|
-
<link rel="modulepreload" crossorigin href="/assets/vue-flow
|
|
21
|
+
<link rel="modulepreload" crossorigin href="/assets/configStore-jJrldIrT.js">
|
|
22
|
+
<link rel="modulepreload" crossorigin href="/assets/monaco-Eb1VRwsF.js">
|
|
23
|
+
<link rel="modulepreload" crossorigin href="/assets/flow-mindmap-Qo4JDluG.js">
|
|
24
|
+
<link rel="modulepreload" crossorigin href="/assets/CommonDialog-33jIvgti.js">
|
|
25
|
+
<link rel="modulepreload" crossorigin href="/assets/vue-flow--96Pa3sG.js">
|
|
26
26
|
<link rel="stylesheet" crossorigin href="/assets/element-plus-D-6gla1z.css">
|
|
27
|
-
<link rel="stylesheet" crossorigin href="/assets/vendor-
|
|
27
|
+
<link rel="stylesheet" crossorigin href="/assets/vendor-aCkTc13z.css">
|
|
28
28
|
<link rel="stylesheet" crossorigin href="/assets/SvgIcon-BQ6bR7l0.css">
|
|
29
29
|
<link rel="stylesheet" crossorigin href="/assets/monaco-B2lPvkrc.css">
|
|
30
30
|
<link rel="stylesheet" crossorigin href="/assets/flow-mindmap-DqCKZUlr.css">
|
package/src/utils/aiEndpoint.js
CHANGED
|
@@ -33,6 +33,10 @@
|
|
|
33
33
|
// 要**明确报错**(提示换模型),而不是把 OpenAI body 打到 Anthropic 路由上等一个
|
|
34
34
|
// 看不懂的 4xx。
|
|
35
35
|
//
|
|
36
|
+
// 目前有两家网关是这个形态:OpenCode Go(三族)与 Command Code(两族,
|
|
37
|
+
// claude-* 只能走 /messages)。两者的客户端身份要求不同——Command Code 只认
|
|
38
|
+
// Bearer,不需要额外的会话头。
|
|
39
|
+
//
|
|
36
40
|
// 参考实现:ai-model-form 包的 server/middleware.js(同一套判断,那边只做连通性测试)。
|
|
37
41
|
// ─────────────────────────────────────────────────────────────
|
|
38
42
|
|
|
@@ -55,6 +59,9 @@ export const AI_USER_AGENT = `zen-gitsync/${PKG_VERSION}`
|
|
|
55
59
|
/** OpenCode 网关的 Go 订阅入口(ai-model-form 里叫 OPENCODE_GO_URL) */
|
|
56
60
|
export const OPENCODE_GO_URL = 'https://opencode.ai/zen/go/v1'
|
|
57
61
|
|
|
62
|
+
/** Command Code 的 Provider API 入口(ai-model-form 里同名常量) */
|
|
63
|
+
export const COMMAND_CODE_URL = 'https://api.commandcode.ai/provider/v1'
|
|
64
|
+
|
|
58
65
|
/**
|
|
59
66
|
* OpenCode Go 上走 Anthropic /messages 协议的模型(鉴权是 x-api-key,不是 Bearer)。
|
|
60
67
|
* 只列**非 chat** 的模型:没列到的一律按 chat 处理,这样网关以后新增 chat 模型
|
|
@@ -108,6 +115,38 @@ export function openCodeGoFamily(modelId) {
|
|
|
108
115
|
return 'chat'
|
|
109
116
|
}
|
|
110
117
|
|
|
118
|
+
/**
|
|
119
|
+
* 是否为 Command Code 网关(commandcode.ai 及其子域)。
|
|
120
|
+
* 与 isOpenCodeGateway 同样只看主机名后缀,防止 evil-commandcode.ai.attacker.com
|
|
121
|
+
* 这类伪装域名被当成官方入口。
|
|
122
|
+
* @param {string} baseURL
|
|
123
|
+
* @returns {boolean}
|
|
124
|
+
*/
|
|
125
|
+
export function isCommandCodeGateway(baseURL) {
|
|
126
|
+
try {
|
|
127
|
+
const host = new URL(normalizeBaseURL(baseURL)).hostname
|
|
128
|
+
return /(^|\.)commandcode\.ai$/i.test(host)
|
|
129
|
+
} catch {
|
|
130
|
+
return false
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* 判断模型在 Command Code 上走哪种协议族。
|
|
136
|
+
*
|
|
137
|
+
* 这里按 `claude-*` 前缀判断而不是维护一张模型清单:官方 /models 的
|
|
138
|
+
* supported_endpoints 字段里「不支持 /chat/completions」的恰好就是全部 claude-*
|
|
139
|
+
* (2026-10-08 核对:11 个,两边完全吻合)。网关侧对 Claude 系是硬约束——
|
|
140
|
+
* 打到 /chat/completions 会直接回 400「must be called via /provider/v1/messages」。
|
|
141
|
+
*
|
|
142
|
+
* @param {string} modelId
|
|
143
|
+
* @returns {'chat'|'messages'}
|
|
144
|
+
*/
|
|
145
|
+
export function commandCodeFamily(modelId) {
|
|
146
|
+
const id = String(modelId || '').trim()
|
|
147
|
+
return /^claude-/i.test(id) ? 'messages' : 'chat'
|
|
148
|
+
}
|
|
149
|
+
|
|
111
150
|
let _processSessionId = null
|
|
112
151
|
|
|
113
152
|
/**
|
|
@@ -170,6 +209,15 @@ export function buildAiChatRequest({ baseURL, model, apiKey, sessionId, extraHea
|
|
|
170
209
|
}
|
|
171
210
|
}
|
|
172
211
|
|
|
212
|
+
if (isCommandCodeGateway(base) && commandCodeFamily(model) !== 'chat') {
|
|
213
|
+
throw new Error(
|
|
214
|
+
`模型「${model}」在 Command Code 网关上只能走 Anthropic 的 /messages 协议,` +
|
|
215
|
+
'本工具的 AI 调用只实现了 OpenAI 兼容的 /chat/completions。请在设置里换一个' +
|
|
216
|
+
'走 chat/completions 的模型(如 moonshotai/Kimi-K3、zai-org/GLM-5.3、' +
|
|
217
|
+
'Qwen/Qwen3.8-Max、deepseek/deepseek-v4-flash)。'
|
|
218
|
+
)
|
|
219
|
+
}
|
|
220
|
+
|
|
173
221
|
return {
|
|
174
222
|
url: `${base}/chat/completions`,
|
|
175
223
|
headers: {
|
|
@@ -18,15 +18,19 @@
|
|
|
18
18
|
// 所以用测试把三件事钉死:
|
|
19
19
|
// 1) 只对 OpenCode 网关加 x-opencode-session,别的 provider 不加(避免污染第三方请求)
|
|
20
20
|
// 2) 请求头里必须有自己的客户端名字(User-Agent 不能是 node-fetch/undici)
|
|
21
|
-
// 3) OpenCode 网关上非 chat 协议族的模型要**明确报错**,不能把 OpenAI
|
|
21
|
+
// 3) OpenCode / Command Code 网关上非 chat 协议族的模型要**明确报错**,不能把 OpenAI
|
|
22
|
+
// body 打错路由(两家网关的协议族识别与伪装域名都要各自钉死)
|
|
22
23
|
import { test } from 'node:test'
|
|
23
24
|
import assert from 'node:assert/strict'
|
|
24
25
|
import {
|
|
25
26
|
AI_USER_AGENT,
|
|
27
|
+
COMMAND_CODE_URL,
|
|
26
28
|
OPENCODE_GO_URL,
|
|
27
29
|
buildAiApiRequest,
|
|
28
30
|
buildAiChatRequest,
|
|
31
|
+
commandCodeFamily,
|
|
29
32
|
describeAiHttpError,
|
|
33
|
+
isCommandCodeGateway,
|
|
30
34
|
isOpenCodeGateway,
|
|
31
35
|
normalizeBaseURL,
|
|
32
36
|
openCodeGoFamily,
|
|
@@ -34,6 +38,7 @@ import {
|
|
|
34
38
|
} from './aiEndpoint.js'
|
|
35
39
|
|
|
36
40
|
const GO = 'https://opencode.ai/zen/go/v1'
|
|
41
|
+
const CC = 'https://api.commandcode.ai/provider/v1'
|
|
37
42
|
|
|
38
43
|
// ========== normalizeBaseURL ==========
|
|
39
44
|
|
|
@@ -73,6 +78,32 @@ test('openCodeGoFamily: 三种协议族与默认 chat', () => {
|
|
|
73
78
|
assert.equal(openCodeGoFamily(''), 'chat')
|
|
74
79
|
})
|
|
75
80
|
|
|
81
|
+
// ========== isCommandCodeGateway ==========
|
|
82
|
+
|
|
83
|
+
test('isCommandCodeGateway: 识别 commandcode.ai 及其子域', () => {
|
|
84
|
+
assert.equal(isCommandCodeGateway(CC), true)
|
|
85
|
+
assert.equal(isCommandCodeGateway('https://api.commandcode.ai/provider/v1/'), true)
|
|
86
|
+
assert.equal(isCommandCodeGateway('https://commandcode.ai/api'), true)
|
|
87
|
+
assert.equal(isCommandCodeGateway('https://api.deepseek.com/v1'), false)
|
|
88
|
+
// 伪装域名不能被当成官方入口
|
|
89
|
+
assert.equal(isCommandCodeGateway('https://evil-commandcode.ai.attacker.com/v1'), false)
|
|
90
|
+
assert.equal(isCommandCodeGateway('not-a-url'), false)
|
|
91
|
+
assert.equal(isCommandCodeGateway(''), false)
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
// ========== commandCodeFamily ==========
|
|
95
|
+
|
|
96
|
+
test('commandCodeFamily: claude-* 走 messages,其余默认 chat', () => {
|
|
97
|
+
assert.equal(commandCodeFamily('claude-sonnet-5'), 'messages')
|
|
98
|
+
assert.equal(commandCodeFamily('claude-opus-5-5'), 'messages')
|
|
99
|
+
// 大小写/空格容错
|
|
100
|
+
assert.equal(commandCodeFamily(' Claude-Haiku-5-5 '), 'messages')
|
|
101
|
+
assert.equal(commandCodeFamily('moonshotai/Kimi-K3'), 'chat')
|
|
102
|
+
assert.equal(commandCodeFamily('deepseek/deepseek-v4-flash'), 'chat')
|
|
103
|
+
assert.equal(commandCodeFamily('inclusionai/ling-3.1-flash:free'), 'chat')
|
|
104
|
+
assert.equal(commandCodeFamily(''), 'chat')
|
|
105
|
+
})
|
|
106
|
+
|
|
76
107
|
// ========== buildAiChatRequest ==========
|
|
77
108
|
|
|
78
109
|
test('buildAiChatRequest: 普通 provider 拼 url + Bearer,不带 opencode 会话头', () => {
|
|
@@ -129,6 +160,25 @@ test('buildAiChatRequest: OpenCode Go 上非 chat 协议族的模型直接给可
|
|
|
129
160
|
)
|
|
130
161
|
})
|
|
131
162
|
|
|
163
|
+
test('buildAiChatRequest: Command Code + chat 模型拼 url,且不该带 opencode 会话头', () => {
|
|
164
|
+
const { url, headers } = buildAiChatRequest({
|
|
165
|
+
baseURL: CC,
|
|
166
|
+
model: 'moonshotai/Kimi-K3',
|
|
167
|
+
apiKey: 'user_abc',
|
|
168
|
+
})
|
|
169
|
+
assert.equal(url, `${COMMAND_CODE_URL}/chat/completions`)
|
|
170
|
+
assert.equal(headers['Authorization'], 'Bearer user_abc')
|
|
171
|
+
// Command Code 只认 Bearer,别误判成 OpenCode 网关往上加会话头
|
|
172
|
+
assert.ok(!('x-opencode-session' in headers), 'Command Code 不需要 x-opencode-session')
|
|
173
|
+
})
|
|
174
|
+
|
|
175
|
+
test('buildAiChatRequest: Command Code 上 claude-* 只能走 /messages,直接给可读报错', () => {
|
|
176
|
+
assert.throws(
|
|
177
|
+
() => buildAiChatRequest({ baseURL: CC, model: 'claude-sonnet-5', apiKey: 'k' }),
|
|
178
|
+
/claude-sonnet-5.*Anthropic.*\/messages.*换一个/
|
|
179
|
+
)
|
|
180
|
+
})
|
|
181
|
+
|
|
132
182
|
test('buildAiChatRequest: 无 apiKey 不发 Authorization,extraHeaders 可覆盖默认头', () => {
|
|
133
183
|
const { headers } = buildAiChatRequest({
|
|
134
184
|
baseURL: 'https://api.deepseek.com/v1',
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-C0FnF6B9.js";import{C as e,Cn as t,Dn as n,En as r,Gn as i,Gr as a,Hn as o,J as s,Mn as c,Mr as l,Pn as u,Rn as d,S as f,Tn as p,Xr as m,Y as h,Yn as g,Zn as _,dr as v,or as y,qn as b,tt as x,vr as S,w as C,wn as w,wr as T,yn as E}from"./element-plus-DTtm3XCd.js";import{n as D,t as O}from"./_plugin-vue_export-helper-Bsx6Zj3t.js";import{t as k}from"./SvgIcon-DcVasCdo.js";import{T as A,m as j,z as M}from"./index-BApctCNq.js";import{d as N,f as P,p as F,u as I}from"./agentConversations-BnG4a1oH.js";d(),v();function L(e,n=680){let r=S(0),a=null;function s(){let t=e.value;return t?(r.value=t.clientWidth,typeof ResizeObserver>`u`||(a=new ResizeObserver(e=>{let t=e[0]?.contentRect?.width;typeof t==`number`&&(r.value=t)}),a.observe(t),!0)):!1}return b(()=>{s()||o(()=>s())}),i(()=>{a?.disconnect(),a=null}),{width:r,narrow:t(()=>r.value>0&&r.value<n)}}d(),v(),l();var R={class:`agent-engine`},z=[`disabled`,`title`,`aria-label`],B={class:`agent-engine__name`},V={class:`agent-engine__item`},H={class:`agent-engine__item-name`},U={key:3,class:`agent-engine__item-missing`},W=O(u({__name:`AgentEngineSelector`,props:{engine:{},locked:{type:Boolean}},emits:[`select`],setup(i,{emit:o}){let l=i,u=o,d=M(),v=t(()=>P(l.engine)),b=t(()=>({gai:!0,claude:d.claudeAvailable,opencode:d.opencodeAvailable,codex:d.codexAvailable})),O=S(!1),L=S(null);function W(e){if(!l.locked){if(!b.value[e]){if(!F(e))return;L.value=e,O.value=!0;return}u(`select`,e)}}return(t,o)=>(g(),n(`div`,R,[c(T(f),{trigger:`click`,onCommand:W},{dropdown:y(()=>[c(T(C),null,{default:y(()=>[(g(!0),n(E,null,_(T(I),t=>(g(),p(T(e),{key:t.id,command:t.id},{default:y(()=>[w(`span`,V,[T(F)(t.id)?(g(),p(j,{key:0,executor:t.id,class:`agent-engine__item-icon`},null,8,[`executor`])):(g(),p(k,{key:1,"icon-class":T(N),class:`agent-engine__item-icon`},null,8,[`icon-class`])),w(`span`,H,m(t.name),1),i.engine===t.id?(g(),p(T(s),{key:2,class:`agent-engine__item-check`},{default:y(()=>[c(T(x))]),_:1})):b.value[t.id]?r(``,!0):(g(),n(`span`,U,m(T(D)(`@42BB9:未安装`)),1))])]),_:2},1032,[`command`]))),128))]),_:1})]),default:y(()=>[w(`button`,{type:`button`,class:a([`agent-engine__btn`,{"is-locked":i.locked}]),disabled:i.locked,title:i.locked?T(D)(`@AGENT:本会话的引擎已锁定;要换引擎请新建会话`):T(D)(`@AGENT:新建会话使用的引擎`),"aria-label":T(D)(`@AGENT:智能体引擎`)},[T(F)(i.engine)?(g(),p(j,{key:0,executor:i.engine,class:`agent-engine__icon`},null,8,[`executor`])):(g(),p(k,{key:1,"icon-class":T(N),class:`agent-engine__icon`},null,8,[`icon-class`])),w(`span`,B,m(v.value),1),c(T(s),{class:`agent-engine__caret`},{default:y(()=>[c(T(h))]),_:1})],10,z)]),_:1}),c(A,{modelValue:O.value,"onUpdate:modelValue":o[0]||=e=>O.value=e,tool:L.value},null,8,[`modelValue`,`tool`])]))}}),[[`__scopeId`,`data-v-cc0a8973`]]);export{L as n,W as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-C0FnF6B9.js";import{At as e,Cn as t,Ct as n,Dn as r,En as i,Gr as a,Hn as o,J as ee,Jt as s,M as c,Mn as l,Mr as u,Pn as d,Rn as f,Tn as p,Tt as m,Vt as te,W as ne,Wt as h,Xr as g,Yn as _,Zn as v,a as y,dr as b,er as x,et as S,gr as C,hn as w,i as T,ir as E,j as re,jn as D,kt as O,ln as k,lt as ie,mt as ae,or as A,qr as j,r as M,rn as oe,sr as N,st as P,tt as se,vr as F,wn as I,wr as L,yn as R}from"./element-plus-DTtm3XCd.js";import{r as z,s as B}from"./vendor-O17eRefg.js";import{n as V,t as H}from"./_plugin-vue_export-helper-Bsx6Zj3t.js";import{t as ce}from"./configStore-DQSKV2_Y.js";import{t as le}from"./CommonDialog-NqZURH2F.js";import{a as U,c as ue,i as W,l as G,n as K,o as q,r as de,s as J,t as fe}from"./agentConversations-BnG4a1oH.js";import{n as pe,t as me}from"./AgentEngineSelector-Bm_wrfGT.js";f(),b(),k(),u();var Y={class:`marketplace-panel`},he={class:`mp-toolbar`},ge={class:`mp-search`},_e=[`placeholder`],ve={class:`mp-toolbar-sub`},ye={class:`mp-target-hint`},be={class:`mp-source-filter`},xe=[`onClick`],Se={class:`mp-body`},Ce={class:`mp-group-header`},we={class:`mp-group-title`},X={key:0,class:`mp-group-count`},Te={key:1,class:`mp-group-error`},Ee=[`href`,`title`],De={key:0,class:`mp-grid`},Oe={class:`mp-card-head`},ke=[`title`],Ae={key:0,class:`mp-card-metric`},je=[`title`],Me={class:`mp-card-meta`},Ne=[`title`],Z=[`title`],Pe={key:2,class:`mp-tag remote`},Fe={class:`mp-card-foot`},Q=[`href`],$={key:1,class:`mp-installed-chip`},Ie=[`disabled`,`onClick`],Le={key:3,class:`mp-not-installable`},Re={key:1,class:`mp-empty`},ze={key:0,class:`mp-group installed`},Be={class:`mp-group-header`},Ve={class:`mp-group-title`},He={class:`mp-group-count`},Ue={key:0,class:`mp-installed-block`},We={class:`mp-installed-target`},Ge={class:`mp-installed-list`},Ke=[`title`],qe=[`title`],Je={key:1,class:`mp-meta-pkg`},Ye={key:2,class:`mp-tag warn`},Xe=[`disabled`,`title`,`onClick`],Ze=[`disabled`,`onClick`],Qe={key:1,class:`mp-empty all`},$e={key:0,class:`mkt-form`},et={class:`mkt-form-name`},tt=[`onUpdate:modelValue`,`placeholder`],nt={key:0,class:`mkt-field`},rt={class:`mkt-hint`},it=H(d({__name:`MarketplacePanel`,props:{type:{}},setup(e){let o=e,u=ce(),d=F([]),f=F([]),m=F(!1),b=F(``),x=F(``),S=F([]),k=F(`project`),j=F(new Set),P=F(new Set),z=F(new Set),B=t(()=>u.currentDirectory||``),H=null;async function U(){if(!m.value){m.value=!0;try{let e=new URLSearchParams({type:o.type,cwd:B.value});x.value&&e.set(`q`,x.value),S.value.length&&e.set(`sources`,S.value.join(`,`));let t=await(await fetch(`/api/agent/marketplace/catalog?${e}`)).json();t?.success?(d.value=t.groups||[],f.value=t.installed||[]):T.error(t?.error||V(`@MKT:加载失败`))}catch{T.error(V(`@MKT:加载失败`))}finally{m.value=!1}}}E(b,e=>{H&&clearTimeout(H),H=setTimeout(()=>{x.value=e.trim(),U()},400)}),E(S,()=>U()),E(()=>o.type,()=>{S.value=[],x.value=``,b.value=``,U()}),E(B,()=>U()),U();let ue=t(()=>{let e=B.value?B.value.split(/[\\/]/).filter(Boolean).pop():``;return k.value===`project`?e||V(`@MKT:当前项目`):V(`@MKT:g ai 智能体`)});function W(e){return e.stars?`${G(e.stars)} ★`:e.downloads?`${G(e.downloads)} ${V(`@MKT:周下载`)}`:e.uses?`${G(e.uses)} ${V(`@MKT:次使用`)}`:``}function G(e){return e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(e)}function K(e){return`${e.id}`}function q(e){return j.value.has(K(e))}let de=t(()=>{let e={project:[],global:[]};for(let t of f.value)(e[t.target]||=[]).push(t);return e}),J=C({visible:!1,item:null,env:{},args:``});function fe(e){return o.type===`mcp`&&(!!e.envKeys?.length||!!e.args?.length)}function pe(e){J.item=e,J.env=Object.fromEntries((e.envKeys||[]).map(e=>[e,``])),J.args=(e.args||[]).join(` `),J.visible=!0}function me(){let e=J.item;if(J.visible=!1,!e)return;let t=Object.fromEntries(Object.entries(J.env).filter(([,e])=>e.trim()!==``)),n=J.args.trim()?J.args.trim().match(/(?:[^\s"]+|"[^"]*")+/g)?.map(e=>e.replace(/^"|"$/g,``))??void 0:void 0;at(e,{env:t,...n?{args:n}:{}})}async function it(e){if(!e.installed||await ot(e)){if(fe(e)){pe(e);return}await at(e,{})}}async function at(e,t){let n=K(e);j.value.add(n);try{let n=await fetch(`/api/agent/marketplace/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({type:o.type,target:k.value,cwd:B.value,item:{...e,...t}})}),r=await n.json().catch(()=>null);if(!n.ok||!r?.success){T.error(r?.error||V(`@MKT:安装失败`));return}r.item?.warning&&T.warning(r.item.warning),r.item?.envKeys?.length?T.warning(`${V(`@MKT:还缺环境变量`)}: ${r.item.envKeys.join(`, `)}`):T.success(V(`@MKT:安装成功`)),await U()}catch{T.error(V(`@MKT:安装失败`))}finally{j.value.delete(n)}}async function ot(e){try{return await M.confirm(`${e.name} ${V(`@MKT:已安装,要重新安装吗?`)}`,V(`@MKT:重新安装`),{confirmButtonText:V(`@MKT:重装`),cancelButtonText:V(`@MKT:取消`),type:`warning`}),!0}catch{return!1}}async function st(e){let t=`${e.target}:${e.id}`;z.value.add(t);try{let t=await fetch(`/api/agent/marketplace/reveal`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({type:o.type,target:e.target,cwd:B.value,id:e.id})}),n=await t.json().catch(()=>null);(!t.ok||!n?.success)&&T.error(n?.error||V(`@MKT:打开失败`))}catch{T.error(V(`@MKT:打开失败`))}finally{z.value.delete(t)}}async function ct(e){try{await M.confirm(`${V(`@MKT:确定卸载`)} ${e.name}?`,V(`@MKT:卸载`),{confirmButtonText:V(`@MKT:卸载`),cancelButtonText:V(`@MKT:取消`),type:`warning`})}catch{return}let t=`${e.target}:${e.id}`;P.value.add(t);try{let t=new URLSearchParams({target:e.target,cwd:B.value}),n=await fetch(`/api/agent/marketplace/item/${o.type}/${encodeURIComponent(e.id)}?${t}`,{method:`DELETE`}),r=await n.json().catch(()=>null);if(!n.ok||!r?.success){T.error(r?.error||V(`@MKT:卸载失败`));return}T.success(V(`@MKT:已卸载`)),await U()}catch{T.error(V(`@MKT:卸载失败`))}finally{P.value.delete(t)}}return(t,o)=>{let u=ee,x=re,C=c,T=ne,E=y;return _(),r(`div`,Y,[I(`div`,he,[I(`div`,ge,[l(u,{class:`mp-search-icon`},{default:A(()=>[l(L(h))]),_:1}),N(I(`input`,{"onUpdate:modelValue":o[0]||=e=>b.value=e,class:`mp-search-input`,type:`text`,placeholder:e.type===`skill`?L(V)(`@MKT:搜索 Skill...`):L(V)(`@MKT:搜索 MCP 服务...`)},null,8,_e),[[w,b.value]])]),l(C,{modelValue:k.value,"onUpdate:modelValue":o[1]||=e=>k.value=e,size:`small`,class:`mp-target`},{default:A(()=>[l(x,{value:`project`},{default:A(()=>[D(g(L(V)(`@MKT:当前项目`)),1)]),_:1}),l(x,{value:`global`},{default:A(()=>[D(g(L(V)(`@MKT:g ai 智能体`)),1)]),_:1})]),_:1},8,[`modelValue`]),l(T,{content:L(V)(`@MKT:刷新`),placement:`top`,"show-after":300},{default:A(()=>[I(`button`,{class:a([`mp-refresh`,{spinning:m.value}]),onClick:U},[l(u,null,{default:A(()=>[l(L(te))]),_:1})],2)]),_:1},8,[`content`])]),I(`div`,ve,[I(`span`,ye,[D(g(L(V)(`@MKT:安装到`))+` `,1),I(`b`,null,g(ue.value),1)]),I(`div`,be,[(_(!0),r(R,null,v(d.value,e=>(_(),r(`button`,{key:e.id,class:a([`mp-chip`,{active:S.value.includes(e.id)}]),onClick:()=>{let t=S.value.indexOf(e.id);t>=0?S.value.splice(t,1):S.value.push(e.id)}},g(e.label),11,xe))),128)),S.value.length?(_(),r(`button`,{key:0,class:`mp-chip clear`,onClick:o[2]||=e=>S.value=[]},g(L(V)(`@MKT:全部来源`)),1)):i(``,!0)])]),N((_(),r(`div`,Se,[(_(!0),r(R,null,v(d.value,e=>(_(),r(`section`,{key:e.id,class:`mp-group`},[I(`header`,Ce,[I(`h3`,we,g(e.label),1),e.status===`ok`?(_(),r(`span`,X,g(e.items.length),1)):(_(),r(`span`,Te,[l(u,null,{default:A(()=>[l(L(oe))]),_:1}),D(` `+g(e.error||L(V)(`@MKT:来源不可用`)),1)])),e.homepage?(_(),r(`a`,{key:2,class:`mp-group-link`,href:e.homepage,target:`_blank`,rel:`noopener noreferrer`,title:e.homepage},[l(u,null,{default:A(()=>[l(L(O))]),_:1})],8,Ee)):i(``,!0)]),e.status===`ok`&&e.items.length?(_(),r(`div`,De,[(_(!0),r(R,null,v(e.items,e=>(_(),r(`article`,{key:K(e),class:`mp-card`},[I(`div`,Oe,[I(`span`,{class:`mp-card-name`,title:e.name},g(e.name),9,ke),W(e)?(_(),r(`span`,Ae,[l(u,null,{default:A(()=>[e.stars?(_(),p(L(s),{key:0})):(_(),p(L(ae),{key:1}))]),_:2},1024),D(` `+g(W(e)),1)])):i(``,!0)]),I(`p`,{class:`mp-card-desc`,title:e.description},g(e.description||L(V)(`@MKT:暂无描述`)),9,je),I(`div`,Me,[e.package?(_(),r(`code`,{key:0,class:`mp-meta-pkg`,title:e.package},g(e.package),9,Ne)):e.repository?(_(),r(`span`,{key:1,class:`mp-meta-repo`,title:e.repository+(e.subpath?` · `+e.subpath:``)},[D(g(e.repository),1),e.subpath?(_(),r(R,{key:0},[D(` · `+g(e.subpath),1)],64)):i(``,!0)],8,Z)):i(``,!0),e.transport===`remote`?(_(),r(`span`,Pe,g(L(V)(`@MKT:远程服务`)),1)):i(``,!0),(_(!0),r(R,null,v((e.tags||[]).slice(0,2),e=>(_(),r(`span`,{key:e,class:`mp-tag`},g(e),1))),128))]),I(`div`,Fe,[e.upstream?(_(),r(`a`,{key:0,class:`mp-card-link`,href:e.upstream,target:`_blank`,rel:`noopener noreferrer`},g(L(V)(`@MKT:查看来源`)),9,Q)):i(``,!0),o[6]||=I(`span`,{class:`mp-foot-spacer`},null,-1),e.installed?(_(),r(`span`,$,[l(u,null,{default:A(()=>[l(L(se))]),_:1}),D(g(L(V)(`@MKT:已安装`)),1)])):e.installable===!1?(_(),r(`span`,Le,g(L(V)(`@MKT:暂不支持一键安装`)),1)):(_(),r(`button`,{key:2,class:`mp-install-btn`,disabled:q(e),onClick:t=>it(e)},g(q(e)?L(V)(`@MKT:安装中...`):L(V)(`@MKT:安装`)),9,Ie))])]))),128))])):e.status===`ok`?(_(),r(`div`,Re,g(L(V)(`@MKT:该来源暂无结果`)),1)):i(``,!0)]))),128)),f.value.length?(_(),r(`section`,ze,[I(`header`,Be,[I(`h3`,Ve,g(L(V)(`@MKT:已安装`)),1),I(`span`,He,g(f.value.length),1)]),(_(),r(R,null,v([`project`,`global`],e=>I(`div`,{key:e},[de.value[e]?.length?(_(),r(`div`,Ue,[I(`div`,We,g(e===`project`?L(V)(`@MKT:当前项目`):L(V)(`@MKT:g ai 智能体`)),1),I(`div`,Ge,[(_(!0),r(R,null,v(de.value[e],t=>(_(),r(`div`,{key:e+t.id,class:`mp-installed-row`},[I(`span`,{class:`mp-installed-name`,title:t.name},g(t.name),9,Ke),t.id&&t.id!==t.name?(_(),r(`code`,{key:0,class:`mp-installed-id`,title:t.dir||t.file||t.id},g(t.id),9,qe)):i(``,!0),t.package?(_(),r(`code`,Je,g(t.package),1)):i(``,!0),t.requiredEnv?.length?(_(),r(`span`,Ye,g(L(V)(`@MKT:待配置`))+`: `+g(t.requiredEnv.join(`, `)),1)):i(``,!0),o[7]||=I(`span`,{class:`mp-foot-spacer`},null,-1),I(`button`,{class:`mp-reveal-btn`,disabled:z.value.has(e+t.id),title:t.dir||t.file||``,onClick:e=>st(t)},[l(u,null,{default:A(()=>[l(L(n))]),_:1}),D(` `+g(L(V)(`@MKT:打开文件夹`)),1)],8,Xe),I(`button`,{class:`mp-remove-btn`,disabled:P.value.has(e+t.id),onClick:e=>ct(t)},[l(u,null,{default:A(()=>[l(L(ie))]),_:1}),D(` `+g(P.value.has(e+t.id)?L(V)(`@MKT:卸载中...`):L(V)(`@MKT:卸载`)),1)],8,Ze)]))),128))])])):i(``,!0)])),64))])):i(``,!0),!m.value&&!d.value.length?(_(),r(`div`,Qe,g(L(V)(`@MKT:加载失败`)),1)):i(``,!0)])),[[E,m.value]]),l(le,{modelValue:J.visible,"onUpdate:modelValue":o[5]||=e=>J.visible=e,title:L(V)(`@MKT:配置 MCP`),width:`460px`,type:`flex`,"close-on-click-modal":!1,"append-to-body":``},{footer:A(()=>[I(`button`,{class:`mkt-cancel`,onClick:o[4]||=e=>J.visible=!1},g(L(V)(`@MKT:取消`)),1),I(`button`,{class:`mkt-confirm`,onClick:me},g(L(V)(`@MKT:安装`)),1)]),default:A(()=>[J.item?(_(),r(`div`,$e,[I(`p`,et,g(J.item.name),1),(_(!0),r(R,null,v(Object.keys(J.env),e=>(_(),r(`div`,{key:e,class:`mkt-field`},[I(`label`,null,g(e),1),N(I(`input`,{"onUpdate:modelValue":t=>J.env[e]=t,type:`text`,autocomplete:`off`,placeholder:L(V)(`@MKT:环境变量值`),spellcheck:`false`},null,8,tt),[[w,J.env[e]]])]))),128)),J.item.args?.length?(_(),r(`div`,nt,[I(`label`,null,g(L(V)(`@MKT:启动参数`)),1),N(I(`input`,{"onUpdate:modelValue":o[3]||=e=>J.args=e,type:`text`,autocomplete:`off`,spellcheck:`false`},null,512),[[w,J.args]]),I(`p`,rt,g(L(V)(`@MKT:参数提示`)),1)])):i(``,!0)])):i(``,!0)]),_:1},8,[`modelValue`,`title`])])}}}),[[`__scopeId`,`data-v-536d7952`]]);f(),b(),u();var at={class:`agent-chat-area`},ot={class:`agent-tabs`,role:`tablist`},st=[`aria-selected`,`onClick`],ct={class:`agent-tab-body`},lt={key:0,class:`agent-chat-pane`},ut={key:0,class:`agent-list-page`},dt={key:0,class:`agent-page-bar`},ft=[`title`,`aria-label`],pt={class:`agent-page-title`},mt={key:0,class:`chat-loading`},ht=H(d({__name:`AgentView`,setup(n){let s=ce(),c=F(null),{narrow:u}=pe(c),d=F(`chat`),f=F(`chat`),te=t(()=>f.value===`mcp`?`mcp`:`skill`),ne=t(()=>[{id:`chat`,label:V(`@AGENT:对话`),icon:S},{id:`skill`,label:V(`@AGENT:Skill 广场`),icon:m},{id:`mcp`,label:V(`@AGENT:MCP 广场`),icon:P}]),{sessions:h,sessionsLoading:y,currentSessionId:b,messages:C,isStreaming:w,sessionLoading:T,loadSessions:re,loadSession:D,deleteSession:O,renameSession:k,newSession:ie,sendMessage:ae,pendingQuestion:M,answeringQuestion:oe,answerQuestion:N,isSessionGenerating:se,currentEngine:H,pendingEngine:le,isEngineLocked:Y,pickEngine:he,stop:ge,inputContextUsage:_e,queuedMessages:ve,queuePaused:ye,removeQueuedMessage:be,flushQueued:xe}=G(),Se=t(()=>Y.value?H.value:le.value);function Ce(e){Y.value||he(e)}let we=t(()=>{let e=s.theme;return e===`dark`||e===`auto`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}),X=t(()=>J(h.value,se)),Te=W(),Ee=t(()=>X.value.find(e=>e.id===b.value)?.title||V(`@AGENT:对话`)),De={"--welcome-avatar":`url("${fe}")`},Oe=t(()=>[{id:`p1`,label:V(`@AGENT:查看项目结构`),prompt:V(`@AGENT:prompt_p1`)},{id:`p2`,label:V(`@AGENT:分析代码质量`),prompt:V(`@AGENT:prompt_p2`)},{id:`p3`,label:V(`@AGENT:帮我提交代码`),prompt:V(`@AGENT:prompt_p3`)},{id:`p4`,label:V(`@AGENT:Git 状态检查`),prompt:V(`@AGENT:prompt_p4`)},{id:`p5`,label:V(`@AGENT:帮我启动项目`),prompt:V(`@AGENT:prompt_p5`)}]);async function ke(e){await ae(e.text,e.files),await o(),Z()}async function Ae(e){await ae(e.prompt),await o(),Z()}let je=U(),Me=F(null),Ne=q();function Z(e=!0){Me.value?.scrollToBottom(e)}E(()=>C.value.length,()=>{o(()=>Z(!1))});function Pe(e){D(e),d.value=`chat`}function Fe(){ie(),d.value=`chat`}let Q=F(280),$=F(!1);function Ie(e){$.value=!0;let t=e.clientX,n=Q.value,r=e=>{let r=e.clientX-t,i=Math.max(200,Math.min(500,n+r));Q.value=i},i=()=>{$.value=!1,document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,i)};document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,i)}return E(u,e=>{e||(d.value=`chat`)}),E(()=>[s.currentDirectory,w.value],async([e,t],n)=>{let r=!n||e!==n[0],i=!!n&&n[1]===!0&&!t;(r||i)&&await re(),b.value&&!w.value&&!h.value.some(e=>e.sessionId===b.value)&&ie()},{immediate:!0}),(t,n)=>(_(),r(`div`,{ref_key:`rootRef`,ref:c,class:`agent-view`},[f.value===`chat`&&!L(u)?(_(),r(R,{key:0},[I(`aside`,{class:`agent-sidebar`,style:j({width:Q.value+`px`})},[l(L(B),{class:`agent-conversations`,items:X.value,"active-id":L(b),loading:L(y),labels:L(Te),onSelect:Pe,onNew:Fe,onRename:L(k),onDelete:L(O)},null,8,[`items`,`active-id`,`loading`,`labels`,`onRename`,`onDelete`])],4),I(`div`,{class:a([`sidebar-resizer`,{active:$.value}]),onMousedown:Ie},null,34)],64)):i(``,!0),I(`main`,at,[I(`nav`,ot,[(_(!0),r(R,null,v(ne.value,e=>(_(),r(`button`,{key:e.id,type:`button`,class:a([`agent-tab`,{active:f.value===e.id}]),role:`tab`,"aria-selected":f.value===e.id,onClick:t=>f.value=e.id},[l(L(ee),null,{default:A(()=>[(_(),p(x(e.icon)))]),_:2},1024),I(`span`,null,g(e.label),1)],10,st))),128)),f.value===`chat`?(_(),p(me,{key:0,class:`agent-engine`,engine:Se.value,locked:L(Y),onSelect:Ce},null,8,[`engine`,`locked`])):i(``,!0)]),I(`div`,ct,[f.value===`chat`?(_(),r(`div`,lt,[L(u)&&d.value===`list`?(_(),r(`div`,ut,[l(L(B),{class:`agent-conversations`,items:X.value,"active-id":L(b),loading:L(y),labels:L(Te),onSelect:Pe,onNew:Fe,onRename:L(k),onDelete:L(O)},null,8,[`items`,`active-id`,`loading`,`labels`,`onRename`,`onDelete`])])):(_(),r(R,{key:1},[L(u)?(_(),r(`div`,dt,[I(`button`,{type:`button`,class:`agent-page-back`,title:L(V)(`@AGENT:返回会话列表`),"aria-label":L(V)(`@AGENT:返回会话列表`),onClick:n[0]||=e=>d.value=`list`},[...n[1]||=[I(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[I(`line`,{x1:`19`,y1:`12`,x2:`5`,y2:`12`}),I(`polyline`,{points:`12 19 5 12 12 5`})],-1)]],8,ft),I(`span`,pt,g(Ee.value),1)])):i(``,!0),I(`div`,{class:`agent-chat-host`,style:De},[L(T)?(_(),r(`div`,mt,[l(L(ee),{class:`is-loading`,size:32},{default:A(()=>[l(L(e))]),_:1}),I(`span`,null,g(L(V)(`@AGENT:加载会话中...`)),1)])):(_(),p(L(z),{key:1,ref_key:`chatContainerRef`,ref:Me,messages:L(C),"preset-questions":Oe.value,"welcome-title":L(V)(`@AGENT:智能体助手`),"welcome-description":L(V)(`@AGENT:我可以帮你阅读代码、执行命令、修改文件。选择下方话题或直接输入你的问题。`),"assistant-name":L(K),"assistant-avatar":L(fe),theme:we.value,generating:L(w),"allow-queue":!0,queued:L(ve),"queue-paused":L(ye),"queue-labels":L(Ne),"upload-config":{accept:L(ue)},"context-usage":L(_e),placeholder:L(w)?L(V)(`@AGENT:生成中,发送后会排队,等本轮跑完自动接上…`):L(V)(`@AGENT:输入消息,Enter 发送`),question:L(M),"question-submitting":L(oe),"question-labels":L(je),"plan-config":{labels:{title:L(V)(`@AGENT:计划`),raw:L(V)(`@AGENT:原始参数`)}},"message-rail-config":L(de),onSend:ke,onSelect:Ae,onStop:L(ge),onUnqueue:L(be),onFlushQueued:L(xe),onAnswer:L(N)},null,8,[`messages`,`preset-questions`,`welcome-title`,`welcome-description`,`assistant-name`,`assistant-avatar`,`theme`,`generating`,`queued`,`queue-paused`,`queue-labels`,`upload-config`,`context-usage`,`placeholder`,`question`,`question-submitting`,`question-labels`,`plan-config`,`message-rail-config`,`onStop`,`onUnqueue`,`onFlushQueued`,`onAnswer`]))])],64))])):(_(),p(it,{key:1,type:te.value},null,8,[`type`]))])])],512))}}),[[`__scopeId`,`data-v-a2f77f8d`]]);export{ht as default};
|